{"version":3,"file":"animacija-f86b2787.js","sources":["../../../frontend/js/animacija.js"],"sourcesContent":["document.addEventListener('DOMContentLoaded', function (event) {\n // console.log('DOM fully loaded and parsed')\n gsap.registerPlugin(ScrollTrigger)\n\n ScrollTrigger.normalizeScroll(true)\n\n // Main Menu\n\n const menuAnchor = document.querySelector('.menubutton')\n const closeMenu = document.querySelector('.menuclose')\n const menuWrapper = document.querySelector('.mainMenu')\n\n const tl = gsap.timeline()\n\n menuAnchor.addEventListener('click', function () {\n document.body.classList.add('menuout')\n gsap.to(window, { duration: 0.1, scrollTo: 10 })\n if (!menuAnchor.classList.contains('is-active')) {\n this.classList.add('is-active')\n\n // tl.to(window, {\n // scrollTo: 0,\n // duration: 0.5,\n // })\n }\n })\n closeMenu.addEventListener('click', function () {\n document.body.classList.remove('menuout')\n\n if (menuAnchor.classList.contains('is-active')) {\n menuAnchor.classList.remove('is-active')\n\n // gsap.to(menuWrapper, {\n // y: '-100%',\n // duration: 0.5,\n // })\n }\n })\n\n const showAnim = gsap\n .from('header', {\n yPercent: -100,\n paused: true,\n duration: 0.2,\n })\n .progress(1)\n\n ScrollTrigger.create({\n start: '100 top',\n end: 99999,\n // markers: true,\n onUpdate: (self) => {\n self.direction === -1 ? showAnim.play() : showAnim.reverse()\n },\n })\n\n let trigger = gsap.utils.toArray('.zoomin')\n\n trigger.forEach((element) => {\n const tl = gsap.timeline({\n scrollTrigger: {\n trigger: element,\n start: 'top bottom',\n duration: 0.6,\n },\n })\n\n tl.from(element, {\n scale: 1.2,\n opacity: 0,\n })\n })\n\n let trigger2 = gsap.utils.toArray('.fadein')\n\n trigger2.forEach((element) => {\n const tl2 = gsap.timeline({\n scrollTrigger: {\n trigger: element,\n start: 'top bottom-=100',\n duration: 1,\n // markers: true,\n },\n })\n\n tl2.from(element, {\n y: 50,\n opacity: 0,\n })\n })\n})\n"],"names":["event","menuAnchor","closeMenu","showAnim","self","element"],"mappings":"AAAA,SAAS,iBAAiB,mBAAoB,SAAUA,EA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