CHOCOLATE CON FRESA
.ardx-chocofresa{container-type:inline-size;container-name:chocofresa;--pink:#ff6f8f;--cream:#f6e4dc;--ink:#f5f1ea;--muted:#d1b8ae;--line:rgba(245,241,234,.12);position:relative;ma rgin:28px 0;border-radius:28px;overflow:hidden;background:#120805;color:var(--ink);font-family:Urbanist,system-ui,-apple-system,sans-serif;font-weight:500;-webkit-font-smoothing:antialiased;text-align:left} .ardx-chocofresa *{box-sizing:border-box} .ardx-chocofresa :where(p,h2,ol,ul,li){margin:0;padding:0;list-style:none;color:inherit;font-family:inherit} .ardx-chocofresa__scene{position:relative;isolation:isolate;min-height:400px;padding:56px 28px 40px;background:radial-gradient(ellipse 90% 80% at 70% 100%,#2e160c 0%,#120805 70%);cursor:pointer} .ardx-chocofresa__fx{position:absolute;inset:0;z-index:-1;width:100%;height:100%;pointer-events:none} .ardx-chocofresa__kicker{font-size:15px;font-weight:600;color:var(--pink)} .ardx-chocofresa__title{margin-top:10px!important;font-size:clamp(40px,12.5cqi,84px);font-weight:900;line-height:.92;letter-spacing:-.05em;color:var(--ink)!important} .ardx-chocofresa__title .w{display:inline-block;white-space:nowrap} .ardx-chocofresa__title .c{display:inline-block;opacity:0;transform:translateY(.4em) rotate(4deg);filter:blur(8px);transition:opacity .8s cubic-bezier(.2,.8,.2,1),transform .8s cubic-bezier(.2,.8,.2,1),filter .8s;transition-delay:calc(var(--d)*40ms)} .ardx-chocofresa.is-in .ardx-chocofresa__title .c{opacity:1;transform:none;filter:none} .ardx-chocofresa__lead{margin-top:16px!important;font-size:clamp(20px,4.6cqi,26px);font-weight:700;letter-spacing:-.01em;color:var(--cream)} .ardx-chocofresa__hint{margin-top:8px!important;font-size:14px;color:var(--muted)} .ardx-chocofresa__btn{margin-top:28px;display:inline-flex;align-items:center;gap:12px;min-height:54px;padding:0 26px;border:0;border-radius:999px;background:var(--ink);color:#120805;font:800 15px/1 Urbanist,system-ui,sans-serif;letter-spacing:.04em;text-transform:uppercase;cursor:pointer;transition:transform .25s ease,background-color .3s ease} .ardx-chocofresa__btn:hover{transform:translateY(-2px)} .ardx-chocofresa__btn:focus-visible{outline:2px solid var(--pink);outline-offset:4px} .ardx-chocofresa__btn svg{transition:transform .45s cubic-bezier(.2,.8,.2,1)} .ardx-chocofresa.is-open .ardx-chocofresa__btn{background:var(--pink)} .ardx-chocofresa.is-open .ardx-chocofresa__btn svg{transform:rotate(135deg)} .ardx-chocofresa__drawer{display:grid;grid-template-rows:0fr;transition:grid-template-rows .7s cubic-bezier(.2,.8,.2,1)} .ardx-chocofresa.is-open .ardx-chocofresa__drawer{grid-template-rows:1fr} .ardx-chocofresa__drawer>div{overflow:hidden} .ardx-chocofresa__notes{display:grid;grid-template-columns:1fr;border-top:1px solid var(--line)} .ardx-chocofresa__note{position:relative;padding:26px 28px;border-bottom:1px solid var(--line);opacity:0;transform:translateY(22px);filter:blur(6px);transition:opacity .8s cubic-bezier(.2,.8,.2,1),transform .8s cubic-bezier(.2,.8,.2,1),filter .8s;transition-delay:calc(var(--i)*170ms + 120ms)} .ardx-chocofresa.is-open .ardx-chocofresa__note{opacity:1;transform:none;filter:none} .ardx-chocofresa__note::before{content:"";position:absolute;left:0;top:0;bottom:0;width:0;background:var(--tone);opacity:.14;transition:width 1.1s cubic-bezier(.2,.8,.2,1);transition-delay:calc(var(--i)*170ms + 300ms)} .ardx-chocofresa.is-open .ardx-chocofresa__note::before{width:100%} .ardx-chocofresa__when{position:relative;display:flex;align-items:center;gap:10px;font-size:14px;font-weight:700;color:var(--tone)} .ardx-chocofresa__when::before{content:"";width:12px;height:12px;border-radius:50%;background:var(--tone)} .ardx-chocofresa__name{position:relative;display:block;margin-top:10px;font-size:clamp(23px,4.4cqi,30px);font-weight:800;line-height:1.08;letter-spacing:-.02em} .ardx-chocofresa__phrase{position:relative;margin-top:8px!important;font-size:16px;line-height:1.5;color:var(--muted)} .ardx-chocofresa__body{padding:30px 28px 6px;max-width:62ch;font-size:18px;line-height:1.6;color:#f2e2da} .ardx-chocofresa__facts{display:flex;flex-wrap:wrap;gap:10px 28px;padding:20px 28px 30px;font-size:15px;color:var(--muted)} .ardx-chocofresa__facts strong{color:var(--ink);font-weight:800} .ardx-chocofresa .ardx-chocofresa__kicker,.ardx-chocofresa .ardx-chocofresa__title,.ardx-chocofresa .ardx-chocofresa__lead,.ardx-chocofresa .ardx-chocofresa__hint,.ardx-chocofresa .ardx-chocofresa__phrase,.ardx-chocofresa .ardx-chocofresa__body p{margin-bottom:0!important;margin-left:0!important;margin-right:0!important;text-indent:0} .ardx-chocofresa .ardx-chocofresa__kicker{margin-top:0!important} .ardx-chocofresa .ardx-chocofresa__notes,.ardx-chocofresa .ardx-chocofresa__facts{margin:0!important;list-style:none} .ardx-chocofresa .ardx-chocofresa__title{font-family:Urbanist,system-ui,sans-serif!important;font-weight:900!important;line-height:.92!important} @container chocofresa (min-width:440px){ .ardx-chocofresa__scene{padding:60px 36px 46px;min-height:430px} .ardx-chocofresa__note{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);grid-template-areas:"when phrase" "name phrase";column-gap:28px;align-items:center;padding:24px 36px} .ardx-chocofresa__when{grid-area:when} .ardx-chocofresa__name{grid-area:name;margin-top:6px} .ardx-chocofresa__phrase{grid-area:phrase;margin-top:0!important} .ardx-chocofresa__body{padding:32px 36px 6px} .ardx-chocofresa__facts{padding:20px 36px 32px} } @container chocofresa (min-width:860px){ .ardx-chocofresa__scene{padding:76px 48px 56px;min-height:460px} .ardx-chocofresa__notes{grid-template-columns:repeat(3,minmax(0,1fr))} .ardx-chocofresa__note{display:block;padding:32px 40px 36px;border-bottom:0;border-left:1px solid var(--line)} .ardx-chocofresa__note:first-child{border-left:0} .ardx-chocofresa__name{margin-top:10px} .ardx-chocofresa__phrase{margin-top:8px!important} .ardx-chocofresa__body{padding:36px 48px 6px} .ardx-chocofresa__facts{padding:20px 48px 36px} } @media (prefers-reduced-motion:reduce){ .ardx-chocofresa *{transition:none!important} .ardx-chocofresa__title .c{opacity:1;transform:none;filter:none} } Navidad en el Inframundo Chocolate con Fresa Fresas con chocolate, sin mancharte. Remueve con el dedo o el cursor. Ver notas aromáticas Al principio Fresa y frutos rojos Fresa recién cogida, roja y jugosa. Al rato Chocolate con leche El chocolate fundido que la envuelve entera. Lo que se queda Vainilla y azúcar El fondo dulce que deja el último bocado. Fresa fresca y frutos rojos que se funden en chocolate con leche, con vainilla y azúcar al fondo. Puro capricho. Hecho a mano en Madrid (function () { document.querySelectorAll('.ardx-chocofresa:not([data-ready])').forEach(function (root) { root.setAttribute('data-ready', '1'); var reduce = window.matchMedia && window.matchMedia('(prefers-reduced-motion: reduce)').matches; var scene = root.querySelector('.ardx-chocofresa__scene'); var canvas = root.querySelector('.ardx-chocofresa__fx'); var btn = root.querySelector('.ardx-chocofresa__btn'); var label = btn.querySelector('span'); var drawer = root.querySelector('.ardx-chocofresa__drawer'); var title = root.querySelector('.ardx-chocofresa__title'); var TAU = Math.PI * 2; if (!reduce) { var txt = title.textContent, n = 0; title.setAttribute('aria-label', txt); title.textContent = ''; txt.split(' ').forEach(function (word, wi, all) { var w = document.createElement('span'); w.className = 'w'; w.setAttribute('aria-hidden', 'true'); for (var i = 0; i < word.length; i++) { var c = document.createElement('span'); c.className = 'c'; c.style.setProperty('--d', n++); c.textContent = word[i]; w.appendChild(c); } title.appendChild(w); if (wi < all.length - 1) { title.appendChild(document.createTextNode(' ')); n++; } }); } if ('IntersectionObserver' in window) { var seen = new IntersectionObserver(function (e) { if (e[0].isIntersecting) { root.classList.add('is-in'); seen.disconnect(); } }, { threshold: .25 }); seen.observe(root); } else root.classList.add('is-in'); /* Efecto Chocolate con Fresa: chocolate fundido en vetas (negro, con leche y blanco) que fluye despacio como un mármol; el cursor o el dedo lo remueve y deja un rastro de fresa que se mezcla con él. Tocar suelta fresa; al abrir las notas todo se remueve en un remolino. */ var fx = null; if (!reduce && canvas.getContext) { var ctx = canvas.getContext('2d'), W = 0, H = 0, dpr = Math.min(window.devicePixelRatio || 1, 2); var parts = [], running = false, raf = 0, t = 0, ptr = { x: -999, y: -999, vx: 0, vy: 0, on: false }, swirl = 0; var CHOC = ['#3a1a0c', '#5a2e1a', '#7a4326', '#9a5a34', '#c08a60']; var BERRY = ['#ff6f8f', '#e8466e', '#ff9db0']; function rnd(a, b) { return a + Math.random() * (b - a); } function resize() { var r = scene.getBoundingClientRect(); W = r.width; H = r.height; canvas.width = W * dpr; canvas.height = H * dpr; ctx.setTransform(dpr, 0, 0, dpr, 0, 0); var want = Math.round(Math.min(260, W * H / 1000)); while (parts.length < want) parts.push(spawn({}, true)); } function spawn(p, first, x, y, berry) { p.x = x !== undefined ? x + rnd(-8, 8) : (first ? rnd(0, W) : -10); p.y = y !== undefined ? y + rnd(-8, 8) : rnd(H * .3, H); p.px = p.x; p.py = p.y; p.berry = !!berry; p.c = berry ? BERRY[(Math.random() * BERRY.length) | 0] : CHOC[(Math.random() * CHOC.length) | 0]; p.w = berry ? rnd(2, 3.6) : rnd(1.6, 3.4); p.life = 0; p.max = berry ? rnd(160, 260) : rnd(300, 600); p.sp = rnd(.5, 1.1); return p; } function flow(x, y) { return Math.sin(y * .012 + t * .004) * .6 + Math.sin(x * .007 - t * .003) * .4 + Math.sin((x - y) * .005) * .3; } function frame() { if (!running) return; raf = requestAnimationFrame(frame); t++; swirl *= .985; ctx.globalCompositeOperation = 'destination-out'; ctx.fillStyle = 'rgba(0,0,0,.028)'; ctx.fillRect(0, 0, W, H); ctx.globalCompositeOperation = 'source-over'; ctx.lineCap = 'round'; var cx = W * .72, cy = H * .62; for (var i = parts.length - 1; i >= 0; i--) { var p = parts[i]; p.life++; var a = flow(p.x, p.y), vx = Math.cos(a) * p.sp + .35, vy = Math.sin(a) * p.sp * .6; if (swirl > .02) { var dx = p.x - cx, dy = p.y - cy, d = Math.sqrt(dx * dx + dy * dy) || 1; vx += -dy / d * swirl * 3; vy += dx / d * swirl * 3; } if (ptr.on) { var ex = p.x - ptr.x, ey = p.y - ptr.y, e2 = ex * ex + ey * ey; if (e2 < 6400) { var k = (80 - Math.sqrt(e2)) / 80; vx += ptr.vx * k * .5; vy += ptr.vy * k * .5; } } p.px = p.x; p.py = p.y; p.x += vx; p.y += vy; var lk = p.life / p.max, al = (lk < .1 ? lk / .1 : lk > .8 ? (1 - lk) / .2 : 1) * (p.berry ? .7 : .45); ctx.globalAlpha = al; ctx.strokeStyle = p.c; ctx.lineWidth = p.w; ctx.beginPath(); ctx.moveTo(p.px, p.py); ctx.lineTo(p.x, p.y); ctx.stroke(); if (p.life > p.max || p.x > W + 20 || p.x < -30 || p.y < -20 || p.y > H + 20) { if (p.berry || parts.length > 300) parts.splice(i, 1); else spawn(p, false); } } ctx.globalAlpha = 1; } function berries(x, y, n) { for (var i = 0; i < n; i++) parts.push(spawn({}, false, x, y, true)); } function start() { if (!running) { running = true; raf = requestAnimationFrame(frame); } } function stop() { running = false; cancelAnimationFrame(raf); } resize(); if ('ResizeObserver' in window) new ResizeObserver(resize).observe(scene); else window.addEventListener('resize', resize); scene.addEventListener('pointermove', function (e) { var r = scene.getBoundingClientRect(), x = e.clientX - r.left, y = e.clientY - r.top; if (ptr.on) { ptr.vx = x - ptr.x; ptr.vy = y - ptr.y; } ptr.x = x; ptr.y = y; ptr.on = true; if (Math.random() < .5) berries(x, y, 2); }); scene.addEventListener('pointerleave', function () { ptr.on = false; }); scene.addEventListener('pointerdown', function (e) { if (e.target.closest('button')) return; var r = scene.getBoundingClientRect(); berries(e.clientX - r.left, e.clientY - r.top, 50); }); document.addEventListener('visibilitychange', function () { if (document.hidden) stop(); }); if ('IntersectionObserver' in window) new IntersectionObserver(function (e) { e[0].isIntersecting ? start() : stop(); }).observe(scene); else start(); fx = { open: function () { swirl = 1; berries(W * .72, H * .62, 80); } }; } /* Ver notas aromáticas: remolino de chocolate y fresa y aparecen las notas */ btn.addEventListener('click', function () { var open = btn.getAttribute('aria-expanded') !== 'true'; btn.setAttribute('aria-expanded', open ? 'true' : 'false'); root.classList.toggle('is-open', open); if (open) drawer.removeAttribute('inert'); else drawer.setAttribute('inert', ''); label.textContent = open ? label.getAttribute('data-open') : label.getAttribute('data-closed'); if (open && fx) fx.open(); }); }); })();
More you might like
Related
Cherry · Car Diffuser
Related
ANTES DE LA TORMENTA
Related
ANTES DE LA TORMENTA
Related