📁 PHP Dosya Yöneticisi
/
/
home
/
demodesigncom
/
firmascripti.demodesign.com.tr
/
assets
/
js
📝
main.js
← Geri Dön
/* -------------------------------------------------------- M O U : Table of Contents =========================================================== 1. Preloader 2. Back to Top 3. Fullpage 4. Sticky Header 5. Off-canvas User Account 6. Sliding Menu 7. Header Search 8. Info Slidingbar 9. Hero Slider : Common 9.1 Hero Slider GSAP 10. Hero Slider : Photography 11. Gallery Slider : Ribbon 12. Gallery Slider : Fullscreen 13. Hero Slider : Fullscreen 14. Hero Slider : Shop 15. Gallery Slider : with thumbs 16. Responsive Menu : HC 17. Hero Banner Scroll Button 18. Portfolio Gallery Grid 18.1 Portfolio Gallery Grid 2 18.2 Portfolio Gallery Grid : Blog 19. Simple Slider 20. Product Category Slider 21. Products Slider 22. Team Slider Style 1 23. Testimonial Slider Style 2 24. Testimonial Slider : Common 25. Testimonial Slider Style 3 26. Counter-up 27. Nice select 28. Select2 29. Login and Coupon 30. Payment methods 31. Cart Quantity 32. Range Slider 33. Google Map 34. AOS 35. Count-down 36. One-page Menu 37. Accordion 38. Fancybox 39. Parallaxie 40. Main Menu GSAP 41. Sliding Menu GSAP -------------------------------------------------------- */ (function ($) { 'use strict'; // 1. Preloader window.addEventListener('load', (event) => { window.setTimeout(() => {}, 3500); $(".loader-mask").delay(3000).fadeOut(400); function progress(){ let percent = document.querySelector('.percent'); let progress = document.querySelector('.loading-progress'); let text = document.querySelector('.text'); let count = 4; let per = 16; let loading = setInterval(animate, 15); function animate(){ if(count === 100 && per === 400){ percent.classList.add("text-blink"); text.style.display = "block"; clearInterval(loading); }else{ per = per + 4; count = count + 1; progress.style.width = per + 'px'; percent.textContent = count + '%'; } } } progress(event); }); // 2. Back to Top $(window).on("scroll", function () { if ($(this).scrollTop() > 80) { $("#back_to_top").fadeIn(); } else { $("#back_to_top").fadeOut(); } }); $("#back_to_top").on("click", function () { $("html, body").animate( { scrollTop: 0, }, 800 ); }); // 3. Fullpage if ($("#fullpage").length) { if ($(window).width() > 1199) { new fullpage("#fullpage", { anchors: ["", "", "", "", "", "", "", "", "", "", "", "", "", "", ""], navigation: true, scrollingSpeed: 1200, navigationTooltips: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15",], }); } } // 4. Sticky Header $(window).on("scroll", function () { if ($(this).scrollTop() > 150) { $(".site-header").addClass("is-sticky"); } else { $(".site-header").removeClass("is-sticky"); } }); // 5. Off-canvas User Account $("#register_now").on("click", function (e) { $(".offcanvas-account-register").addClass("active"); $(".offcanvas-account-login").removeClass("active"); e.preventDefault(); }); $("#login_now").on("click", function (e) { $(".offcanvas-account-login").addClass("active"); $(".offcanvas-account-register").removeClass("active"); e.preventDefault(); }); // 5.2 Shop Filters $("#show_filter").on("click", function (e) { $(".sidebar.shop-filter").addClass("active"); $(".shop-filter-btn button#hide_filter").addClass("active"); e.preventDefault(); }); $("#hide_filter").on("click", function (e) { $(".sidebar.shop-filter").removeClass("active"); $(".shop-filter-btn button#hide_filter").removeClass("active"); e.preventDefault(); }); // 6. Sliding Menu $(".menu-open").on("click", function () { $(".menu-open, .nav-container.nav-sliding, .offcanvas-overlay").addClass( "active" ); }); $(".menu-close, .offcanvas-overlay").on("click", function () { $(".menu-open, .nav-container.nav-sliding, .offcanvas-overlay").removeClass( "active" ); }); // 7. Header Search $(".header-search").on("click", function () { $(".header-search, .search-container, .offcanvas-overlay").addClass( "active" ); }); $(".search-close, .offcanvas-overlay").on("click", function () { $(".header-search, .search-container, .offcanvas-overlay").removeClass( "active" ); }); // 8. Info Slidingbar $(".slidingbar-open").on("click", function () { $("#main").css("marginLeft", "200px"); $(".slidingbar-open, .slidingbar-container, .offcanvas-overlay").addClass( "active" ); return false; }); $(".slidingbar-close, .offcanvas-overlay").on("click", function () { $("#main").css("marginLeft", "0"); $( ".slidingbar-open, .slidingbar-container, .offcanvas-overlay" ).removeClass("active"); }); // 9. Hero Slider : Common var slideStandard = new Swiper(".swiper__hero-slider", { pagination: { el: ".swiper-pagination", type: "fraction", }, effect: "fade", fadeEffect: { crossFade: true, }, scrollbar: { el: ".swiper-scrollbar", }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, autoplay: { delay: 6000, disableOnInteraction: false, } }); // 9.1 Hero Slider GSAP var sliderTl = gsap.timeline({defaults: {duration: 1.5, opacity: 0, ease: "Elastic.easeOut(1.5, 1)"}}) slideStandard.on('slideChange', function () { sliderTl.from(".swiper__hero-slide .hero-image-content__image", {xPercent: 25, rotate: 5}) .from(".swiper__hero-slide h1", {x: 50, scaleX: 1.15}, "-=1") .from(".swiper__hero-slide h2", {x: 100, scaleX: 1.25}, "-=1.3") .from(".swiper__hero-slide p", {y: 15}, "-=1.3") .from(".swiper__hero-slide .theme-btn", {y: 30, scaleY: 1.5}, "-=1.3") }) // 10. Hero Slider : Photography new Swiper(".swiper__hero-slider-photography", { pagination: { el: ".swiper-pagination", type: "progressbar", }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, mousewheel: true, slidesPerView: 1, breakpoints: { 640: { slidesPerView: 1, }, 768: { slidesPerView: 2, }, 1024: { slidesPerView: 3, }, }, }); // 11. Gallery Slider : Ribbon var swiper = new Swiper(".swiper__gallery-ribbon", { slidesPerView: 2, spaceBetween: 24, autoplay: { delay: 5000, disableOnInteraction: false, }, speed: 1500, centeredSlides: true, pagination: { el: ".swiper-pagination", clickable: true, renderBullet: function (index, className) { return '<span class="' + className + '">' + (index + 1) + "</span>"; }, }, }); // 12. Gallery Slider : Fullscreen new Swiper(".swiper__gallery-fullscreen", { pagination: { el: ".swiper-pagination", type: "fraction", }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, scrollbar: { el: ".swiper-scrollbar", }, effect: "fade", mousewheel: true, autoplay: { delay: 5000, disableOnInteraction: false, }, speed: 1500 }); // 13. Hero Slider : Fullscreen new Swiper(".swiper__slider-fullscreen", { pagination: { el: ".swiper-pagination", type: "fraction", }, mousewheel: true, scrollbar: { el: ".swiper-scrollbar", }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, autoplay: { delay: 5000, disableOnInteraction: false, }, speed: 1500 }); // 14. Hero Slider : Shop new Swiper(".swiper__hero-slider-shop", { pagination: { el: ".swiper-pagination", type: "fraction", }, scrollbar: { el: ".swiper-scrollbar", }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, autoplay: { delay: 5000, disableOnInteraction: false, }, speed: 1500 }); // 15. Gallery Slider : with thumbs var swiper_widget_thumbs = new Swiper(".swiper__widget-thumb", { loop: true, spaceBetween: 18, slidesPerView: 5, freeMode: true, watchSlidesProgress: true }); var swiper_widget_slide = new Swiper(".swiper__widget-slide", { loop: true, spaceBetween: 18, effect: "fade", autoplay: { delay: 5000, disableOnInteraction: false, }, speed: 1500, pagination: { el: ".swiper-pagination", type: "fraction", }, navigation: { nextEl: ".swiper-button-next", prevEl: ".swiper-button-prev", }, thumbs: { swiper: swiper_widget_thumbs, }, }); // 16. Responsive Menu : HC $("#responsive_menu").hcOffcanvasNav({ disableAt: 1200, insertClose: true, insertBack: true, labelClose: "Close", labelBack: "Back", levelTitleAsBack: true, levelOpen: "expand" }); // 17. Hero Banner Scroll Button $(".scroll-btn").on("click", function () { $("html,body").animate( { scrollTop: $("#down").offset().top - 73, }, 1250 ); }); // 18. Portfolio Gallery Grid $(".grid").imagesLoaded(function () { $(".filter-item-btn").on("click", "button", function () { var filterValue = $(this).attr("data-filter"); $grid.isotope({ filter: filterValue, }); }); var $grid = $(".grid").isotope({ itemSelector: ".grid-item, .grid-item-2, .grid-item-3, .grid-item-4", percentPosition: true, masonry: { columnWidth: ".grid-item, .grid-item-2, .grid-item-3, .grid-item-4", }, }); }); // 18.1 Portfolio Gallery Grid 2 $(".grid-2").imagesLoaded(function () { $(".filter-item-btn").on("click", "button", function () { var filterValue = $(this).attr("data-filter"); $grid_2.isotope({ filter: filterValue, }); }); var $grid_2 = $(".grid-2").isotope({ itemSelector: ".grid-item-5", percentPosition: true, masonry: { columnWidth: ".grid-item-5", }, }); }); // 18.2 Portfolio Gallery Grid : Blog $(".grid-items").imagesLoaded(function () { $(".filter-item-btn").on("click", "button", function () { var filterValue = $(this).attr("data-filter"); $grid_items.isotope({ filter: filterValue, }); }); var $grid_items = $(".grid-items").isotope({ itemSelector: ".grid-item-blog", percentPosition: true, masonry: { columnWidth: ".grid-item-blog", }, }); }); $(".filter-item-btn > button").on("click", function (event) { $(this).siblings(".active").removeClass("active"); $(this).addClass("active"); event.preventDefault(); }); // 19. Simple Slider $(".simple-gallery-slider").owlCarousel({ loop: true, animateOut: "fadeOut", items: 1, dots: true, nav: false, autoplay: true, autoplayTimeout: 5000, smartSpeed: 2500, }); // 20. Product Category Slider $(".mou_simple-slider").owlCarousel({ loop: true, autoplayHoverPause: true, margin: 24, nav: true, navText: [ '<i class="flaticon-left-arrow"></i>', '<i class="flaticon-right-arrow"></i>', ], dots: false, autoplay: true, autoplayTimeout: 4000, smartSpeed: 1500, responsive: { 0: { items: 1, }, 521: { items: 2, }, 992: { items: 3, }, }, }); // 21. Products Slider $(".product-items-slider").owlCarousel({ loop: true, autoplayHoverPause: true, margin: 24, nav: false, dots: false, autoplay: true, autoplayTimeout: 4000, smartSpeed: 1500, responsive: { 0: { items: 1, }, 576: { items: 2, }, 800: { items: 3, }, 1200: { items: 4, }, 1401: { items: 5, }, }, }); // 22. Team Slider Style 1 $(".team__slider-style-1").owlCarousel({ loop: true, margin: 30, nav: true, navText: [ '<i class="flaticon-left-arrow"></i>', '<i class="flaticon-right-arrow"></i>', ], dots: false, autoplay: true, autoplayTimeout: 4000, smartSpeed: 1500, responsive: { 0: { items: 1, }, 481: { items: 2, }, 992: { items: 3, }, }, }); // 23. Testimonial Slider Style 2 $(".testimonial__slider-style-2").owlCarousel({ dots: false, margin: 30, autoplayHoverPause: true, loop: true, items: 1, nav: true, navText: [ '<i class="flaticon-left-arrow"></i>', '<i class="flaticon-right-arrow"></i>', ], autoplay: true, autoplayTimeout: 4000, smartSpeed: 1500, }); // 24. Testimonial Slider : Common $(".testimonial__slider").owlCarousel({ dots: false, margin: 30, autoplayHoverPause: true, loop: true, nav: true, navText: [ '<i class="flaticon-left-arrow"></i>', '<i class="flaticon-right-arrow"></i>', ], autoplay: true, autoplayTimeout: 4000, smartSpeed: 1500, responsive: { 0: { items: 1, }, 767: { items: 2, }, 992: { items: 1, }, 1401: { items: 2, }, }, }); // 25. Testimonial Slider Style 3 $(".testimonial__slider-style-3").owlCarousel({ animateOut: "fadeOut", loop: true, items: 1, dots: false, autoplay: true, autoplayHoverPause: true, autoplayTimeout: 4000, smartSpeed: 2500, }); // 26. Counter-up $(".counter").counterUp(); // 27. Nice select $(document).ready(function () { $(".woocommerce-ordering select").niceSelect(); }); // 28. Select2 $(document).ready(function () { $("#billing_country, #billing_state").select2(); }); // 29. Login and Coupon $(".showlogin").on("click", function (e) { $(".form-login").slideToggle(250); e.preventDefault(); }); $(".showcoupon").on("click", function (e) { $(".coupon").slideToggle(200); e.preventDefault(); }); // 30. Payment methods var paymentMethods = $(".payment_methods > li > .payment_box").hide(); paymentMethods.first().slideDown("easeOutExpo"); $(".payment_methods > li > input").change(function () { var current = $(this).parent().children(".payment_box"); paymentMethods.not(current).slideUp("easeInExpo"); $(this).parent().children(".payment_box").slideDown("easeOutExpo"); return false; }); // 31. Cart Quantity $(function () { jQuery(document).on("click", ".plus", function (e) { e.preventDefault(); var quantityInput = jQuery(this).parents(".quantity").find("input.qty"), newValue = parseInt(quantityInput.val(), 10) + 1, maxValue = parseInt(quantityInput.attr("max"), 10); if (!maxValue) { maxValue = 9999999999; } if (newValue <= maxValue) { quantityInput.val(newValue); quantityInput.change(); } }); jQuery(document).on("click", ".minus", function (e) { e.preventDefault(); var quantityInput = jQuery(this).parents(".quantity").find("input.qty"), newValue = parseInt(quantityInput.val(), 10) - 1, minValue = parseInt(quantityInput.attr("min"), 10); if (!minValue) { minValue = 1; } if (newValue >= minValue) { quantityInput.val(newValue); quantityInput.change(); } }); }); // 32. Range Slider $(function () { $("#slider-range").slider({ range: true, min: 0, max: 1500, values: [150, 800], slide: function (event, ui) { $("#amount").val("$" + ui.values[0] + " - $" + ui.values[1]); }, }); $("#amount").val( "$" + $("#slider-range").slider("values", 0) + " - $" + $("#slider-range").slider("values", 1) ); }); // 33. Google Map function basicmap() { var mapOptions = { zoom: 14, scrollwheel: false, center: new google.maps.LatLng(-37.813629, 144.963058), // Melbourne, Australia // This is where you would paste any style found on Snazzy Maps. styles: [ { "featureType": "all", "elementType": "labels.text.fill", "stylers": [ { "saturation": 36 }, { "color": "#12161e" }, { "lightness": 40 } ] }, { "featureType": "all", "elementType": "labels.text.stroke", "stylers": [ { "visibility": "on" }, { "color": "#12161e" }, { "lightness": 16 } ] }, { "featureType": "all", "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "administrative", "elementType": "geometry.fill", "stylers": [ { "color": "#12161e" }, { "lightness": 20 } ] }, { "featureType": "administrative", "elementType": "geometry.stroke", "stylers": [ { "color": "#12161e" }, { "lightness": 17 }, { "weight": 1.2 } ] }, { "featureType": "landscape", "elementType": "geometry", "stylers": [ { "color": "#12161e" }, { "lightness": 20 } ] }, { "featureType": "poi", "elementType": "geometry", "stylers": [ { "color": "#12161e" }, { "lightness": 21 } ] }, { "featureType": "road.highway", "elementType": "geometry.fill", "stylers": [ { "color": "#12161e" }, { "lightness": 17 } ] }, { "featureType": "road.highway", "elementType": "geometry.stroke", "stylers": [ { "color": "#12161e" }, { "lightness": 29 }, { "weight": 0.2 } ] }, { "featureType": "road.arterial", "elementType": "geometry", "stylers": [ { "color": "#12161e" }, { "lightness": 18 } ] }, { "featureType": "road.local", "elementType": "geometry", "stylers": [ { "color": "#12161e" }, { "lightness": 16 } ] }, { "featureType": "transit", "elementType": "geometry", "stylers": [ { "color": "#12161e" }, { "lightness": 19 } ] }, { "featureType": "water", "elementType": "geometry", "stylers": [ { "color": "#12161e" }, { "lightness": 17 } ] } ] }; var mapElement = document.getElementById("map"); var map = new google.maps.Map(mapElement, mapOptions); var marker = new google.maps.Marker({ position: new google.maps.LatLng(-37.813629, 144.963058), map: map, title: "M O U", icon: "https://res.cloudinary.com/camicrouser/image/upload/v1643792892/Marker-MOU.png", }); } if ($("#map").length != 0) { google.maps.event.addDomListener(window, "load", basicmap); } // 34. AOS AOS.init({ offset: 0, duration: 2000, easing: 'ease-in-out-back', once: true }); // 35. Count-down $("#countdown-active").countdown("2022/06/30", function (event) { $(this).html( event.strftime( '<div class="single-countdown"><h2>%D</h2><span>Days</span></div>' + '<div class="single-countdown"><h2>%H</h2><span>Hours</span></div>' + '<div class="single-countdown"><h2>%M</h2><span>Minutes</span></div>' + '<div class="single-countdown count-seconds"><h2>%S</h2><span>Seconds</span></div>' ) ); }); // 36. One-page Menu function smoothScrollTop() { $(".nav-container .menu-main > li > a").on("click", function (event) { var target = $(this.getAttribute("href")); if (target.length) { event.preventDefault(); $("html, body") .stop() .animate( { scrollTop: target.offset().top - 75, }, 1000 ); } // Active Menu $(".nav-container .menu-main > li > a").removeClass("active"); $(this).addClass("active"); }); } smoothScrollTop(); // 37. Accordion $(".accordion") .find(".accordion-title") .on("click", function () { $(this).toggleClass("active"); $(this).next().slideToggle("fast"); $(".accordion-content").not($(this).next()).slideUp("fast"); $(".accordion-title").not($(this)).removeClass("active"); }); // 38. Fancybox $(".gallery").fancybox(); // 39. Parallaxie $(".parallaxie").parallaxie({ speed: 1.1, offset: 50, }); // 40. Main Menu GSAP var mainMenu = gsap.timeline() mainMenu.fromTo(".nav-container .menu-main > li", {y: -10}, {opacity: 1, y: 0, stagger: 0.1}) // 41. Sliding Menu GSAP const menuTrigger = document.querySelector(".menu-open"); const offCanvas = document.querySelector(".offcanvas-overlay"); const menuClose = document.querySelector(".menu-close"); var slidingMenu = gsap.timeline({ defaults: { duration: 1, ease: "back.inOut(1.7)" }, }); if (menuTrigger){ menuTrigger.addEventListener("click", () => { slidingMenu.to(".offcanvas-overlay", { width: "100%" }); slidingMenu.to( ".nav-container.nav-sliding .menu-main li", { opacity: 1, y: "30px", stagger: 0.1 }, "-=1" ); }); } if (menuClose){ menuClose.addEventListener("click", () => { slidingMenu.to(".nav-container.nav-sliding .menu-main li", { opacity: 0, y: "0", stagger: 0.05, }); }); } if (offCanvas){ offCanvas.addEventListener("click", () => { slidingMenu.to(".nav-container.nav-sliding .menu-main li", { opacity: 0, y: "0", stagger: 0.05, }); }); } })(jQuery);
💾 Kaydet
İptal
📝 Yeniden Adlandır
İptal
Kaydet
🔐 Dosya İzinleri (chmod)
İzin Değeri:
Hızlı Seçim:
777
755
644
600
777
= Herkes okur/yazar/çalıştırır
755
= Sahip tam, diğerleri okur/çalıştırır
644
= Sahip okur/yazar, diğerleri okur
600
= Sadece sahip okur/yazar
İptal
Uygula