-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
281 lines (267 loc) · 11.2 KB
/
Copy pathindex.html
File metadata and controls
281 lines (267 loc) · 11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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
103
104
105
106
107
108
109
110
111
112
113
114
115
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
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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<!-- Favicons / site icon -->
<link rel="icon" type="image/png" href="../../icon.png" />
<link rel="icon" type="image/png" sizes="16x16" href="../../icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="../../icon.png" />
<link rel="apple-touch-icon" sizes="180x180" href="../../icon.png" />
<link rel="shortcut icon" href="../../icon.png" />
<title>Algebraic Colored Lattice Field</title>
<link rel="stylesheet" href="styles.css" />
<style>
.home-link {
position: fixed;
top: 12px;
right: 12px;
z-index: 9999;
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 14px;
font-family:
system-ui,
-apple-system,
sans-serif;
font-size: 13px;
font-weight: 600;
color: #e6edf3;
background: rgba(22, 27, 34, 0.92);
border: 1px solid #30363d;
border-radius: 8px;
text-decoration: none;
backdrop-filter: blur(8px);
transition: all 0.15s ease;
}
.home-link:hover {
background: rgba(48, 54, 61, 0.95);
border-color: #58a6ff;
color: #58a6ff;
}
</style>
</head>
<body>
<a class="home-link" href="../../index.html" title="Back to home">← Home</a>
<header>
<h1>Algebraic Colored Lattice Field</h1>
</header>
<main>
<button id="sidebarToggle" class="sidebar-toggle" title="Collapse / expand controls">
☰
</button>
<div class="canvas-wrap">
<canvas id="field" width="700" height="700"></canvas>
<div class="legend">
<span>min</span>
<div class="gradient"></div>
<span>max</span>
</div>
</div>
<aside class="controls">
<div class="control">
<label for="D">Square-free integer D</label>
<select id="D">
<option value="2">2</option>
<option value="3">3</option>
<option value="5" selected>5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="13">13</option>
<option value="17">17</option>
<option value="19">19</option>
<option value="23">23</option>
<option value="29">29</option>
<option value="31">31</option>
<option value="37">37</option>
<option value="41">41</option>
<option value="43">43</option>
<option value="47">47</option>
<option value="53">53</option>
<option value="59">59</option>
<option value="61">61</option>
<option value="67">67</option>
<option value="71">71</option>
<option value="73">73</option>
<option value="79">79</option>
<option value="83">83</option>
<option value="89">89</option>
<option value="97">97</option>
</select>
</div>
<div class="control">
<label for="mode">Field mode</label>
<select id="mode">
<option value="magnitude">|η(x)|</option>
<option value="rational">Rational part |a(x)|</option>
<option value="irrational">Irrational part |b(x)|√D</option>
<option value="snapped">Snap displacement</option>
</select>
</div>
<div class="control">
<label>K frequencies: <output id="kOut">3</output></label>
<input type="range" id="K" min="1" max="42" value="3" step="1" />
<button class="sweep-btn" data-target="K" title="Sweep K">⟲ sweep</button>
</div>
<div class="control">
<label>Frequency scale α: <output id="alphaOut">0.080</output></label>
<input type="range" id="alpha" min="0.001" max="2.0" value="0.08" step="0.001" />
<button class="sweep-btn" data-target="alpha" title="Sweep alpha">⟲ sweep</button>
</div>
<div class="control">
<label>Amplitude ε: <output id="epsOut">0.30</output></label>
<input type="range" id="eps" min="0.0" max="5.0" value="0.30" step="0.01" />
<button class="sweep-btn" data-target="eps" title="Sweep epsilon">⟲ sweep</button>
</div>
<div class="control">
<label>Grid size: <output id="sizeOut">256</output></label>
<input type="hidden" id="size" value="256" />
<div class="int-stepper">
<button id="sizeMinus" title="Decrease grid size">−</button>
<input type="range" id="sizeInput" min="1" max="1024" value="256" step="1" />
<button id="sizePlus" title="Increase grid size">+</button>
</div>
</div>
<div class="control">
<label>Upsample (grid sampling): <output id="upsampleOut">1</output>×</label>
<input type="range" id="upsample" min="1" max="8" value="1" step="1" />
</div>
<div class="control">
<label>Zoom granularity: <output id="zoomStepOut">1.100</output></label>
<input type="range" id="zoomStep" min="1.001" max="4.0" value="1.1" step="0.001" />
<div class="rational-stepper">
<div class="rs-frac">
<div class="int-stepper">
<button id="zoomNumMinus" title="Decrease numerator">−</button>
<input type="number" id="zoomNum" min="1" max="100000" value="11" step="1" />
<button id="zoomNumPlus" title="Increase numerator">+</button>
</div>
<span class="rs-bar">/</span>
<div class="int-stepper">
<button id="zoomDenMinus" title="Decrease denominator">−</button>
<input type="number" id="zoomDen" min="1" max="100000" value="10" step="1" />
<button id="zoomDenPlus" title="Increase denominator">+</button>
</div>
</div>
</div>
<button class="sweep-btn" data-target="zoom" data-dir="in" title="Sweep zoom in">
⟲ in
</button>
<button class="sweep-btn" data-target="zoom" data-dir="out" title="Sweep zoom out">
⟲ out
</button>
</div>
<div class="control">
<label>Color map</label>
<select id="cmap">
<option value="viridis" selected>viridis</option>
<option value="magma">magma</option>
<option value="grayscale">grayscale</option>
<option value="twilight">twilight</option>
<option value="rainbow">rainbow</option>
<option value="disco">disco</option>
<option value="neon">neon</option>
<option value="fire">fire</option>
<option value="ice">ice</option>
<option value="plasma">plasma</option>
</select>
</div>
<div class="control">
<label>2D color map (hue ⊗ value)</label>
<select id="cmap2d">
<option value="none">none (use 1D map)</option>
<option value="snap" selected>snap distance ⊗ field</option>
<option value="rational_irrational">rational ⊗ irrational</option>
<option value="xy_phase">xy phase ⊗ field</option>
</select>
</div>
<div class="control">
<label>Color cycling speed: <output id="cycleOut">0.00</output></label>
<input type="range" id="cycle" min="0.0" max="2.0" value="0.0" step="0.01" />
</div>
<div class="control">
<label>Seed (phase offset): <output id="seedOut">0</output></label>
<input type="range" id="seed" min="0" max="1000" value="0" step="1" />
<button class="sweep-btn" data-target="seed" title="Sweep seed">⟲ sweep</button>
</div>
<div class="control">
<label>Integer offset: <output id="offsetOut">0, 0</output></label>
<div class="offset-buttons">
<button id="offsetXMinus">x-</button>
<button id="offsetXPlus">x+</button>
<button id="offsetYMinus">y-</button>
<button id="offsetYPlus">y+</button>
</div>
</div>
<div class="control">
<label>Autocorrelation walk</label>
<div class="offset-buttons">
<button id="acCompute" title="Compute top-2 autocorrelation vectors">analyze</button>
<button id="acStep" title="Random walk one step">step</button>
<button id="acPlay" title="Play / pause random walk">▶ play</button>
<button id="acShow" title="Show / hide autocorrelation vectors on lattice">
show vectors
</button>
</div>
<output id="acOut">no vectors</output>
</div>
<div class="control">
<label>Walk speed: <output id="acSpeedOut">2.0</output> steps/s</label>
<input type="range" id="acSpeed" min="0.1" max="20" value="2" step="0.1" />
</div>
<button id="regen">Regenerate</button>
<button id="resetView">Reset view</button>
<button id="exportPng">Export PNG</button>
<div class="info">
<h3>About</h3>
<p>
Each lattice site
<span class="math">x ∈ ℤ²</span> is assigned an algebraic displacement
<span class="math">η(x) = a(x) + b(x)√D</span>
built from a sum of K incommensurate algebraic gratings. The visualization shows the
magnitude of this deterministic, aperiodic field.
</p>
<p>
Lower D values and small α yield long-range moiré-like interference
reminiscent of Penrose patterns, constrained to the square lattice.
</p>
<p>
<strong>Drag</strong> to pan and <strong>scroll</strong> to zoom into the rational
lattice. Use <em>Reset view</em> to return to the origin.
</p>
<div class="stats" id="stats"></div>
</div>
</aside>
</main>
<!-- Floating draggable, collapsible 3D FFT subwindow -->
<div id="fftWindow" class="floating-window">
<div class="fw-titlebar" id="fftTitlebar">
<span class="fw-title">3D FFT spectrum</span>
<div class="fw-buttons">
<button id="fftRefresh" class="fw-btn" title="Recompute FFT">⟳</button>
<button id="fftCollapse" class="fw-btn" title="Collapse / expand">▾</button>
</div>
</div>
<div class="fw-body" id="fftBody">
<canvas id="fftCanvas" width="320" height="260"></canvas>
<div class="fw-controls">
<label
>Rotate
<input type="range" id="fftRot" min="0" max="360" value="35" step="1" />
</label>
<label
>Tilt
<input type="range" id="fftTilt" min="5" max="85" value="55" step="1" />
</label>
<label
>Height
<input type="range" id="fftScale" min="0.1" max="3" value="1" step="0.05" />
</label>
</div>
</div>
</div>
<script type="module" src="main.js"></script>
</body>
</html>