Commit 935a9b0
committed
feat: cinematic 3D scene, light/dark theme system, and design system hardening
## What Changed
### 3D Scene (Three.js)
- Added SceneManager.js — full Three.js scene with rotating wireframe cube,
inner icosahedron, 100×100 GridHelper, and 500-particle volumetric dust system
- Added Scene.svelte — Svelte lifecycle wrapper that mounts/destroys the canvas;
canvas is position:fixed, z-index:-1, pointer-events:none so it renders behind
all page content without intercepting interaction
- Added ProductMonoliths.svelte — three interactive wireframe panels on the home
page that sit behind the product cards; respond to hover with tilt, glow edges,
and color transitions via raycasting
- Animation loop (tick/rAF), mouse parallax on cube rotation, and scroll-linked
grid drift are all wired up in SceneManager constructor
### Light / Dark Theme System
- Defined dual-theme CSS variable sets in app.css:
:root / [data-theme='light'] — pure white bg, black text
[data-theme='dark'] — pure black bg, white text
Both themes are fully monochrome; no accent colors at any layer
- Theme toggle implemented in +layout.svelte; state persists to localStorage
with prefers-color-scheme as fallback when no stored preference exists
- data-theme attribute set on <html> element; all CSS variables resolve automatically
- SceneManager.js watches data-theme via MutationObserver and calls
updateThemeColors() to sync fog color/density, wireframe color, grid colors,
and particle opacity to the active theme in real time
- ProductMonoliths.svelte has its own MutationObserver for the same reason
- Theme toggle button added to Nav.svelte; displays [LIGHT] / [DARK] label
### Design System Hardening
- Removed overly aggressive wildcard transparency rule:
main, section, div:not(.webgl-canvas) { background-color: transparent }
This rule was interfering with component styles. Body transparent is sufficient
since the canvas sits at z-index:-1 behind everything
- Replaced all hardcoded rgba(255,255,255,...) values in +page.svelte with
theme-aware CSS variables (--surface, --border-glow) so hover states and
text-shadows work correctly in both light and dark mode
- Nav background set to transparent with backdrop-filter:blur for glass effect
over 3D canvas; footer background set to transparent for same reason
- Removed debug console.log from SceneManager.updateThemeColors()
### Documentation
- README.md: complete rewrite from Vite boilerplate to full project README
covering what the Sovren Stack is, tech stack, project structure tree with
every file annotated, architecture sections for theme system and 3D scene,
shared component reference, deployment, SEO, and IDE setup
- CLAUDE.md: added Theme System section (data flow diagram, adding theme-aware
styles guide), added 3D Scene System section (architecture tree, key files,
CSS layering requirements, theme color mapping table, modification guidelines),
updated color tokens to reflect dual-theme variable structure, updated rules to
prohibit hardcoded color values, updated Remaining Work with completed items
## Problems Solved
- 3D scene disappeared after theme toggle integration — root cause was the
animation loop (tick()) being dropped during refactor; restored in constructor
- 3D canvas was occluded by page content — fixed by making body/nav/footer
backgrounds transparent and keeping canvas at z-index:-1
- Light mode 3D elements had no contrast — fixed by mapping wireframe/grid/fog
colors per theme (black wireframes on white in light, white on black in dark)
- Fog density was a type error — fixed by instanceof check before accessing
FogExp2.density vs Fog (which has no density property)
- Product card hover used hardcoded white rgba values — broke in light mode;
replaced with --surface and --border-glow tokens
- README was the default Vite scaffold boilerplate — replaced with accurate
project documentation that explains the codebase to any new contributor1 parent 286fe80 commit 935a9b0
File tree
8 files changed
+538
-107
lines changed- src
- lib
- three
- routes
8 files changed
+538
-107
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
| |||
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
21 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
31 | 37 | | |
32 | 38 | | |
33 | | - | |
| 39 | + | |
34 | 40 | | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
42 | 50 | | |
43 | 51 | | |
| 52 | + | |
| 53 | + | |
44 | 54 | | |
45 | 55 | | |
46 | 56 | | |
| |||
117 | 127 | | |
118 | 128 | | |
119 | 129 | | |
120 | | - | |
121 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
122 | 237 | | |
123 | 238 | | |
124 | 239 | | |
| |||
223 | 338 | | |
224 | 339 | | |
225 | 340 | | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
226 | 344 | | |
227 | 345 | | |
228 | 346 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | | - | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | | - | |
| 19 | + | |
16 | 20 | | |
17 | | - | |
18 | | - | |
| 21 | + | |
19 | 22 | | |
20 | | - | |
| 23 | + | |
21 | 24 | | |
22 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
23 | 34 | | |
24 | | - | |
| 35 | + | |
25 | 36 | | |
26 | | - | |
| 37 | + | |
27 | 38 | | |
28 | | - | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
29 | 103 | | |
30 | | - | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
31 | 109 | | |
32 | | - | |
| 110 | + | |
33 | 111 | | |
34 | | - | |
| 112 | + | |
35 | 113 | | |
36 | | - | |
| 114 | + | |
37 | 115 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
43 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
0 commit comments