Files

49 lines
3.4 KiB
HTML

<template>
<style>
@font-face { font-family: 'Jua'; src: url('assets/fonts/Jua-Regular.ttf'); }
@font-face { font-family: 'Pretendard'; src: url('assets/fonts/PretendardVariable.woff2'); font-weight: 100 900; }
#root { position: absolute; inset: 0; overflow: hidden; background: #8e9bb3; color: #fff; }
#s2-world { position: absolute; inset: 0; }
#s2-cam { position: absolute; inset: 0; transform-origin: 50% 50%; }
#s2-bg { position: absolute; left: 0; top: 0; width: 1080px; height: 1920px; object-fit: cover; }
#s2-cloud { position: absolute; left: 640px; top: 250px; width: 300px; }
#s2-rain { position: absolute; left: 120px; top: 1420px; width: 220px; }
.s2-chip { position: absolute; padding: 18px 40px; border-radius: 28px; background: #fff; color: #28304a; font: 800 60px/1 'Pretendard', sans-serif; letter-spacing: -1px; box-shadow: 0 10px 30px rgba(40, 48, 74, 0.25); white-space: nowrap; }
#s2-c1 { left: 90px; top: 420px; }
#s2-c2 { left: 330px; top: 560px; }
#s2-c3 { left: 150px; top: 700px; }
#s2-ask { position: absolute; left: 90px; top: 960px; width: 900px; font: 400 112px/1.18 'Jua', sans-serif; letter-spacing: -2px; color: #28304a; text-shadow: 0 0 22px rgba(255, 255, 255, 0.85), 0 4px 14px rgba(255, 255, 255, 0.6); word-break: keep-all; }
#s2-ask .w { display: inline-block; margin-right: 0.22em; }
#s2-flood { position: absolute; inset: 0; background: #e3efff; }
</style>
<div id="root" data-composition-id="s2" data-width="1080" data-height="1920">
<div id="s2-world" class="clip" data-start="0" data-duration="3">
<div id="s2-cam">
<img id="s2-bg" src="assets/bg/rain-city.webp" alt="" />
<img id="s2-cloud" src="assets/icons/cloud.png" alt="" />
<img id="s2-rain" src="assets/icons/rain.png" alt="" />
<div id="s2-c1" class="s2-chip">흐림</div>
<div id="s2-c2" class="s2-chip">19°</div>
<div id="s2-c3" class="s2-chip">습도 70%</div>
<h1 id="s2-ask"><span class="w">…그래서</span><br /><span class="w">오늘</span><span class="w">뭐</span><span class="w">하죠?</span></h1>
</div>
<div id="s2-flood"></div>
</div>
</div>
<script>
const tl = gsap.timeline({ paused: true });
// 휩 인: 아래서 올라와 맺힘, 그 뒤 느린 드리프트
tl.fromTo("#s2-cam", { y: 420, filter: "blur(16px)", scale: 1.1 }, { y: 0, filter: "blur(0px)", duration: 0.25, ease: "expo.out" }, 0);
tl.to("#s2-cam", { scale: 1.04, duration: 2.6, ease: "power2.inOut" }, 0.25);
tl.fromTo("#s2-cloud", { x: 30, y: 0 }, { x: -40, y: 12, duration: 3, ease: "none" }, 0);
tl.fromTo("#s2-rain", { y: -10 }, { y: 30, duration: 3, ease: "none" }, 0);
// 날씨 숫자 칩: 위에서 떨어져 튕김 (위치·크기만 튕기고 투명도는 안 튕김)
tl.fromTo(["#s2-c1", "#s2-c2", "#s2-c3"], { y: -220, scale: 0.6, opacity: 0 }, { y: 0, scale: 1, opacity: 1, duration: 0.45, ease: "back.out(1.6)", stagger: 0.1 }, 0.2);
// …그래서 뭐 하죠?
tl.fromTo("#s2-ask .w", { opacity: 0, filter: "blur(8px)" }, { opacity: 1, filter: "blur(0px)", duration: 0.13, ease: "power4.out", stagger: 0.07 }, 1.3);
// 색 플러드: 브랜드 땅이 가운데서 번져 다음 장면으로
tl.fromTo("#s2-flood", { clipPath: "circle(0% at 50% 62%)" }, { clipPath: "circle(120% at 50% 62%)", duration: 0.4, ease: "power2.inOut" }, 2.6);
window.__timelines["s2"] = tl;
</script>
</template>