performance updates

This commit is contained in:
Constantin Plaiasu 2024-09-10 04:00:37 +03:00
parent e59aaf63eb
commit 585dc64651
5 changed files with 9 additions and 6 deletions

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:3e5,dots:!0,fade:!1,arrows:!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({lazyLoad:"ondemand",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

@ -0,0 +1 @@
function r(){var e=$(".hero__slider");e&&(e.on("init",function(a,o){var i=$(".movie-slide:first-child").find("[data-animation]");t(i)}),e.on("beforeChange",function(a,o,i,s){var n=$('.movie-slide[data-slick-index="'+s+'"]').find("[data-animation]");t(n)}),e.slick({autoplay:!0,autoplaySpeed:3e3,lazyLoad:"ondemand",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 t(a){var o="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(o,function(){i.removeClass(n)})})}}r();$(".movie-slider-one").slick({lazyLoad:"ondemand",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-bvo3Sf5y.js",
"file": "assets/home-lkw6nBi6.js",
"name": "home",
"src": "resources/js/home.js",
"isEntry": true

View file

@ -19,11 +19,12 @@
});
BasicSlider.slick({
autoplay: true,
autoplaySpeed: 300000,
// lazyLoad: 'ondemand',
autoplaySpeed: 3000,
lazyLoad: 'ondemand',
dots: true,
fade: false,
arrows: false,
slidesToShow: 1,
// 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: [

View file

@ -2,7 +2,9 @@
@push('head')
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
@if(!empty($hero))
<link rel="preload" as="image" type="image/webp" href="{{ $hero[0]['backdrop'] }}" fetchpriority="high" />
@endif
<style>
{!! Vite::content('resources/scss/home.scss') !!}
{!! Vite::content('resources/scss/animate.scss') !!}
@ -18,7 +20,7 @@
<div class="hero__slider">
@foreach ($hero as $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;" alt="{{ __($slider['title']) }} image" class="lazy" data-src="{{ $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">
<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>
<ul class="movie-meta justify-content-lg-start justify-content-center" data-animation="fadeInUp" data-delay=".4s">