"use client"; /** * neon.tsx — a neon sign on a brick wall, drawn in single-stroke glass tubing. * Hover and it flickers on with a mains hum; click and it shorts out with sparks and smoke, then relights. * * Part of toy-buttons. MIT licensed. Only depends on React. */ import { useEffect, useId, useImperativeHandle, useMemo, useRef, type ButtonHTMLAttributes, type CSSProperties, type MouseEvent, type ReactNode, type Ref } from "react"; type Palette = { tube: string; core: string; halo: string; unlit: string }; type Props = Omit, "children"> & { children?: ReactNode; ref?: Ref; palette?: Palette; }; const W = 260; const H = 100; const PADX = 60; const PADT = 140; const PADB = 60; const CW = W + PADX * 2; const CH = H + PADT + PADB; const FLOOR = PADT + H + 20; const REST_LIT = 0.25; const DEFAULT_PALETTE: Palette = { tube: "#ff2d95", core: "#ffe1f0", halo: "#ff1f8a", unlit: "#6e1640" }; const FLICK: [number, number][] = [[0, 0.25], [40, 0.9], [90, 0.2], [160, 1], [200, 0.35], [260, 0.9], [300, 0.6], [360, 1]]; const OFF: [number, number][] = [[0, 0.5], [120, 0.25]]; const SHORT_RELIGHT = 700; const SHORT_END = 1100; const SHORT_BURN_END = 1450; const GLYPH_H = 40; const GAP = 8; const GLYPHS: Record = { A: [28, "M3 38L14 2L25 38M7 26H21"], B: [28, "M4 3V37H15C23 37 24 31 24 28.5C24 24 21 20.5 15 20.5H4M4 3H14C21 3 23 7 23 11C23 16 20 20.5 14 20.5"], C: [28, "M25 9C22 3 18 3 14 3C5 3 3 10 3 20C3 30 5 37 14 37C18 37 22 37 25 31"], D: [28, "M4 3V37H12C23 37 25 30 25 20C25 10 23 3 12 3Z"], E: [28, "M24 3H4V37H24M4 20H20"], F: [28, "M24 3H4V38M4 20H20"], G: [28, "M25 9C22 3 18 3 14 3C5 3 3 10 3 20C3 30 5 37 14 37C23 37 25 31 25 22H15"], H: [28, "M4 3V37M24 3V37M4 20H24"], I: [10, "M5 3V37"], J: [28, "M22 2V28C22 35 18 37 12 37C7 37 4 35 3 30"], K: [28, "M4 3V37M24 3L4 22M10 17L25 37"], L: [28, "M4 3V37H24"], M: [28, "M3 38V2L14 22L25 2V38"], N: [28, "M4 38V2L24 38V2"], O: [28, "M14 3C4 3 3 10 3 20C3 30 4 37 14 37C24 37 25 30 25 20C25 10 24 3 14 3Z"], P: [28, "M4 38V3H15C24 3 25 9 25 14C25 20 22 24 15 24H4"], Q: [28, "M14 3C4 3 3 10 3 20C3 30 4 37 14 37C24 37 25 30 25 20C25 10 24 3 14 3ZM16 28L26 38"], R: [28, "M4 38V3H15C24 3 25 9 25 14C25 20 22 24 15 24H4M15 24L25 38"], S: [28, "M24 9C22 4 18 3 14 3C7 3 4 7 4 11C4 17 10 19 14 20C19 21 25 23 25 29C25 34 21 37 14 37C8 37 4 35 3 30"], T: [28, "M2 3H26M14 3V38"], U: [28, "M4 2V26C4 34 8 37 14 37C20 37 24 34 24 26V2"], V: [28, "M2 2L14 38L26 2"], W: [30, "M2 2L8 38L15 14L22 38L28 2"], X: [28, "M3 3L25 37M25 3L3 37"], Y: [28, "M2 2L14 20L26 2M14 20V38"], Z: [28, "M3 3H25L3 37H25"], }; type Glyph = { ch: string; x: number; w: number; path: string | null }; const layout = (label: string): { glyphs: Glyph[]; scale: number; left: number } => { const chars = Array.from(label.toUpperCase()); const glyphs: Glyph[] = []; let x = 0; for (const ch of chars) { const g = GLYPHS[ch]; const w = g ? g[0] : ch === " " ? 14 : 26; glyphs.push({ ch, x, w, path: g ? g[1] : null }); x += w + GAP; } const total = Math.max(1, x - GAP); const scale = Math.min(1.15, 176 / total); return { glyphs, scale, left: W / 2 - (total * scale) / 2 }; }; const shortIndex = (glyphs: Glyph[]) => { const real = glyphs.map((g, i) => (g.ch === " " ? -1 : i)).filter((i) => i >= 0); return real.length > 1 ? real[1] : real[0] ?? -1; }; const clamp = (n: number, lo = 0, hi = 1) => Math.max(lo, Math.min(hi, n)); const seqAt = (seq: [number, number][], t: number) => { let v = seq[0][1]; for (const [ms, val] of seq) { if (t >= ms) v = val; else break; } return v; }; const mulberry = (seed: number) => () => { seed = (seed + 0x6d2b79f5) | 0; let t = Math.imul(seed ^ (seed >>> 15), 1 | seed); t = (t + Math.imul(t ^ (t >>> 7), 61 | t)) ^ t; return ((t ^ (t >>> 14)) >>> 0) / 4294967296; }; const BRICKS = (() => { const r = mulberry(11); const cols = ["#2a1714", "#33201b", "#24130f"]; const out: { x: number; y: number; c: string; l: number }[] = []; for (let row = 0; row < 11; row++) { for (let col = -1; col < 12; col++) out.push({ x: col * 28 + (row % 2 ? 14 : 0), y: row * 12 + 1, c: cols[(r() * 3) | 0], l: 0.03 + r() * 0.07 }); } return out; })(); type Spark = { x: number; y: number; vx: number; vy: number; life: number; age: number; bounced: boolean; floor: number }; type Puff = { x: number; y: number; age: number; life: number; delay: number; ph: number; rv: number }; export function NeonButton({ children = "open", palette = DEFAULT_PALETTE, onClick, className, type = "button", disabled = false, ref, ...rest }: Props) { const uid = `tb-neon-${useId().replace(/[^a-zA-Z0-9_-]/g, "")}`; const btnRef = useRef(null); const wrapRef = useRef(null); const canvasRef = useRef(null); const playRef = useRef<() => void>(() => {}); useImperativeHandle(ref, () => btnRef.current!, []); const labelText = typeof children === "string" || typeof children === "number" ? String(children) : "open"; const lay = useMemo(() => layout(labelText), [labelText]); const sIdx = shortIndex(lay.glyphs); const shortG = sIdx >= 0 ? lay.glyphs[sIdx] : null; const firstX = shortG?.path ? parseFloat((/^M\s*(-?[\d.]+)/.exec(shortG.path) ?? [])[1] ?? "") : NaN; const gx = Number.isFinite(firstX) && firstX <= 6 ? firstX : 3; const shortBx = shortG ? lay.left + (shortG.x + gx) * lay.scale : W / 2; const shortY = 50; useEffect(() => { const btn = btnRef.current, wrap = wrapRef.current, cv = canvasRef.current; if (!btn || !wrap || !cv) return; const ctx = cv.getContext("2d"); if (!ctx) return; const media = window.matchMedia("(prefers-reduced-motion: reduce)"); let reduced = media.matches; let visible = true, hovering = false; let frame = 0, last = 0; let seq: { start: number; scale: number; data: [number, number][] } | null = null; let shortAt = 0; // timestamp of the active short, 0 when none let fade: number | null = null; let dipUntil = 0; let lit = REST_LIT, spill = 0, litPrev = REST_LIT; let sVal = 1, burn = 0; const sparks: Spark[] = []; const puffs: Puff[] = []; const timers = new Set(); const cx = PADX + shortBx, cy = PADT + shortY; let sp1 = false, sp2 = false; wrap.style.setProperty("--tb-neon-ax", `${shortBx + 20}px`); const puffSprite = document.createElement("canvas"); puffSprite.width = 64; puffSprite.height = 64; { const pc = puffSprite.getContext("2d"); if (pc) { const g = pc.createRadialGradient(32, 32, 0, 32, 32, 32); g.addColorStop(0, "rgba(200,200,212,1)"); g.addColorStop(0.5, "rgba(200,200,212,.45)"); g.addColorStop(1, "rgba(200,200,212,0)"); pc.fillStyle = g; pc.fillRect(0, 0, 64, 64); } } const running = () => !disabled && !btn.matches(":disabled") && visible && !document.hidden && !reduced; const spillOf = (l: number) => clamp((l - 0.2) / 0.8); const setup = () => { const scale = btn.getBoundingClientRect().width / (btn.offsetWidth || 1) || 1; const dpr = Math.min(2, (window.devicePixelRatio || 1) * scale); cv.width = Math.round(CW * dpr); cv.height = Math.round(CH * dpr); ctx.setTransform(dpr, 0, 0, dpr, 0, 0); }; const apply = (l: number, sp: number, s: number, b: number, a = 0) => { wrap.style.setProperty("--tb-neon-lit", l.toFixed(3)); wrap.style.setProperty("--tb-neon-spill", sp.toFixed(3)); wrap.style.setProperty("--tb-neon-s", String(s)); wrap.style.setProperty("--tb-neon-burn", String(b)); wrap.style.setProperty("--tb-neon-arc", a.toFixed(3)); }; const clearCanvas = () => ctx.clearRect(0, 0, CW, CH); const burst = (n: number) => { for (let i = 0; i < n; i++) { const an = Math.random() * 6.2832, sp = 120 + Math.random() * 180; sparks.push({ x: cx, y: cy, vx: Math.cos(an) * sp, vy: Math.sin(an) * sp, life: 0.25 + Math.random() * 0.25, age: 0, bounced: false, floor: FLOOR + Math.random() * 18 }); } }; const BANDS = ["#ffffff", "#ffe9a8", "#ff9a2e", "#b33a00"]; const bandOf = (f: number) => (f < 0.15 ? 0 : f < 0.4 ? 1 : f < 0.7 ? 2 : 3); const drawFx = (ts: number) => { clearCanvas(); ctx.lineCap = "round"; ctx.globalCompositeOperation = "source-over"; for (const p of puffs) { if (p.delay > 0) continue; const k = p.age / p.life; const r = 2.5 + 12 * k; const x = p.x + (2 + 12 * k) * Math.sin((p.age / 0.7) * 6.2832 + p.ph); const y = p.y - p.rv * p.age; ctx.globalAlpha = 0.40 * Math.min(1, k / 0.1) * Math.pow(1 - k, 1.3); ctx.drawImage(puffSprite, x - r, y - r, 2 * r, 2 * r); } ctx.globalAlpha = 1; ctx.globalCompositeOperation = "lighter"; if (shortAt && ts < 700) { const sput = (ts >= 260 && ts < 290) || (ts >= 420 && ts < 450); const e = Math.min(1, Math.max(Math.exp(-ts / 150), 0.55 * (1 - ts / 700)) + (sput ? 0.45 : 0)), r = 12 + 30 * e; const g = ctx.createRadialGradient(cx, cy, 0, cx, cy, r); g.addColorStop(0, `rgba(255,250,235,${e.toFixed(3)})`); g.addColorStop(0.25, `rgba(255,190,90,${(0.8 * e).toFixed(3)})`); g.addColorStop(0.55, `rgba(255,140,40,${(0.35 * e).toFixed(3)})`); g.addColorStop(1, "rgba(255,120,30,0)"); ctx.fillStyle = g; ctx.beginPath(); ctx.arc(cx, cy, r, 0, 6.2832); ctx.fill(); } if (shortAt && ts < 320) { const f = Math.exp(-ts / 110); const hg = ctx.createLinearGradient(cx - 55, 0, cx + 55, 0); hg.addColorStop(0, "rgba(255,220,170,0)"); hg.addColorStop(0.5, `rgba(255,245,225,${(0.9 * f).toFixed(3)})`); hg.addColorStop(1, "rgba(255,220,170,0)"); ctx.fillStyle = hg; ctx.fillRect(cx - 55, cy - 1, 110, 2); const vg = ctx.createLinearGradient(0, cy - 22, 0, cy + 22); vg.addColorStop(0, "rgba(255,220,170,0)"); vg.addColorStop(0.5, `rgba(255,245,225,${(0.55 * f).toFixed(3)})`); vg.addColorStop(1, "rgba(255,220,170,0)"); ctx.fillStyle = vg; ctx.fillRect(cx - 0.75, cy - 22, 1.5, 44); } if (shortAt && (ts < 120 || (ts >= 260 && ts < 290) || (ts >= 420 && ts < 450))) { ctx.beginPath(); for (let n = 0; n < 3; n++) { const an = Math.random() * 6.2832, ux = Math.cos(an), uy = Math.sin(an); let bx = cx, by = cy; ctx.moveTo(bx, by); for (let k = 0; k < 4; k++) { const ln = 3 + Math.random() * 2.5, off = (Math.random() - 0.5) * 5; bx += ux * ln - uy * off; by += uy * ln + ux * off; ctx.lineTo(bx, by); } } ctx.lineWidth = 3; ctx.strokeStyle = "#ffb35c"; ctx.globalAlpha = 0.3; ctx.stroke(); ctx.lineWidth = 0.8; ctx.strokeStyle = "#fffaf0"; ctx.globalAlpha = 1; ctx.stroke(); } const passes: [number, (b: number) => number, number, number][] = [ [2.2, () => 0.22, 0.03, 0], [0.55, (b) => (b === 3 ? 0.5 : 0.75), 0.034, 0.012], [1.25, (b) => (b === 3 ? 0.7 : 1), 0.012, 0], ]; for (const [lw, alpha, t0, t1] of passes) { ctx.lineWidth = lw; for (let b = 0; b < 4; b++) { ctx.strokeStyle = BANDS[b]; ctx.globalAlpha = alpha(b); ctx.beginPath(); for (const s of sparks) { if (bandOf(s.age / s.life) !== b) continue; ctx.moveTo(s.x - s.vx * t0, s.y - s.vy * t0); ctx.lineTo(s.x - s.vx * t1, s.y - s.vy * t1); } ctx.stroke(); } } ctx.globalAlpha = 1; ctx.globalCompositeOperation = "source-over"; }; const stepFx = (dt: number) => { for (let i = sparks.length - 1; i >= 0; i--) { const s = sparks[i]; s.age += dt; s.vy += 1100 * dt; const d = Math.exp(-1.2 * dt); s.vx *= d; s.vy *= d; s.x += s.vx * dt; s.y += s.vy * dt; if (s.y > s.floor && s.vy > 0) { if (!s.bounced) { s.vy = -s.vy * 0.35; s.bounced = true; s.y = s.floor; s.life = Math.min(s.life, s.age + 0.12); } else s.age = s.life; } if (s.age >= s.life) sparks.splice(i, 1); } for (let i = puffs.length - 1; i >= 0; i--) { const p = puffs[i]; if (p.delay > 0) { p.delay -= dt; continue; } p.age += dt; if (p.age >= p.life) puffs.splice(i, 1); } }; const tick = (now: number) => { frame = 0; if (!running()) { last = 0; return; } const dt = last ? Math.min(0.048, (now - last) / 1000) : 0.016; last = now; let l = REST_LIT; let s = 1, b = 0, a = 0; let alive = false; let ts = 0; const baseLit = () => { if (seq) { const t = (now - seq.start) / seq.scale; if (t >= seq.data[seq.data.length - 1][0]) { const v = seq.data[seq.data.length - 1][1]; seq = null; if (hovering) return v; return v; } alive = true; return seqAt(seq.data, t); } if (hovering) { alive = true; if (now < dipUntil) return 0.8; if (Math.random() < 1 / 400) dipUntil = now + 30; return 0.97 + 0.03 * Math.sin((2 * Math.PI * now) / 90); } if (fade !== null) { const k = (now - fade) / 300; if (k < 1) { alive = true; return 1 - (1 - REST_LIT) * k; } fade = null; } return REST_LIT; }; if (shortAt) { ts = now - shortAt; alive = true; const sput = (ts >= 260 && ts < 290) || (ts >= 420 && ts < 450); if (!sp1 && ts >= 260) { sp1 = true; burst(10); } if (!sp2 && ts >= 420) { sp2 = true; burst(10); } if (ts < SHORT_RELIGHT) { l = sput ? 0.5 : 0.1; s = 0; } else if (ts < SHORT_END) { l = seqAt(FLICK, (ts - SHORT_RELIGHT) / 0.7); s = ts >= 1050 ? 1 : 0; } else { if (fade === null && !hovering && !seq) fade = now; l = baseLit(); if (!hovering && fade === now) l = 1; } b = ts < SHORT_BURN_END ? 1 : 0; a = ts < 700 ? Math.min(1, Math.max(Math.exp(-ts / 180), 0.35 * (1 - ts / 700)) + (sput ? 0.4 : 0)) : 0; if (ts >= SHORT_BURN_END) shortAt = 0; } else { l = baseLit(); } stepFx(dt); spill += (spillOf(litPrev) - spill) * (1 - Math.exp(-dt / 0.08)); litPrev = l; lit = l; sVal = s; burn = b; apply(lit, spill, sVal, burn, a); const fx = sparks.length > 0 || puffs.length > 0 || (shortAt && ts < 700); if (fx) drawFx(ts); else if (cv.dataset.dirty === "1") { clearCanvas(); cv.dataset.dirty = "0"; } if (fx) cv.dataset.dirty = "1"; const spillSettling = Math.abs(spill - spillOf(lit)) > 0.004; if (alive || fx || spillSettling) frame = requestAnimationFrame(tick); else { last = 0; spill = spillOf(lit); apply(lit, spill, sVal, burn); } }; const wake = () => { if (!frame && running()) { last = 0; frame = requestAnimationFrame(tick); } }; const stillRamp = (from: number, to: number, ms: number, done?: () => void) => { const steps = 4; for (let k = 1; k <= steps; k++) { const id = window.setTimeout(() => { timers.delete(id); lit = from + (to - from) * (k / steps); spill = spillOf(lit); apply(lit, spill, 1, 0); if (k === steps) done?.(); }, (ms * k) / steps); timers.add(id); } }; const clearTimers = () => { timers.forEach((id) => window.clearTimeout(id)); timers.clear(); }; const refresh = () => { wrap.dataset.tbPaused = String(disabled || !visible || document.hidden); if (running()) { hovering = hovering && btn.matches(":hover"); wake(); } else { cancelAnimationFrame(frame); frame = 0; last = 0; shortAt = 0; seq = null; fade = null; sparks.length = 0; puffs.length = 0; clearCanvas(); if (!reduced || !timers.size) { lit = reduced && hovering ? 1 : REST_LIT; spill = spillOf(lit); apply(lit, spill, 1, 0); } } }; const enter = () => { hovering = true; if (reduced) { clearTimers(); stillRamp(lit, 1, 150); return; } if (!running()) return; if (!shortAt) seq = { start: performance.now(), scale: 1, data: FLICK }; wake(); }; const leave = () => { hovering = false; if (reduced) { clearTimers(); stillRamp(lit, REST_LIT, 150); return; } if (!running()) return; if (!shortAt) seq = { start: performance.now(), scale: 1, data: OFF }; wake(); }; const mediaChange = () => { reduced = media.matches; clearTimers(); refresh(); }; const io = typeof IntersectionObserver === "undefined" ? null : new IntersectionObserver(([en]) => { visible = en.isIntersecting; refresh(); }); const ro = typeof ResizeObserver === "undefined" ? null : new ResizeObserver(() => setup()); setup(); io?.observe(wrap); ro?.observe(btn); window.addEventListener("resize", setup); btn.addEventListener("pointerenter", enter); btn.addEventListener("pointerleave", leave); document.addEventListener("visibilitychange", refresh); media.addEventListener("change", mediaChange); playRef.current = () => { if (disabled || btn.matches(":disabled")) return; if (reduced) { clearTimers(); const base = hovering ? 1 : REST_LIT; lit = 0.1; spill = spillOf(0.1); apply(lit, spill, 1, 0); const id = window.setTimeout(() => { timers.delete(id); stillRamp(0.1, 1, 150, () => { const id2 = window.setTimeout(() => { timers.delete(id2); if (!hovering) stillRamp(1, base, 150); }, 600); timers.add(id2); }); }, 150); timers.add(id); return; } if (shortAt) return; // the short is already playing; onClick still fired shortAt = performance.now(); seq = null; fade = null; sp1 = false; sp2 = false; for (let i = 0; i < 70; i++) { let a: number, sp: number, life: number; if (i < 56) { a = Math.random() * 6.2832; if (Math.sin(a) > 0 && Math.random() < 0.3) a = -a; sp = 90 + 430 * Math.pow(Math.random(), 1.6); life = 0.3 + Math.random() * 0.5; } else { a = -Math.PI / 2 + (Math.random() - 0.5) * 2.4; sp = 40 + Math.random() * 100; life = 0.6 + Math.random() * 0.35; } sparks.push({ x: cx, y: cy, vx: Math.cos(a) * sp, vy: Math.sin(a) * sp, life, age: 0, bounced: false, floor: FLOOR + Math.random() * 18 }); } for (let i = 0; i < 28; i++) puffs.push({ x: cx + (Math.random() - 0.5) * 4, y: cy - 6, age: 0, life: 0.6, delay: (i / 27) * 0.7, ph: Math.random() * 6.28, rv: 85 * (0.85 + 0.3 * Math.random()) }); wake(); }; refresh(); return () => { playRef.current = () => {}; cancelAnimationFrame(frame); clearTimers(); io?.disconnect(); ro?.disconnect(); window.removeEventListener("resize", setup); btn.removeEventListener("pointerenter", enter); btn.removeEventListener("pointerleave", leave); document.removeEventListener("visibilitychange", refresh); media.removeEventListener("change", mediaChange); }; }, [disabled, shortBx]); const click = (e: MouseEvent) => { if (disabled || e.currentTarget.matches(":disabled")) return; onClick?.(e); if (e.defaultPrevented) return; playRef.current(); }; const RX: Record = { P: 22.5, R: 22.5, E: 20, F: 20, B: 23.5, K: 14, S: 21 }; const LX: Record = { O: 3, C: 3, G: 3, Q: 3, S: 4 }; const real = lay.glyphs.filter((g) => g.ch !== " " && g.path); const jumps = real.slice(1).map((g, k) => { const a = real[k]; const x1 = lay.left + (a.x + (RX[a.ch] ?? a.w - 3)) * lay.scale - 1.2; const x2 = lay.left + (g.x + (LX[g.ch] ?? 4)) * lay.scale + 1.2; return `M${x1.toFixed(2)} 50Q${((x1 + x2) / 2).toFixed(2)} 51.2 ${x2.toFixed(2)} 50`; }).join(""); const mk = (g: Glyph, i: number) => { const tx = lay.left + g.x * lay.scale; const ty = 50 - (GLYPH_H / 2) * lay.scale; if (g.ch === " ") return null; if (g.path) return ; return ( {g.ch} ); }; const mainEls = lay.glyphs.map((g, i) => (i === sIdx ? null : mk(g, i))); const shortEls = sIdx >= 0 ? mk(lay.glyphs[sIdx], sIdx) : null; const both = (p: Record) => (<>); const litUse = (p: Record) => (<>); const clips = [50, 130, 210].flatMap((x) => [[x, 18], [x, 82]]); const vars = { "--tb-neon-unlit": palette.unlit } as CSSProperties; return ( ); } export default NeonButton; const css = ` .tb-neon-wrap{position:relative;display:inline-block;width:${W}px;height:${H}px;vertical-align:middle;--tb-neon-lit:${REST_LIT};--tb-neon-spill:0;--tb-neon-s:1;--tb-neon-burn:0;--tb-neon-arc:0;--tb-neon-ax:60px} .tb-neon-btn{position:relative;display:block;box-sizing:border-box;width:${W}px;height:${H}px;padding:0;margin:0;border:0;border-radius:50px;background:transparent; overflow:visible;cursor:pointer;-webkit-tap-highlight-color:transparent;font:inherit;color:inherit} .tb-neon-btn:focus-visible{outline:3px solid #ffc94a;outline-offset:6px} .tb-neon-btn:disabled{cursor:default;opacity:.6;filter:saturate(.5)} .tb-neon-wall,.tb-neon-spill,.tb-neon-face,.tb-neon-arc{position:absolute;left:-20px;top:-15px;width:300px;height:130px;pointer-events:none; -webkit-mask-image:radial-gradient(ellipse 150px 65px at 50% 50%, #000 0%, #000 56%, rgba(0,0,0,.8) 70%, rgba(0,0,0,.45) 84%, rgba(0,0,0,.15) 94%, transparent 100%);mask-image:radial-gradient(ellipse 150px 65px at 50% 50%, #000 0%, #000 56%, rgba(0,0,0,.8) 70%, rgba(0,0,0,.45) 84%, rgba(0,0,0,.15) 94%, transparent 100%)} .tb-neon-wall svg{display:block} .tb-neon-face{opacity:var(--tb-neon-spill);will-change:opacity}.tb-neon-face svg{display:block} .tb-neon-spill{opacity:var(--tb-neon-spill);mix-blend-mode:screen;will-change:opacity; background:radial-gradient(ellipse 150px 62px at 50% 50%,rgba(255,40,140,.42),rgba(255,40,140,.18) 50%,rgba(255,40,140,.05) 80%,transparent 100%)} .tb-neon-arc{opacity:var(--tb-neon-arc);mix-blend-mode:screen;will-change:opacity; background:radial-gradient(circle 95px at var(--tb-neon-ax) 50%,rgba(255,150,50,.85),rgba(255,110,30,.3) 45%,transparent 100%)} .tb-neon-sign{position:absolute;left:0;top:0;overflow:visible;pointer-events:none;will-change:transform;transform-origin:50% 50%;transition:transform 220ms cubic-bezier(.2,1.6,.4,1)} .tb-neon-btn:active .tb-neon-sign{transform:translateY(1.5px) scale(.985);transition-duration:70ms;transition-timing-function:cubic-bezier(.3,0,.3,1)} .tb-neon-btn:disabled .tb-neon-sign{transform:none} .tb-neon-halo,.tb-neon-body{opacity:var(--tb-neon-lit)} .tb-neon-core{opacity:calc(var(--tb-neon-lit) * var(--tb-neon-lit))} .tb-neon-burn{opacity:var(--tb-neon-burn)} .tb-neon-canvas{position:absolute;left:-${PADX}px;top:-${PADT}px;width:${CW}px;height:${CH}px;pointer-events:none} .tb-neon-sr{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0} .tb-neon-wrap[data-tb-paused=true] *{animation-play-state:paused!important} @media (prefers-reduced-motion:reduce){.tb-neon-wrap *,.tb-neon-wrap *::before,.tb-neon-wrap *::after{animation:none!important;transition:none!important}} `;