From 21df667646a187e93ca2e3625378953da2ea6493 Mon Sep 17 00:00:00 2001 From: AlacrisDevs Date: Wed, 18 Feb 2026 10:02:20 +0200 Subject: [PATCH] Minor update --- README.md | 65 ++++++++++------- package-lock.json | 19 +++++ package.json | 3 +- src/lib/AudioVisualizer.svelte | 76 +++++++++++++------- src/lib/Controls.svelte | 125 +++++++++++++++++++++++---------- src/routes/+page.svelte | 29 ++++---- 6 files changed, 213 insertions(+), 104 deletions(-) diff --git a/README.md b/README.md index c15abb1..b469880 100644 --- a/README.md +++ b/README.md @@ -1,42 +1,57 @@ -# sv +# Audio Visualizer -Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli). +A real-time audio visualizer built with SvelteKit, Canvas API, and Web Audio API. Capture audio from your microphone, browser tab, or a local file and watch it come to life with reactive visuals, particles, and customizable themes. -## Creating a project +## Features -If you're seeing this, you've probably already done this step. Congrats! +- **4 Visualization Modes** — Circular, Bars, Wave, and Blob +- **3 Audio Sources** — Microphone, Browser Tab (Chrome/Edge), and Local File +- **Particle System** — Configurable density, size, rotation, and custom particle images +- **Audio Reactivity** — Sensitivity, smoothing, and bass emphasis controls +- **Visual Effects** — Shake, zoom, and glow intensity sliders +- **Color Presets & Custom Colors** — 6 built-in presets or pick your own gradient +- **Branding** — Custom logo with optional spin, title, and subtitle with positioning +- **Background** — Custom image, color picker, and vignette toggle +- **Theme System** — Save, load, import, and export themes as `.vslzr` files +- **Screenshot Export** — Save the current visualization as a PNG +- **Fullscreen Mode** — Immersive fullscreen with keyboard shortcut +- **i18n** — English and Estonian via Paraglide.js +- **Persistent Settings** — All settings saved to localStorage + +## Quick Start ```sh -# create a new project -npx sv create my-app -``` +# Clone the repo +git clone https://git.lapikud.ee/sass/audio-visualizer.git +cd audio-visualizer -To recreate this project with the same configuration: +# Install dependencies +npm install -```sh -# recreate this project -npx sv create --template minimal --types ts --add tailwindcss="plugins:typography,forms" paraglide="languageTags:en, et+demo:no" --install npm audio-visualizer-v2 -``` - -## Developing - -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: - -```sh +# Start dev server npm run dev - -# or start the server and open the app in a new browser tab -npm run dev -- --open ``` -## Building +Open [http://localhost:5173](http://localhost:5173) in your browser. -To create a production version of your app: +## Keyboard Shortcuts + +| Key | Action | +| --- | --- | +| `Space` | Play / Stop | +| `F` | Toggle Fullscreen | +| `H` | Hide / Show Sidebar | + +## Build ```sh npm run build +npm run preview ``` -You can preview the production build with `npm run preview`. +## Tech Stack -> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. +- **SvelteKit** + **Svelte 5** (runes) +- **Tailwind CSS v4** +- **Canvas API** + **Web Audio API** +- **Paraglide.js** for i18n diff --git a/package-lock.json b/package-lock.json index 9c01615..88dbd6a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,6 +15,7 @@ "@tailwindcss/forms": "^0.5.11", "@tailwindcss/typography": "^0.5.19", "@tailwindcss/vite": "^4.1.18", + "@types/node": "^25.2.3", "svelte": "^5.49.2", "svelte-check": "^4.3.6", "tailwindcss": "^4.1.18", @@ -1397,6 +1398,17 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/node": { + "version": "25.2.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.2.3.tgz", + "integrity": "sha512-m0jEgYlYz+mDJZ2+F4v8D1AyQb+QzsNqRuI7xg1VQX/KlKS0qT9r1Mo16yo5F/MtifXFgaofIFsdFMox2SxIbQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "undici-types": "~7.16.0" + } + }, "node_modules/@types/trusted-types": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", @@ -2410,6 +2422,13 @@ "node": ">=14.17" } }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + }, "node_modules/unplugin": { "version": "2.3.11", "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-2.3.11.tgz", diff --git a/package.json b/package.json index eba537c..43a531c 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,11 @@ "@tailwindcss/forms": "^0.5.11", "@tailwindcss/typography": "^0.5.19", "@tailwindcss/vite": "^4.1.18", + "@types/node": "^25.2.3", "svelte": "^5.49.2", "svelte-check": "^4.3.6", "tailwindcss": "^4.1.18", "typescript": "^5.9.3", "vite": "^7.3.1" } -} \ No newline at end of file +} diff --git a/src/lib/AudioVisualizer.svelte b/src/lib/AudioVisualizer.svelte index 53702a7..4afa99b 100644 --- a/src/lib/AudioVisualizer.svelte +++ b/src/lib/AudioVisualizer.svelte @@ -1,4 +1,4 @@ - @@ -332,7 +381,7 @@ 'file' ? 'bg-white/15 text-white' : 'bg-white/5 text-zinc-500 hover:bg-white/10'}" - onclick={() => audioFileInput.click()}>{m.file()} audioFileInput?.click()}>{m.file()} @@ -927,7 +976,7 @@ />