accelr8 1.0.0 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "accelr8-canvas",
3
+ "main": "src/worker.ts",
4
+ "compatibility_date": "2026-06-01",
5
+ "durable_objects": {
6
+ "bindings": [{ "name": "LOBBY", "class_name": "Lobby" }]
7
+ },
8
+ "migrations": [{ "tag": "v1", "new_sqlite_classes": ["Lobby"] }],
9
+ "observability": { "enabled": true }
10
+ }
package/ascii.txt DELETED
@@ -1,11 +0,0 @@
1
- ('-. ('-. _ .-')
2
- ( OO ).-. _( OO) ( \( -O )
3
- / . --. / .-----. .-----. (,------. ,--. ,------. .-----.
4
- | \-. \ ' .--./ ' .--./ | .---' | |.-') | /`. ' / .-. \
5
- .-'-' | | | |('-. | |('-. | | | | OO ) | / | | | \_.' /
6
- \| |_.' | /_) |OO ) /_) |OO ) (| '--. | |`-' | | |_.' | / .-. '.
7
- | .-. | || |`-'| || |`-'| | .--' (| '---.' | . '.' | | | |
8
- | | | | (_' '--'\ (_' '--'\ | `---. | | | |\ \ \ '-' /
9
- `--' `--' `-----' `-----' `------' `------' `--' '--' `----''
10
-
11
-
package/bin/index.js DELETED
@@ -1,314 +0,0 @@
1
- #!/usr/bin/env node
2
- const blessed = require('reblessed');
3
- const fs = require('fs');
4
- const { spawn } = require('child_process');
5
- const path = require('path');
6
-
7
- // Settings
8
- const MIN_WIDTH = 100;
9
- const MIN_HEIGHT = 30;
10
- const screen = blessed.screen({ smartCSR: true, title: 'ACCELR8 Terminal' });
11
-
12
- let hasLoadedUI = false;
13
- let asciiLogo, menu, errorBox, leftBox, rightBox;
14
-
15
- // Load ASCII logo
16
- const asciiContent = fs.readFileSync(path.join(__dirname, '../ascii.txt'), 'utf-8');
17
- const logoLines = asciiContent.split('\n');
18
- const logoHeight = logoLines.length;
19
- const logoWidth = Math.max(...logoLines.map(line => line.length));
20
-
21
- // Konami Code: up, up, down, down, left, right, left, right
22
- const konamiSequence = ['up', 'up', 'down', 'down', 'left', 'right', 'left', 'right'];
23
- let konamiIndex = 0;
24
-
25
- screen.on('keypress', (ch, key) => {
26
- if (!key) return;
27
- if (key.name === konamiSequence[konamiIndex]) {
28
- konamiIndex++;
29
- if (konamiIndex === konamiSequence.length) {
30
- launchNetHack();
31
- }
32
- } else {
33
- konamiIndex = 0;
34
- }
35
- });
36
-
37
- // === Size Check ===
38
- function tooSmall() {
39
- return screen.width < MIN_WIDTH || screen.height < MIN_HEIGHT;
40
- }
41
-
42
- function showError() {
43
- if (errorBox) return;
44
- errorBox = blessed.box({
45
- top: 'center',
46
- left: 'center',
47
- width: 'shrink',
48
- height: 5,
49
- content: '⚠️ Please enlarge your terminal window.\n(min size: 100x30)',
50
- align: 'center',
51
- valign: 'middle',
52
- border: { type: 'line' },
53
- style: { fg: 'red', border: { fg: 'red' } },
54
- });
55
- screen.append(errorBox);
56
- screen.render();
57
- }
58
-
59
- function hideError() {
60
- if (errorBox) {
61
- errorBox.destroy();
62
- errorBox = null;
63
- screen.render();
64
- }
65
- }
66
-
67
- function showUI() {
68
- if (hasLoadedUI) return;
69
-
70
- const logoTop = Math.floor((screen.height - logoHeight - 10) / 2);
71
- const logoLeft = Math.floor((screen.width - logoWidth) / 2);
72
-
73
- asciiLogo = blessed.box({
74
- top: logoTop,
75
- left: logoLeft,
76
- width: logoWidth,
77
- height: logoHeight,
78
- content: asciiContent,
79
- tags: false,
80
- style: { fg: 'cyan', bold: true },
81
- wrap: false,
82
- });
83
-
84
- const sideWidth = Math.floor(screen.width * 0.25);
85
- const sideHeight = screen.height - 2;
86
-
87
- leftBox = blessed.box({
88
- top: 1,
89
- left: 0,
90
- width: sideWidth,
91
- height: sideHeight,
92
- tags: true,
93
- style: { bg: 'default' },
94
- content: '',
95
- wrap: false,
96
- });
97
-
98
- rightBox = blessed.box({
99
- top: 1,
100
- left: screen.width - sideWidth,
101
- width: sideWidth,
102
- height: sideHeight,
103
- tags: true,
104
- style: { bg: 'default' },
105
- content: '',
106
- wrap: false,
107
- });
108
-
109
- menu = blessed.list({
110
- top: logoTop + logoHeight + 2,
111
- left: 'center',
112
- width: '40%',
113
- height: 7,
114
- items: [
115
- '[1] About the House',
116
- '[2] Meet the Founders',
117
- '[3] Upcoming Events',
118
- '[4] Apply to Stay',
119
- '[5] Exit',
120
- ],
121
- keys: true,
122
- mouse: true,
123
- border: { type: 'line' },
124
- style: {
125
- selected: { bg: 'blue', fg: 'white' },
126
- item: { hover: { bg: 'gray' } },
127
- },
128
- });
129
-
130
- menu.on('select', (item, index) => {
131
- if (index === 4) {
132
- screen.destroy();
133
- process.exit(0);
134
- } else {
135
- const messageBox = blessed.message({
136
- top: 'center',
137
- left: 'center',
138
- width: '50%',
139
- height: 5,
140
- border: { type: 'line' },
141
- style: { fg: 'yellow', border: { fg: 'cyan' } },
142
- });
143
- screen.append(messageBox);
144
- messageBox.display(`Loading: ${item.getText()}`, 2, () => {
145
- messageBox.destroy();
146
- screen.render();
147
- });
148
- }
149
- });
150
-
151
- screen.append(leftBox);
152
- screen.append(rightBox);
153
- screen.append(asciiLogo);
154
- screen.append(menu);
155
- menu.focus();
156
- screen.render();
157
-
158
- startFluidLoop(leftBox, sideWidth, sideHeight);
159
- startFluidLoop(rightBox, sideWidth, sideHeight);
160
-
161
- hasLoadedUI = true;
162
- }
163
-
164
- function destroyUI() {
165
- [asciiLogo, menu, leftBox, rightBox].forEach(el => el && el.destroy());
166
- asciiLogo = null;
167
- menu = null;
168
- leftBox = null;
169
- rightBox = null;
170
- hasLoadedUI = false;
171
- screen.render();
172
- }
173
-
174
- function checkSizeAndUpdate() {
175
- if (tooSmall()) {
176
- destroyUI();
177
- showError();
178
- } else {
179
- hideError();
180
- showUI();
181
- }
182
- }
183
-
184
- // === Boot Animation ===
185
- const bootLines = [
186
- 'Booting ACCELR8...',
187
- 'Verifying resident keys...',
188
- 'Warming up the coffee script engine...',
189
- 'Wiping whiteboard...',
190
- 'Ready.',
191
- ];
192
-
193
- const bootBox = blessed.box({
194
- top: 'center',
195
- left: 'center',
196
- width: '80%',
197
- height: bootLines.length + 4,
198
- tags: true,
199
- border: { type: 'line' },
200
- style: { fg: 'green', border: { fg: 'green' } },
201
- content: '',
202
- });
203
-
204
- screen.append(bootBox);
205
- screen.render();
206
-
207
- let i = 0;
208
- const showNextBootLine = () => {
209
- if (i < bootLines.length) {
210
- bootBox.setContent(bootBox.getContent() + `\n${bootLines[i++]}`);
211
- screen.render();
212
- setTimeout(showNextBootLine, 400);
213
- } else {
214
- setTimeout(() => {
215
- screen.remove(bootBox);
216
- screen.render();
217
- checkSizeAndUpdate();
218
- }, 1000);
219
- }
220
- };
221
- showNextBootLine();
222
-
223
- // === Resize Listener ===
224
- screen.on('resize', () => {
225
- checkSizeAndUpdate();
226
- });
227
-
228
- // === Quit keys ===
229
- screen.key(['escape', 'q', 'C-c'], () => {
230
- screen.destroy();
231
- process.exit(0);
232
- });
233
-
234
- // === Konami Easter Egg: Launch NetHack ===
235
- function launchNetHack() {
236
- screen.children.forEach(child => child.destroy());
237
- screen.render();
238
-
239
- playGlitchAnimation(() => {
240
- screen.destroy();
241
- const game = spawn('nethack', { stdio: 'inherit' });
242
- game.on('exit', code => process.exit(code));
243
- });
244
- }
245
-
246
- function playGlitchAnimation(callback) {
247
- const glitchChars = ['█', '▓', '▒', '░', '#', '%', '&', '@', 'Ξ', '∆'];
248
- const glitchBox = blessed.box({
249
- top: 0,
250
- left: 0,
251
- width: '100%',
252
- height: '100%',
253
- tags: true,
254
- style: { fg: 'magenta', bg: 'black' },
255
- content: '',
256
- });
257
-
258
- screen.append(glitchBox);
259
- let frame = 0;
260
- const totalFrames = 15;
261
-
262
- const interval = setInterval(() => {
263
- let output = '';
264
- for (let y = 0; y < screen.height; y++) {
265
- let line = '';
266
- for (let x = 0; x < screen.width; x++) {
267
- line += Math.random() > 0.92 ? glitchChars[Math.floor(Math.random() * glitchChars.length)] : ' ';
268
- }
269
- output += line + '\n';
270
- }
271
-
272
- glitchBox.setContent(output);
273
- screen.render();
274
- frame++;
275
-
276
- if (frame === totalFrames) {
277
- clearInterval(interval);
278
- glitchBox.setContent('{green-fg}ACCESS GRANTED: Launching Secret Mode...{/green-fg}');
279
- glitchBox.style.fg = 'green';
280
- screen.render();
281
- setTimeout(callback, 1500);
282
- }
283
- }, 50);
284
- }
285
-
286
- // === Animated Fluid Side Panels ===
287
- function startFluidLoop(box, width, height) {
288
- let t = 0;
289
- setInterval(() => {
290
- const frame = generateFluidFrame(width - 2, height - 2, t);
291
- box.setContent(frame);
292
- screen.render();
293
- t += 1;
294
- }, 80);
295
- }
296
-
297
- function generateFluidFrame(width, height, t) {
298
- let output = '';
299
- for (let y = 0; y < height; y++) {
300
- let line = '';
301
- for (let x = 0; x < width; x++) {
302
- const wave = Math.sin((x + t) / 4) + Math.cos((y + t) / 4);
303
- const char = wave > 1 ? '▓' : wave > 0.3 ? '▒' : wave > -0.5 ? '░' : ' ';
304
- line += `{${getColorCode(t + x + y)}-fg}${char}{/}`;
305
- }
306
- output += line + '\n';
307
- }
308
- return output;
309
- }
310
-
311
- function getColorCode(n) {
312
- const colors = ['red', 'magenta', 'blue', 'cyan', 'green', 'yellow'];
313
- return colors[Math.floor(n / 4) % colors.length];
314
- }