Caption Neon Glow
framecn/caption-neon-glowFreeComponent
Captions with a neon glow effect on each word.
Install it
npx shadcn@latest add https://framecn.dev/r/caption-neon-glow.jsonSource
1"use client";23import { Timegroup } from "@editframe/react";4import type { CSSProperties } from "react";56export interface CaptionWord {7 text: string;8 start: number;9 end: number;10}1112export interface CaptionNeonGlowProps {13 words?: CaptionWord[];14 glowColor?: string;15 fontSize?: number;16 fontWeight?: number | string;17 wordsPerGroup?: number;18 background?: string;19 speed?: number;20 fps?: number;21 durationInFrames?: number;22 width?: number;23 height?: number;24 className?: string;25}2627const DEFAULT_WORDS: CaptionWord[] = [28 { end: 0.35, start: 0, text: "Every" },29 { end: 0.65, start: 0.35, text: "great" },30 { end: 1, start: 0.65, text: "video" },31 { end: 1.45, start: 1.1, text: "starts" },32 { end: 1.65, start: 1.45, text: "with" },33 { end: 1.8, start: 1.65, text: "a" },34 { end: 2.15, start: 1.8, text: "single" },35 { end: 2.7, start: 2.15, text: "frame." },36 { end: 3.2, start: 3, text: "No" },37 { end: 3.9, start: 3.2, text: "timelines." },38 { end: 4.2, start: 4, text: "No" },39 { end: 4.5, start: 4.2, text: "drag" },40 { end: 4.65, start: 4.5, text: "and" },41 { end: 5.1, start: 4.65, text: "drop." },42 { end: 5.55, start: 5.3, text: "Just" },43 { end: 6, start: 5.55, text: "code." },44];4546export const CaptionNeonGlow = ({47 words = DEFAULT_WORDS,48 glowColor = "#00fff0",49 fontSize = 80,50 fontWeight = 900,51 wordsPerGroup = 6,52 background = "#0a0a0a",53 speed = 1,54 fps = 30,55 durationInFrames = 180,56 width = 1280,57 height = 720,58 className,59}: CaptionNeonGlowProps) => {60 const safeSpeed = Math.max(0.01, speed);61 const durationMs = (durationInFrames / fps) * 1000;6263 const groups = [];64 for (let i = 0; i < words.length; i += wordsPerGroup) {65 const groupWords = words.slice(i, i + wordsPerGroup);66 groups.push({67 endMs: ((groupWords.at(-1)?.end ?? 0) * 1000) / safeSpeed + 180,68 startMs: (groupWords[0].start * 1000) / safeSpeed,69 words: groupWords,70 });71 }7273 const containerStyle: CSSProperties = {74 background,75 height,76 overflow: "hidden",77 position: "relative",78 width,79 };8081 return (82 <Timegroup83 className={className}84 duration={`${durationMs}ms`}85 mode="fixed"86 style={containerStyle}87 >88 <>89 <style>{`90 @keyframes framecn-cng-grp-in {91 from { opacity: 0; }92 to { opacity: 1; }93 }94 @keyframes framecn-cng-grp-out {95 from { opacity: 1; }96 to { opacity: 0; }97 }98// … truncated
What it pulls in
npm packages
Files it writes
More from framecn
All 101 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| AI Generate Overlayai-generate-overlay | framecn | Components | Free | 1 dep | |
| AI Generation Canvasai-generation-canvas | framecn | Components | Free | 1 dep | |
| Animated Bar Chartanimated-bar-chart | framecn | Components | Free | 1 dep | |
| Animated Line Chartanimated-line-chart | framecn | Components | Free | 1 dep | |
| Backdropbackdrop | framecn | Components | Free | 1 dep | |
| Blur Out Upblur-out-up | framecn | Components | Free | 1 dep | |
| Blur Revealblur-reveal | framecn | Components | Free | 1 dep | |
| Bounding Box Selectorbounding-box-selector | framecn | Components | Free | 1 dep |
