From 4db7cd2d275cf35c41118d3a7c4df0c30b022e96 Mon Sep 17 00:00:00 2001 From: "alexei.dolgolyov" Date: Thu, 12 Mar 2026 11:27:49 +0300 Subject: [PATCH] Replace blob background with floating particle field Canvas-based particle system with 60 glowing dots drifting upward, tinted with the accent color. Eliminates the gradient banding issue from the previous CSS blur approach. Renders at native resolution with radial gradients for perfectly smooth glow. Co-Authored-By: Claude Opus 4.6 --- .../src/wled_controller/static/css/base.css | 62 +-------- server/src/wled_controller/static/js/app.js | 11 +- .../wled_controller/static/js/core/bg-anim.js | 131 ++++++++++++++++++ .../src/wled_controller/templates/index.html | 26 +--- 4 files changed, 149 insertions(+), 81 deletions(-) create mode 100644 server/src/wled_controller/static/js/core/bg-anim.js diff --git a/server/src/wled_controller/static/css/base.css b/server/src/wled_controller/static/css/base.css index 6495564..8266f51 100644 --- a/server/src/wled_controller/static/css/base.css +++ b/server/src/wled_controller/static/css/base.css @@ -84,17 +84,17 @@ body.modal-open { } /* ── Ambient animated background ── */ -#bg-anim-layer { +#bg-anim-canvas { display: none; position: fixed; inset: 0; z-index: -1; + width: 100%; + height: 100%; pointer-events: none; - overflow: hidden; - background: var(--bg-color); } -[data-bg-anim="on"] #bg-anim-layer { +[data-bg-anim="on"] #bg-anim-canvas { display: block; } @@ -102,60 +102,6 @@ body.modal-open { background: transparent; } -#bg-anim-layer .bg-blob { - position: absolute; - border-radius: 50%; - filter: blur(80px); - will-change: transform; -} - -#bg-anim-layer .bg-blob-a { - width: 600px; - height: 400px; - top: 10%; - left: 10%; - background: var(--bg-anim-a); - animation: blobA 20s ease-in-out infinite alternate; -} - -#bg-anim-layer .bg-blob-b { - width: 500px; - height: 500px; - top: 40%; - right: 5%; - background: var(--bg-anim-b); - animation: blobB 25s ease-in-out infinite alternate; -} - -#bg-anim-layer .bg-blob-c { - width: 450px; - height: 550px; - bottom: 5%; - left: 30%; - background: var(--bg-anim-c); - animation: blobC 22s ease-in-out infinite alternate; -} - -/* Blob colors derived from accent via JS (--bg-anim-a/b/c set in index.html) */ - -@keyframes blobA { - 0% { transform: translate(0, 0) scale(1); } - 50% { transform: translate(15vw, 10vh) scale(1.15); } - 100% { transform: translate(-5vw, 20vh) scale(0.9); } -} - -@keyframes blobB { - 0% { transform: translate(0, 0) scale(1); } - 50% { transform: translate(-20vw, -10vh) scale(1.1); } - 100% { transform: translate(5vw, 15vh) scale(0.95); } -} - -@keyframes blobC { - 0% { transform: translate(0, 0) scale(1); } - 50% { transform: translate(10vw, -15vh) scale(1.2); } - 100% { transform: translate(-10vw, -5vh) scale(0.85); } -} - .container { padding: 20px; } diff --git a/server/src/wled_controller/static/js/app.js b/server/src/wled_controller/static/js/app.js index 3d28855..425a837 100644 --- a/server/src/wled_controller/static/js/app.js +++ b/server/src/wled_controller/static/js/app.js @@ -12,6 +12,7 @@ import { t, initLocale, changeLocale } from './core/i18n.js'; // Layer 1.5: visual effects import { initCardGlare } from './core/card-glare.js'; +import { initBgAnim, updateBgAnimAccent, updateBgAnimTheme } from './core/bg-anim.js'; // Layer 2: ui import { @@ -169,6 +170,10 @@ Object.assign(window, { // core / state (for inline script) setApiKey, + // visual effects (called from inline -
-
-
-
-
+