<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Frame Drift</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;display:grid;place-items:center;touch-action:none}
.frame{position:relative;width:min(68vw,70vh*0.72);height:min(78vh,68vw*1.28);padding:14px;background:var(--card);border-radius:4px;overflow:hidden}
.inner{position:absolute;inset:14px;overflow:hidden}
.inner img{width:112%;height:112%;object-fit:cover;position:absolute;top:-6%;left:-6%;display:block}
</style>
</head>
<body>
<div class="stage" id="stage">
<div class="frame" id="frame">
<div class="inner"><img id="pic" src="/images/webp/courtyard-coat.webp" alt=""></div>
</div>
</div>
<p class="hint">Move or drag</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 stage = document.getElementById("stage");
const frame = document.getElementById("frame");
const pic = document.getElementById("pic");
if (reduce) return;
const fx = gsap.quickTo(frame, "x", {duration:0.7, ease:"power3"});
const fy = gsap.quickTo(frame, "y", {duration:0.7, ease:"power3"});
const px = gsap.quickTo(pic, "x", {duration:1.05, ease:"power3"});
const py = gsap.quickTo(pic, "y", {duration:1.05, ease:"power3"});
function move(e){
const r = stage.getBoundingClientRect();
const nx = (e.clientX - r.width/2) / (r.width/2);
const ny = (e.clientY - r.height/2) / (r.height/2);
fx(nx * 28); fy(ny * 20);
px(nx * -22); py(ny * -16);
}
function reset(){ fx(0); fy(0); px(0); py(0); }
stage.addEventListener("pointermove", move);
stage.addEventListener("pointerleave", reset);
})();
</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 “Frame Drift”.
The frame leans toward the pointer; the still inside lags a little behind.
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.