From b83cf678d03a8070ddf32f5d8b0bfc24314afc0b Mon Sep 17 00:00:00 2001 From: orfelorfel23 Date: Mon, 7 Sep 2026 18:16:33 +0200 Subject: [PATCH] feat: Add 19 visualizer shapes (headphones, invader, gamepad, saturn, etc.) --- public/app.js | 348 +++++++++++++++++++++++ public/index.html | 133 +++++++++ public/presets/dj_headphones.json | 81 ++++++ public/presets/retro_arcade_invader.json | 81 ++++++ 4 files changed, 643 insertions(+) create mode 100644 public/presets/dj_headphones.json create mode 100644 public/presets/retro_arcade_invader.json diff --git a/public/app.js b/public/app.js index 55ad155..66a051e 100644 --- a/public/app.js +++ b/public/app.js @@ -807,6 +807,354 @@ const a = start + i * step; verts.push({ x: Math.cos(a) * r, y: Math.sin(a) * r }); } + } else if (shape === 'headphones') { + verts = [ + { x: 0, y: -0.88 }, + { x: 0.35, y: -0.84 }, + { x: 0.65, y: -0.65 }, + { x: 0.72, y: -0.35 }, + { x: 0.92, y: -0.10 }, + { x: 0.92, y: 0.40 }, + { x: 0.72, y: 0.65 }, + { x: 0.52, y: 0.55 }, + { x: 0.46, y: 0.15 }, + { x: 0.50, y: -0.22 }, + { x: 0.25, y: -0.65 }, + { x: 0, y: -0.72 }, + { x: -0.25, y: -0.65 }, + { x: -0.50, y: -0.22 }, + { x: -0.46, y: 0.15 }, + { x: -0.52, y: 0.55 }, + { x: -0.72, y: 0.65 }, + { x: -0.92, y: 0.40 }, + { x: -0.92, y: -0.10 }, + { x: -0.72, y: -0.35 }, + { x: -0.65, y: -0.65 }, + { x: -0.35, y: -0.84 } + ]; + } else if (shape === 'speaker') { + verts = [ + { x: -0.75, y: -0.30 }, + { x: 0.68, y: -0.75 }, + { x: 0.85, y: -0.45 }, + { x: 0.92, y: 0 }, + { x: 0.85, y: 0.45 }, + { x: 0.68, y: 0.75 }, + { x: -0.42, y: 0.30 }, + { x: -0.42, y: 0.85 }, + { x: -0.65, y: 0.85 }, + { x: -0.65, y: 0.30 }, + { x: -0.75, y: 0.30 } + ]; + } else if (shape === 'cassette') { + verts = [ + { x: -0.88, y: -0.62 }, + { x: 0.88, y: -0.62 }, + { x: 0.88, y: 0.48 }, + { x: 0.58, y: 0.48 }, + { x: 0.42, y: 0.72 }, + { x: -0.42, y: 0.72 }, + { x: -0.58, y: 0.48 }, + { x: -0.88, y: 0.48 } + ]; + } else if (shape === 'invader') { + verts = [ + { x: -0.32, y: -0.90 }, + { x: -0.16, y: -0.90 }, + { x: -0.16, y: -0.68 }, + { x: 0.16, y: -0.68 }, + { x: 0.16, y: -0.90 }, + { x: 0.32, y: -0.90 }, + { x: 0.32, y: -0.68 }, + { x: 0.64, y: -0.68 }, + { x: 0.64, y: -0.45 }, + { x: 0.85, y: -0.45 }, + { x: 0.85, y: 0.0 }, + { x: 0.64, y: 0.0 }, + { x: 0.64, y: 0.25 }, + { x: 0.85, y: 0.25 }, + { x: 0.85, y: 0.70 }, + { x: 0.58, y: 0.70 }, + { x: 0.58, y: 0.48 }, + { x: 0.28, y: 0.48 }, + { x: 0.28, y: 0.82 }, + { x: 0.08, y: 0.82 }, + { x: 0.08, y: 0.55 }, + { x: -0.08, y: 0.55 }, + { x: -0.08, y: 0.82 }, + { x: -0.28, y: 0.82 }, + { x: -0.28, y: 0.48 }, + { x: -0.58, y: 0.48 }, + { x: -0.58, y: 0.70 }, + { x: -0.85, y: 0.70 }, + { x: -0.85, y: 0.25 }, + { x: -0.64, y: 0.25 }, + { x: -0.64, y: 0.0 }, + { x: -0.85, y: 0.0 }, + { x: -0.85, y: -0.45 }, + { x: -0.64, y: -0.45 }, + { x: -0.64, y: -0.68 }, + { x: -0.32, y: -0.68 } + ]; + } else if (shape === 'gamepad') { + verts = [ + { x: 0, y: -0.32 }, + { x: 0.35, y: -0.48 }, + { x: 0.70, y: -0.48 }, + { x: 0.88, y: -0.15 }, + { x: 0.92, y: 0.25 }, + { x: 0.72, y: 0.85 }, + { x: 0.45, y: 0.75 }, + { x: 0.30, y: 0.28 }, + { x: 0, y: 0.18 }, + { x: -0.30, y: 0.28 }, + { x: -0.45, y: 0.75 }, + { x: -0.72, y: 0.85 }, + { x: -0.92, y: 0.25 }, + { x: -0.88, y: -0.15 }, + { x: -0.70, y: -0.48 }, + { x: -0.35, y: -0.48 } + ]; + } else if (shape === 'saturn') { + const count = 48; + for (let i = 0; i < count; i++) { + const a = (i / count) * Math.PI * 2; + const sphereR = 0.58; + const ringFactor = Math.pow(Math.cos(a), 4); + const r = sphereR + (0.95 - sphereR) * ringFactor; + const rot = -0.22; + const rawX = Math.cos(a) * r; + const rawY = Math.sin(a) * (r * (0.55 + 0.45 * (1 - ringFactor))); + const px = rawX * Math.cos(rot) - rawY * Math.sin(rot); + const py = rawX * Math.sin(rot) + rawY * Math.cos(rot); + verts.push({ x: px, y: py }); + } + } else if (shape === 'rocket') { + verts = [ + { x: 0, y: -0.96 }, + { x: 0.22, y: -0.55 }, + { x: 0.36, y: -0.05 }, + { x: 0.40, y: 0.35 }, + { x: 0.82, y: 0.72 }, + { x: 0.52, y: 0.72 }, + { x: 0.24, y: 0.72 }, + { x: 0.16, y: 0.92 }, + { x: -0.16, y: 0.92 }, + { x: -0.24, y: 0.72 }, + { x: -0.52, y: 0.72 }, + { x: -0.82, y: 0.72 }, + { x: -0.40, y: 0.35 }, + { x: -0.36, y: -0.05 }, + { x: -0.22, y: -0.55 } + ]; + } else if (shape === 'snowflake') { + const arms = 6; + for (let i = 0; i < arms; i++) { + const baseAngle = (i / arms) * Math.PI * 2 - Math.PI / 2; + verts.push({ x: Math.cos(baseAngle) * 0.98, y: Math.sin(baseAngle) * 0.98 }); + verts.push({ x: Math.cos(baseAngle + 0.15) * 0.70, y: Math.sin(baseAngle + 0.15) * 0.70 }); + verts.push({ x: Math.cos(baseAngle + 0.08) * 0.52, y: Math.sin(baseAngle + 0.08) * 0.52 }); + verts.push({ x: Math.cos(baseAngle + Math.PI / arms) * 0.30, y: Math.sin(baseAngle + Math.PI / arms) * 0.30 }); + verts.push({ x: Math.cos(baseAngle + (Math.PI * 2 / arms) - 0.08) * 0.52, y: Math.sin(baseAngle + (Math.PI * 2 / arms) - 0.08) * 0.52 }); + verts.push({ x: Math.cos(baseAngle + (Math.PI * 2 / arms) - 0.15) * 0.70, y: Math.sin(baseAngle + (Math.PI * 2 / arms) - 0.15) * 0.70 }); + } + } else if (shape === 'leaf') { + verts = [ + { x: 0, y: -0.96 }, + { x: 0.15, y: -0.55 }, + { x: 0.48, y: -0.72 }, + { x: 0.28, y: -0.25 }, + { x: 0.85, y: -0.22 }, + { x: 0.35, y: 0.08 }, + { x: 0.70, y: 0.35 }, + { x: 0.16, y: 0.38 }, + { x: 0.06, y: 0.88 }, + { x: -0.06, y: 0.88 }, + { x: -0.16, y: 0.38 }, + { x: -0.70, y: 0.35 }, + { x: -0.35, y: 0.08 }, + { x: -0.85, y: -0.22 }, + { x: -0.28, y: -0.25 }, + { x: -0.48, y: -0.72 }, + { x: -0.15, y: -0.55 } + ]; + } else if (shape === 'wave') { + verts = [ + { x: -0.88, y: 0.75 }, + { x: -0.65, y: 0.45 }, + { x: -0.30, y: 0.20 }, + { x: 0.15, y: -0.15 }, + { x: 0.55, y: -0.55 }, + { x: 0.72, y: -0.90 }, + { x: 0.50, y: -0.92 }, + { x: 0.25, y: -0.72 }, + { x: 0.38, y: -0.48 }, + { x: 0.20, y: -0.20 }, + { x: 0.10, y: 0.15 }, + { x: 0.45, y: 0.50 }, + { x: 0.88, y: 0.75 } + ]; + } else if (shape === 'tornado') { + verts = [ + { x: -0.88, y: -0.88 }, + { x: 0.88, y: -0.88 }, + { x: 0.75, y: -0.52 }, + { x: 0.58, y: -0.50 }, + { x: 0.65, y: -0.15 }, + { x: 0.45, y: -0.12 }, + { x: 0.48, y: 0.25 }, + { x: 0.28, y: 0.28 }, + { x: 0.25, y: 0.65 }, + { x: 0.05, y: 0.95 }, + { x: -0.05, y: 0.95 }, + { x: -0.25, y: 0.65 }, + { x: -0.28, y: 0.28 }, + { x: -0.48, y: 0.25 }, + { x: -0.45, y: -0.12 }, + { x: -0.65, y: -0.15 }, + { x: -0.58, y: -0.50 }, + { x: -0.75, y: -0.52 } + ]; + } else if (shape === 'sword') { + verts = [ + { x: 0, y: -0.98 }, + { x: 0.14, y: -0.75 }, + { x: 0.14, y: 0.22 }, + { x: 0.75, y: 0.24 }, + { x: 0.75, y: 0.34 }, + { x: 0.10, y: 0.34 }, + { x: 0.09, y: 0.72 }, + { x: 0.20, y: 0.78 }, + { x: 0, y: 0.94 }, + { x: -0.20, y: 0.78 }, + { x: -0.09, y: 0.72 }, + { x: -0.10, y: 0.34 }, + { x: -0.75, y: 0.34 }, + { x: -0.75, y: 0.24 }, + { x: -0.14, y: 0.22 }, + { x: -0.14, y: -0.75 } + ]; + } else if (shape === 'bat') { + verts = [ + { x: 0, y: -0.45 }, + { x: 0.12, y: -0.68 }, + { x: 0.22, y: -0.45 }, + { x: 0.55, y: -0.78 }, + { x: 0.96, y: -0.42 }, + { x: 0.76, y: -0.05 }, + { x: 0.74, y: 0.28 }, + { x: 0.48, y: 0.32 }, + { x: 0.38, y: 0.58 }, + { x: 0.18, y: 0.48 }, + { x: 0, y: 0.78 }, + { x: -0.18, y: 0.48 }, + { x: -0.38, y: 0.58 }, + { x: -0.48, y: 0.32 }, + { x: -0.74, y: 0.28 }, + { x: -0.76, y: -0.05 }, + { x: -0.96, y: -0.42 }, + { x: -0.55, y: -0.78 }, + { x: -0.22, y: -0.45 }, + { x: -0.12, y: -0.68 } + ]; + } else if (shape === 'wolf') { + verts = [ + { x: 0, y: -0.52 }, + { x: 0.35, y: -0.50 }, + { x: 0.62, y: -0.92 }, + { x: 0.68, y: -0.45 }, + { x: 0.92, y: -0.05 }, + { x: 0.68, y: 0.18 }, + { x: 0.78, y: 0.42 }, + { x: 0.42, y: 0.50 }, + { x: 0.28, y: 0.88 }, + { x: 0, y: 0.95 }, + { x: -0.28, y: 0.88 }, + { x: -0.42, y: 0.50 }, + { x: -0.78, y: 0.42 }, + { x: -0.68, y: 0.18 }, + { x: -0.92, y: -0.05 }, + { x: -0.68, y: -0.45 }, + { x: -0.62, y: -0.92 }, + { x: -0.35, y: -0.50 } + ]; + } else if (shape === 'axe') { + verts = [ + { x: 0, y: -0.92 }, + { x: 0.18, y: -0.65 }, + { x: 0.88, y: -0.68 }, + { x: 0.94, y: -0.15 }, + { x: 0.88, y: 0.38 }, + { x: 0.20, y: 0.20 }, + { x: 0.12, y: 0.92 }, + { x: -0.12, y: 0.92 }, + { x: -0.20, y: 0.20 }, + { x: -0.88, y: 0.38 }, + { x: -0.94, y: -0.15 }, + { x: -0.88, y: -0.68 }, + { x: -0.18, y: -0.65 } + ]; + } else if (shape === 'peace') { + const count = 48; + for (let i = 0; i < count; i++) { + const a = (i / count) * Math.PI * 2 - Math.PI / 2; + let r = 0.88; + const dTop = Math.abs(a - (-Math.PI / 2)); + const dBot = Math.abs(a - (Math.PI / 2)); + const dDiagR = Math.abs(a - (Math.PI * 0.25)); + const dDiagL = Math.abs(a - (Math.PI * 0.75)); + if (dTop < 0.18 || dBot < 0.18 || dDiagR < 0.18 || dDiagL < 0.18) { + r = 0.98; + } + verts.push({ x: Math.cos(a) * r, y: Math.sin(a) * r }); + } + } else if (shape === 'yinyang') { + const count = 64; + for (let i = 0; i < count; i++) { + const a = (i / count) * Math.PI * 2; + const r = 0.74 + 0.22 * Math.sin(a) + 0.08 * Math.cos(2 * a); + verts.push({ x: Math.cos(a) * r, y: Math.sin(a) * r }); + } + } else if (shape === 'anchor') { + verts = [ + { x: 0, y: -0.94 }, + { x: 0.18, y: -0.82 }, + { x: 0.08, y: -0.70 }, + { x: 0.65, y: -0.65 }, + { x: 0.65, y: -0.52 }, + { x: 0.12, y: -0.52 }, + { x: 0.12, y: 0.35 }, + { x: 0.88, y: 0.22 }, + { x: 0.78, y: 0.58 }, + { x: 0.38, y: 0.82 }, + { x: 0, y: 0.92 }, + { x: -0.38, y: 0.82 }, + { x: -0.78, y: 0.58 }, + { x: -0.88, y: 0.22 }, + { x: -0.12, y: 0.35 }, + { x: -0.12, y: -0.52 }, + { x: -0.65, y: -0.52 }, + { x: -0.65, y: -0.65 }, + { x: -0.08, y: -0.70 }, + { x: -0.18, y: -0.82 } + ]; + } else if (shape === 'cat') { + verts = [ + { x: 0, y: -0.48 }, + { x: 0.30, y: -0.48 }, + { x: 0.68, y: -0.92 }, + { x: 0.72, y: -0.35 }, + { x: 0.94, y: 0.05 }, + { x: 0.88, y: 0.48 }, + { x: 0.45, y: 0.82 }, + { x: 0, y: 0.86 }, + { x: -0.45, y: 0.82 }, + { x: -0.88, y: 0.48 }, + { x: -0.94, y: 0.05 }, + { x: -0.72, y: -0.35 }, + { x: -0.68, y: -0.92 }, + { x: -0.30, y: -0.48 } + ]; } SHAPE_VERTICES_CACHE[shape] = verts; diff --git a/public/index.html b/public/index.html index 43cdcc2..7222d26 100644 --- a/public/index.html +++ b/public/index.html @@ -469,6 +469,139 @@ Hexagramm + + + + + + + + + + + + + + + + + + + diff --git a/public/presets/dj_headphones.json b/public/presets/dj_headphones.json new file mode 100644 index 0000000..7f1de15 --- /dev/null +++ b/public/presets/dj_headphones.json @@ -0,0 +1,81 @@ +{ + "name": "DJ Studio Headphones", + "icon": "๐ŸŽง", + "shapeType": "headphones", + "showCover": true, + "coverShape": "circle", + "circleRadius": 155, + "pulseIntensity": 0.6, + "pulseDecay": 0.82, + "showBorder": true, + "borderWidth": 4, + "borderColor": "#bd00ff", + "showProgressRing": true, + "progressRingColor": "#00f0ff", + "progressRingWidth": 4, + "rotationSpeed": 0.6, + "beatSpinImpulse": true, + "showSpectrum": true, + "spectrumMode": "radial_bars", + "linearAlignment": "center_mirrored", + "barCount": 110, + "spectrumMaxHeight": 145, + "barWidth": 3.5, + "barSpacing": 8, + "barCornerRadius": 2, + "freqSensitivity": 1.35, + "freqFocus": "bass_heavy", + "mirrorSpectrum": true, + "stereoSplit": true, + "stereoMode": "split_hemisphere", + "routePulse": "sub_bass", + "routeParticles": "treble", + "routeShake": "sub_bass", + "bpmSync": false, + "bpmValue": 128, + "bpmSyncRotation": false, + "bpmSyncGrid": false, + "enableParticles": true, + "particleType": "sparks", + "particleCount": 120, + "particleSpeed": 1.2, + "particleWarp": 2.0, + "enableGrid": true, + "colorGrid": "#bd00ff", + "gridPerspective": 0.65, + "gridAudioReactive": 0.5, + "enableShake": true, + "camShakeIntensity": 0.35, + "enableGlitch": false, + "rgbSplitIntensity": 0.18, + "beatFlash": true, + "enableBassZoom": true, + "enableVhs": false, + "vhsScanlineIntensity": 0.2, + "vhsNoiseIntensity": 0.1, + "vhsCrtCurvature": false, + "enableAfterglow": true, + "afterglowDecay": 0.8, + "afterglowMode": "magenta_dream", + "colorMode": "gradient_3", + "colorGrad1": "#bd00ff", + "colorGrad2": "#ff007f", + "colorGrad3": "#00f0ff", + "colorParticle": "#e4a4ff", + "gradientStyle": "angular", + "enableGlow": true, + "glowIntensity": 0.88, + "glowBlur": 26, + "laserCore": true, + "backgroundMode": "transparent", + "showTextOverlay": true, + "fontFamily": "'Outfit', sans-serif", + "textPosition": "below_circle", + "titleFontSize": 40, + "artistFontSize": 24, + "textPulseWithBeat": true, + "textGlow": true, + "titleColor": "#ffffff", + "artistColor": "#bd00ff", + "timecodeColor": "#00f0ff" +} diff --git a/public/presets/retro_arcade_invader.json b/public/presets/retro_arcade_invader.json new file mode 100644 index 0000000..6eafb30 --- /dev/null +++ b/public/presets/retro_arcade_invader.json @@ -0,0 +1,81 @@ +{ + "name": "8-Bit Space Invader", + "icon": "๐Ÿ‘พ", + "shapeType": "invader", + "showCover": true, + "coverShape": "circle", + "circleRadius": 150, + "pulseIntensity": 0.55, + "pulseDecay": 0.8, + "showBorder": true, + "borderWidth": 4, + "borderColor": "#00ff66", + "showProgressRing": true, + "progressRingColor": "#00f0ff", + "progressRingWidth": 4, + "rotationSpeed": 0.5, + "beatSpinImpulse": true, + "showSpectrum": true, + "spectrumMode": "radial_bars", + "linearAlignment": "center_mirrored", + "barCount": 96, + "spectrumMaxHeight": 140, + "barWidth": 4, + "barSpacing": 8, + "barCornerRadius": 0, + "freqSensitivity": 1.3, + "freqFocus": "flat", + "mirrorSpectrum": true, + "stereoSplit": true, + "stereoMode": "split_hemisphere", + "routePulse": "sub_bass", + "routeParticles": "treble", + "routeShake": "sub_bass", + "bpmSync": false, + "bpmValue": 130, + "bpmSyncRotation": false, + "bpmSyncGrid": false, + "enableParticles": true, + "particleType": "starfield", + "particleCount": 110, + "particleSpeed": 1.2, + "particleWarp": 2.2, + "enableGrid": true, + "colorGrid": "#00ff66", + "gridPerspective": 0.7, + "gridAudioReactive": 0.5, + "enableShake": true, + "camShakeIntensity": 0.35, + "enableGlitch": true, + "rgbSplitIntensity": 0.25, + "beatFlash": false, + "enableBassZoom": true, + "enableVhs": true, + "vhsScanlineIntensity": 0.25, + "vhsNoiseIntensity": 0.12, + "vhsCrtCurvature": false, + "enableAfterglow": true, + "afterglowDecay": 0.78, + "afterglowMode": "green_matrix", + "colorMode": "gradient_3", + "colorGrad1": "#00ff66", + "colorGrad2": "#00f0ff", + "colorGrad3": "#ffff00", + "colorParticle": "#00ff88", + "gradientStyle": "angular", + "enableGlow": true, + "glowIntensity": 0.85, + "glowBlur": 24, + "laserCore": true, + "backgroundMode": "transparent", + "showTextOverlay": true, + "fontFamily": "'Outfit', sans-serif", + "textPosition": "below_circle", + "titleFontSize": 38, + "artistFontSize": 22, + "textPulseWithBeat": true, + "textGlow": true, + "titleColor": "#ffffff", + "artistColor": "#00ff66", + "timecodeColor": "#00f0ff" +}