A hold-to-breathe coherence ring for wellness and clinical apps: press and hold to inhale as the ring swells and the halo blooms, release to exhale as it settles. Spring-physics tracking plus a live coherence score make calm breathing feel tangible on any device.
// Drop the standalone breath-coherence-ring.html into /public/effects/breath-coherence-ring.html
// Or copy the HTML/CSS/JS tab directly into your component — zero external dependencies.
export function BreathCoherenceRingEmbed() {
return (
<div className="relative min-h-[480px] w-full overflow-hidden rounded-2xl border border-white/10">
<iframe
src="/effects/breath-coherence-ring.html"
title="Breath Coherence Ring"
className="h-full min-h-[480px] w-full border-0"
loading="lazy"
/>
</div>
)
}Loading single-file HTML…
Build a single-file, zero-dependency "Breath Coherence Ring" component for a MedTech wellness app in a glacial porcelain surface (#eef6f8) with a frosted glass card.
Structure: a centered 240px SVG viewBox="0 0 200 200" containing (a) a faint track circle r=78 stroke #cfe3e6, (b) a fill disc r=60 using a radial gradient from #0d9488 to #06b6d4 at low opacity, (c) a progress ring stroke #0d9488 with round caps, strokeDasharray driven by JS, (d) a soft breathing halo circle with a blur filter that grows on inhale. Below the ring, a score readout (e.g. "Coherence 84") in a tabular-nums font and a small hint line "Press & hold to inhale".
Interaction: use pointerdown/pointermove/pointerup and pointercancel (plus touch-action:none) on the SVG. On hold, animate a target value 0→1 over ~4s using requestAnimationFrame with a critically-damped spring (stiffness 120, damping 18) so the ring eases, never snaps. On release, decay the target to 0 with a gentler spring. Map the eased value to ring radius, halo scale and ring stroke progress. Release also computes a coherence score from hold duration consistency and shows it with a subtle count-up.
Motion: every transition uses transform/opacity only, 60fps on mobile. Honor prefers-reduced-motion by replacing the spring with a simple CSS 3.5s ease-in-out pulse and disabling the halo blur.
Palette: track #cfe3e6, accent #0d9488, secondary #06b6d4, text #0f3b3f, muted #6b8f92, card rgba(255,255,255,0.72) with 1px rgba(255,255,255,0.9) border and subtle shadow.
Responsive from 390px to desktop; listen for window message { type:"prompt-lab-theme", accent, accentSecondary } to update CSS variables --accent and --accent2.WHY THIS WORKS IN PRODUCTION
- Hold-to-breathe pointer interaction with critically-damped spring easing
- Live coherence score derived from hold consistency, no libraries
- Pure inline SVG + CSS variables, honors prefers-reduced-motion
- Glacial porcelain glass card, responsive 390px → desktop
DROP-IN SPECS // WEB & MOBILE FIT






