A frosted clinical card with a live-scrolling ECG trace you can scrub with a finger or cursor to read heart-rate, SpO2, and rhythm at any point in the last 60 seconds. It turns dense patient telemetry into one calm, tactile gesture that works identically on phone touch and desktop pointer.
// Drop the standalone interactive-vital-sparkline.html into /public/effects/interactive-vital-sparkline.html
// Or copy the HTML/CSS/JS tab directly into your component — zero external dependencies.
export function InteractiveVitalSparklineEmbed() {
return (
<div className="relative min-h-[480px] w-full overflow-hidden rounded-2xl border border-white/10">
<iframe
src="/effects/interactive-vital-sparkline.html"
title="Vital Sparkline Card"
className="h-full min-h-[480px] w-full border-0"
loading="lazy"
/>
</div>
)
}Loading single-file HTML…
Build a single-file, zero-dependency "Vital Sparkline Card" in glacial MedTech style. Surface: #eef6f8 background, a frosted card (rgba(255,255,255,0.72), backdrop-filter: blur(18px), 1px rgba(13,148,136,0.14) border, radius 20px, soft 0 18px 40px -24px rgba(13,80,80,0.28) shadow). Inside: a header row ("Heart rhythm", live dot, "HH:MM" caption), a large inline SVG ECG polyline (viewBox 0 0 600 160) rendered from a 60-sample heartbeat buffer using a repeating PQRST motif; stroke #0d9488 width 2.5, round caps, plus a 12% opacity area fill. Below it, three metric chips: HR 72 bpm, SpO2 98%, HRV 41 ms in #06b6d4 accents.
Interaction: pointerdown/move/up (and touch equivalents via pointer events) map X to a sample index; draw a vertical hairline cursor (#06b6d4, 1px, 60% opacity), project a dot onto the trace, and update the three chips to the values at that index with a 120ms crossfade. On release, cursor fades out and the chips spring (CSS transition, cubic-bezier(.2,.9,.3,1.2)) back to the latest reading. Add a subtle 1.6s CSS keyframe breathing glow on the live dot and a gentle 2px amplitude sway on the polyline (transform: translateY, alternate, 3.2s).
Palette: #0d9488 primary, #06b6d4 secondary, #eef6f8 canvas, #0f2b2b ink, #94b8b8 muted. Responsive 390px→desktop: SVG scales with width:100%, chips wrap to a 3-col grid at ≥420px. Respect prefers-reduced-motion: disable sway and glow, keep scrub. Listen to window message {type:"prompt-lab-theme", accent, accentSecondary} and set :root --accent/--accent2 so stroke colors update live. No libraries, no localStorage, ≤16 KB.WHY THIS WORKS IN PRODUCTION
- Scrub an ECG trace to read HR, SpO2 and HRV at any moment
- Pointer + touch share one handler; chips spring back on release
- Frosted clinical card with teal/cyan accents on porcelain canvas
- prefers-reduced-motion drops sway/glow, keeps scrub usable
DROP-IN SPECS // WEB & MOBILE FIT








