-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
288 lines (266 loc) · 18 KB
/
index.html
File metadata and controls
288 lines (266 loc) · 18 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
282
283
284
285
286
287
288
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="google-site-verification" content="61Y9kjxqcAt7TYpyxqaFIaPjGP3IktL46ohSLVOZY4c" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, user-scalable=no">
<title>HexLife Explorer - Interactive Hexagonal Cellular Automata</title>
<meta name="description" content="Explore complex emergent behaviors with HexLife Explorer, an interactive web-based cellular automaton simulator on a hexagonal grid, powered by WebGL2 and Web Workers. Define custom rulesets and observe intricate patterns unfold in multiple concurrent simulations.">
<meta property="og:type" content="website">
<meta property="og:url" content="https://sidem.github.io/HexLife/">
<meta property="og:title" content="HexLife Explorer - Interactive Hexagonal Cellular Automata">
<meta property="og:description" content="Discover emergent complexity with HexLife Explorer, a WebGL2 & Web Worker powered cellular automaton on a hexagonal grid.">
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:url" content="https://sidem.github.io/HexLife/">
<meta property="twitter:title" content="HexLife Explorer - Interactive Hexagonal Cellular Automata">
<meta property="twitter:description" content="Discover emergent complexity with HexLife Explorer, a WebGL2 & Web Worker powered cellular automaton on a hexagonal grid.">
<meta name="theme-color" content="#1e1e1e">
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "SoftwareApplication",
"name": "HexLife Explorer",
"operatingSystem": "WEB",
"applicationCategory": "GameApplication",
"offers": {
"@type": "Offer",
"price": "0"
},
"abstract": "An interactive web-based cellular automaton simulator on a hexagonal grid, leveraging WebGL2 for high-performance rendering and Web Workers for concurrent simulations. Users can define custom rulesets and observe emergent behaviors.",
"url": "https://sidem.github.io/HexLife/",
"author": {
"@type": "Person",
"name": "Sidem"
},
"keywords": "cellular automata, hexagonal grid, WebGL, simulation, generative art, complex systems, web workers, javascript"
}
</script>
<!-- CSS link will be injected by Vite during build -->
<link rel="icon" type="image/x-icon" href="favicon.ico">
<link rel="apple-touch-icon" href="favicon.ico">
</head>
<body>
<div id="loading-indicator">
<div class="loading-content">
<div class="loader-grid">
<div class="loader-hex" id="loader-hex-0"></div>
<div class="loader-hex" id="loader-hex-1"></div>
<div class="loader-hex" id="loader-hex-2"></div>
<div class="loader-hex" id="loader-hex-3"></div>
<div class="loader-hex" id="loader-hex-4"></div>
<div class="loader-hex" id="loader-hex-5"></div>
<div class="loader-hex" id="loader-hex-6"></div>
<div class="loader-hex" id="loader-hex-7"></div>
<div class="loader-hex" id="loader-hex-8"></div>
</div>
<div id="loading-title">Loading HexLife Explorer...</div>
<div id="loading-status">Initializing...</div>
</div>
</div>
<div id="onboarding-overlay" class="hidden"></div>
<div id="onboarding-tooltip" class="hidden">
<div id="onboarding-progress-container">
<div id="onboarding-progress-bar"></div>
</div>
<h3 id="onboarding-tooltip-title"></h3>
<div id="onboarding-tooltip-content"></div>
<div id="onboarding-tooltip-actions">
<button id="onboarding-action-primary" class="button"></button>
<button id="onboarding-action-secondary" class="button-link">Skip Tour</button>
</div>
</div>
<div id="app-container">
<div id="top-info-bar">
<div id="appMenuButton" class="button-like" tabindex="0">
<div id="appLogo">⬡</div>
<span id="appTitle">HexLife Explorer</span>
</div>
<div id="rulesetDisplayContainer" data-tour-id="ruleset-display-container">
<div class="ruleset-history-controls">
<button id="undoButton" class="button-icon" title="Undo Ruleset Change (Ctrl+Z)" disabled>↶</button>
<button id="redoButton" class="button-icon" title="Redo Ruleset Change (Ctrl+Y)" disabled>↷</button>
</div>
<span class="ruleset-viz-container"></span>
<div id="rulesetDisplay" class="ruleset-display-toggle">
<span id="rulesetDisplayName"></span>
<code id="rulesetDisplayCode">N/A</code>
</div>
<button id="saveRulesetButton" class="button-icon save-ruleset-button" data-tour-id="save-ruleset-button" title="Save this ruleset to your personal library">⭐</button>
<div class="ruleset-history-controls">
<button id="historyButton" class="button-icon" title="View Ruleset History">🕒</button>
</div>
</div>
<div id="statsDisplayContainer" class="stats-container" data-tour-id="stats-display-container">
<span>Tick: <span id="stat-tick">--</span></span>
<span>Ratio: <span id="stat-ratio">--</span>%</span>
<span>Brush: <span id="stat-brush-size">--</span></span>
<span>FPS: <span id="stat-fps">--</span></span>
<span>TPS: <span id="stat-actual-tps">--</span>/<span id="stat-target-tps">--</span></span>
</div>
</div>
<div id="appMenuPopout" class="popout-panel popout-menu hidden">
<ul class="popout-link-list">
<li>
<a href="https://github.com/Sidem/HexLife/" target="_blank" rel="noopener">
<span class="icon">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.012 8.012 0 0 0 16 8c0-4.42-3.58-8-8-8z"/>
</svg>
</span>
GitHub
</a>
</li>
<li>
<a href="https://t.me/+40UOmH_v5UE2ZGIy" target="_blank" rel="noopener">
<span class="icon">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 16 16">
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0zM8.287 5.906c-.778.324-2.334.994-4.666 2.01-.378.15-.577.298-.595.442-.03.243.275.339.69.47l.175.055c.408.133.958.288 1.243.294.26.006.549-.1.868-.32 2.179-1.471 3.304-2.214 3.374-2.23.05-.012.12-.026.166.016.047.041.042.12.037.141-.03.129-1.227 1.241-1.846 1.817-.193.18-.33.307-.358.336a8.154 8.154 0 0 1-.188.186c-.38.366-.664.64.015 1.088.327.216.589.393.85.571.284.194.568.387.936.629.093.06.183.125.27.187.331.236.63.448.997.414.214-.02.435-.22.547-.82.265-1.417.786-4.486.906-5.751a1.426 1.426 0 0 0-.013-.315.337.337 0 0 0-.114-.217.526.526 0 0 0-.31-.093c-.3.005-.763.166-2.984 1.09z"/>
</svg>
</span>
Telegram
</a>
</li>
</ul>
</div>
<div id="main-content-area" data-tour-id="main-content-area">
<div id="vertical-toolbar" role="toolbar" aria-label="Main controls">
<button id="playPauseButton" class="toolbar-button" title="[P]lay/Pause Simulation" data-tour-id="play-pause-button">▶</button>
<button id="controlsButton" class="toolbar-button" title="Simulation Controls" data-tour-id="controls-button">⚙️</button>
<button id="rulesetActionsButton" class="toolbar-button" title="Ruleset Actions (Generate, Mutate, Library)" data-tour-id="ruleset-actions-button">🧬</button>
<button id="resetClearButton" class="toolbar-button" title="Reset/Clear Worlds" data-tour-id="reset-clear-button">🔄</button>
<button id="editRuleButton" class="toolbar-button" title="[E]dit Ruleset Panel" data-tour-id="edit-rule-button">📝</button>
<button id="setupPanelButton" class="toolbar-button" title="[S]etup Worlds Panel" data-tour-id="setup-panel-button">🌐</button>
<button id="analysisPanelButton" class="toolbar-button" title="[A]nalysis Panel" data-tour-id="analysis-panel-button">📈</button>
<button id="rankPanelButton" class="toolbar-button" title="Rule Rank Panel" data-tour-id="rank-panel-button">🏆</button>
<button id="saveStateButton" class="toolbar-button" title="Save Selected World State" data-tour-id="save-state-button">💾</button>
<button id="loadStateButton" class="toolbar-button" title="Load World State" data-tour-id="load-state-button">📂</button>
<button id="shareButton" class="toolbar-button" title="Share Setup" data-tour-id="share-button">🔗</button>
<button id="colorPanelButton" class="toolbar-button" title="Chroma Lab - Color Customization">🎨</button>
<button id="shortcutsButton" class="toolbar-button" title="Keyboard Shortcuts">⌨️</button>
<button id="helpButton" class="toolbar-button" title="Help">🎓</button>
</div>
<canvas id="hexGridCanvas" aria-label="Hexagonal cellular automaton simulation display" data-tour-id="hex-grid-canvas">
</canvas>
<div id="selected-world-guide" style="position: absolute; pointer-events: none; box-sizing: border-box; display: none;"></div>
<div id="minimap-guide" style="position: absolute; pointer-events: none; box-sizing: border-box; display: none;"></div>
<div id="mobile-canvas-controls" class="hidden">
<div id="mobile-fab-container-right" class="mobile-fab-container"></div>
<div id="mobile-fab-container-left" class="mobile-fab-container left"></div>
</div>
</div>
<div id="controlsPopout" class="popout-panel hidden" data-tour-id="controls-popout">
<h4>Controls</h4>
<div id="desktopControlsMount"></div>
</div>
<div id="resetClearPopout" class="popout-panel hidden" data-tour-id="reset-clear-popout">
<h4>Reset / Clear<button class="button-help-trigger" data-tour-name="resetClear" title="Help with this feature">[?]</button></h4>
<button id="resetCurrentButtonPopout" class="button">Reset Selected</button>
<button id="resetAllButtonPopout" class="button">Reset All</button>
<div class="popout-separator"></div>
<button id="clearCurrentButtonPopout" class="button">Clear Selected</button>
<button id="clearAllButtonPopout" class="button">Clear All</button>
</div>
<div id="sharePopout" class="popout-panel hidden">
<h4>Share Link<button class="button-help-trigger" data-tour-name="saveLoad" title="Help with this feature">[?]</button></h4>
<div class="form-group">
<label for="shareLinkInput">Your shareable link:</label>
<input type="text" id="shareLinkInput" class="hex-input" readonly>
</div>
<div class="form-group-buttons">
<button id="copyShareLinkButton" class="button">Copy to Clipboard</button>
</div>
</div>
<div id="historyPopout" class="popout-panel hidden">
<h4>Ruleset History<button class="button-help-trigger" data-tour-name="history" title="Help with this feature">[?]</button></h4>
<div id="historyList" class="history-list-container"></div>
</div>
<div id="shortcutsPanel" class="draggable-panel-base hidden" role="dialog" aria-labelledby="shortcutsPanelTitle" aria-modal="true">
<button class="close-panel-button" title="Close Panel">×</button>
<h3 id="shortcutsPanelTitle">Keyboard Shortcuts</h3>
<div class="panel-content-area"></div>
</div>
<div id="rulesetEditorPanel" class="draggable-panel-base hidden" role="dialog" aria-labelledby="rulesetEditorTitle" aria-modal="true" data-tour-id="ruleset-editor-panel">
<button id="closeEditorButton" class="close-panel-button" title="Close Panel">×</button>
<h3 id="rulesetEditorTitle">Ruleset Editor<button class="button-help-trigger" data-tour-name="editor" title="Help with this feature">[?]</button></h3>
<div class="panel-content-area">
</div>
</div>
<div id="worldSetupPanel" class="draggable-panel-base hidden" role="dialog" aria-labelledby="setupPanelTitle" aria-modal="true" data-tour-id="setup-panel">
<button class="close-panel-button" title="Close Panel">×</button>
<h3 id="setupPanelTitle">World Setup<button class="button-help-trigger" data-tour-name="setup" title="Help with this feature">[?]</button></h3>
<div class="panel-content-area">
</div>
</div>
<div id="analysisPanel" class="draggable-panel-base hidden" role="dialog" aria-labelledby="analysisPanelTitle" aria-modal="true" data-tour-id="analysis-panel">
<button id="closeAnalysisPanelButton" class="close-panel-button" title="Close Panel">×</button>
<h3 id="analysisPanelTitle">Analysis Tools<button class="button-help-trigger" data-tour-name="analysis" title="Help with this feature">[?]</button></h3>
<div class="panel-content-area">
<!-- This will be populated by AnalysisComponent -->
</div>
</div>
<div id="ruleRankPanel" class="draggable-panel-base hidden" role="dialog" aria-labelledby="rankPanelTitle" aria-modal="true" data-tour-id="rule-rank-panel">
<button id="closeRankPanelButton" class="close-panel-button" title="Close Panel">×</button>
<h3 id="rankPanelTitle">Rule Usage Ranking<button class="button-help-trigger" data-tour-name="ruleRank" title="Help with this feature">[?]</button></h3>
<div id="ruleRankContent" class="panel-content-area">
</div>
</div>
<div id="learningPanel" class="draggable-panel-base hidden" role="dialog" aria-labelledby="learningPanelTitle" aria-modal="true">
<button class="close-panel-button" title="Close Panel">×</button>
<h3 id="learningPanelTitle">Learning Hub (Alpha)</h3>
<div class="panel-content-area">
<!-- This will be populated by LearningComponent -->
</div>
</div>
<div id="rulesetActionsPanel" class="draggable-panel-base hidden" role="dialog" aria-labelledby="rulesetActionsTitle" aria-modal="true" data-tour-id="ruleset-actions-panel">
<button class="close-panel-button" title="Close Panel">×</button>
<h3 id="rulesetActionsTitle">Ruleset Actions<button class="button-help-trigger" data-tour-name="rulesetGeneration" title="Help with this feature">[?]</button></h3>
<div class="panel-content-area" id="ruleset-actions-content-mount">
</div>
</div>
<div id="chromaLabPanel" class="draggable-panel-base hidden" role="dialog" aria-labelledby="chromaLabTitle" aria-modal="true">
<button class="close-panel-button" title="Close Panel">×</button>
<h3 id="chromaLabTitle">Chroma Lab</h3>
<div class="panel-content-area">
</div>
</div>
<div id="bottom-tab-bar" class="hidden">
<button class="tab-bar-button active" data-view="simulate" title="Simulation View">
<span class="icon">⬡</span>
<span class="label">Simulate</span>
</button>
<button class="tab-bar-button" data-view="rules" title="Ruleset Controls">
<span class="icon">🧬</span>
<span class="label">Rules</span>
</button>
<button class="tab-bar-button" data-view="editor" title="Ruleset Editor">
<span class="icon">📝</span>
<span class="label">Editor</span>
</button>
<button class="tab-bar-button" data-view="worlds" title="World Setup">
<span class="icon">🪐</span>
<span class="label">Worlds</span>
</button>
<button class="tab-bar-button" data-view="analyze" title="Analysis Tools">
<span class="icon">📊</span>
<span class="label">Analyze</span>
</button>
<button class="tab-bar-button" data-view="learning" title="Learning Hub">
<span class="icon">🎓</span>
<span class="label">Learn</span>
</button>
<button class="tab-bar-button" data-view="more" title="More Options">
<span class="icon">•••</span>
<span class="label">More</span>
</button>
</div>
</div>
<input type="file" id="fileInput" accept=".txt,.json" style="display: none;" aria-label="Load file">
<div id="mobile-views-container"></div>
<div id="modal-container"></div>
<div id="popover-container"></div>
<div id="dialog-container"></div>
<div id="toast-container"></div>
<!-- Vite will inject the script tag here during build -->
<script type="module" src="/src/main.js"></script>
</body>
</html>