tangled
alpha
login
or
join now
dunkirk.sh
/
plastic
2
fork
atom
self modifying website
2
fork
atom
overview
issues
pulls
pipelines
feat: add basic site
dunkirk.sh
9 months ago
3cfc384e
d7153c93
verified
This commit was signed with the committer's
known signature
.
dunkirk.sh
SSH Key Fingerprint:
SHA256:DqcG0RXYExE26KiWo3VxJnsxswN1QNfTBvB+bdSpk80=
+419
1 changed file
expand all
collapse all
unified
split
index.html
+419
index.html
···
1
1
+
<!doctype html>
2
2
+
<html lang="en">
3
3
+
<head>
4
4
+
<meta charset="UTF-8" />
5
5
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
+
<title>C:\PLASTIC.EXE - Self-Modifying System</title>
7
7
+
<style>
8
8
+
@import url("https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap");
9
9
+
10
10
+
body {
11
11
+
background: #f0f0f0;
12
12
+
font-family: "Courier Prime", "Courier New", monospace;
13
13
+
color: #000000;
14
14
+
margin: 0;
15
15
+
padding: 20px;
16
16
+
line-height: 1.2;
17
17
+
font-size: 14px;
18
18
+
}
19
19
+
20
20
+
.terminal {
21
21
+
background: #ffffff;
22
22
+
border: 2px solid #808080;
23
23
+
box-shadow:
24
24
+
inset -2px -2px #c0c0c0,
25
25
+
inset 2px 2px #404040;
26
26
+
max-width: 800px;
27
27
+
margin: 0 auto;
28
28
+
padding: 0;
29
29
+
}
30
30
+
31
31
+
.title-bar {
32
32
+
background: #c0c0c0;
33
33
+
color: #000000;
34
34
+
padding: 4px 8px;
35
35
+
font-weight: bold;
36
36
+
border-bottom: 1px solid #808080;
37
37
+
font-size: 12px;
38
38
+
}
39
39
+
40
40
+
.content {
41
41
+
padding: 10px;
42
42
+
background: #ffffff;
43
43
+
}
44
44
+
45
45
+
.prompt {
46
46
+
color: #000000;
47
47
+
margin: 0;
48
48
+
}
49
49
+
50
50
+
.cursor {
51
51
+
background: #000000;
52
52
+
color: #ffffff;
53
53
+
animation: blink 1s infinite;
54
54
+
}
55
55
+
56
56
+
@keyframes blink {
57
57
+
0%,
58
58
+
50% {
59
59
+
opacity: 1;
60
60
+
}
61
61
+
51%,
62
62
+
100% {
63
63
+
opacity: 0;
64
64
+
}
65
65
+
}
66
66
+
67
67
+
h1 {
68
68
+
color: #000000;
69
69
+
font-size: 24px;
70
70
+
margin: 10px 0;
71
71
+
text-transform: uppercase;
72
72
+
}
73
73
+
74
74
+
h2 {
75
75
+
color: #000000;
76
76
+
font-size: 16px;
77
77
+
margin: 15px 0 5px 0;
78
78
+
text-transform: uppercase;
79
79
+
}
80
80
+
81
81
+
.command {
82
82
+
color: #ffffff;
83
83
+
background: #808080;
84
84
+
padding: 2px 4px;
85
85
+
display: inline-block;
86
86
+
margin: 2px;
87
87
+
}
88
88
+
89
89
+
.button {
90
90
+
background: #c0c0c0;
91
91
+
color: #000000;
92
92
+
border: 2px outset #c0c0c0;
93
93
+
padding: 4px 8px;
94
94
+
font-family: inherit;
95
95
+
font-size: 12px;
96
96
+
cursor: pointer;
97
97
+
margin: 5px 2px;
98
98
+
display: inline-block;
99
99
+
text-decoration: none;
100
100
+
text-transform: uppercase;
101
101
+
}
102
102
+
103
103
+
.button:active {
104
104
+
border: 2px inset #c0c0c0;
105
105
+
}
106
106
+
107
107
+
.button:hover {
108
108
+
background: #d0d0d0;
109
109
+
}
110
110
+
111
111
+
.editor {
112
112
+
width: calc(100% - 20px);
113
113
+
height: 150px;
114
114
+
background: #0000ff;
115
115
+
color: #ffffff;
116
116
+
font-family: inherit;
117
117
+
margin: 10px 0;
118
118
+
padding: 10px;
119
119
+
border: 2px inset #c0c0c0;
120
120
+
font-size: 12px;
121
121
+
resize: none;
122
122
+
}
123
123
+
124
124
+
.status-bar {
125
125
+
background: #c0c0c0;
126
126
+
color: #000000;
127
127
+
padding: 2px 8px;
128
128
+
border-top: 1px solid #808080;
129
129
+
font-size: 11px;
130
130
+
display: flex;
131
131
+
justify-content: space-between;
132
132
+
}
133
133
+
134
134
+
.file-listing {
135
135
+
margin: 10px 0;
136
136
+
}
137
137
+
138
138
+
.file-line {
139
139
+
margin: 2px 0;
140
140
+
font-family: inherit;
141
141
+
}
142
142
+
143
143
+
.dir {
144
144
+
color: #000080;
145
145
+
}
146
146
+
147
147
+
.exe {
148
148
+
color: #000000;
149
149
+
}
150
150
+
151
151
+
.txt {
152
152
+
color: #000000;
153
153
+
}
154
154
+
155
155
+
.error {
156
156
+
color: #ffffff;
157
157
+
background: #ff0000;
158
158
+
padding: 2px 4px;
159
159
+
}
160
160
+
161
161
+
ul {
162
162
+
margin: 5px 0;
163
163
+
padding-left: 20px;
164
164
+
}
165
165
+
166
166
+
li {
167
167
+
margin: 2px 0;
168
168
+
}
169
169
+
170
170
+
.separator {
171
171
+
color: #808080;
172
172
+
margin: 10px 0;
173
173
+
}
174
174
+
175
175
+
.ascii-art {
176
176
+
color: #000000;
177
177
+
font-size: 10px;
178
178
+
line-height: 1;
179
179
+
white-space: pre;
180
180
+
margin: 10px 0;
181
181
+
}
182
182
+
</style>
183
183
+
</head>
184
184
+
<body>
185
185
+
<div class="terminal">
186
186
+
<div class="title-bar">
187
187
+
C:\PLASTIC.EXE - [Self-Modifying System v2.1]
188
188
+
</div>
189
189
+
190
190
+
<div class="content">
191
191
+
<p class="prompt">C:\PLASTIC> DIR</p>
192
192
+
193
193
+
<div class="file-listing">
194
194
+
<div class="file-line">
195
195
+
Volume in drive C is PLASTIC-SYS
196
196
+
</div>
197
197
+
<div class="file-line">Directory of C:\PLASTIC</div>
198
198
+
<div class="file-line"></div>
199
199
+
<div class="file-line">
200
200
+
<span class="dir">SYSTEM <DIR></span> 12-15-95
201
201
+
3:42p
202
202
+
</div>
203
203
+
<div class="file-line">
204
204
+
<span class="exe">PLASTIC EXE</span> 24,576 12-15-95
205
205
+
3:42p
206
206
+
</div>
207
207
+
<div class="file-line">
208
208
+
<span class="txt">README TXT</span> 1,024 12-15-95 3:42p
209
209
+
</div>
210
210
+
<div class="file-line">
211
211
+
<span class="txt">CONFIG SYS</span> 512 12-15-95 3:42p
212
212
+
</div>
213
213
+
<div class="file-line">4 File(s) 26,112 bytes</div>
214
214
+
<div class="file-line">524,288 bytes free</div>
215
215
+
</div>
216
216
+
217
217
+
<p class="prompt">C:\PLASTIC> PLASTIC.EXE</p>
218
218
+
219
219
+
<pre class="ascii-art">
220
220
+
██████╗ ██╗ █████╗ ███████╗████████╗██╗ ██████╗
221
221
+
██╔══██╗██║ ██╔══██╗██╔════╝╚══██╔══╝██║██╔════╝
222
222
+
██████╔╝██║ ███████║███████╗ ██║ ██║██║
223
223
+
██╔═══╝ ██║ ██╔══██║╚════██║ ██║ ██║██║
224
224
+
██║ ███████╗██║ ██║███████║ ██║ ██║╚██████╗
225
225
+
╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═════╝</pre
226
226
+
>
227
227
+
228
228
+
<h2>System Information:</h2>
229
229
+
<p>PLASTIC v2.1 - Self-Modifying Code System</p>
230
230
+
<p>Copyright (C) 1995 DUNKIRK Corp.</p>
231
231
+
<p>
232
232
+
All rights reserved. Licensed to: REGISTERED USER under MIT
233
233
+
</p>
234
234
+
235
235
+
<div class="separator">
236
236
+
════════════════════════════════════════════════════════════
237
237
+
</div>
238
238
+
239
239
+
<h2>About This System:</h2>
240
240
+
<p>
241
241
+
PLASTIC.EXE is an experimental self-modifying executable
242
242
+
that allows real-time code injection and system
243
243
+
modification. WARNING: Use at your own risk. System may
244
244
+
become unstable.
245
245
+
</p>
246
246
+
247
247
+
<h2>Experimental Code Generator:</h2>
248
248
+
<p>Describe changes to make to the page:</p>
249
249
+
<textarea
250
250
+
class="editor"
251
251
+
id="codeEditor"
252
252
+
placeholder="e.g., 'Add a retro calculator widget', 'Change theme to green terminal', or 'Completely redesign as a DOS file manager'"
253
253
+
></textarea>
254
254
+
<div class="button" onclick="generateAndExecute()">
255
255
+
GENERATE & EXECUTE
256
256
+
</div>
257
257
+
<div class="button" onclick="clearEditor()">CLEAR</div>
258
258
+
<div
259
259
+
id="statusDisplay"
260
260
+
style="color: #000080; margin-top: 10px"
261
261
+
></div>
262
262
+
263
263
+
<h2>System Features:</h2>
264
264
+
<ul>
265
265
+
<li>
266
266
+
Real-time <span class="command">EXEC</span> code
267
267
+
modification
268
268
+
</li>
269
269
+
<li>Compatible with DOS 6.22 and Windows 95</li>
270
270
+
<li>640K memory optimized</li>
271
271
+
<li>No TSR conflicts detected</li>
272
272
+
<li>Supports EGA/VGA graphics modes</li>
273
273
+
</ul>
274
274
+
275
275
+
<h2>System Commands:</h2>
276
276
+
<p>
277
277
+
<span class="command">HELP</span>
278
278
+
<span class="command">DIR</span>
279
279
+
<span class="command">EDIT</span>
280
280
+
<span class="command">RUN</span>
281
281
+
<span class="command">EXIT</span>
282
282
+
</p>
283
283
+
284
284
+
<div class="separator">
285
285
+
════════════════════════════════════════════════════════════
286
286
+
</div>
287
287
+
288
288
+
<p>Runtime: 00:13:37 | Memory: 589K free | CPU: 80486DX-33</p>
289
289
+
<p class="error">
290
290
+
WARNING: Unauthorized modification may corrupt system files
291
291
+
</p>
292
292
+
293
293
+
<p class="prompt">C:\PLASTIC> <span class="cursor">_</span></p>
294
294
+
</div>
295
295
+
296
296
+
<div class="status-bar">
297
297
+
<span>F1=Help F2=Save F3=Load F10=Menu</span>
298
298
+
<span>12:34 PM</span>
299
299
+
</div>
300
300
+
</div>
301
301
+
302
302
+
<script>
303
303
+
async function generateAndExecute() {
304
304
+
const userPrompt = document.getElementById("codeEditor").value;
305
305
+
const statusDiv = document.getElementById("statusDisplay");
306
306
+
307
307
+
if (userPrompt.trim() === "") {
308
308
+
statusDiv.textContent = "ERROR: No description provided";
309
309
+
return;
310
310
+
}
311
311
+
312
312
+
statusDiv.textContent = "CONNECTING TO AI SYSTEM...";
313
313
+
314
314
+
try {
315
315
+
const currentPageHTML = document.documentElement.outerHTML;
316
316
+
317
317
+
const response = await fetch(
318
318
+
"https://ai.hackclub.com/chat/completions",
319
319
+
{
320
320
+
method: "POST",
321
321
+
headers: {
322
322
+
"Content-Type": "application/json",
323
323
+
},
324
324
+
body: JSON.stringify({
325
325
+
messages: [
326
326
+
{
327
327
+
role: "user",
328
328
+
content: `Here is the current HTML page:\n\n${currentPageHTML}\n\nUser request: "${userPrompt}"\n\nGenerate HTML code that fits the DOS/retro terminal aesthetic for this request. Use flat colors like #00ff41 (green), #ffff00 (yellow), #00ffff (cyan), #ffffff (white), #c0c0c0 (gray), #000080 (blue), and #ff0000 (red). Use monospace fonts and simple borders. Make it look like it belongs in a 1990s DOS program. Only return the HTML code to add, no explanations.`,
329
329
+
},
330
330
+
],
331
331
+
}),
332
332
+
},
333
333
+
);
334
334
+
335
335
+
if (!response.ok) {
336
336
+
throw new Error(
337
337
+
`HTTP ${response.status}: ${response.statusText}`,
338
338
+
);
339
339
+
}
340
340
+
341
341
+
statusDiv.textContent = "AI PROCESSING...";
342
342
+
343
343
+
const data = await response.json();
344
344
+
console.log("API Response:", data); // Debug log
345
345
+
346
346
+
let generatedCode;
347
347
+
if (
348
348
+
data.choices &&
349
349
+
data.choices[0] &&
350
350
+
data.choices[0].message
351
351
+
) {
352
352
+
generatedCode = data.choices[0].message.content;
353
353
+
} else if (data.content) {
354
354
+
generatedCode = data.content;
355
355
+
} else if (data.response) {
356
356
+
generatedCode = data.response;
357
357
+
} else if (typeof data === "string") {
358
358
+
generatedCode = data;
359
359
+
} else {
360
360
+
throw new Error("Unexpected API response format");
361
361
+
}
362
362
+
363
363
+
// Clean up the code (remove markdown formatting if present)
364
364
+
let cleanCode = generatedCode
365
365
+
.replace(/```html\n?/g, "")
366
366
+
.replace(/```\n?/g, "");
367
367
+
368
368
+
statusDiv.textContent = "INJECTING CODE...";
369
369
+
370
370
+
// Insert the generated code
371
371
+
document.querySelector(".content").innerHTML += cleanCode;
372
372
+
document.getElementById("codeEditor").value = "";
373
373
+
374
374
+
statusDiv.textContent = "CODE EXECUTION SUCCESSFUL";
375
375
+
376
376
+
// Clear status after 3 seconds
377
377
+
setTimeout(() => {
378
378
+
statusDiv.textContent = "";
379
379
+
}, 3000);
380
380
+
} catch (error) {
381
381
+
statusDiv.textContent = `SYSTEM ERROR: ${error.message}`;
382
382
+
console.error("Error:", error);
383
383
+
}
384
384
+
}
385
385
+
386
386
+
function clearEditor() {
387
387
+
document.getElementById("codeEditor").value = "";
388
388
+
document.getElementById("statusDisplay").textContent = "";
389
389
+
}
390
390
+
391
391
+
// Handle Ctrl+Enter in textarea
392
392
+
document.addEventListener("DOMContentLoaded", function () {
393
393
+
document
394
394
+
.getElementById("codeEditor")
395
395
+
.addEventListener("keydown", function (e) {
396
396
+
if (e.ctrlKey && e.key === "Enter") {
397
397
+
e.preventDefault();
398
398
+
generateAndExecute();
399
399
+
}
400
400
+
});
401
401
+
});
402
402
+
403
403
+
// Update time in status bar
404
404
+
setInterval(() => {
405
405
+
const now = new Date();
406
406
+
const timeStr = now.toLocaleTimeString([], {
407
407
+
hour: "2-digit",
408
408
+
minute: "2-digit",
409
409
+
});
410
410
+
const statusBarTime = document.querySelector(
411
411
+
".status-bar span:last-child",
412
412
+
);
413
413
+
if (statusBarTime) {
414
414
+
statusBarTime.textContent = timeStr;
415
415
+
}
416
416
+
}, 1000);
417
417
+
</script>
418
418
+
</body>
419
419
+
</html>