performance updates

This commit is contained in:
Constantin Plaiasu 2024-09-10 16:58:45 +03:00
parent 6dc35e22fd
commit 1dbd255a80
5 changed files with 34 additions and 29 deletions

View file

@ -0,0 +1 @@
function r(){var e=$(".hero__slider");e&&(e.on("init",function(s,t){var i=$(".movie-slide:first-child").find("[data-animation]");o(i)}),e.on("beforeChange",function(s,t,i,n){var a=$('.movie-slide[data-slick-index="'+n+'"]').find("[data-animation]");o(a)}),e.slick({autoplay:!0,autoplaySpeed:3e3,dots:!0,fade:!1,arrows:!1,slidesToShow:1,slidesToScroll:1,infinite:!0}));function o(s){var t="webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend";s.each(function(){var i=$(this),n=i.data("delay"),a="animated "+i.data("animation");i.css({"animation-delay":n,"-webkit-animation-delay":n}),i.addClass(a).one(t,function(){i.removeClass(a)})})}}r();$(".movie-slider-one").slick({autoplay:!0,slidesToShow:7,slidesToScroll:1,infinite:!0,speed:700,dots:!1,arrows:!0,nextArrow:'<div class="next"><svg class="si"><use href="#si-long-arrow-right"></svg></i></div>',prevArrow:'<div class="prev"><svg class="si"><use href="#si-long-arrow-left"></svg></i></div>',responsive:[{breakpoint:1650,settings:{slidesToShow:5}},{breakpoint:1200,settings:{slidesToShow:4}},{breakpoint:992,settings:{slidesToShow:3}},{breakpoint:768,settings:{slidesToShow:2}},{breakpoint:512,settings:{slidesToShow:2}}]});(function(e){"user strict"})(jQuery);document.addEventListener("readystatechange",e=>{});

View file

@ -1 +0,0 @@
function r(){var e=$(".hero__slider");e&&(e.on("init",function(a,t){var i=$(".movie-slide:first-child").find("[data-animation]");o(i)}),e.on("beforeChange",function(a,t,i,s){var n=$('.movie-slide[data-slick-index="'+s+'"]').find("[data-animation]");o(n)}),e.slick({autoplay:!0,autoplaySpeed:3e3,dots:!0,fade:!1,arrows:!1,slidesToShow:1,responsive:[{breakpoint:1024,settings:{slidesToShow:1,slidesToScroll:1,infinite:!0}},{breakpoint:991,settings:{slidesToShow:1,slidesToScroll:1,arrows:!1}},{breakpoint:767,settings:{slidesToShow:1,slidesToScroll:1,arrows:!1}}]}));function o(a){var t="webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend";a.each(function(){var i=$(this),s=i.data("delay"),n="animated "+i.data("animation");i.css({"animation-delay":s,"-webkit-animation-delay":s}),i.addClass(n).one(t,function(){i.removeClass(n)})})}}r();$(".movie-slider-one").slick({autoplay:!0,slidesToShow:7,slidesToScroll:1,infinite:!0,speed:700,dots:!1,arrows:!0,nextArrow:'<div class="next"><svg class="si"><use href="#si-long-arrow-right"></svg></i></div>',prevArrow:'<div class="prev"><svg class="si"><use href="#si-long-arrow-left"></svg></i></div>',responsive:[{breakpoint:1650,settings:{slidesToShow:5}},{breakpoint:1200,settings:{slidesToShow:4}},{breakpoint:992,settings:{slidesToShow:3}},{breakpoint:768,settings:{slidesToShow:2}},{breakpoint:512,settings:{slidesToShow:2}}]});(function(e){"user strict"})(jQuery);document.addEventListener("readystatechange",e=>{});

View file

