document.addEventListener("DOMContentLoaded", function () { // Convert given phone number to the format +12345678901 function formatPhoneNumber(number) { let cleaned = ("" + number).replace(/\D/g, ""); let match = cleaned.match(/^1?(\d{10})$/); if (match) { return "+1" + match[1]; } return null; } const klaviyoForms = document.querySelectorAll(".klaviyo-form"); klaviyoForms.forEach((form) => { form.addEventListener("submit", function (event) { // Always prevent the default form submission event.preventDefault(); // Form Data Extraction const formData = new FormData(form); const attributes = {}; const standardAttributes = [ "email", "phone_number", "external_id", "anonymous_id", "_kx", "first_name", "last_name", "organization", "title", "image", ]; const nestedObjects = { location: [ "address1", "address2", "city", "country", "region", "zip", "timezone", "ip", ], }; for (let [key, value] of formData.entries()) { if (standardAttributes.includes(key)) { attributes[key] = value; } else { let addedToNested = false; for (const [objectName, fields] of Object.entries(nestedObjects)) { if (fields.includes(key)) { if (!attributes[objectName]) attributes[objectName] = {}; attributes[objectName][key] = value; addedToNested = true; break; } } if (!addedToNested) { if (!attributes.properties) attributes.properties = {}; attributes.properties[key] = value; } } } // Phone Number Formatting if (attributes.phone_number) { attributes.phone_number = formatPhoneNumber(attributes.phone_number); if (!attributes.phone_number) { console.error("Error: Invalid phone number format."); let customErrorElement = form.querySelector(".custom-error"); if (customErrorElement) { customErrorElement.textContent = "Invalid phone number format. Please use a format like 123-456-7890 or 1234567890."; customErrorElement.style.display = "block"; } return; } } // Klaviyo API Configuration const klaviyoListId = form.getAttribute("data-klaviyo-list-id"); const options = { method: "POST", headers: { revision: "2023-08-15", "content-type": "application/json", }, body: JSON.stringify({ data: { type: "subscription", attributes: { custom_source: form.getAttribute("data-name"), profile: { data: { type: "profile", attributes: attributes, }, }, }, relationships: { list: { data: { type: "list", id: klaviyoListId } }, }, }, }), }; // Klaviyo API Call fetch( "https://a.klaviyo.com/client/subscriptions/?company_id=Vh5DpK", options ) .then((response) => { if (!response.ok) { return response.json().then((err) => Promise.reject(err)); } else { // Display the success message on successful submission let customSuccessElement = form.querySelector(".custom-success"); if (customSuccessElement) customSuccessElement.style.display = "block"; } }) .catch((err) => { console.error("Error sending data to Klaviyo:", err); // Display the error message on error let customErrorElement = form.querySelector(".custom-error"); if (customErrorElement) customErrorElement.style.display = "block"; }); }); }); }); gsap.registerPlugin(Observer); CustomEase.create("primary-ease", "M0,0 C0.15,0 0.15,1 1,1"); let mm = gsap.matchMedia(); gsap.config({ nullTargetWarn: false, }); const lenis = new Lenis({ duration: 0.75, lerp: 0.1, direction: "vertical", smooth: true, }); lenis.on("scroll", ScrollTrigger.update); gsap.ticker.add((time) => { lenis.raf(time * 1000); }); lenis.stop(); gsap.registerPlugin(TextPlugin); let splitText; let lineSplit; let splitChar; function runSplit() { return new Promise(function (resolve, reject) { splitText = new SplitType("[stagger-link]", { types: "words, chars", }); lineSplit = new SplitType("[lineSplit]", { types: "lines", tagName: "span", }); splitChar = new SplitType("[split-it]", { types: "words, chars", lineClass: "s-l", wordClass: "s-w", }); splitType = new SplitType(".slider_cms_title", { types: "words, chars", tagName: "span", }); resolve(); }); } function globalScripts() { $("[title-reveal]").each(function (index) { let contentLines = $(this).find("h1"); let tl = gsap.timeline({ scrollTrigger: { trigger: $(this), start: "top 90%", toggleActions: "play none none reverse", }, }); tl.fromTo( contentLines, { yPercent: 100, clipPath: "polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%)", }, { yPercent: 0, clipPath: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)", ease: "expo.out", duration: 2, stagger: 0.2, } ); }); $("[lineSplit]").each(function (index) { let contentLines = $(this).find(".line"); let tl = gsap.timeline({ scrollTrigger: { trigger: $(this), start: "top 90%", toggleActions: "play none none reverse", }, }); tl.fromTo( contentLines, { yPercent: 100, clipPath: "polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%)", }, { yPercent: 0, clipPath: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)", ease: "expo.out", duration: 2, stagger: 0.2, } ); }); $("[scroll-fade]").each(function (index) { let tl = gsap.timeline({ scrollTrigger: { trigger: $(this), start: "top 90%", toggleActions: "play none none reverse", }, }); tl.fromTo( $(this), { opacity: 0, }, { opacity: 1, ease: "sine.inOut", duration: 1, } ); }); $("[scroll-clip]").each(function (index) { let tl = gsap.timeline({ scrollTrigger: { trigger: $(this), start: "top 100%", toggleActions: "play none none reverse", }, }); tl.fromTo( $(this), { yPercent: 100, clipPath: "polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%)", }, { yPercent: 0, clipPath: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)", ease: "primary-ease", duration: 1, } ); }); $("[scroll-line]").each(function (index) { let tl = gsap.timeline({ scrollTrigger: { trigger: $(this), start: "top 100%", toggleActions: "play none none reverse", }, }); tl.fromTo( $(this), { clipPath: "polygon(0% 0%, 0% 0%, 0% 100%, 0% 100%)", }, { clipPath: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)", ease: "power3.inOut", duration: 1.2, } ); }); } let windowWidth = $(window).innerWidth(); window.addEventListener("resize", function () { if (windowWidth !== $(window).innerWidth()) { windowWidth = $(window).innerWidth(); lineSplit.revert(); runSplit(); } }); runSplit(); function startTypewriterAnimation() { $(".typewriter-text").each(function () { let chars = $(this).find(".char"); let typeWriter = gsap.timeline({ scrollTrigger: { trigger: "[footer-type-trigger]", start: "bottom top", toggleActions: "play none none none", }, }); typeWriter .fromTo( chars, { opacity: 0, }, { opacity: 1, duration: 0.001, stagger: 0.075, } ) .add(() => { chars.last().addClass("show-after"); }); }); } document.addEventListener("DOMContentLoaded", function () { runSplit().then(() => { startTypewriterAnimation(); }); }); //STUDIO PAGE SLIDERS const gallerySlider = new Swiper(".swiper.is-gallery", { // Parameters loop: true, autoplay: { delay: 0, }, slidesPerView: 4, centeredSlides: true, speed: 1200, slideNextClass: "swiper-slide-next", slidePrevClass: "swiper-slide-prev", /*parallax: true*/ }); const brandsSlider = new Swiper(".swiper.is-brands", { // Parameters autoplay: true, slidesPerView: 2, speed: 800, grabCursor: true, spaceBetween: 32, breakpoints: { 320: { slidesPerView: 1.2, spaceBetween: 18, }, 640: { slidesPerView: 2, spaceBetween: 32, }, }, }); //index-item $(".index-slider").each(function (index) { let swiperEl = $(this).find(".swiper.is-index"); const indexSlider = new Swiper(swiperEl[0], { slidesPerView: "auto", speed: 800, grabCursor: true, spaceBetween: 32, }); }); const singleProjSlider = new Swiper(".swiper.is-single_project", { // Parameters loop: true, autoplay: true, slidesPerView: 3, speed: 800, grabCursor: true, spaceBetween: 12, breakpoints: { 320: { slidesPerView: 1.2, spaceBetween: 18, }, 640: { slidesPerView: 3, spaceBetween: 12, }, }, }); const homeNewsSlider = new Swiper(".swiper.news_wrapper", { // Parameters loop: true, autoplay: true, slidesPerView: 3, speed: 800, grabCursor: true, spaceBetween: 12, breakpoints: { 320: { slidesPerView: 1.2, spaceBetween: 12, }, 640: { slidesPerView: 3, spaceBetween: 12, }, 1560: { slidesPerView: 4, spaceBetween: 12, }, }, }); $(".index-tag_list > :not(:last-child)").after(", "); function homePageLoad() { window.scrollTo(0, 0); let homeIntroAnimation = gsap.timeline({ defaults: { ease: "primary-ease", }, onComplete: () => { ScrollTrigger.refresh(); lenis.start(); $(".nav-wrap").addClass("show"); }, }); homeIntroAnimation.set(".page-wrap", { opacity: 1, }); if (document.querySelector("[secondary-nav]")) { $(".nav-wrap").addClass("nav-alt"); } // if (document.querySelector("[pload-img]")) { homeIntroAnimation.fromTo( "[pload-img]", { scale: 1.2, clipPath: "polygon(0% 0%, 100% 0%, 100% 0%, 0% 0%)", }, { scale: 1, clipPath: "polygon(0% 0%, 100% 0%, 100% 100%, 0% 100%)", duration: 1.4, } ); } homeIntroAnimation.fromTo( "[intro-fade]", { opacity: 0, }, { opacity: 1, duration: 1.2, ease: "power4.in", }, "<" ); // mm.add("(min-width: 992px)", () => { homeIntroAnimation.fromTo( ".owl-hero_logo", { width: "13.75rem", }, { width: "1.95rem", scrollTrigger: { trigger: ".otherway-hero_bot", start: "clamp(top top)", end: "clamp(bottom bottom)", endTrigger: ".otherway-hero", scrub: true, }, ease: "none", } ); } // homePageLoad(); function stdPageLoad() { if (document.querySelector("[secondary-nav]")) { $(".nav-wrap").addClass("nav-alt"); } lenis.start(); // let stdPage = gsap.timeline({ onComplete: () => { $(".nav-wrap").addClass("show"); }, }); stdPage.set(".page-wrap", { opacity: 1, }); } function studioPageLoad() { if (document.querySelector("[secondary-nav]")) { $(".nav-wrap").addClass("nav-alt"); } lenis.start(); let stdPage = gsap.timeline({ onComplete: () => { $(".nav-wrap").addClass("show"); }, }); stdPage.set(".page-wrap", { opacity: 1, }); // mm.add("(min-width: 992px)", () => { // gsap.utils.toArray(".floating-img_holder").forEach(randomFloat); // gsap.set(".floating-img_holder", { // top: "random(20, 60, 10)%", // scale: "random(0.1, 1)", // }); // function randomFloat(element) { // gsap.to(element, { // scale: "random(0.1, 1)", // xPercent: "random(-20, 20)", // yPercent: "random(-20, 20)", // ease: "sine.inOut", // duration: gsap.utils.random([4, 6]), // onComplete: () => randomFloat(element), // }); // } // }); } function worksPageLoad() { if (document.querySelector("[secondary-nav]")) { $(".nav-wrap").addClass("nav-alt"); } $(".expand-btn").on("click", function () { $(this).toggleClass("expanded"); $(".project_info-wrap").toggleClass("grid-reveal"); setTimeout(function () { lenis.resize(); }, 600); }); $(".filter-form_item").on("click", function () { setTimeout(function () { lenis.resize(); ScrollTrigger.refresh(); }, 600); }); lenis.start(); let worksPage = gsap.timeline({ onComplete: () => { $(".nav-wrap").addClass("show"); }, }); worksPage.set(".page-wrap", { opacity: 1, }); worksPage.fromTo( ".l-line-wrap .l-line", { opacity: 0, yPercent: 100, }, { opacity: 1, yPercent: 0, duration: 1.2, ease: "power4.out", stagger: { amount: 0.2, from: "start" }, } ); worksPage.to( "[load-fade]", { opacity: 1, duration: 0.4, ease: "power2.in", }, ">-0.5" ); } // worksPageLoad(); //HOMEPAGE FOOTER MARQUEE // attribute value checker function attr(defaultVal, attrVal) { const defaultValType = typeof defaultVal; if (typeof attrVal !== "string" || attrVal.trim() === "") return defaultVal; if (attrVal === "true" && defaultValType === "boolean") return true; if (attrVal === "false" && defaultValType === "boolean") return false; if (isNaN(attrVal) && defaultValType === "string") return attrVal; if (!isNaN(attrVal) && defaultValType === "number") return +attrVal; return defaultVal; } // marquee component $("[tr-marquee-element='component']").each(function (index) { let componentEl = $(this), panelEl = componentEl.find("[tr-marquee-element='panel']"), triggerHoverEl = componentEl.find("[tr-marquee-element='triggerhover']"), triggerClickEl = componentEl.find("[tr-marquee-element='triggerclick']"); let speedSetting = attr(100, componentEl.attr("tr-marquee-speed")), verticalSetting = attr(false, componentEl.attr("tr-marquee-vertical")), reverseSetting = attr(false, componentEl.attr("tr-marquee-reverse")), scrollDirectionSetting = attr( false, componentEl.attr("tr-marquee-scrolldirection") ), scrollScrubSetting = attr( false, componentEl.attr("tr-marquee-scrollscrub") ), moveDistanceSetting = -100, timeScaleSetting = 1, pausedStateSetting = false; if (reverseSetting) moveDistanceSetting = 100; let marqueeTimeline = gsap.timeline({ repeat: -1, onReverseComplete: () => marqueeTimeline.progress(1), }); if (verticalSetting) { speedSetting = panelEl.first().height() / speedSetting; marqueeTimeline.fromTo( panelEl, { yPercent: 0 }, { yPercent: moveDistanceSetting, ease: "none", duration: speedSetting, } ); } else { speedSetting = panelEl.first().width() / speedSetting; marqueeTimeline.fromTo( panelEl, { xPercent: 0 }, { xPercent: moveDistanceSetting, ease: "none", duration: speedSetting, } ); } let scrubObject = { value: 1 }; ScrollTrigger.create({ trigger: "body", start: "top top", end: "bottom bottom", onUpdate: (self) => { if (!pausedStateSetting) { if (scrollDirectionSetting && timeScaleSetting !== self.direction) { timeScaleSetting = self.direction; marqueeTimeline.timeScale(self.direction); } if (scrollScrubSetting) { let v = self.getVelocity() * 0.006; v = gsap.utils.clamp(-60, 60, v); let scrubTimeline = gsap.timeline({ onUpdate: () => marqueeTimeline.timeScale(scrubObject.value), }); scrubTimeline.fromTo( scrubObject, { value: v }, { value: timeScaleSetting, duration: 0.5 } ); } } }, }); function pauseMarquee(isPausing) { pausedStateSetting = isPausing; let pauseObject = { value: 1 }; let pauseTimeline = gsap.timeline({ onUpdate: () => marqueeTimeline.timeScale(pauseObject.value), }); if (isPausing) { pauseTimeline.fromTo( pauseObject, { value: timeScaleSetting }, { value: 0, duration: 0.5 } ); triggerClickEl.addClass("is-paused"); } else { pauseTimeline.fromTo( pauseObject, { value: 0 }, { value: timeScaleSetting, duration: 0.5 } ); triggerClickEl.removeClass("is-paused"); } } if (window.matchMedia("(pointer: fine)").matches) { triggerHoverEl.on("mouseenter", () => pauseMarquee(true)); triggerHoverEl.on("mouseleave", () => pauseMarquee(false)); } triggerClickEl.on("click", function () { !$(this).hasClass("is-paused") ? pauseMarquee(true) : pauseMarquee(false); }); }); //COUNT PROJECTS // var projectCount = $(".project_item").length; // $(".projects_count").text(projectCount); // SLIDER $(".slider_wrap").each(function () { let childArrow = $(this).find(".slider_btn"); let childItem = $(this).find(".slider_cms_item"); let childImages = childItem.find(".slider_cms_img").hide(); let childDots = $(this).find(".slider_dot_item"); let totalSlides = childImages.length; let activeIndex = 0; childImages.eq(0).css("display", "flex"); gsap.set(childDots.eq(0).find(".slider_dot_line"), { x: "0%" }); // DOT LINES let tl2 = gsap.timeline({ repeat: -1 }); childDots.each(function (index) { tl2.addLabel(`step${index}`); tl2.to($(this).find(".slider_dot_line"), { scaleX: "1.0", ease: "none", duration: 5, onComplete: () => { goNext(index + 1); }, }); }); // MAIN SLIDER CODE function moveSlide(nextIndex, forwards) { let tl3 = gsap.timeline(); tl3.set(childDots.eq(nextIndex).find(".slider_dot_line"), { x: "0%" }); tl3.fromTo( childDots.eq(activeIndex).find(".slider_dot_line"), { x: "0%" }, { x: "100%" } ); tl2.seek(`step${nextIndex}`); const current = childImages.eq(activeIndex); const next = childImages.eq(nextIndex); let tl = gsap.timeline({ defaults: { duration: 1, ease: "power2.inOut" } }); childImages.hide(); current.css("display", "flex"); next.css("display", "flex"); tl.fromTo(next, { opacity: 0 }, { opacity: 1 }); tl.fromTo(current, { opacity: 1 }, { opacity: 0 }, "<"); activeIndex = nextIndex; } // ARROWS function goNext(num) { let nextIndex = num; if (nextIndex > totalSlides - 1) nextIndex = 0; moveSlide(nextIndex, true); } childArrow.filter(".is-next").on("click", function () { goNext(activeIndex + 1); }); childArrow.filter(".is-prev").on("click", function () { let nextIndex = activeIndex - 1; if (nextIndex < 0) nextIndex = totalSlides - 1; moveSlide(nextIndex, false); }); // CLICK OF DOTS childDots.on("click", function () { let dotIndex = $(this).index(); if (activeIndex > dotIndex) { moveSlide(dotIndex, false); } else if (activeIndex < dotIndex) { moveSlide(dotIndex, true); } }); }); // CMS NEXT POWER-UP $("[tr-cmsnext-element='component']").each(function (index) { let componentEl = $(this), cmsListEl = componentEl.find(".w-dyn-items").first(), cmsItemEl = cmsListEl.children(), currentItemEl, noResultEl = componentEl.find("[tr-cmsnext-element='no-result']"); cmsItemEl.each(function (index) { if ($(this).find(".w--current").length) currentItemEl = $(this); }); let nextItemEl = currentItemEl.next(), prevItemEl = currentItemEl.prev(); if (componentEl.attr("tr-cmsnext-loop") === "true") { if (!nextItemEl.length) nextItemEl = cmsItemEl.first(); if (!prevItemEl.length) prevItemEl = cmsItemEl.last(); } let displayEl = nextItemEl; if (componentEl.attr("tr-cmsnext-showprev") === "true") displayEl = prevItemEl; if (componentEl.attr("tr-cmsnext-showall") === "true") { prevItemEl.addClass("is-prev"); currentItemEl.addClass("is-current"); nextItemEl.addClass("is-next"); } else { cmsItemEl.not(displayEl).remove(); if (!displayEl.length) noResultEl.show(); if ( !displayEl.length && componentEl.attr("tr-cmsnext-hideempty") === "true" ) componentEl.hide(); } }); //INDEX DROPDOWN $(".index-dropdown_top").on("click", function () { var $clickedSibling = $(this).siblings(".index-dropdown_bot"); $(".index-dropdown_bot").not($clickedSibling).removeClass("grid-reveal"); $clickedSibling.toggleClass("grid-reveal"); }); //INDEX PLUS $(".index-dropdown_top").each(function () { $(this).on("click", function () { var $clickedHolder = $(this).find(".plus-holder"); $(".index-dropdown_top") .not($(this)) .find(".plus-holder") .removeClass("active"); $clickedHolder.toggleClass("active"); }); }); //INDEX HOVER $(".services-section").each(function (index) { let childTriggers = $(this).find(".home-scroll_text-item"); let childTargets = $(this).find(".services-scroll_img"); // switch active class function makeItemActive(index) { childTargets.removeClass("is-active"); childTargets.eq(index).addClass("is-active"); // }); childTriggers.removeClass("is-active"); childTriggers.eq(index).addClass("is-active"); } makeItemActive(0); // create triggers mm.add("(min-width: 992px)", () => { childTriggers.each(function (index) { ScrollTrigger.create({ trigger: $(this), start: "top 40%", end: "top 35%", onToggle: (isActive) => { if (isActive) { makeItemActive(index); } }, }); }); }); mm.add("(max-width: 991px)", () => { childTriggers.each(function (index) { childTargets.eq(index).removeClass("is-active"); ScrollTrigger.create({ trigger: $(this), start: "top center", end: "bottom center", onEnter: () => { childTargets.eq(index).addClass("is-active"); childTriggers.eq(index).addClass("is-active"); }, onEnterBack: () => { childTargets.eq(index).addClass("is-active"); childTriggers.eq(index).addClass("is-active"); }, onLeave: () => { childTargets.removeClass("is-active"); childTriggers.removeClass("is-active"); }, onLeaveBack: () => { childTargets.removeClass("is-active"); childTriggers.removeClass("is-active"); }, }); }); }); }); $(".video-holder").each(function (index) { let playBtn = $(this).find(".video-play"); let videoEL = $(this).find(".video-element"); playBtn.click(function () { playBtn.addClass("hide"); videoEL.get(0).play(); }); }); $(".single-page_nav").on("click", function () { $(".nav-wrap").removeClass("nav-alt"); }); $(".nav_link.w--current").on("click", function (event) { event.preventDefault(); $(".nav-wrap").addClass("nav-alt"); }); gsap.to(".nav-progress", { width: "100%", ease: "none", scrollTrigger: { trigger: document.body, start: "top top", end: "bottom bottom", ease: "linear", scrub: true, }, }); $(".filter-form_item").on("click", function (event) { $("#all").removeClass("fs-cmsfilter_active"); }); $("#all").on("click", function (event) { $(".filter-form_radio").removeClass("fs-cmsfilter_active"); $(this).addClass("fs-cmsfilter_active"); }); $(".footer").each(function () { let footerSvg = $(this).find(".footer-svg"); let footerSvgChars = footerSvg.find(".footer-svg_item"); let footerTl = gsap.timeline({ scrollTrigger: { trigger: $(this), start: "top 80%", end: "bottom bottom", toggleActions: "play none none reset", }, }); footerTl.fromTo( footerSvgChars, { yPercent: 100, }, { duration: 1.4, yPercent: 0, stagger: 0.05, ease: "expo.out", }, "<" ); ScrollTrigger.create({ trigger: $(this), start: "top bottom", end: "bottom bottom", onEnter: () => { $(".nav-wrap").removeClass("show"); }, onLeaveBack: () => { $(".nav-wrap").addClass("show"); }, }); }); window.onpageshow = function (event) { if (event.persisted) { window.location.reload(); } }; if (!$(".testimonial-section").length && !$(".press_section").length) { $(".single-more_heading").addClass("pad-top"); } function footerScaleAnimation() { gsap.registerPlugin(ScrollTrigger); const footerScaleTimeline = gsap.timeline({ scrollTrigger: { trigger: "[footer-scale-trigger]", start: "bottom bottom", end: "bottom top", scrub: true, }, }); footerScaleTimeline.fromTo( "[footer-scale-item]", { width: "5.6em" }, { width: "8.6em" } ); footerScaleTimeline.to("[nav-hide-o]", { y: "-10rem", opacity: 0, ease: "expo-out", }); } footerScaleAnimation(); // function copyToClipboard() { // const $copiedCursor = $(".copied_cursor"); // function updateOffsets() { // return window.matchMedia("(max-width: 992px)").matches // ? { x: -50, y: 20 } // : { x: -50, y: 20 }; // } // let offsets = updateOffsets(); // $(window).on("resize", () => { // offsets = updateOffsets(); // ScrollTrigger.refresh(); // }); // $(document).on("mousemove", function (event) { // gsap.to($copiedCursor, { // x: event.clientX + offsets.x, // y: event.clientY + offsets.y, // duration: 0.1, // ease: "power2.out", // }); // }); // $("[copy-text-item]") // .on("mouseenter", function () { // $copiedCursor.text(""); // gsap.to($copiedCursor, { opacity: 1, duration: 0 }); // }) // .on("mouseleave", function () { // gsap.to($copiedCursor, { opacity: 0, duration: 0 }); // }) // .on("click", function () { // const $landText = $(this).find("[copy-text]"); // const originalText = $landText.text(); // navigator.clipboard // .writeText(originalText) // .then(() => { // $copiedCursor.text("Copied!"); // gsap.to($copiedCursor, { opacity: 1, duration: 0.1 }); // setTimeout(() => { // gsap.to($copiedCursor, { opacity: 0, duration: 0.3 }); // }, 1000); // }) // .catch((err) => { // console.error("Failed to copy text: ", err); // }); // }); // } // copyToClipboard();