···
+
<meta charset="UTF-8" />
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
+
<title>C:\PLASTIC.EXE - Self-Modifying System</title>
+
@import url("https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&display=swap");
+
font-family: "Courier Prime", "Courier New", monospace;
+
border: 2px solid #808080;
+
inset -2px -2px #c0c0c0,
+
border-bottom: 1px solid #808080;
+
animation: blink 1s infinite;
+
text-transform: uppercase;
+
text-transform: uppercase;
+
border: 2px outset #c0c0c0;
+
text-transform: uppercase;
+
border: 2px inset #c0c0c0;
+
width: calc(100% - 20px);
+
border: 2px inset #c0c0c0;
+
border-top: 1px solid #808080;
+
justify-content: space-between;
+
<div class="title-bar">
+
C:\PLASTIC.EXE - [Self-Modifying System v2.1]
+
<p class="prompt">C:\PLASTIC> DIR</p>
+
<div class="file-listing">
+
<div class="file-line">
+
Volume in drive C is PLASTIC-SYS
+
<div class="file-line">Directory of C:\PLASTIC</div>
+
<div class="file-line"></div>
+
<div class="file-line">
+
<span class="dir">SYSTEM <DIR></span> 12-15-95
+
<div class="file-line">
+
<span class="exe">PLASTIC EXE</span> 24,576 12-15-95
+
<div class="file-line">
+
<span class="txt">README TXT</span> 1,024 12-15-95 3:42p
+
<div class="file-line">
+
<span class="txt">CONFIG SYS</span> 512 12-15-95 3:42p
+
<div class="file-line">4 File(s) 26,112 bytes</div>
+
<div class="file-line">524,288 bytes free</div>
+
<p class="prompt">C:\PLASTIC> PLASTIC.EXE</p>
+
<pre class="ascii-art">
+
██████╗ ██╗ █████╗ ███████╗████████╗██╗ ██████╗
+
██╔══██╗██║ ██╔══██╗██╔════╝╚══██╔══╝██║██╔════╝
+
██████╔╝██║ ███████║███████╗ ██║ ██║██║
+
██╔═══╝ ██║ ██╔══██║╚════██║ ██║ ██║██║
+
██║ ███████╗██║ ██║███████║ ██║ ██║╚██████╗
+
╚═╝ ╚══════╝╚═╝ ╚═╝╚══════╝ ╚═╝ ╚═╝ ╚═════╝</pre
+
<h2>System Information:</h2>
+
<p>PLASTIC v2.1 - Self-Modifying Code System</p>
+
<p>Copyright (C) 1995 DUNKIRK Corp.</p>
+
All rights reserved. Licensed to: REGISTERED USER under MIT
+
<div class="separator">
+
════════════════════════════════════════════════════════════
+
<h2>About This System:</h2>
+
PLASTIC.EXE is an experimental self-modifying executable
+
that allows real-time code injection and system
+
modification. WARNING: Use at your own risk. System may
+
<h2>Experimental Code Generator:</h2>
+
<p>Describe changes to make to the page:</p>
+
placeholder="e.g., 'Add a retro calculator widget', 'Change theme to green terminal', or 'Completely redesign as a DOS file manager'"
+
<div class="button" onclick="generateAndExecute()">
+
<div class="button" onclick="clearEditor()">CLEAR</div>
+
style="color: #000080; margin-top: 10px"
+
<h2>System Features:</h2>
+
Real-time <span class="command">EXEC</span> code
+
<li>Compatible with DOS 6.22 and Windows 95</li>
+
<li>640K memory optimized</li>
+
<li>No TSR conflicts detected</li>
+
<li>Supports EGA/VGA graphics modes</li>
+
<h2>System Commands:</h2>
+
<span class="command">HELP</span>
+
<span class="command">DIR</span>
+
<span class="command">EDIT</span>
+
<span class="command">RUN</span>
+
<span class="command">EXIT</span>
+
<div class="separator">
+
════════════════════════════════════════════════════════════
+
<p>Runtime: 00:13:37 | Memory: 589K free | CPU: 80486DX-33</p>
+
WARNING: Unauthorized modification may corrupt system files
+
<p class="prompt">C:\PLASTIC> <span class="cursor">_</span></p>
+
<div class="status-bar">
+
<span>F1=Help F2=Save F3=Load F10=Menu</span>
+
async function generateAndExecute() {
+
const userPrompt = document.getElementById("codeEditor").value;
+
const statusDiv = document.getElementById("statusDisplay");
+
if (userPrompt.trim() === "") {
+
statusDiv.textContent = "ERROR: No description provided";
+
statusDiv.textContent = "CONNECTING TO AI SYSTEM...";
+
const currentPageHTML = document.documentElement.outerHTML;
+
const response = await fetch(
+
"https://ai.hackclub.com/chat/completions",
+
"Content-Type": "application/json",
+
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.`,
+
`HTTP ${response.status}: ${response.statusText}`,
+
statusDiv.textContent = "AI PROCESSING...";
+
const data = await response.json();
+
console.log("API Response:", data); // Debug log
+
data.choices[0].message
+
generatedCode = data.choices[0].message.content;
+
} else if (data.content) {
+
generatedCode = data.content;
+
} else if (data.response) {
+
generatedCode = data.response;
+
} else if (typeof data === "string") {
+
throw new Error("Unexpected API response format");
+
// Clean up the code (remove markdown formatting if present)
+
let cleanCode = generatedCode
+
.replace(/```html\n?/g, "")
+
.replace(/```\n?/g, "");
+
statusDiv.textContent = "INJECTING CODE...";
+
// Insert the generated code
+
document.querySelector(".content").innerHTML += cleanCode;
+
document.getElementById("codeEditor").value = "";
+
statusDiv.textContent = "CODE EXECUTION SUCCESSFUL";
+
// Clear status after 3 seconds
+
statusDiv.textContent = "";
+
statusDiv.textContent = `SYSTEM ERROR: ${error.message}`;
+
console.error("Error:", error);
+
function clearEditor() {
+
document.getElementById("codeEditor").value = "";
+
document.getElementById("statusDisplay").textContent = "";
+
// Handle Ctrl+Enter in textarea
+
document.addEventListener("DOMContentLoaded", function () {
+
.getElementById("codeEditor")
+
.addEventListener("keydown", function (e) {
+
if (e.ctrlKey && e.key === "Enter") {
+
// Update time in status bar
+
const now = new Date();
+
const timeStr = now.toLocaleTimeString([], {
+
const statusBarTime = document.querySelector(
+
".status-bar span:last-child",
+
statusBarTime.textContent = timeStr;