ZoneSyncAnimation
Source: https://yesoulfitness.com/pages/zonesyncanimation
/* ZoneSync Heart Rate Card โ encapsulated for Shopify Page embed. Removed: / / / / / wrappers, global *{} and html,body resets, the demo page background, the widget grid overlay, and the card's outer border / gradient / shadow. All tokens scoped to .zs-widget (no :root leak). */ .zs-widget { --red: #ee2737; --line: rgba(255, 255, 255, .16); --text: rgba(255, 255, 255, .86); --muted: rgba(255, 255, 255, .62); position: relative; isolation: isolate; /* Make the widget its own sizing context so the internal type/spacing scales to THIS box, not the browser viewport. This is the fix for the embedded-overflow problem (the giant wrapping BPM number). */ container-type: inline-size; display: grid; place-items: center; width: 100%; max-width: 860px; margin: 0 auto; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 16px; /* Minimal dark surface keeps the white/red content legible on any background. If your Promise visual area is already dark and you want the widget fully transparent, delete just this line. */ background: #0b0c0f; color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif; } .zs-widget, .zs-widget * { box-sizing: border-box; } .zs-widget .heart-card { position: relative; width: 82%; aspect-ratio: 1 / 1; padding: clamp(22px, 4.5cqw, 46px); overflow: hidden; /* outer frame removed: no border / background / box-shadow / sheen */ } .zs-widget .top { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; } .zs-widget .label { color: var(--text); font-size: clamp(14px, 2.1cqw, 22px); font-weight: 950; letter-spacing: .02em; } .zs-widget .badge { position: relative; display: inline-flex; align-items: center; gap: .55em; overflow: hidden; padding: .7em 1em; border: 1px solid rgba(238, 39, 55, .78); border-radius: 999px; background: linear-gradient(135deg, rgba(238, 39, 55, .24), rgba(238, 39, 55, .08)), rgba(12, 13, 16, .72); color: rgba(255, 238, 240, .95); font-size: clamp(11px, 1.65cqw, 17px); line-height: 1; font-weight: 950; box-shadow: 0 0 0 1px rgba(255, 255, 255, .05) inset, 0 0 24px rgba(238, 39, 55, .2); animation: zsBadgeGlow 1.25s ease-in-out infinite; transition: opacity .28s ease, transform .28s ease; } .zs-widget .badge::before { content: ""; width: .62em; height: .62em; border-radius: 50%; background: #fff; box-shadow: 0 0 0 .34em rgba(238, 39, 55, .22), 0 0 1.2em rgba(238, 39, 55, .9); animation: zsBadgeDot 1.25s ease-in-out infinite; } .zs-widget .badge::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 0 36%, rgba(255, 255, 255, .34) 48%, transparent 60% 100%); transform: translateX(-130%); animation: zsBadgeSweep 2.2s ease-in-out infinite; } .zs-widget .badge.is-calm { opacity: .18; transform: translateY(-4px); animation: none; } .zs-widget .badge.is-calm::before, .zs-widget .badge.is-calm::after { animation: none; } @keyframes zsBadgeGlow { 50% { filter: brightness(1.28); border-color: rgba(255, 190, 195, .9); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08) inset, 0 0 34px rgba(238, 39, 55, .46); } } @keyframes zsBadgeDot { 50% { transform: scale(.72); opacity: .7; } } @keyframes zsBadgeSweep { 0%, 38% { transform: translateX(-130%); opacity: 0; } 55% { opacity: .85; } 100% { transform: translateX(130%); opacity: 0; } } .zs-widget .readout { display: flex; align-items: center; gap: clamp(14px, 2.4cqw, 26px); margin-top: clamp(16px, 2.8cqw, 28px); } .zs-widget .heart { width: clamp(42px, 7.5cqw, 76px); filter: drop-shadow(0 0 18px rgba(238, 39, 55, .78)); animation: zsBeat .88s ease-in-out infinite; } @keyframes zsBeat { 0%, 100% { transform: scale(1); } 16% { transform: scale(1.18); } 32% { transform: scale(.96); } 48% { transform: scale(1.1); } } .zs-widget .bpm { color: var(--red); font-size: clamp(92px, 20cqw, 188px); line-height: .76; font-weight: 950; letter-spacing: 0; white-space: nowrap; text-shadow: 0 0 30px rgba(238, 39, 55, .45); animation: zsBpmGlow 1.2s ease-in-out infinite; transition: color .28s ease, text-shadow .28s ease; } .zs-widget .bpm.is-calm { color: #fff; text-shadow: 0 0 18px rgba(255, 255, 255, .18); } @keyframes zsBpmGlow { 50% { text-shadow: 0 0 46px rgba(238, 39, 55, .72); } } .zs-widget .unit { align-self: flex-end; padding-bottom: .7em; color: var(--muted); font-size: clamp(18px, 3.2cqw, 32px); font-weight: 900; } .zs-widget .chart { position: absolute; left: clamp(30px, 5.6cqw, 66px); right: clamp(30px, 5.6cqw, 66px); bottom: clamp(48px, 8cqw, 92px); height: 44%; } .zs-widget .chart svg { width: 100%; height: 100%; display: block; overflow: visible; } .zs-widget .grid { stroke: var(--line); stroke-width: 1.7; stroke-dasharray: 6 6; } .zs-widget .axis { stroke: rgba(255, 255, 255, .24); stroke-width: 1.4; } .zs-widget .zone { fill: rgba(238, 39, 55, .17); } .zs-widget .zone-line { stroke: rgba(238, 39, 55, .9); stroke-width: 1.6; stroke-dasharray: 6 5; } .zs-widget .shade { fill: rgba(0, 0, 0, .56); } .zs-widget .plot { fill: none; stroke: var(--red); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 7px rgba(238, 39, 55, .85)) drop-shadow(0 0 18px rgba(238, 39, 55, .4)); stroke-dasharray: 980; stroke-dashoffset: 980; transition: stroke-dashoffset .08s linear; } .zs-widget .dot { fill: var(--red); stroke: #fff; stroke-width: 2.4; opacity: 0; transform: scale(.3); transform-box: fill-box; transform-origin: center; filter: drop-shadow(0 0 8px rgba(238, 39, 55, .82)); transition: opacity .16s ease, transform .16s ease; } .zs-widget .dot.is-visible { opacity: 1; transform: scale(1); } .zs-widget .sync { position: absolute; right: 12%; bottom: 12%; width: clamp(92px, 16cqw, 148px); aspect-ratio: 1; display: grid; place-items: center; border: 2px solid rgba(255, 105, 112, .96); border-radius: 50%; background: radial-gradient(circle, rgba(33, 7, 11, .98), rgba(10, 11, 13, .97)); box-shadow: 0 0 28px rgba(238, 39, 55, .84), inset 0 0 22px rgba(238, 39, 55, .28); opacity: 0; transform: scale(.7); animation: zsSyncIn 4.8s ease-in-out infinite; pointer-events: none; } .zs-widget .sync::before, .zs-widget .sync::after { content: ""; position: absolute; inset: -20%; border: 2px dashed rgba(238, 39, 55, .72); border-radius: 50%; animation: zsOrbit 2.8s linear infinite; } .zs-widget .sync::after { inset: -39%; opacity: .45; animation-direction: reverse; } @keyframes zsSyncIn { 0%, 50% { opacity: 0; transform: scale(.72); } 53%, 84% { opacity: 1; transform: scale(1); } 92%, 100% { opacity: 0; transform: scale(.82); } } @keyframes zsOrbit { to { transform: rotate(360deg); } } .zs-widget .sync svg { width: 56%; margin-top: -12%; filter: drop-shadow(0 0 8px rgba(238, 39, 55, .8)); } .zs-widget .sync span { position: absolute; bottom: 21%; color: #fff; font-size: clamp(9px, 1.6cqw, 14px); line-height: 1.05; text-align: center; font-weight: 950; } .zs-widget .pulse { position: absolute; right: 23%; bottom: 21%; width: 9px; height: 9px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 8px rgba(238, 39, 55, .32), 0 0 28px rgba(238, 39, 55, .9); animation: zsPulse 4.8s ease-in-out infinite; } @keyframes zsPulse { 0%, 50% { opacity: 0; transform: scale(.6); } 53%, 84% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.8); } } @media (max-width: 620px) { .zs-widget .heart-card { width: 90%; } .zs-widget .chart { left: 28px; right: 28px; } } HEART RATE (BPM) ABOVE ZONE 116 BPM 180 140 120 80 ZONESYNC ACTIVE (function () { var widget = document.querySelector("[data-zs-widget]"); if (!widget) return; var bpm = widget.querySelector("#bpm"); var badge = widget.querySelector("#badge"); var plot = widget.querySelector("#plot"); var dots = Array.prototype.slice.call(widget.querySelectorAll("[data-dot]")); var cycle = 4800; var lineLag = 180; var frames = [ { value: 116, delay: 0 }, { value: 117, delay: 360 }, { value: 120, delay: 720 }, { value: 124, delay: 1080 }, { value: 128, delay: 1440 }, { value: 134, delay: 1800 }, { value: 141, delay: 2160 }, { value: 152, delay: 2520 }, { value: 148, delay: 2880 }, { value: 136, delay: 3240 }, { value: 133, delay: 3600 }, { value: 134, delay: 3960 }, { value: 132, delay: 4320 } ]; var pathLength = plot.getTotalLength(); plot.style.strokeDasharray = pathLength; plot.style.strokeDashoffset = pathLength; function setBpm(value) { bpm.textContent = value; var calm = value = frame.delay; dots[index].classList.toggle("is-visible", visible); if (visible) current = frame; }); var lineStart = frames[0].delay + lineLag; var lineEnd = frames[frames.length - 1].delay + lineLag; var lineProgress = Math.max(0, Math.min(1, (elapsed - lineStart) / (lineEnd - lineStart))); plot.style.strokeDashoffset = pathLength * (1 - lineProgress); setBpm(current.value); if (elapsed > frames[frames.length - 1].delay + 320) { dots.forEach(function (dot) { dot.classList.remove("is-visible"); }); plot.style.strokeDashoffset = pathLength; } requestAnimationFrame(renderTimeline); } requestAnimationFrame(renderTimeline); })();