Trying to add blur and lazy to slides
This commit is contained in:
parent
53c81e4f15
commit
9d68b1e6c1
8 changed files with 25 additions and 3 deletions
|
|
@ -211,7 +211,7 @@
|
||||||
background-image: url('/images/home-slide-snd-2.jpg')
|
background-image: url('/images/home-slide-snd-2.jpg')
|
||||||
}
|
}
|
||||||
|
|
||||||
.webp .carousel-item-1 {
|
.webp .carousel-item-1.lazy {
|
||||||
background-image: url('/images/home-slide1.webp')
|
background-image: url('/images/home-slide1.webp')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -227,10 +227,30 @@
|
||||||
background-image: url('/images/home-slide4.webp')
|
background-image: url('/images/home-slide4.webp')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.webp .carousel-item-1 {
|
||||||
|
background-image: url('/images/home-slide1-blur.webp')
|
||||||
|
}
|
||||||
|
|
||||||
|
.webp .carousel-item-2 {
|
||||||
|
background-image: url('/images/home-slide2-blur.webp')
|
||||||
|
}
|
||||||
|
|
||||||
|
.webp .carousel-item-3 {
|
||||||
|
background-image: url('/images/home-slide3-blur.webp')
|
||||||
|
}
|
||||||
|
|
||||||
|
.webp .carousel-item-4 {
|
||||||
|
background-image: url('/images/home-slide4-blur.webp')
|
||||||
|
}
|
||||||
|
|
||||||
.webp .carousel-snd-item-1 {
|
.webp .carousel-snd-item-1 {
|
||||||
background-image: url('/images/home-slide-snd-1.webp')
|
background-image: url('/images/home-slide-snd-1.webp')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.webp .carousel-snd-item-2 {
|
||||||
|
background-image: url('/images/home-slide-snd-2-blur.webp')
|
||||||
|
}
|
||||||
|
|
||||||
.webp .carousel-snd-item-2.lazy {
|
.webp .carousel-snd-item-2.lazy {
|
||||||
background-image: url('/images/home-slide-snd-2.webp')
|
background-image: url('/images/home-slide-snd-2.webp')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,10 @@ class Index extends Component {
|
||||||
const car2 = $('#carouselSndIndicators');
|
const car2 = $('#carouselSndIndicators');
|
||||||
car1.carousel();
|
car1.carousel();
|
||||||
car2.carousel();
|
car2.carousel();
|
||||||
|
_.defer(() => {
|
||||||
|
$('#firsthomeslide').addClass('lazy');
|
||||||
|
});
|
||||||
const loadLazy = (ev) => {
|
const loadLazy = (ev) => {
|
||||||
// console.log('Slide');
|
|
||||||
ev.relatedTarget.classList.add('lazy');
|
ev.relatedTarget.classList.add('lazy');
|
||||||
};
|
};
|
||||||
car1.on('slide.bs.carousel', loadLazy);
|
car1.on('slide.bs.carousel', loadLazy);
|
||||||
|
|
@ -114,7 +116,7 @@ class Index extends Component {
|
||||||
</ol>
|
</ol>
|
||||||
<div className="carousel-inner" role="listbox">
|
<div className="carousel-inner" role="listbox">
|
||||||
|
|
||||||
<div className="carousel-item carousel-item-1 active">
|
<div id="firsthomeslide" className="carousel-item carousel-item-1 active">
|
||||||
<div
|
<div
|
||||||
tabIndex={0}
|
tabIndex={0}
|
||||||
role="button"
|
role="button"
|
||||||
|
|
|
||||||
BIN
public/images/home-slide-snd-1-blur.webp
Normal file
BIN
public/images/home-slide-snd-1-blur.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
public/images/home-slide-snd-2-blur.webp
Normal file
BIN
public/images/home-slide-snd-2-blur.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
BIN
public/images/home-slide1-blur.webp
Normal file
BIN
public/images/home-slide1-blur.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 71 KiB |
BIN
public/images/home-slide2-blur.webp
Normal file
BIN
public/images/home-slide2-blur.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 15 KiB |
BIN
public/images/home-slide3-blur.webp
Normal file
BIN
public/images/home-slide3-blur.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 35 KiB |
BIN
public/images/home-slide4-blur.webp
Normal file
BIN
public/images/home-slide4-blur.webp
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 30 KiB |
Loading…
Add table
Add a link
Reference in a new issue