diff --git a/commonHelpers.js b/commonHelpers.js index 32c43ac..57fc79f 100644 --- a/commonHelpers.js +++ b/commonHelpers.js @@ -1,4 +1,4 @@ -import{A as C,S as k,N as K,K as N,M as P,i as V,a as j}from"./assets/vendor-DOMKpuM6.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))t(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&t(c)}).observe(document,{childList:!0,subtree:!0});function o(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function t(i){if(i.ep)return;i.ep=!0;const s=o(i);fetch(i.href,s)}})();const X=document.querySelector(".about-me-btn");X.classList.add("btn-active");const H=document.querySelector(".about-me-chapter .section-title");H.classList.add("active");new C("#accordionAbout",{openOnInit:[0],showMultiple:!0,beforeOpen:function(e){e.querySelector(".about-me-btn.ac-trigger").classList.add("btn-active"),e.querySelector(".about-me-chapter .section-title").classList.add("active")},beforeClose:function(e){e.querySelector(".about-me-btn.ac-trigger").classList.remove("btn-active"),e.querySelector(".about-me-chapter .section-title").classList.remove("active")}});new k("#swiperAbout",{modules:[K,N,P],navigation:{nextEl:".about-me-btn-swipe"},mousewheel:{invert:!0},keyboard:{enabled:!0,onlyInViewport:!0},mousewheel:!0,touch:!0,centeredSlides:!1,loop:!0,speed:500,spaceBetween:0,slideToClickedSlide:!0,allowTouchMove:!0,slidesPerView:2,width:260,breakpoints:{768:{slidesPerView:3,width:600},1440:{slidesPerView:6,width:1200}}});const b={cards:document.querySelectorAll(".marquee__card"),covers:document.querySelector(".covers")};let _={root:null,rootMargin:"0px",threshold:0},F=e=>{e.forEach(n=>{if(n.isIntersecting){b.cards.forEach(o=>{o.classList.add("animation")});return}b.cards.forEach(o=>{o.classList.remove("animation")})})},Y=new IntersectionObserver(F,_);Y.observe(b.covers);new C(".accordion-container-faq",{duration:800,showMultiple:!0});document.addEventListener("DOMContentLoaded",function(){const e=document.querySelectorAll(".faq-item");z.forEach(n=>n.addEventListener("click",()=>{n.classList.toggle("active")})),e.forEach(n=>{const o=n.querySelector(".faq-btn"),t=n.querySelector(".ac-panel");o.addEventListener("click",function(){t.style.display==="flex"?t.style.display="none":t.style.display="flex"})})});const z=document.querySelectorAll(".faq-item"),U=document.querySelector(".menu-link"),u=document.querySelector(".menu-list"),W=document.querySelector(".burger-btn"),w=document.querySelector(".burger-menu"),$=document.querySelector(".close-btn"),G=document.querySelector(".burger-order-btn"),J=document.querySelector(".burger-menu-list");U.addEventListener("click",re);W.addEventListener("click",ae);$.addEventListener("click",S);G.addEventListener("click",S);J.addEventListener("click",S);const Z=new KeyframeEffect(u,[{opacity:"0",transform:"translateY(-100%)"},{opacity:"1",transform:"translateY(0)"}],{duration:500}),Q=new KeyframeEffect(u,[{opacity:"1",transform:"translateY(0)"},{opacity:"0",transform:"translateY(-100%)"}],{duration:500}),ee=new Animation(Z,document.timeline),te=new Animation(Q,document.timeline),ne=new KeyframeEffect(w,[{transform:"translateX(100%)"},{transform:"translateX(0)"}],{duration:500}),oe=new KeyframeEffect(w,[{transform:"translateX(0)"},{transform:"translateX(100%)"}],{duration:500}),ie=new Animation(ne,document.timeline),se=new Animation(oe,document.timeline);function re(){if(u.classList.contains("visually-hidden")){ee.play(),u.classList.remove("visually-hidden");return}te.play(),setTimeout(()=>{u.classList.add("visually-hidden")},500)}function ae(){w.classList.add("is-open"),ie.play()}function S(){se.play(),setTimeout(()=>{w.classList.remove("is-open")},500)}const ce=document.querySelector(".window-btn"),f=document.querySelector(".backdrop"),M="is-open",le=document.querySelector("body"),de=e=>{f.classList.add(M),le.style.overflow="hidden",ue(e)};ce.addEventListener("click",()=>{E()});f.addEventListener("click",e=>{e.target===f&&E()});document.addEventListener("keydown",e=>{e.key==="Escape"&&E()});function E(){f.classList.remove(M),document.body.style.overflow="auto",R()}function ue({title:e="",message:n=""}){const o=document.createElement("h2");o.classList.add("window-title"),o.textContent=e;const t=document.createElement("p");t.classList.add("window-text"),t.textContent=n,R();const i=document.querySelector(".modal-window");i.appendChild(o),i.appendChild(t)}function R(){const e=document.querySelector(".window-title"),n=document.querySelector(".window-text");e&&e.remove(),n&&n.remove()}document.addEventListener("DOMContentLoaded",function(){const e=document.querySelectorAll(".project-list-item"),n=document.querySelector(".prev"),o=document.querySelector(".next");let t=0,i=0,s=0,c=0;e.forEach((a,L)=>{L!==t&&(a.style.display="none")});function l(){e.forEach((a,L)=>{L===t?a.style.display="block":a.style.display="none"}),n.disabled=t===0,o.disabled=t===e.length-1}n.addEventListener("click",function(){t>0&&(i=t,t--,l(),e[i].style.animation="slideRightToLeft 0.2s ease-in-out",e[t].style.animation="slideRightToLeft 0.2s ease-in-out")}),o.addEventListener("click",function(){t0?(i=t,t--,l(),e[i].style.animation="slideRightToLeft 0.2s ease-in-out",e[t].style.animation="slideRightToLeft 0.2s ease-in-out"):a.code==="ArrowRight"&&t50?t>0&&(i=t,t--,l(),e[i].style.animation="slideRightToLeft 0.2s ease-in-out",e[t].style.animation="slideRightToLeft 0.2s ease-in-out"):s-c>50&&t` +import{A as C,S as k,N as K,K as N,M as P,i as V,a as j}from"./assets/vendor-DOMKpuM6.js";(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))t(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const c of s.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&t(c)}).observe(document,{childList:!0,subtree:!0});function o(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function t(i){if(i.ep)return;i.ep=!0;const s=o(i);fetch(i.href,s)}})();const X=document.querySelector(".about-me-btn");X.classList.add("btn-active");const H=document.querySelector(".about-me-chapter .section-title");H.classList.add("active");new C("#accordionAbout",{openOnInit:[0],showMultiple:!0,beforeOpen:function(e){e.querySelector(".about-me-btn.ac-trigger").classList.add("btn-active"),e.querySelector(".about-me-chapter .section-title").classList.add("active")},beforeClose:function(e){e.querySelector(".about-me-btn.ac-trigger").classList.remove("btn-active"),e.querySelector(".about-me-chapter .section-title").classList.remove("active")}});new k("#swiperAbout",{modules:[K,N,P],navigation:{nextEl:".about-me-btn-swipe"},mousewheel:{invert:!0},keyboard:{enabled:!0,onlyInViewport:!0},mousewheel:!0,touch:!0,centeredSlides:!1,loop:!0,speed:500,spaceBetween:0,slideToClickedSlide:!0,allowTouchMove:!0,slidesPerView:2,width:260,breakpoints:{768:{slidesPerView:3,width:600},1440:{slidesPerView:6,width:1200}}});const b={cards:document.querySelectorAll(".marquee__card"),covers:document.querySelector(".covers")};let _={root:null,rootMargin:"0px",threshold:0},F=e=>{e.forEach(n=>{if(n.isIntersecting){b.cards.forEach(o=>{o.classList.add("animation")});return}b.cards.forEach(o=>{o.classList.remove("animation")})})},Y=new IntersectionObserver(F,_);Y.observe(b.covers);new C(".accordion-container-faq",{duration:800,showMultiple:!0});document.addEventListener("DOMContentLoaded",function(){const e=document.querySelectorAll(".faq-item");z.forEach(n=>n.addEventListener("click",()=>{n.classList.toggle("active")})),e.forEach(n=>{const o=n.querySelector(".faq-btn"),t=n.querySelector(".ac-panel");o.addEventListener("click",function(){t.style.display==="flex"?t.style.display="none":t.style.display="flex"})})});const z=document.querySelectorAll(".faq-item"),U=document.querySelector(".menu-link"),u=document.querySelector(".menu-list"),W=document.querySelector(".burger-btn"),w=document.querySelector(".burger-menu"),$=document.querySelector(".close-btn"),G=document.querySelector(".burger-order-btn"),J=document.querySelector(".burger-menu-list");U.addEventListener("click",re);W.addEventListener("click",ae);$.addEventListener("click",S);G.addEventListener("click",S);J.addEventListener("click",S);const Z=new KeyframeEffect(u,[{opacity:"0",transform:"translateY(-100%)"},{opacity:"1",transform:"translateY(0)"}],{duration:500}),Q=new KeyframeEffect(u,[{opacity:"1",transform:"translateY(0)"},{opacity:"0",transform:"translateY(-100%)"}],{duration:500}),ee=new Animation(Z,document.timeline),te=new Animation(Q,document.timeline),ne=new KeyframeEffect(w,[{transform:"translateX(100%)"},{transform:"translateX(0)"}],{duration:500}),oe=new KeyframeEffect(w,[{transform:"translateX(0)"},{transform:"translateX(100%)"}],{duration:500}),ie=new Animation(ne,document.timeline),se=new Animation(oe,document.timeline);function re(){if(u.classList.contains("visually-hidden")){ee.play(),u.classList.remove("visually-hidden");return}te.play(),setTimeout(()=>{u.classList.add("visually-hidden")},500)}function ae(){w.classList.add("is-open"),ie.play(),document.body.style.overflow="hidden"}function S(){se.play(),setTimeout(()=>{w.classList.remove("is-open")},500),document.body.style.overflow=""}const ce=document.querySelector(".window-btn"),f=document.querySelector(".backdrop"),M="is-open",le=document.querySelector("body"),de=e=>{f.classList.add(M),le.style.overflow="hidden",ue(e)};ce.addEventListener("click",()=>{E()});f.addEventListener("click",e=>{e.target===f&&E()});document.addEventListener("keydown",e=>{e.key==="Escape"&&E()});function E(){f.classList.remove(M),document.body.style.overflow="auto",R()}function ue({title:e="",message:n=""}){const o=document.createElement("h2");o.classList.add("window-title"),o.textContent=e;const t=document.createElement("p");t.classList.add("window-text"),t.textContent=n,R();const i=document.querySelector(".modal-window");i.appendChild(o),i.appendChild(t)}function R(){const e=document.querySelector(".window-title"),n=document.querySelector(".window-text");e&&e.remove(),n&&n.remove()}document.addEventListener("DOMContentLoaded",function(){const e=document.querySelectorAll(".project-list-item"),n=document.querySelector(".prev"),o=document.querySelector(".next");let t=0,i=0,s=0,c=0;e.forEach((a,L)=>{L!==t&&(a.style.display="none")});function l(){e.forEach((a,L)=>{L===t?a.style.display="block":a.style.display="none"}),n.disabled=t===0,o.disabled=t===e.length-1}n.addEventListener("click",function(){t>0&&(i=t,t--,l(),e[i].style.animation="slideRightToLeft 0.2s ease-in-out",e[t].style.animation="slideRightToLeft 0.2s ease-in-out")}),o.addEventListener("click",function(){t0?(i=t,t--,l(),e[i].style.animation="slideRightToLeft 0.2s ease-in-out",e[t].style.animation="slideRightToLeft 0.2s ease-in-out"):a.code==="ArrowRight"&&t50?t>0&&(i=t,t--,l(),e[i].style.animation="slideRightToLeft 0.2s ease-in-out",e[t].style.animation="slideRightToLeft 0.2s ease-in-out"):s-c>50&&t`
  • Reviewer diff --git a/commonHelpers.js.map b/commonHelpers.js.map index fe2e514..6cce4ea 100644 --- a/commonHelpers.js.map +++ b/commonHelpers.js.map @@ -1 +1 @@ -{"version":3,"file":"commonHelpers.js","sources":["../src/partials/about-me/accordion.js","../src/partials/about-me/swiper.js","../src/partials/covers/covers.js","../src/partials/faq/faq.js","../src/partials/header/header.js","../src/partials/modal/modal.js","../src/partials/projects/projects.js","../src/partials/reviews/reviews.js","../src/partials/scroll-to-top-btn/scroll-to-top-btn.js","../src/partials/work-together/elements.js","../src/partials/work-together/userDataApi.js","../src/partials/work-together/validationForm.js","../src/partials/work-together/work-together.js"],"sourcesContent":["import Accordion from 'accordion-js';\n\nconst btnAcc = document.querySelector('.about-me-btn');\nbtnAcc.classList.add('btn-active');\nconst titleAcc = document.querySelector('.about-me-chapter .section-title');\ntitleAcc.classList.add('active');\n\nconst accAboutMe = new Accordion('#accordionAbout', {\n openOnInit: [0],\n showMultiple: true,\n beforeOpen: function (accAboutMe) {\n const btn = accAboutMe.querySelector('.about-me-btn.ac-trigger');\n btn.classList.add('btn-active');\n const title = accAboutMe.querySelector('.about-me-chapter .section-title');\n title.classList.add('active');\n },\n beforeClose: function (accAboutMe) {\n const btn = accAboutMe.querySelector('.about-me-btn.ac-trigger');\n btn.classList.remove('btn-active');\n const title = accAboutMe.querySelector('.about-me-chapter .section-title');\n title.classList.remove('active');\n },\n});\n","import Swiper from 'swiper';\nimport 'swiper/css';\n\nimport 'swiper/css/mousewheel';\n\nimport { Navigation, Keyboard, Mousewheel } from 'swiper/modules';\n\nconst swiperAboutMe = new Swiper('#swiperAbout', {\n modules: [Navigation, Keyboard, Mousewheel],\n navigation: {\n nextEl: '.about-me-btn-swipe',\n },\n mousewheel: {\n invert: true,\n },\n keyboard: {\n enabled: true,\n onlyInViewport: true,\n },\n mousewheel: true,\n touch: true,\n centeredSlides: false,\n loop: true,\n speed: 500,\n spaceBetween: 0,\n slideToClickedSlide: true,\n allowTouchMove: true,\n slidesPerView: 2,\n width: 260,\n breakpoints: {\n 768: {\n slidesPerView: 3,\n width: 600,\n },\n 1440: {\n slidesPerView: 6,\n width: 1200,\n },\n },\n});\n","const section = {\n cards: document.querySelectorAll('.marquee__card'),\n covers: document.querySelector('.covers'),\n};\n\nlet options = {\n root: null,\n rootMargin: '0px',\n threshold: 0,\n};\n\nlet animationCovers = entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n section.cards.forEach(card => {\n card.classList.add('animation');\n // console.log('add');\n });\n return;\n }\n section.cards.forEach(card => {\n card.classList.remove('animation');\n // console.log('remove');\n });\n });\n};\n\nlet observer = new IntersectionObserver(animationCovers, options);\nobserver.observe(section.covers);\n","import Accordion from 'accordion-js';\nnew Accordion('.accordion-container-faq', {\n duration: 800,\n showMultiple: true,\n});\n\ndocument.addEventListener('DOMContentLoaded', function () {\n const accordionItems = document.querySelectorAll('.faq-item');\n faqs.forEach(faq =>\n faq.addEventListener('click', () => {\n faq.classList.toggle('active');\n })\n );\n\n accordionItems.forEach(item => {\n const btn = item.querySelector('.faq-btn');\n const content = item.querySelector('.ac-panel');\n\n btn.addEventListener('click', function () {\n if (content.style.display === 'flex') {\n content.style.display = 'none';\n } else {\n content.style.display = 'flex';\n }\n });\n });\n});\nconst faqs = document.querySelectorAll('.faq-item');\n","// console.log('HEADER');\nconst menuBtn = document.querySelector('.menu-link');\nconst menuList = document.querySelector('.menu-list')\nconst burgerBtn = document.querySelector('.burger-btn');\nconst burgerMenu = document.querySelector('.burger-menu');\nconst closeBtn = document.querySelector('.close-btn');\nconst orderBtn = document.querySelector('.burger-order-btn');\nconst burgerMenuList = document.querySelector('.burger-menu-list');\n\nmenuBtn.addEventListener('click', handleMenuClick);\nburgerBtn.addEventListener('click', handleBurgerClick);\ncloseBtn.addEventListener('click', handleCloseClick);\norderBtn.addEventListener('click', handleCloseClick);\nburgerMenuList.addEventListener('click', handleCloseClick);\n\nconst dropDownKeyframes = new KeyframeEffect(\n menuList,\n [{ opacity: \"0\",\n transform: \"translateY(-100%)\"\n },\n { opacity: \"1\",\n transform: \"translateY(0)\"\n }],\n { duration: 500 });\n\nconst dropUpKeyframes = new KeyframeEffect(\n menuList,\n [{ opacity: \"1\",\n transform: \"translateY(0)\"\n },\n { opacity: \"0\",\n transform: \"translateY(-100%)\"\n }],\n { duration: 500 });\n\nconst dropDownAnimation = new Animation(\n dropDownKeyframes,\n document.timeline\n)\n\nconst dropUpAnimation = new Animation(\n dropUpKeyframes,\n document.timeline\n)\n\nconst openKeyframes = new KeyframeEffect(\n burgerMenu,\n [{ transform: \"translateX(100%)\"\n },\n { transform: \"translateX(0)\"\n }],\n { duration: 500 }\n)\n\nconst closeKeyframe = new KeyframeEffect(\n burgerMenu,\n [{ transform: \"translateX(0)\"\n },\n { transform: \"translateX(100%)\"\n }],\n { duration: 500 }\n)\n\nconst openBurgerAnimation = new Animation(\n openKeyframes,\n document.timeline\n)\n\nconst closeBurgerAnimation = new Animation(\n closeKeyframe,\n document.timeline\n)\n\nfunction handleMenuClick() {\n \n if (menuList.classList.contains('visually-hidden')) {\n dropDownAnimation.play();\n menuList.classList.remove('visually-hidden');\n return;\n }\n dropUpAnimation.play();\n setTimeout(() => {\n menuList.classList.add('visually-hidden');\n }, 500);\n \n}\n\nfunction handleBurgerClick() {\n burgerMenu.classList.add('is-open');\n openBurgerAnimation.play();\n}\n\nfunction handleCloseClick() {\n closeBurgerAnimation.play();\n setTimeout(() => {\n burgerMenu.classList.remove('is-open');\n }, 500);\n}\n\n","const btnClose = document.querySelector('.window-btn');\nconst windowBackdrop = document.querySelector('.backdrop');\nconst OPEN_CLASS = 'is-open';\nconst body = document.querySelector('body');\n\nexport const openModalWithData = data => {\n windowBackdrop.classList.add(OPEN_CLASS);\n body.style.overflow = 'hidden';\n renderModalData(data);\n};\n\nbtnClose.addEventListener('click', () => {\n closeWindow();\n});\n\nwindowBackdrop.addEventListener('click', event => {\n if (event.target === windowBackdrop) {\n closeWindow();\n }\n});\n\ndocument.addEventListener('keydown', event => {\n if (event.key === 'Escape') {\n closeWindow();\n }\n});\n\nfunction closeWindow() {\n windowBackdrop.classList.remove(OPEN_CLASS);\n document.body.style.overflow = 'auto';\n clearModalData();\n}\n\nfunction renderModalData({ title = '', message = '' }) {\n const modalTitle = document.createElement('h2');\n modalTitle.classList.add('window-title');\n modalTitle.textContent = title;\n\n const modalText = document.createElement('p');\n modalText.classList.add('window-text');\n modalText.textContent = message;\n clearModalData();\n\n const modalWindow = document.querySelector('.modal-window');\n modalWindow.appendChild(modalTitle);\n modalWindow.appendChild(modalText);\n}\n\nfunction clearModalData() {\n const modalTitle = document.querySelector('.window-title');\n const modalText = document.querySelector('.window-text');\n if (modalTitle) {\n modalTitle.remove();\n }\n if (modalText) {\n modalText.remove();\n }\n}\n","document.addEventListener('DOMContentLoaded', function() {\n const projectItems = document.querySelectorAll('.project-list-item');\n const prevButton = document.querySelector('.prev');\n const nextButton = document.querySelector('.next');\n\n let currentIndex = 0;\n let prevIndex = 0;\n let touchStartX = 0;\n let touchEndX = 0;\n\n projectItems.forEach((item, index) => {\n if (index !== currentIndex) {\n item.style.display = 'none';\n }\n });\n\n function showCurrentCard() {\n projectItems.forEach((item, index) => {\n if (index === currentIndex) {\n item.style.display = 'block';\n } else {\n item.style.display = 'none';\n }\n });\n\n prevButton.disabled = currentIndex === 0;\n nextButton.disabled = currentIndex === projectItems.length - 1;\n }\n\n prevButton.addEventListener('click', function() {\n if (currentIndex > 0) {\n prevIndex = currentIndex; \n currentIndex--;\n showCurrentCard();\n projectItems[prevIndex].style.animation = 'slideRightToLeft 0.2s ease-in-out';\n projectItems[currentIndex].style.animation = 'slideRightToLeft 0.2s ease-in-out';\n }\n });\n\n nextButton.addEventListener('click', function() {\n if (currentIndex < projectItems.length - 1) {\n prevIndex = currentIndex; \n currentIndex++;\n showCurrentCard();\n projectItems[prevIndex].style.animation = 'slideLeftToRight 0.2s ease-in-out';\n projectItems[currentIndex].style.animation = 'slideLeftToRight 0.2s ease-in-out';\n }\n });\n\n document.addEventListener('keydown', function(event) {\n if (event.code === 'ArrowLeft' && currentIndex > 0) {\n prevIndex = currentIndex; \n currentIndex--;\n showCurrentCard();\n projectItems[prevIndex].style.animation = 'slideRightToLeft 0.2s ease-in-out';\n projectItems[currentIndex].style.animation = 'slideRightToLeft 0.2s ease-in-out';\n } else if (event.code === 'ArrowRight' && currentIndex < projectItems.length - 1) {\n prevIndex = currentIndex;\n currentIndex++;\n showCurrentCard();\n projectItems[prevIndex].style.animation = 'slideLeftToRight 0.2s ease-in-out';\n projectItems[currentIndex].style.animation = 'slideLeftToRight 0.2s ease-in-out';\n }\n });\n\n document.addEventListener('touchstart', function(event) {\n touchStartX = event.touches[0].clientX;\n });\n\n document.addEventListener('touchend', function(event) {\n touchEndX = event.changedTouches[0].clientX;\n handleSwipe();\n });\n\n function handleSwipe() {\n const swipeThreshold = 50; // Порог свайпа\n\n if (touchEndX - touchStartX > swipeThreshold) {\n // Свайп вправо\n if (currentIndex > 0) {\n prevIndex = currentIndex; \n currentIndex--;\n showCurrentCard();\n projectItems[prevIndex].style.animation = 'slideRightToLeft 0.2s ease-in-out';\n projectItems[currentIndex].style.animation = 'slideRightToLeft 0.2s ease-in-out';\n }\n } else if (touchStartX - touchEndX > swipeThreshold) {\n // Свайп влево\n if (currentIndex < projectItems.length - 1) {\n prevIndex = currentIndex; \n currentIndex++;\n showCurrentCard();\n projectItems[prevIndex].style.animation = 'slideLeftToRight 0.2s ease-in-out';\n projectItems[currentIndex].style.animation = 'slideLeftToRight 0.2s ease-in-out';\n }\n }\n }\n\n showCurrentCard();\n});\n\n","import Swiper from 'swiper/bundle';\nimport iziToast from 'izitoast';\nimport 'izitoast/dist/css/iziToast.min.css';\nimport \"swiper/css/bundle\";\n\nconst reviewsList = document.querySelector(\"#reviews-list\");\nconst buttonNext = document.querySelector(\".swiper-button-next\"); \nconst buttonPrev = document.querySelector(\".swiper-button-prev\");\nlet quantitySlides;\nlet flag = true;\n\nfunction setQSlides() {\n const windowWidth = window.innerWidth;\n if (windowWidth < 768)\n {\n quantitySlides = 1;\n }\n else if (windowWidth < 1440)\n {\n quantitySlides = 2\n }\n else\n {\n quantitySlides = 4;\n }\n\n}\n\nasync function fetchReviews() {\n try\n {\n const response = await fetch('https://portfolio-js.b.goit.study/api/reviews');\n if (response.status != 200) { throw new Error('Failed to fetch reviews'); }\n \n const reviews = await response.json();\n flag = true;\n return reviews;\n }\n catch (error)\n {\n return error;\n }\n}\n\nfunction fillList(reviews) {\n reviewsList.innerHTML = '';\n \n const listHTML = reviews.map(review => `\n
  • \n \"Reviewer\"\n
    ${review.author}
    \n

    ${review.review}

    \n
  • \n `).join('');\n\n reviewsList.insertAdjacentHTML('beforeend', listHTML);\n}\n\nfunction errorList() {\n\n const element = document.querySelector('.error');\n if (element) {\n element.remove();\n } \n \n const listHTML = `

    Not Found

    `;\n\n reviewsList.insertAdjacentHTML('beforebegin', listHTML);\n}\n\nasync function loadReviews() {\n try\n {\n const reviews = await fetchReviews();\n fillList(reviews);\n const swiper = new Swiper('.swiper', {\n\n navigation: {\n nextEl: buttonNext,\n prevEl: buttonPrev,\n },\n\n slidesPerView: quantitySlides,\n slidesPerGroup: quantitySlides,\n spaceBetween: 16,\n\n keyboard: {\n enabled: true,\n onlyInViewport: true,\n pageUpDown: true\n },\n\n mousewheel: {\n sensitivity: 1,\n },\n \n autoHeight: false,\n observer: true,\n\n });\n flag = true;\n }\n catch (error)\n {\n iziToast.error({\n title: 'Error',\n message: 'Sorry, something went wrong with reviews.'\n });\n errorList();\n flag = false;\n }\n}\n\nsetQSlides();\nloadReviews();\n\nwindow.addEventListener('resize', function () {\n if (flag) {\n setQSlides();\n loadReviews();\n }\n});","const btnTop = document.querySelector('#scroll-top');\n\nwindow.addEventListener('scroll', scrollFunction);\n\nfunction scrollFunction() {\n btnTop.style.display = window.scrollY > 250 ? 'flex' : 'none';\n}\n\nbtnTop.addEventListener('click', () => {\n window.scrollTo({ top: 0, behavior: 'smooth' });\n});\n","export const form = document.querySelector('.js-submit-form');\nexport const [inputEmail, inputComments] = form;\n\nexport const validEmailSpan = document.querySelector('.valid-email-text');\nexport const invalidEmailSpan = document.querySelector('.invalid-email-text');\nexport const invalidCommentSpan = document.querySelector(\n '.invalid-comments-text'\n);\n","import axios from 'axios';\n\nexport const sendUserDataApi = async ({ email, comment }) => {\n const URL = 'https://portfolio-js.b.goit.study/api/requests';\n\n const { data } = await axios.post(URL, { email, comment });\n return data;\n};\n","import {\n validEmailSpan,\n invalidEmailSpan,\n invalidCommentSpan,\n inputEmail,\n inputComments,\n} from './elements.js';\n\nconst VALIDATION_CLASS = {\n valid: 'valid-input',\n invalid: 'invalid-input',\n isVisible: 'is-visible',\n};\n\nexport const validateEmail = email => {\n const pattern = /^\\w+(\\.\\w+)?@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$/;\n const isValidEmail = pattern.test(email);\n\n if (!isValidEmail) {\n inputEmail.classList.add(VALIDATION_CLASS.invalid);\n invalidEmailSpan.classList.add(VALIDATION_CLASS.isVisible);\n } else {\n inputEmail.classList.add(VALIDATION_CLASS.valid);\n validEmailSpan.classList.add(VALIDATION_CLASS.isVisible);\n }\n return isValidEmail;\n};\n\nexport const validateText = text => {\n if (!text) {\n inputComments.classList.add(VALIDATION_CLASS.invalid);\n invalidCommentSpan.classList.add(VALIDATION_CLASS.isVisible);\n } else {\n inputComments.classList.add(VALIDATION_CLASS.valid);\n }\n return !!text;\n};\n\nexport const resetFieldValidation = field => {\n const fieldName = field.name;\n\n if (fieldName === 'userEmail') {\n validEmailSpan.classList.remove(VALIDATION_CLASS.isVisible);\n invalidEmailSpan.classList.remove(VALIDATION_CLASS.isVisible);\n }\n\n if (fieldName === 'userComments') {\n invalidCommentSpan.classList.remove(VALIDATION_CLASS.isVisible);\n }\n\n field.classList.remove(VALIDATION_CLASS.valid);\n field.classList.remove(VALIDATION_CLASS.invalid);\n};\n\nexport const resetAllValidation = () => {\n const validationSpans = [\n validEmailSpan,\n invalidEmailSpan,\n invalidCommentSpan,\n ];\n\n validationSpans.forEach(spanElement => {\n spanElement.classList.remove(VALIDATION_CLASS.isVisible);\n });\n\n const validationInputs = [inputEmail, inputComments];\n\n validationInputs.forEach(input => {\n input.classList.remove(VALIDATION_CLASS.valid);\n input.classList.remove(VALIDATION_CLASS.invalid);\n });\n};\n","import iziToast from 'izitoast';\nimport 'izitoast/dist/css/iziToast.min.css';\n\nimport { form, inputEmail, inputComments } from './elements.js';\nimport { sendUserDataApi } from './userDataApi.js';\nimport {\n resetAllValidation,\n resetFieldValidation,\n validateEmail,\n validateText,\n} from './validationForm.js';\nimport { openModalWithData } from '../modal/modal.js';\n\nconst STORAGE_KEY = 'formData';\n\nconst formData = getFromLocalStorage() || {\n userEmail: '',\n userComments: '',\n};\n\ninputEmail.value = formData.userEmail;\ninputComments.value = formData.userComments;\n\nform.addEventListener('input', event => {\n resetFieldValidation(event.target);\n\n const { name, value } = event.target;\n formData[name] = value.trim();\n setToLocalStorage(formData);\n});\n\nform.addEventListener('submit', onSubmit);\n\nasync function onSubmit(event) {\n event.preventDefault();\n const { userEmail, userComments } = formData;\n\n const isValidEmail = validateEmail(userEmail);\n const isValidText = validateText(userComments);\n\n if (!isValidEmail || !isValidText) {\n return;\n }\n\n try {\n const data = await sendUserDataApi({\n email: userEmail,\n comment: userComments,\n });\n openModalWithData(data);\n\n resetData();\n } catch (error) {\n iziToast.error({\n title: 'Error',\n message: error.message,\n position: 'topRight',\n });\n }\n}\n\n// helpers\nfunction setToLocalStorage(value, key = STORAGE_KEY) {\n localStorage.setItem(key, JSON.stringify(value));\n}\nfunction getFromLocalStorage(key = STORAGE_KEY) {\n return JSON.parse(localStorage.getItem(key));\n}\n\nfunction resetData(key = STORAGE_KEY) {\n localStorage.removeItem(key);\n form.reset();\n resetAllValidation();\n formData.userEmail = '';\n formData.userComments = '';\n}\n"],"names":["btnAcc","titleAcc","Accordion","accAboutMe","Swiper","Navigation","Keyboard","Mousewheel","section","options","animationCovers","entries","entry","card","observer","accordionItems","faqs","faq","item","btn","content","menuBtn","menuList","burgerBtn","burgerMenu","closeBtn","orderBtn","burgerMenuList","handleMenuClick","handleBurgerClick","handleCloseClick","dropDownKeyframes","dropUpKeyframes","dropDownAnimation","dropUpAnimation","openKeyframes","closeKeyframe","openBurgerAnimation","closeBurgerAnimation","btnClose","windowBackdrop","OPEN_CLASS","body","openModalWithData","data","renderModalData","closeWindow","event","clearModalData","title","message","modalTitle","modalText","modalWindow","projectItems","prevButton","nextButton","currentIndex","prevIndex","touchStartX","touchEndX","index","showCurrentCard","handleSwipe","reviewsList","buttonNext","buttonPrev","quantitySlides","flag","setQSlides","windowWidth","fetchReviews","response","reviews","error","fillList","listHTML","review","errorList","element","loadReviews","swiper","iziToast","btnTop","scrollFunction","form","inputEmail","inputComments","validEmailSpan","invalidEmailSpan","invalidCommentSpan","sendUserDataApi","email","comment","URL","axios","VALIDATION_CLASS","validateEmail","isValidEmail","validateText","text","resetFieldValidation","field","fieldName","resetAllValidation","spanElement","input","STORAGE_KEY","formData","getFromLocalStorage","name","value","setToLocalStorage","onSubmit","userEmail","userComments","isValidText","resetData","key"],"mappings":"gyBAEA,MAAMA,EAAS,SAAS,cAAc,eAAe,EACrDA,EAAO,UAAU,IAAI,YAAY,EACjC,MAAMC,EAAW,SAAS,cAAc,kCAAkC,EAC1EA,EAAS,UAAU,IAAI,QAAQ,EAEZ,IAAIC,EAAU,kBAAmB,CAClD,WAAY,CAAC,CAAC,EACd,aAA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D,CACA,SAASF,GAAoBS,EAAMX,EAAa,CAC9C,OAAO,KAAK,MAAM,aAAa,QAAQW,CAAG,CAAC,CAC7C,CAEA,SAASD,GAAUC,EAAMX,EAAa,CACpC,aAAa,WAAWW,CAAG,EAC3BjC,EAAK,MAAK,EACVmB,KACAI,EAAS,UAAY,GACrBA,EAAS,aAAe,EAC1B"} \ No newline at end of file +{"version":3,"file":"commonHelpers.js","sources":["../src/partials/about-me/accordion.js","../src/partials/about-me/swiper.js","../src/partials/covers/covers.js","../src/partials/faq/faq.js","../src/partials/header/header.js","../src/partials/modal/modal.js","../src/partials/projects/projects.js","../src/partials/reviews/reviews.js","../src/partials/scroll-to-top-btn/scroll-to-top-btn.js","../src/partials/work-together/elements.js","../src/partials/work-together/userDataApi.js","../src/partials/work-together/validationForm.js","../src/partials/work-together/work-together.js"],"sourcesContent":["import Accordion from 'accordion-js';\n\nconst btnAcc = document.querySelector('.about-me-btn');\nbtnAcc.classList.add('btn-active');\nconst titleAcc = document.querySelector('.about-me-chapter .section-title');\ntitleAcc.classList.add('active');\n\nconst accAboutMe = new Accordion('#accordionAbout', {\n openOnInit: [0],\n showMultiple: true,\n beforeOpen: function (accAboutMe) {\n const btn = accAboutMe.querySelector('.about-me-btn.ac-trigger');\n btn.classList.add('btn-active');\n const title = accAboutMe.querySelector('.about-me-chapter .section-title');\n title.classList.add('active');\n },\n beforeClose: function (accAboutMe) {\n const btn = accAboutMe.querySelector('.about-me-btn.ac-trigger');\n btn.classList.remove('btn-active');\n const title = accAboutMe.querySelector('.about-me-chapter .section-title');\n title.classList.remove('active');\n },\n});\n","import Swiper from 'swiper';\nimport 'swiper/css';\n\nimport 'swiper/css/mousewheel';\n\nimport { Navigation, Keyboard, Mousewheel } from 'swiper/modules';\n\nconst swiperAboutMe = new Swiper('#swiperAbout', {\n modules: [Navigation, Keyboard, Mousewheel],\n navigation: {\n nextEl: '.about-me-btn-swipe',\n },\n mousewheel: {\n invert: true,\n },\n keyboard: {\n enabled: true,\n onlyInViewport: true,\n },\n mousewheel: true,\n touch: true,\n centeredSlides: false,\n loop: true,\n speed: 500,\n spaceBetween: 0,\n slideToClickedSlide: true,\n allowTouchMove: true,\n slidesPerView: 2,\n width: 260,\n breakpoints: {\n 768: {\n slidesPerView: 3,\n width: 600,\n },\n 1440: {\n slidesPerView: 6,\n width: 1200,\n },\n },\n});\n","const section = {\n cards: document.querySelectorAll('.marquee__card'),\n covers: document.querySelector('.covers'),\n};\n\nlet options = {\n root: null,\n rootMargin: '0px',\n threshold: 0,\n};\n\nlet animationCovers = entries => {\n entries.forEach(entry => {\n if (entry.isIntersecting) {\n section.cards.forEach(card => {\n card.classList.add('animation');\n // console.log('add');\n });\n return;\n }\n section.cards.forEach(card => {\n card.classList.remove('animation');\n // console.log('remove');\n });\n });\n};\n\nlet observer = new IntersectionObserver(animationCovers, options);\nobserver.observe(section.covers);\n","import Accordion from 'accordion-js';\nnew Accordion('.accordion-container-faq', {\n duration: 800,\n showMultiple: true,\n});\n\ndocument.addEventListener('DOMContentLoaded', function () {\n const accordionItems = document.querySelectorAll('.faq-item');\n faqs.forEach(faq =>\n faq.addEventListener('click', () => {\n faq.classList.toggle('active');\n })\n );\n\n accordionItems.forEach(item => {\n const btn = item.querySelector('.faq-btn');\n const content = item.querySelector('.ac-panel');\n\n btn.addEventListener('click', function () {\n if (content.style.display === 'flex') {\n content.style.display = 'none';\n } else {\n content.style.display = 'flex';\n }\n });\n });\n});\nconst faqs = document.querySelectorAll('.faq-item');\n","// console.log('HEADER');\nconst menuBtn = document.querySelector('.menu-link');\nconst menuList = document.querySelector('.menu-list')\nconst burgerBtn = document.querySelector('.burger-btn');\nconst burgerMenu = document.querySelector('.burger-menu');\nconst closeBtn = document.querySelector('.close-btn');\nconst orderBtn = document.querySelector('.burger-order-btn');\nconst burgerMenuList = document.querySelector('.burger-menu-list');\n\nmenuBtn.addEventListener('click', handleMenuClick);\nburgerBtn.addEventListener('click', handleBurgerClick);\ncloseBtn.addEventListener('click', handleCloseClick);\norderBtn.addEventListener('click', handleCloseClick);\nburgerMenuList.addEventListener('click', handleCloseClick);\n\nconst dropDownKeyframes = new KeyframeEffect(\n menuList,\n [{ opacity: \"0\",\n transform: \"translateY(-100%)\"\n },\n { opacity: \"1\",\n transform: \"translateY(0)\"\n }],\n { duration: 500 });\n\nconst dropUpKeyframes = new KeyframeEffect(\n menuList,\n [{ opacity: \"1\",\n transform: \"translateY(0)\"\n },\n { opacity: \"0\",\n transform: \"translateY(-100%)\"\n }],\n { duration: 500 });\n\nconst dropDownAnimation = new Animation(\n dropDownKeyframes,\n document.timeline\n)\n\nconst dropUpAnimation = new Animation(\n dropUpKeyframes,\n document.timeline\n)\n\nconst openKeyframes = new KeyframeEffect(\n burgerMenu,\n [{ transform: \"translateX(100%)\"\n },\n { transform: \"translateX(0)\"\n }],\n { duration: 500 }\n)\n\nconst closeKeyframe = new KeyframeEffect(\n burgerMenu,\n [{ transform: \"translateX(0)\"\n },\n { transform: \"translateX(100%)\"\n }],\n { duration: 500 }\n)\n\nconst openBurgerAnimation = new Animation(\n openKeyframes,\n document.timeline\n)\n\nconst closeBurgerAnimation = new Animation(\n closeKeyframe,\n document.timeline\n)\n\nfunction handleMenuClick() {\n \n if (menuList.classList.contains('visually-hidden')) {\n dropDownAnimation.play();\n menuList.classList.remove('visually-hidden');\n return;\n }\n dropUpAnimation.play();\n setTimeout(() => {\n menuList.classList.add('visually-hidden');\n }, 500);\n \n}\n\nfunction handleBurgerClick() {\n burgerMenu.classList.add('is-open');\n openBurgerAnimation.play();\n document.body.style.overflow = 'hidden';\n}\n\nfunction handleCloseClick() {\n closeBurgerAnimation.play();\n setTimeout(() => {\n burgerMenu.classList.remove('is-open');\n }, 500);\n document.body.style.overflow = '';\n}\n\n","const btnClose = document.querySelector('.window-btn');\nconst windowBackdrop = document.querySelector('.backdrop');\nconst OPEN_CLASS = 'is-open';\nconst body = document.querySelector('body');\n\nexport const openModalWithData = data => {\n windowBackdrop.classList.add(OPEN_CLASS);\n body.style.overflow = 'hidden';\n renderModalData(data);\n};\n\nbtnClose.addEventListener('click', () => {\n closeWindow();\n});\n\nwindowBackdrop.addEventListener('click', event => {\n if (event.target === windowBackdrop) {\n closeWindow();\n }\n});\n\ndocument.addEventListener('keydown', event => {\n if (event.key === 'Escape') {\n closeWindow();\n }\n});\n\nfunction closeWindow() {\n windowBackdrop.classList.remove(OPEN_CLASS);\n document.body.style.overflow = 'auto';\n clearModalData();\n}\n\nfunction renderModalData({ title = '', message = '' }) {\n const modalTitle = document.createElement('h2');\n modalTitle.classList.add('window-title');\n modalTitle.textContent = title;\n\n const modalText = document.createElement('p');\n modalText.classList.add('window-text');\n modalText.textContent = message;\n clearModalData();\n\n const modalWindow = document.querySelector('.modal-window');\n modalWindow.appendChild(modalTitle);\n modalWindow.appendChild(modalText);\n}\n\nfunction clearModalData() {\n const modalTitle = document.querySelector('.window-title');\n const modalText = document.querySelector('.window-text');\n if (modalTitle) {\n modalTitle.remove();\n }\n if (modalText) {\n modalText.remove();\n }\n}\n","document.addEventListener('DOMContentLoaded', function() {\n const projectItems = document.querySelectorAll('.project-list-item');\n const prevButton = document.querySelector('.prev');\n const nextButton = document.querySelector('.next');\n\n let currentIndex = 0;\n let prevIndex = 0;\n let touchStartX = 0;\n let touchEndX = 0;\n\n projectItems.forEach((item, index) => {\n if (index !== currentIndex) {\n item.style.display = 'none';\n }\n });\n\n function showCurrentCard() {\n projectItems.forEach((item, index) => {\n if (index === currentIndex) {\n item.style.display = 'block';\n } else {\n item.style.display = 'none';\n }\n });\n\n prevButton.disabled = currentIndex === 0;\n nextButton.disabled = currentIndex === projectItems.length - 1;\n }\n\n prevButton.addEventListener('click', function() {\n if (currentIndex > 0) {\n prevIndex = currentIndex; \n currentIndex--;\n showCurrentCard();\n projectItems[prevIndex].style.animation = 'slideRightToLeft 0.2s ease-in-out';\n projectItems[currentIndex].style.animation = 'slideRightToLeft 0.2s ease-in-out';\n }\n });\n\n nextButton.addEventListener('click', function() {\n if (currentIndex < projectItems.length - 1) {\n prevIndex = currentIndex; \n currentIndex++;\n showCurrentCard();\n projectItems[prevIndex].style.animation = 'slideLeftToRight 0.2s ease-in-out';\n projectItems[currentIndex].style.animation = 'slideLeftToRight 0.2s ease-in-out';\n }\n });\n\n document.addEventListener('keydown', function(event) {\n if (event.code === 'ArrowLeft' && currentIndex > 0) {\n prevIndex = currentIndex; \n currentIndex--;\n showCurrentCard();\n projectItems[prevIndex].style.animation = 'slideRightToLeft 0.2s ease-in-out';\n projectItems[currentIndex].style.animation = 'slideRightToLeft 0.2s ease-in-out';\n } else if (event.code === 'ArrowRight' && currentIndex < projectItems.length - 1) {\n prevIndex = currentIndex;\n currentIndex++;\n showCurrentCard();\n projectItems[prevIndex].style.animation = 'slideLeftToRight 0.2s ease-in-out';\n projectItems[currentIndex].style.animation = 'slideLeftToRight 0.2s ease-in-out';\n }\n });\n\n document.addEventListener('touchstart', function(event) {\n touchStartX = event.touches[0].clientX;\n });\n\n document.addEventListener('touchend', function(event) {\n touchEndX = event.changedTouches[0].clientX;\n handleSwipe();\n });\n\n function handleSwipe() {\n const swipeThreshold = 50; // Порог свайпа\n\n if (touchEndX - touchStartX > swipeThreshold) {\n // Свайп вправо\n if (currentIndex > 0) {\n prevIndex = currentIndex; \n currentIndex--;\n showCurrentCard();\n projectItems[prevIndex].style.animation = 'slideRightToLeft 0.2s ease-in-out';\n projectItems[currentIndex].style.animation = 'slideRightToLeft 0.2s ease-in-out';\n }\n } else if (touchStartX - touchEndX > swipeThreshold) {\n // Свайп влево\n if (currentIndex < projectItems.length - 1) {\n prevIndex = currentIndex; \n currentIndex++;\n showCurrentCard();\n projectItems[prevIndex].style.animation = 'slideLeftToRight 0.2s ease-in-out';\n projectItems[currentIndex].style.animation = 'slideLeftToRight 0.2s ease-in-out';\n }\n }\n }\n\n showCurrentCard();\n});\n\n","import Swiper from 'swiper/bundle';\nimport iziToast from 'izitoast';\nimport 'izitoast/dist/css/iziToast.min.css';\nimport \"swiper/css/bundle\";\n\nconst reviewsList = document.querySelector(\"#reviews-list\");\nconst buttonNext = document.querySelector(\".swiper-button-next\"); \nconst buttonPrev = document.querySelector(\".swiper-button-prev\");\nlet quantitySlides;\nlet flag = true;\n\nfunction setQSlides() {\n const windowWidth = window.innerWidth;\n if (windowWidth < 768)\n {\n quantitySlides = 1;\n }\n else if (windowWidth < 1440)\n {\n quantitySlides = 2\n }\n else\n {\n quantitySlides = 4;\n }\n\n}\n\nasync function fetchReviews() {\n try\n {\n const response = await fetch('https://portfolio-js.b.goit.study/api/reviews');\n if (response.status != 200) { throw new Error('Failed to fetch reviews'); }\n \n const reviews = await response.json();\n flag = true;\n return reviews;\n }\n catch (error)\n {\n return error;\n }\n}\n\nfunction fillList(reviews) {\n reviewsList.innerHTML = '';\n \n const listHTML = reviews.map(review => `\n
  • \n \"Reviewer\"\n
    ${review.author}
    \n

    ${review.review}

    \n
  • \n `).join('');\n\n reviewsList.insertAdjacentHTML('beforeend', listHTML);\n}\n\nfunction errorList() {\n\n const element = document.querySelector('.error');\n if (element) {\n element.remove();\n } \n \n const listHTML = `

    Not Found

    `;\n\n reviewsList.insertAdjacentHTML('beforebegin', listHTML);\n}\n\nasync function loadReviews() {\n try\n {\n const reviews = await fetchReviews();\n fillList(reviews);\n const swiper = new Swiper('.swiper', {\n\n navigation: {\n nextEl: buttonNext,\n prevEl: buttonPrev,\n },\n\n slidesPerView: quantitySlides,\n slidesPerGroup: quantitySlides,\n spaceBetween: 16,\n\n keyboard: {\n enabled: true,\n onlyInViewport: true,\n pageUpDown: true\n },\n\n mousewheel: {\n sensitivity: 1,\n },\n \n autoHeight: false,\n observer: true,\n\n });\n flag = true;\n }\n catch (error)\n {\n iziToast.error({\n title: 'Error',\n message: 'Sorry, something went wrong with reviews.'\n });\n errorList();\n flag = false;\n }\n}\n\nsetQSlides();\nloadReviews();\n\nwindow.addEventListener('resize', function () {\n if (flag) {\n setQSlides();\n loadReviews();\n }\n});","const btnTop = document.querySelector('#scroll-top');\n\nwindow.addEventListener('scroll', scrollFunction);\n\nfunction scrollFunction() {\n btnTop.style.display = window.scrollY > 250 ? 'flex' : 'none';\n}\n\nbtnTop.addEventListener('click', () => {\n window.scrollTo({ top: 0, behavior: 'smooth' });\n});\n","export const form = document.querySelector('.js-submit-form');\nexport const [inputEmail, inputComments] = form;\n\nexport const validEmailSpan = document.querySelector('.valid-email-text');\nexport const invalidEmailSpan = document.querySelector('.invalid-email-text');\nexport const invalidCommentSpan = document.querySelector(\n '.invalid-comments-text'\n);\n","import axios from 'axios';\n\nexport const sendUserDataApi = async ({ email, comment }) => {\n const URL = 'https://portfolio-js.b.goit.study/api/requests';\n\n const { data } = await axios.post(URL, { email, comment });\n return data;\n};\n","import {\n validEmailSpan,\n invalidEmailSpan,\n invalidCommentSpan,\n inputEmail,\n inputComments,\n} from './elements.js';\n\nconst VALIDATION_CLASS = {\n valid: 'valid-input',\n invalid: 'invalid-input',\n isVisible: 'is-visible',\n};\n\nexport const validateEmail = email => {\n const pattern = /^\\w+(\\.\\w+)?@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$/;\n const isValidEmail = pattern.test(email);\n\n if (!isValidEmail) {\n inputEmail.classList.add(VALIDATION_CLASS.invalid);\n invalidEmailSpan.classList.add(VALIDATION_CLASS.isVisible);\n } else {\n inputEmail.classList.add(VALIDATION_CLASS.valid);\n validEmailSpan.classList.add(VALIDATION_CLASS.isVisible);\n }\n return isValidEmail;\n};\n\nexport const validateText = text => {\n if (!text) {\n inputComments.classList.add(VALIDATION_CLASS.invalid);\n invalidCommentSpan.classList.add(VALIDATION_CLASS.isVisible);\n } else {\n inputComments.classList.add(VALIDATION_CLASS.valid);\n }\n return !!text;\n};\n\nexport const resetFieldValidation = field => {\n const fieldName = field.name;\n\n if (fieldName === 'userEmail') {\n validEmailSpan.classList.remove(VALIDATION_CLASS.isVisible);\n invalidEmailSpan.classList.remove(VALIDATION_CLASS.isVisible);\n }\n\n if (fieldName === 'userComments') {\n invalidCommentSpan.classList.remove(VALIDATION_CLASS.isVisible);\n }\n\n field.classList.remove(VALIDATION_CLASS.valid);\n field.classList.remove(VALIDATION_CLASS.invalid);\n};\n\nexport const resetAllValidation = () => {\n const validationSpans = [\n validEmailSpan,\n invalidEmailSpan,\n invalidCommentSpan,\n ];\n\n validationSpans.forEach(spanElement => {\n spanElement.classList.remove(VALIDATION_CLASS.isVisible);\n });\n\n const validationInputs = [inputEmail, inputComments];\n\n validationInputs.forEach(input => {\n input.classList.remove(VALIDATION_CLASS.valid);\n input.classList.remove(VALIDATION_CLASS.invalid);\n });\n};\n","import iziToast from 'izitoast';\nimport 'izitoast/dist/css/iziToast.min.css';\n\nimport { form, inputEmail, inputComments } from './elements.js';\nimport { sendUserDataApi } from './userDataApi.js';\nimport {\n resetAllValidation,\n resetFieldValidation,\n validateEmail,\n validateText,\n} from './validationForm.js';\nimport { openModalWithData } from '../modal/modal.js';\n\nconst STORAGE_KEY = 'formData';\n\nconst formData = getFromLocalStorage() || {\n userEmail: '',\n userComments: '',\n};\n\ninputEmail.value = formData.userEmail;\ninputComments.value = formData.userComments;\n\nform.addEventListener('input', event => {\n resetFieldValidation(event.target);\n\n const { name, value } = event.target;\n formData[name] = value.trim();\n setToLocalStorage(formData);\n});\n\nform.addEventListener('submit', onSubmit);\n\nasync function onSubmit(event) {\n event.preventDefault();\n const { userEmail, userComments } = formData;\n\n const isValidEmail = validateEmail(userEmail);\n const isValidText = validateText(userComments);\n\n if (!isValidEmail || !isValidText) {\n return;\n }\n\n try {\n const data = await sendUserDataApi({\n email: userEmail,\n comment: userComments,\n });\n openModalWithData(data);\n\n resetData();\n } catch (error) {\n iziToast.error({\n title: 'Error',\n message: error.message,\n position: 'topRight',\n });\n }\n}\n\n// helpers\nfunction setToLocalStorage(value, key = STORAGE_KEY) {\n localStorage.setItem(key, JSON.stringify(value));\n}\nfunction getFromLocalStorage(key = STORAGE_KEY) {\n return JSON.parse(localStorage.getItem(key));\n}\n\nfunction resetData(key = STORAGE_KEY) {\n localStorage.removeItem(key);\n form.reset();\n resetAllValidation();\n formData.userEmail = '';\n formData.userComments = '';\n}\n"],"names":["btnAcc","titleAcc","Accordion","accAboutMe","Swiper","Navigation","Keyboard","Mousewheel","section","options","animationCovers","entries","entry","card","observer","accordionItems","faqs","faq","item","btn","content","menuBtn","menuList","burgerBtn","burgerMenu","closeBtn","orderBtn","burgerMenuList","handleMenuClick","handleBurgerClick","handleCloseClick","dropDownKeyframes","dropUpKeyframes","dropDownAnimation","dropUpAnimation","openKeyframes","closeKeyframe","openBurgerAnimation","closeBurgerAnimation","btnClose","windowBackdrop","OPEN_CLASS","body","openModalWithData","data","renderModalData","closeWindow","event","clearModalData","title","message","modalTitle","modalText","modalWindow","projectItems","prevButton","nextButton","currentIndex","prevIndex","touchStartX","touchEndX","index","showCurrentCard","handleSwipe","reviewsList","buttonNext","buttonPrev","quantitySlides","flag","setQSlides","windowWidth","fetchReviews","response","reviews","error","fillList","listHTML","review","errorList","element","loadReviews","swiper","iziToast","btnTop","scrollFunction","form","inputEmail","inputComments","validEmailSpan","invalidEmailSpan","invalidCommentSpan","sendUserDataApi","email","comment","URL","axios","VALIDATION_CLASS","validateEmail","isValidEmail","validateText","text","resetFieldValidation","field","fieldName","resetAllValidation","spanElement","input","STORAGE_KEY","formData","getFromLocalStorage","name","value","setToLocalStorage","onSubmit","userEmail","userComments","isValidText","resetData","key"],"mappings":"gyBAEA,MAAMA,EAAS,SAAS,cAAc,eAAe,EACrDA,EAAO,UAAU,IAAI,YAAY,EACjC,MAAMC,EAAW,SAAS,cAAc,kCAAkC,EAC1EA,EAAS,UAAU,IAAI,QAAQ,EAEZ,IAAIC,EAAU,kBAAmB,CAClD,WAAY,CAAC,CAAC,EACd,aAAc,GACd,WAAY,SAAUC,EAAY,CACpBA,EAAW,cAAc,0BAA0B,EAC3D,UAAU,IAAI,YAAY,EAChBA,EAAW,cAAc,kCAAkC,EACnE,UAAU,IAAI,QAAQ,CAC7B,EACD,YAAa,SAAUA,EAAY,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