← back to Model Arena

color-story-carousel.html

415 lines

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Color Story — Seasonal Wallcovering Carousel</title>
<style>
  /* ============================================================
     EDITABLE PALETTE — change these to re-theme the whole story.
     Base design tokens follow the terracotta-sun luxe direction.
     ============================================================ */
  :root{
    --bg:#f7efe6;
    --surface:#fff9f1;
    --ink:#3a2c22;
    --muted:#a08c7a;
    --accent:#c65f38;
    --accent-2:#e0a458;
    --line:rgba(58,44,34,.14);

    --serif:'Didot','Bodoni MT','Playfair Display',Georgia,serif;
    --sans:-apple-system,'Segoe UI','Helvetica Neue',Arial,sans-serif;

    --s4:4px;--s8:8px;--s12:12px;--s16:16px;--s24:24px;
    --s32:32px;--s48:48px;--s64:64px;--s96:96px;
  }

  *{margin:0;padding:0;box-sizing:border-box}
  html,body{height:100%}
  body{
    background:#e7ddd0;
    font-family:var(--sans);
    color:var(--ink);
    display:flex;align-items:center;justify-content:center;
    min-height:100vh;padding:24px;
    -webkit-font-smoothing:antialiased;
  }

  /* ---- Frame: locked 1080x1080, scales to viewport ---- */
  .stage{
    width:1080px;height:1080px;
    max-width:min(1080px,94vw);max-height:min(1080px,94vw);
    aspect-ratio:1/1;position:relative;
    border-radius:14px;overflow:hidden;
    box-shadow:0 16px 48px rgba(0,0,0,.18);
    background:var(--bg);
  }
  /* scale internal 1080 coordinate space down responsively */
  .viewport{position:absolute;inset:0;overflow:hidden}
  .track{
    display:flex;height:100%;
    transition:transform .62s cubic-bezier(.22,1,.36,1);
    will-change:transform;
  }
  .slide{
    position:relative;flex:0 0 100%;height:100%;
    overflow:hidden;
    display:flex;flex-direction:column;
  }

  /* ambient slow gradient drift for cover */
  @keyframes drift{
    0%{transform:translate(-4%,-3%) scale(1.15)}
    50%{transform:translate(3%,2%) scale(1.22)}
    100%{transform:translate(-4%,-3%) scale(1.15)}
  }
  @keyframes fadeUp{from{opacity:0;transform:translateY(28px)}to{opacity:1;transform:none}}
  @keyframes swatchIn{from{opacity:0;transform:scale(.94)}to{opacity:1;transform:none}}

  .label{
    font-family:var(--sans);
    text-transform:uppercase;
    font-size:12px;letter-spacing:.22em;
    color:var(--muted);font-weight:600;
  }

  /* entrance stagger — only the active slide animates */
  .slide.is-active .anim{animation:fadeUp .7s cubic-bezier(.22,1,.36,1) both}
  .slide.is-active .anim:nth-child(1){animation-delay:.05s}
  .slide.is-active .anim:nth-child(2){animation-delay:.14s}
  .slide.is-active .anim:nth-child(3){animation-delay:.23s}
  .slide.is-active .anim:nth-child(4){animation-delay:.32s}
  .slide.is-active .anim:nth-child(5){animation-delay:.41s}
  .slide:not(.is-active) .anim{opacity:0}

  /* ============ COVER (slide 1) ============ */
  .cover{
    background:
      radial-gradient(120% 90% at 78% 12%, rgba(224,164,88,.55), transparent 60%),
      radial-gradient(120% 100% at 12% 92%, rgba(198,95,56,.5), transparent 55%),
      linear-gradient(160deg,#fbf3e9,#f2e4d3);
    padding:96px 88px;justify-content:space-between;
  }
  .cover::before{
    content:"";position:absolute;inset:-25%;
    background:radial-gradient(45% 45% at 30% 30%, rgba(198,95,56,.28), transparent 70%),
               radial-gradient(45% 45% at 72% 68%, rgba(224,164,88,.32), transparent 70%);
    animation:drift 18s ease-in-out infinite;z-index:0;
  }
  .cover>*{position:relative;z-index:1}
  .cover .topline{display:flex;justify-content:space-between;align-items:baseline}
  .brand{font-family:var(--serif);font-size:22px;letter-spacing:.04em;color:var(--ink)}
  .season{font-size:12px;letter-spacing:.22em;text-transform:uppercase;color:var(--accent);font-weight:700}

  .cover .center{align-self:flex-start;max-width:88%}
  .kicker{font-size:12px;letter-spacing:.28em;text-transform:uppercase;color:var(--muted);margin-bottom:28px;font-weight:600}
  .palette-name{
    font-family:var(--serif);
    font-size:104px;line-height:.98;font-weight:400;
    color:var(--ink);letter-spacing:-.01em;
  }
  .palette-name em{font-style:italic;color:var(--accent)}
  .cover .sub{margin-top:34px;font-size:21px;line-height:1.5;color:#5a4636;max-width:78%}

  .dots-preview{display:flex;gap:12px;margin-top:8px}
  .dots-preview span{width:56px;height:56px;border-radius:50%;box-shadow:0 4px 14px rgba(58,44,34,.18);border:2px solid rgba(255,255,255,.6)}

  .cover .footer{display:flex;justify-content:space-between;align-items:center}
  .swipe-hint{font-size:13px;letter-spacing:.14em;text-transform:uppercase;color:var(--muted);display:flex;align-items:center;gap:12px}
  .swipe-hint .arrow{font-size:22px;color:var(--accent);animation:nudge 1.8s ease-in-out infinite}
  @keyframes nudge{0%,100%{transform:translateX(0)}50%{transform:translateX(8px)}}

  /* ============ HUE SLIDES (2–4) ============ */
  .hue{padding:0;background:var(--surface)}
  .hue .swatch{
    position:relative;flex:0 0 56%;width:100%;overflow:hidden;
  }
  .hue .swatch .fill{position:absolute;inset:0;animation:swatchIn .8s cubic-bezier(.22,1,.36,1) both}
  /* subtle woven texture drawn in CSS over the swatch */
  .hue .swatch .fill::after{
    content:"";position:absolute;inset:0;opacity:.16;mix-blend-mode:soft-light;
    background-image:
      repeating-linear-gradient(45deg,rgba(255,255,255,.5) 0 2px,transparent 2px 7px),
      repeating-linear-gradient(-45deg,rgba(0,0,0,.4) 0 2px,transparent 2px 7px);
    background-size:14px 14px;
  }
  .hue .swatch .fill::before{
    content:"";position:absolute;inset:0;
    background:radial-gradient(120% 90% at 20% 15%,rgba(255,255,255,.28),transparent 55%),
               linear-gradient(180deg,transparent 60%,rgba(0,0,0,.14));
  }
  .hue .swatch .index{
    position:absolute;top:56px;left:64px;z-index:2;
    font-family:var(--serif);font-size:26px;color:rgba(255,255,255,.85);
    letter-spacing:.1em;
  }
  .hue .swatch .hex{
    position:absolute;bottom:44px;left:64px;z-index:2;
    font-family:var(--sans);font-size:14px;letter-spacing:.24em;
    text-transform:uppercase;color:rgba(255,255,255,.9);font-weight:600;
  }
  .hue .swatch .chip-name{
    position:absolute;bottom:44px;right:64px;z-index:2;
    font-family:var(--serif);font-style:italic;font-size:34px;
    color:rgba(255,255,255,.96);text-shadow:0 2px 12px rgba(0,0,0,.25);
  }

  .hue .detail{
    flex:1;padding:56px 64px 60px;
    display:flex;flex-direction:column;justify-content:center;gap:22px;
    background:var(--surface);
  }
  .hue .detail .desig{font-family:var(--serif);font-size:64px;line-height:1;color:var(--ink);font-weight:400}
  .hue .detail .desig .num{font-size:24px;color:var(--accent);vertical-align:super;margin-right:14px;letter-spacing:0}
  .hue .detail .meta{display:flex;gap:40px;flex-wrap:wrap}
  .hue .detail .meta div{display:flex;flex-direction:column;gap:6px}
  .hue .detail .meta .v{font-family:var(--serif);font-size:20px;color:var(--ink)}
  .tip{
    display:flex;gap:18px;align-items:flex-start;
    padding-top:24px;border-top:1px solid var(--line);
  }
  .tip .icon{
    flex:0 0 44px;height:44px;border-radius:50%;
    background:linear-gradient(135deg,var(--accent),var(--accent-2));
    display:flex;align-items:center;justify-content:center;color:#fff;font-size:20px;
    box-shadow:0 6px 18px rgba(198,95,56,.3);
  }
  .tip .txt{font-size:20px;line-height:1.5;color:#5a4636;max-width:92%}
  .tip .txt b{color:var(--ink);font-weight:600}

  /* ============ CTA (slide 5) ============ */
  .cta{
    background:
      radial-gradient(110% 80% at 85% 90%, rgba(224,164,88,.5), transparent 55%),
      linear-gradient(155deg,#3a2c22,#5a3826);
    color:var(--surface);padding:96px 88px;justify-content:space-between;
  }
  .cta .label{color:rgba(255,249,241,.6)}
  .cta .headline{
    font-family:var(--serif);font-size:80px;line-height:1.02;font-weight:400;
    letter-spacing:-.01em;margin-top:20px;
  }
  .cta .headline em{font-style:italic;color:var(--accent-2)}
  .cta .body{font-size:22px;line-height:1.55;color:rgba(255,249,241,.78);max-width:80%;margin-top:30px}
  .cta .swatches{display:flex;gap:0;margin:44px 0;border-radius:12px;overflow:hidden;box-shadow:0 12px 36px rgba(0,0,0,.35)}
  .cta .swatches span{flex:1;height:96px}
  .cta .action{display:flex;align-items:center;justify-content:space-between}
  .pill{
    background:var(--accent-2);color:#3a2c22;font-weight:700;
    padding:20px 40px;border-radius:999px;font-size:18px;letter-spacing:.04em;
    box-shadow:0 10px 30px rgba(224,164,88,.4);
  }
  .cta .handle{font-size:17px;letter-spacing:.16em;text-transform:uppercase;color:rgba(255,249,241,.7)}

  /* ============ Navigation chrome ============ */
  .dots{
    position:absolute;bottom:26px;left:50%;transform:translateX(-50%);
    display:flex;gap:11px;z-index:20;
  }
  .dots button{
    width:9px;height:9px;border-radius:50%;border:0;padding:0;cursor:pointer;
    background:rgba(58,44,34,.28);transition:all .25s ease;
  }
  .dots button.active{background:var(--accent);width:26px;border-radius:6px}
  .slide.cta ~ .dots button,.dots.on-dark button{}

  .nav-arrow{
    position:absolute;top:50%;transform:translateY(-50%);z-index:20;
    width:52px;height:52px;border-radius:50%;border:0;cursor:pointer;
    background:rgba(255,249,241,.72);color:var(--ink);
    font-size:22px;display:flex;align-items:center;justify-content:center;
    box-shadow:0 6px 20px rgba(0,0,0,.16);
    transition:transform .2s ease,opacity .2s ease;backdrop-filter:blur(4px);
    opacity:0;
  }
  .stage:hover .nav-arrow{opacity:1}
  .nav-arrow:hover{transform:translateY(-50%) scale(1.08)}
  .nav-arrow.prev{left:20px}
  .nav-arrow.next{right:20px}
  .nav-arrow:disabled{opacity:0!important;pointer-events:none}

  .counter{
    position:absolute;top:22px;right:26px;z-index:20;
    font-size:12px;letter-spacing:.18em;color:var(--muted);
    background:rgba(255,249,241,.6);padding:6px 12px;border-radius:999px;
    font-weight:600;backdrop-filter:blur(4px);
  }
  .cta-active .counter{color:rgba(255,249,241,.8);background:rgba(255,255,255,.12)}
  .cta-active .dots button{background:rgba(255,249,241,.3)}
  .cta-active .dots button.active{background:var(--accent-2)}
</style>
</head>
<body>
  <div class="stage" id="stage" role="region" aria-label="Wallcovering color story carousel">
    <div class="viewport">
      <div class="track" id="track"></div>
    </div>
    <button class="nav-arrow prev" id="prev" aria-label="Previous slide">‹</button>
    <button class="nav-arrow next" id="next" aria-label="Next slide">›</button>
    <div class="counter" id="counter">01 / 05</div>
    <div class="dots" id="dots"></div>
  </div>

<script>
/* ================================================================
   EDITABLE COLOR STORY — edit this object to change the whole deck.
   ================================================================ */
const STORY = {
  brand:"ATELIER WALLCOVERINGS",
  season:"Autumn 2026",
  kicker:"The Color Story of the Season",
  paletteName:["Terracotta","& Sage"],   // second part styled as accent italic
  coverSub:"A quiet, sun-warmed palette for rooms that feel lived-in and luxe — three heritage hues layered for depth.",
  hues:[
    {
      name:"Oatmeal", hex:"#e4d8c4", swatch:"#ddceb6", textOnDark:false,
      family:"Warm Neutral", finish:"Grasscloth",
      tip:["Ground the room.","Wrap it across all four walls of a <b>reading nook</b> or entry — it reflects daylight softly and lets furniture and art take the lead."]
    },
    {
      name:"Celadon", hex:"#9fb09a", swatch:"#8fa389", textOnDark:false,
      family:"Muted Sage", finish:"Silk Weave",
      tip:["Cool a sunny space.","Ideal on a <b>powder-room</b> feature wall or behind open kitchen shelving, where its green-grey calm balances warm brass and oak."]
    },
    {
      name:"Terracotta", hex:"#c65f38", swatch:"#bd5730", textOnDark:true,
      family:"Burnt Clay", finish:"Matte Linen",
      tip:["Add the warmth.","Use as an accent on a <b>dining-room</b> wall or a bedroom headboard panel — candlelight makes this clay hue glow at dusk."]
    }
  ],
  cta:{
    label:"Bring it home",
    headline:["Order the","full ", "swatch set"],   // middle word accented
    body:"Sample all three hues, at scale, in your own light. Free swatch trio shipped within 48 hours.",
    action:"Request Swatches",
    handle:"@atelier.wallcoverings"
  }
};

/* ---- helper to pick readable ink over a swatch ---- */
function slides(){
  const s=[];
  // COVER
  s.push(`
   <section class="slide cover" data-tone="light">
     <div class="topline anim">
       <span class="brand">${STORY.brand}</span>
       <span class="season">${STORY.season}</span>
     </div>
     <div class="center">
       <div class="kicker anim">${STORY.kicker}</div>
       <h1 class="palette-name anim">${STORY.paletteName[0]} <em>${STORY.paletteName[1]}</em></h1>
       <p class="sub anim">${STORY.coverSub}</p>
     </div>
     <div class="footer anim">
       <div class="dots-preview">
         ${STORY.hues.map(h=>`<span style="background:${h.swatch}"></span>`).join("")}
       </div>
       <div class="swipe-hint">Swipe the story <span class="arrow">→</span></div>
     </div>
   </section>`);

  // HUE SLIDES
  STORY.hues.forEach((h,i)=>{
    const ink = h.textOnDark ? "rgba(255,255,255,.92)" : "rgba(58,44,34,.7)";
    const inkStrong = h.textOnDark ? "#fff" : "var(--ink)";
    s.push(`
     <section class="slide hue" data-tone="${h.textOnDark?'dark':'light'}">
       <div class="swatch anim">
         <div class="fill" style="background:${h.swatch}"></div>
         <div class="index" style="color:${ink}">0${i+2} — Hue</div>
         <div class="hex" style="color:${ink}">${h.hex}</div>
         <div class="chip-name" style="color:${inkStrong};text-shadow:${h.textOnDark?'0 2px 12px rgba(0,0,0,.3)':'none'}">${h.name}</div>
       </div>
       <div class="detail">
         <h2 class="desig anim"><span class="num">0${i+2}</span>${h.name}</h2>
         <div class="meta anim">
           <div><span class="label">Color Family</span><span class="v">${h.family}</span></div>
           <div><span class="label">Suggested Finish</span><span class="v">${h.finish}</span></div>
         </div>
         <div class="tip anim">
           <div class="icon">✦</div>
           <p class="txt"><b>${h.tip[0]}</b> ${h.tip[1]}</p>
         </div>
       </div>
     </section>`);
  });

  // CTA
  s.push(`
   <section class="slide cta" data-tone="dark">
     <div>
       <div class="label anim">${STORY.cta.label}</div>
       <h2 class="headline anim">${STORY.cta.headline[0]} <em>${STORY.cta.headline[1]}</em>${STORY.cta.headline[2]}</h2>
       <p class="body anim">${STORY.cta.body}</p>
     </div>
     <div class="swatches anim">
       ${STORY.hues.map(h=>`<span style="background:${h.swatch}"></span>`).join("")}
     </div>
     <div class="action anim">
       <span class="pill">${STORY.cta.action}</span>
       <span class="handle">${STORY.cta.handle}</span>
     </div>
   </section>`);
  return s.join("");
}

const track=document.getElementById('track');
track.innerHTML=slides();
const slidesEl=[...track.children];
const N=slidesEl.length;
const stage=document.getElementById('stage');
const dotsWrap=document.getElementById('dots');
const counter=document.getElementById('counter');
const prev=document.getElementById('prev');
const next=document.getElementById('next');

dotsWrap.innerHTML=slidesEl.map((_,i)=>`<button aria-label="Go to slide ${i+1}"></button>`).join("");
const dots=[...dotsWrap.children];

let idx=0;
function go(n){
  idx=Math.max(0,Math.min(N-1,n));
  track.style.transform=`translateX(${-idx*100}%)`;
  slidesEl.forEach((el,i)=>el.classList.toggle('is-active',i===idx));
  dots.forEach((d,i)=>d.classList.toggle('active',i===idx));
  counter.textContent=`0${idx+1} / 0${N}`;
  prev.disabled=idx===0;
  next.disabled=idx===N-1;
  stage.classList.toggle('cta-active', slidesEl[idx].dataset.tone==='dark' && slidesEl[idx].classList.contains('cta'));
}
prev.onclick=()=>go(idx-1);
next.onclick=()=>go(idx+1);
dots.forEach((d,i)=>d.onclick=()=>go(i));

// keyboard
document.addEventListener('keydown',e=>{
  if(e.key==='ArrowRight')go(idx+1);
  if(e.key==='ArrowLeft')go(idx-1);
});

// touch swipe
let x0=null;
stage.addEventListener('touchstart',e=>x0=e.touches[0].clientX,{passive:true});
stage.addEventListener('touchend',e=>{
  if(x0===null)return;
  const dx=e.changedTouches[0].clientX-x0;
  if(Math.abs(dx)>40)go(idx+(dx<0?1:-1));
  x0=null;
});
// pointer / mouse drag
let px=null;
stage.addEventListener('mousedown',e=>{px=e.clientX});
window.addEventListener('mouseup',e=>{
  if(px===null)return;
  const dx=e.clientX-px;
  if(Math.abs(dx)>60)go(idx+(dx<0?1:-1));
  px=null;
});

go(0);
</script>
</body>
</html>