diff --git a/src/components/sections/IntroductionSection.vue b/src/components/sections/IntroductionSection.vue index 3b87542..286045f 100644 --- a/src/components/sections/IntroductionSection.vue +++ b/src/components/sections/IntroductionSection.vue @@ -11,53 +11,29 @@ const section = ref(null); let ctx; let split; let animation; +const date = ref("--:--"); +const time = ref(""); +let interval; function createTween() { - split = SplitText.create(".text", { type: "words" }); + animation?.kill(); + split = SplitText.create(".text", { + type: "words", + }); + + animation = gsap.from(split.words, { + y: 30, + opacity: 0, + duration: 0.9, + ease: "power2.out", + stagger: 0.05, - const tl = gsap.timeline({ scrollTrigger: { - trigger: ".text", - start: "top 75%", + trigger: section.value, + start: "top 10%", toggleActions: "play none none none", }, }); - - tl.set(".block", { - borderColor: "#fff", - boxShadow: "0 0 0px #fff", - opacity: 0.3, - }); - - // Flicker - tl.to(".block", { - opacity: 1, - duration: 0.05, - stagger: 0.1, - }) - .to(".block", { opacity: 0.4, duration: 0.05, stagger: 0.1 }) - .to(".block", { opacity: 1, duration: 0.1 }) - .to(".block", { opacity: 0.6, duration: 0.05 }) - .to(".block", { opacity: 1, duration: 0.2 }); - - // Glow aufbauen - tl.to( - ".block", - { - boxShadow: "0 0 20px #fff, 0 0 10px #fff", - duration: 0.6, - ease: "power2.out", - }, - "-=0.3", - ); - - tl.from(split.words, { - y: 30, // kleine Bewegung statt Rotation - opacity: 0, - duration: 0.8, - ease: "power2.out", // weicher als power3 - stagger: 0.05, // subtiler - }); } onMounted(() => { @@ -70,86 +46,151 @@ onMounted(() => { requestAnimationFrame(() => { ScrollTrigger.refresh(); }); + getTimeDate(); + interval = setInterval(() => { + getTimeDate(); + }, 1000); + console.log(date.value); }); function handleResize() { split && split.revert(); - createTween(); + split = SplitText.create(".text", { + type: "words", + }); ScrollTrigger.refresh(); } onUnmounted(() => { window.removeEventListener("resize", handleResize); ctx?.revert(); + clearInterval(interval); }); + +function getTimeDate() { + const now = new Date(); + + time.value = now.toLocaleTimeString("de-DE", { + timeZone: "Europe/Berlin", + hour: "2-digit", + minute: "2-digit", + }); + + date.value = now.toLocaleDateString("de-DE", { + timeZone: "Europe/Berlin", + weekday: "long", + day: "2-digit", + month: "long", + year: "numeric", + }); +} diff --git a/src/components/sections/WelcomeSection.vue b/src/components/sections/WelcomeSection.vue index b999888..d991269 100644 --- a/src/components/sections/WelcomeSection.vue +++ b/src/components/sections/WelcomeSection.vue @@ -167,7 +167,7 @@ onUnmounted(() => { .parallax__content { justify-content: center; align-items: center; - min-height: 100svh; + min-height: 50svh; display: flex; position: relative; } @@ -229,6 +229,7 @@ onUnmounted(() => { font-weight: 800; line-height: 1; position: relative; + /* color: #e84b3d; 633a34 */ } .parallax__radial-gradient {