Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
proc
/
self
/
root
/
srv
/
data
/
trash
/
vhost_www.bachtale.com_1719306535
/
htdocs
/
assets
/
js
/
//proc/self/root/srv/data/trash/vhost_www.bachtale.com_1719306535/htdocs/assets/js/app_front.js
/* * Welcome to your app's main JavaScript file! * * We recommend including the built version of this JavaScript file * (and its CSS file) in your base layout (base.html.twig). */ // any CSS you require will output into a single css file (app.css in this case) require('../css/app_front.scss'); // Need jQuery? Install it with "yarn add jquery", then uncomment to require it. const $ = require('jquery'); global.$ = global.jQuery = $; require('popper.js'); require('bootstrap'); require('jquery.appear/jquery.appear.js'); require('owl.carousel'); require('blueimp-gallery/js/jquery.blueimp-gallery'); console.log('Hello Webpack Encore! Edit me in assets/js/app.js'); window.onscroll = function() { var currentScrollPos = window.pageYOffset; if (currentScrollPos < 5 ) { $(".menu").removeClass("fixed"); $("#navbar-top").slideDown("slow"); } else { $(".menu").addClass("fixed"); $("#navbar-top").hide(); } } // SLIDER HEIGHT jQuery(document).ready(function($) { var windowWidth = $(window).width(); if(windowWidth < 1430){ var autoHeight = windowWidth/2 $(".slider-img").css({ height: autoHeight}); } }); // SIDEBAR HIDE $(document).ready(function () { $('#sidebarCollapse').on('click', function () { $('#sidebar').toggleClass('active'); }); if($(window).width() < 1092){ $('#sidebar').toggleClass('active'); } }); //SLIDER jQuery(document).ready(function ($) { $('.product-slider').owlCarousel({ items: 1, center: true, loop: false, nav: true, navText: ['<span class="fa fa-chevron-left"></span>', '<span class="fa fa-chevron-right"></span>'], margin: 0, dots: true, mouseDrag: true, touchDrag: true, autoplay: false, autoplayTimeout: 3000, autoplayHoverPause: true, responsive: { 0: { nav: true, dots: false }, 992: { nav: true, dots: true } } }); }); jQuery(document).ready(function($) { $('.owl-slider').owlCarousel({ items: 1, center: true, loop: true, nav:true, navText: ['<span class="fas fa-chevron-left"></span>', '<span class="fas fa-chevron-right"></span>'], margin: 0, dots:false, mouseDrag:true, touchDrag:true, autoplay:true, autoplayTimeout:12000, autoplayHoverPause:true, responsive: { 0: { nav: true, dots: false }, 992: { nav: true, dots: false } } }); }); //END SLIDER //REVEAL const threshold = .1 const options = { root: null, rootMargin: '0px', threshold } const handleIntersect = function (entries, observer) { entries.forEach(function (entry) { if (entry.intersectionRatio > threshold) { entry.target.classList.remove('reveal') observer.unobserve(entry.target) } }) } document.documentElement.classList.add('reveal-loaded') window.addEventListener("DOMContentLoaded", function () { const observer = new IntersectionObserver(handleIntersect, options) const targets = document.querySelectorAll('.reveal') targets.forEach(function (target) { observer.observe(target) }) var lazyloadImages; if ("IntersectionObserver" in window) { lazyloadImages = document.querySelectorAll(".lazy"); var imageObserver = new IntersectionObserver(function (entries, observer) { entries.forEach(function (entry) { if (entry.isIntersecting) { var image = entry.target; image.src = image.dataset.src; image.classList.remove("lazy"); imageObserver.unobserve(image); } }); }); lazyloadImages.forEach(function (image) { imageObserver.observe(image); }); } else { var lazyloadThrottleTimeout; lazyloadImages = document.querySelectorAll(".lazy"); function lazyload() { if (lazyloadThrottleTimeout) { clearTimeout(lazyloadThrottleTimeout); } lazyloadThrottleTimeout = setTimeout(function () { var scrollTop = window.pageYOffset; lazyloadImages.forEach(function (img) { if (img.offsetTop < (window.innerHeight + scrollTop)) { img.src = img.dataset.src; img.classList.remove('lazy'); } }); if (lazyloadImages.length == 0) { document.removeEventListener("scroll", lazyload); window.removeEventListener("resize", lazyload); window.removeEventListener("orientationChange", lazyload); } }, 20); } document.addEventListener("scroll", lazyload); window.addEventListener("resize", lazyload); window.addEventListener("orientationChange", lazyload); } });