@ -6,7 +6,7 @@
"isEntry": true
},
"resources/js/home.js": {
"file": "assets/home-mbsL_elV.js",
"file": "assets/home-Cs-dzyRx.js",
"name": "home",
"src": "resources/js/home.js",
"isEntry": true

View file

@ -25,34 +25,36 @@
fade: false,
arrows: false,
slidesToShow: 1,
slidesToScroll: 1,
infinite: true,
// nextArrow: '<div class="next"><i class="las la-long-arrow-alt-right"></i></div>',
// prevArrow: '<div class="prev"><i class="las la-long-arrow-alt-left"></i></div>',
responsive: [
{
breakpoint: 1024,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
infinite: true,
}
},
{
breakpoint: 991,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
arrows: false
}
},
{
breakpoint: 767,
settings: {
slidesToShow: 1,
slidesToScroll: 1,
arrows: false
}
}
]
// responsive: [
// {
// breakpoint: 1024,
// settings: {
// slidesToShow: 1,
// slidesToScroll: 1,
// infinite: true,
// }
// },
// {
// breakpoint: 991,
// settings: {
// slidesToShow: 1,
// slidesToScroll: 1,
// arrows: false
// }
// },
// {
// breakpoint: 767,
// settings: {
// slidesToShow: 1,
// slidesToScroll: 1,
// arrows: false
// }
// }
// ]
});
}

View file

@ -23,7 +23,10 @@
@foreach ($hero as $slider)
{{-- @dd($slider) --}}
<div class="movie-slide"{{-- data-bg="{{ $slider['backdrop'] }}" --}} >
<img style="object-fit: cover; object-position: center; z-index:-1;position:absolute; width: 100%; height:100%; pointer-events: none;" @if(isset($slider['backdrop']) && $slider['backdrop'] !== '') {{-- src="{{img_url('w1280', $hero[0]['backdrop_path'], true, 360, 200 )}}" --}} data-srcset="{{img_url('w1280', $slider['backdrop_path'], true, 360, 200 )}} 360w, {{img_url('w1280', $slider['backdrop_path'], true, 1280, 720 )}} 1280w" class="lazy" @endif width="100%" height="720" alt="{{ str($slider['title'])->apa() }} ({{ $slider['year'] }})" src="data:image/svg+xml,%3Csvg width='1280' height='720' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1280' height='720' x='0' y='0' fill='%231B1B3F' /%3E%3C/svg%3E" data-sizes="70vw, 100vw">
<figure style=" z-index:-1;position:absolute; top:0; min-width:100vw; height:100%; width:100%">
<img style="object-fit: cover; object-position: center; z-index:-1;position:relative; width: 100%; height:100%; pointer-events: none;" @if(isset($slider['backdrop']) && $slider['backdrop'] !== '') {{-- src="{{img_url('w1280', $hero[0]['backdrop_path'], true, 360, 200 )}}" --}} data-srcset="{{img_url('w1280', $slider['backdrop_path'], true, 360, 200 )}} 360w, {{img_url('w1280', $slider['backdrop_path'], true, 1280, 720 )}} 1280w" class="lazy" @endif width="100%" height="720" alt="{{ str($slider['title'])->apa() }} ({{ $slider['year'] }})" src="data:image/svg+xml,%3Csvg width='1280' height='720' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1280' height='720' x='0' y='0' fill='%231B1B3F' /%3E%3C/svg%3E" data-sizes="70vw, 100vw">
</figure>
{{-- <img style="object-fit: cover; object-position: center; z-index:-1;position:absolute; width: 100%; height:100%; pointer-events: none;" alt="{{ __($slider['title']) }} image" class="lazy" data-lazy="{{ $slider['backdrop'] }}" width="780" height="439" src="data:image/svg+xml,%3Csvg width='780' height='439' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='780' height='439' x='0' y='0' fill='%231B1B3F' /%3E%3C/svg%3E"> --}}
<div class="movie-slide__content">
<h2 class="movie-name" data-animation="fadeInUp" data-delay=".2s">{{ __($slider['title']) }}</h2>