performance updates

This commit is contained in:
Constantin Plaiasu 2024-09-10 16:12:42 +03:00
parent 23ae052873
commit 6dc35e22fd
5 changed files with 9 additions and 5 deletions

View file

@ -1 +0,0 @@
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({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,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 "isEntry": true
}, },
"resources/js/home.js": { "resources/js/home.js": {
"file": "assets/home-6GBdEVYw.js", "file": "assets/home-mbsL_elV.js",
"name": "home", "name": "home",
"src": "resources/js/home.js", "src": "resources/js/home.js",
"isEntry": true "isEntry": true

View file

@ -20,7 +20,7 @@
BasicSlider.slick({ BasicSlider.slick({
autoplay: true, autoplay: true,
autoplaySpeed: 3000, autoplaySpeed: 3000,
lazyLoad: 'ondemand', // lazyLoad: 'ondemand',
dots: true, dots: true,
fade: false, fade: false,
arrows: false, arrows: false,

View file

@ -3,7 +3,9 @@
@push('head') @push('head')
<link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin> <link rel="preconnect" href="https://cdn.jsdelivr.net" crossorigin>
@if(!empty($hero)) @if(!empty($hero))
<link rel="preload" as="image" type="image/webp" href="{{ $hero[0]['backdrop'] }}" fetchpriority="high" /> {{-- <link rel="preload" as="image" type="image/webp" href="{{ $hero[0]['backdrop'] }}" fetchpriority="high" /> --}}
<link rel="preload" as="image" type="image/webp" href="{{img_url('w1280', $hero[0]['backdrop_path'], true, 360, 200 )}}" imagesrcset="{{img_url('w1280', $hero[0]['backdrop_path'], true, 360, 200 )}} 360w, {{img_url('w1280', $hero[0]['backdrop_path'], true, 1280, 720 )}} 1280w" imagesizes="70vw, 100vw" fetchpriority="high" />
{{-- <link rel="preload" as="image" type="image/webp" href="{{img_url('w1280', $hero[1]['backdrop_path'], true, 360, 200 )}}" imagesrcset="{{img_url('w1280', $hero[1]['backdrop_path'], true, 360, 200 )}} 360w, {{img_url('w1280', $hero[1]['backdrop_path'], true, 1280, 720 )}} 1280w" imagesizes="70vw, 100vw" fetchpriority="high" /> --}}
@endif @endif
<style> <style>
{!! Vite::content('resources/scss/home.scss') !!} {!! Vite::content('resources/scss/home.scss') !!}
@ -19,8 +21,10 @@
<section class="hero"> <section class="hero">
<div class="hero__slider"> <div class="hero__slider">
@foreach ($hero as $slider) @foreach ($hero as $slider)
{{-- @dd($slider) --}}
<div class="movie-slide"{{-- data-bg="{{ $slider['backdrop'] }}" --}} > <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-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"> <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">
{{-- <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"> <div class="movie-slide__content">
<h2 class="movie-name" data-animation="fadeInUp" data-delay=".2s">{{ __($slider['title']) }}</h2> <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"> <ul class="movie-meta justify-content-lg-start justify-content-center" data-animation="fadeInUp" data-delay=".4s">