How developerrahulofficial/lyrics-elements works
Project type and purpose
• This is a single-page React+TypeScript front-end application (built with Vite) that runs entirely in the browser.
• Purpose: take user-uploaded MP3 and timed lyrics, map each word to periodic-table elements (or emoji/physics symbols), render an animated lyric video in sync with the audio, and export it via FFmpeg compiled to WebAssembly.
File structure
• Top-level:
• package.json, tsconfig*, vite.config.ts → build & config
• public/ → static assets (demo.mp3, robots.txt, index.html, ffmpeg WASM module)
• src/ → source code
• src/ breakdown:
• components/ → React UI components (AddMp3Button, FileUpload, VideoEditor, LyricsEditor, LyricsDisplay, ExportVideo, AudioPlayer, ThemeSwitcher, etc.)
• components/ui/ → library of reusable design system primitives (buttons, dialogs, sliders…)
• hooks/ → cross-cutting logic (use-mobile, use-toast)
• lib/utils.ts → generic helpers
• utils/ → domain logic (lyricsService.ts, periodicTable.ts, videoExporter.ts)
• pages/ → route entry points (Index, NotFound)
• main.tsx, App.tsx → application root
• public/ffmpeg → ffmpeg-core.js/.wasm/.worker.js for client-side video encoding
Key insights from README
• Core algorithm flow:
1. parse lyrics & timestamps
2. lookup in emojiMap.ts → periodicTable.ts → physicsMap
3. render stacked blocks via React + Framer Motion
4. hand off rendered frames + audio to FFmpeg WASM for export
• Tech stack: React, TypeScript, TailwindCSS, Vite, Framer Motion, FFmpeg WASM.