<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Seam Line</title>
<style>
:root{
--ground:#F3EEE2;--card:#E6E3CE;--card2:#EBE8D7;--ink:#1E1F15;--deep:#0F100A;
--lift:#3D4128;--muted:#5A5E3B;--soft:#C9C8A6;--accent:#86914C;
--font:"Geist",system-ui,-apple-system,sans-serif;
}
@font-face{font-family:"Geist";src:url("/fonts-geist/Geist-Regular-latin.woff2") format("woff2");font-weight:400;font-style:normal;font-display:swap;}
@font-face{font-family:"Geist";src:url("/fonts-geist/Geist-Medium-latin.woff2") format("woff2");font-weight:500;font-style:normal;font-display:swap;}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--ground);color:var(--ink);font-family:var(--font);-webkit-font-smoothing:antialiased}
button{font:inherit;color:inherit;background:none;border:0;padding:0;cursor:pointer}
.cover{width:100%;height:100%;object-fit:cover;object-position:center;display:block;pointer-events:none;user-select:none}
.hint{position:fixed;left:50%;bottom:5vh;transform:translateX(-50%);margin:0;font-size:10px;font-weight:500;letter-spacing:.22em;text-transform:uppercase;color:var(--muted);pointer-events:none;z-index:5;white-space:nowrap}
@media (prefers-reduced-motion:reduce){ .hint{display:none} }
html,body{overflow:hidden}
.stage{position:fixed;inset:0;cursor:pointer}
.layer{position:absolute;inset:0;overflow:hidden}
.seam{position:absolute;top:-12%;bottom:-12%;width:1px;background:color-mix(in srgb,var(--ground) 75%,transparent);pointer-events:none;z-index:3;opacity:.75;transform-origin:50% 50%}
</style>
</head>
<body>
<div class="stage" id="stage" role="button" tabindex="0" aria-label="Advance the seam">
<div class="layer" id="below"><img class="cover" alt=""></div>
<div class="layer" id="above"><img class="cover" alt=""></div>
<div class="seam" id="seam"></div>
</div>
<p class="hint">Click or tap</p>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.13.0/dist/gsap.min.js"></script>
<script>
(function(){
const reduce = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
const srcOf = (f) => "/images/webp/" + f;
const files = ["golden-hour-coat.webp","courtyard-coat.webp","wet-street-coat.webp","platform-suit.webp","coastal-white.webp","look-walk.webp"];
let i = 0;
const above = document.getElementById("above");
const imgA = above.querySelector("img");
const imgB = document.querySelector("#below img");
const seamEl = document.getElementById("seam");
function setImgs(){
imgA.src = srcOf(files[i % files.length]);
imgB.src = srcOf(files[(i+1) % files.length]);
}
setImgs();
const slant = 16;
function poly(t){
const x = -10 + t * 120;
return `polygon(0% 0%, ${x+slant}% 0%, ${x-slant}% 100%, 0% 100%)`;
}
function placeSeam(t){
const x = -10 + t * 120;
seamEl.style.left = x + "%";
seamEl.style.transform = "rotate(" + (-9) + "deg)";
}
let tRest = reduce ? 0 : 0.16;
gsap.set(above, {clipPath: poly(tRest)});
placeSeam(tRest);
let busy = false;
function run(){
if (busy) return;
if (reduce){
i = (i+1) % files.length; setImgs();
gsap.set(above, {clipPath: poly(0)}); placeSeam(0); return;
}
busy = true;
const st = {t: tRest};
gsap.to(st, {t:1, duration:1.12, ease:"power3.inOut",
onUpdate(){ gsap.set(above, {clipPath: poly(st.t)}); placeSeam(st.t); },
onComplete(){
i = (i+1) % files.length; setImgs();
tRest = 0.16;
gsap.set(above, {clipPath: poly(tRest)}); placeSeam(tRest);
busy = false;
}
});
}
const stage = document.getElementById("stage");
stage.addEventListener("click", run);
stage.addEventListener("keydown", (e)=>{ if(e.key==="Enter"||e.key===" ") { e.preventDefault(); run(); }});
})();
</script>
</body>
</html>
Build a single self-contained HTML file (vanilla CSS and JavaScript; GSAP 3.13+ from jsDelivr, plus ScrollTrigger or Flip only if required) for “Seam Line”.
A diagonal seam travels; the next still is already waiting underneath.
Use the Olive & Moss palette: ground #F3EEE2, card #E6E3CE, ink #1E1F15, deep #0F100A, lift #3D4128, muted #5A5E3B, soft #C9C8A6, accent #86914C. Amber #FFA51F is not used as type. Images use object-fit: cover (or equivalent cover mapping in a shader) and must be undistorted at rest. Easing: expo.out / power3.inOut, no bounce or elastic. Respect prefers-reduced-motion. One file.