0xab17…feaa

All memos sent from and to 0xab17…feaa.

// Initialization const typingSpeed = typingSpeeds[poemId - 1]; const context = contexts[poemId - 1]; const upscalePrompt = "black and white," + upscalePrompts[talismanId - 1] + ",metallic grain surface"; // This prompt should be used to upscale the talisman let animate = undefined; let isAnimateLoaded = import(`${arweaveGatewayURL}${animateURL}`) .then(() => { animate = Motion.animate; // Now you can use the animate function console.log("Successfully imported animate"); }) .catch((error) => console.error("Failed to import animate:", error)); console.log(codem); console.log("Is it a signed edition? " + isSignedEdition); // Font loading and initialization function initializeFonts() { const fontFaces = ` @font-face { font-family: "Font-Bold"; src: URL("${arweaveGatewayURL}${fontBoldURL}"); font-display: swap; } @font-face { font-family: "Font-Light"; src: URL("${arweaveGatewayURL}${fontLightURL}"); font-display: swap; } @font-face { font-family: "Braille"; src: URL("${arweaveGatewayURL}${fontBrailleURL}"); font-display: swap; } @font-face { font-family: "Silver-LQ"; src: URL("${arweaveGatewayURL}${fontSilverLQURL}"); font-display: swap; } @font-face { font-family: "Silver"; src: URL("${arweaveGatewayURL}${fontSilverURL}"); font-display: swap; } `; const style = document.createElement("style"); style.textContent = fontFaces; document.head.appendChild(style); const fonts = [ { name: "Silver", class: "HQ-font-loaded", url: `${arweaveGatewayURL}${fontSilverURL}`, }, { name: "Silver-LQ", class: "LQ-font-loaded", url: `${arweaveGatewayURL}${fontSilverLQURL}`, }, { name: "Font-Bold", class: "default-font-loaded", url: `${arweaveGatewayURL}${fontBoldURL}`, }, ]; // Start loading all fonts immediately fonts.forEach((font) => { new FontFace(font.name, `url(${font.url})`) .load() .then((loadedFont) => { document.fonts.add(loadedFont); console.log(`${font.name} loaded`); }) .catch((err) => console.error(`Failed to load ${font.name}:`, err)); }); function applyFont() { for (const font of fonts) { if (document.fonts.check(`12px "${font.name}"`)) { document.body.classList.add(font.class); console.log(`Applied ${font.name}`); return true; } } return false; } function checkAndApplyFonts() { if (applyFont()) return; const checkInterval = setInterval(() => { if (applyFont()) { clearInterval(checkInterval); } }, 50); document.fonts.ready.then(() => { applyFont(); clearInterval(checkInterval); }); } // Start checking for font availability immediately checkAndApplyFonts(); } // Call the font initialization function initializeFonts(); document.querySelector(".author").innerText = author; document.querySelector(".coverAuthor").innerText = "codem by " + author; document.querySelector(".context").innerText = context; document.querySelector(".code").innerText = codem; const talismanImg = new Image(); talismanImg.src = `${arweaveGatewayURL}${talismansURL}/${talismanId}.avif`; //`./images/talismans/avif/${talismanId}.avif`; talismanImg.alt = upscalePrompt; talismanImg.onload = () => { const talisman = document.querySelector(".talisman"); talisman.style.backgroundImage = `URL("${talismanImg.src}")`; talisman.setAttribute("aria-label", upscalePrompt); const coverTalisman = document.querySelector(".coverTalisman"); coverTalisman.style.backgroundImage = `URL("${talismanImg.src}")`; coverTalisman.setAttribute("aria-label", upscalePrompt); setFavicon(); }; talismanImg.onerror = () => { talismanImg.src = talismanLQURL; //`./images/talismans/lowres-avif/${talismanId}.avif`; }; // document.querySelector(".title").innerText = title; document.querySelector(".coverTitle").innerText = title; addSignature(); document.addEventListener("DOMContentLoaded", () => { console.log("window loaded"); const URLParams = new URLSearchParams(location.hash.substring(1)); if (URLParams.has("poem")) { toggleCover(0, false); console.log("Poem Mode Activated"); } else if ( !URLParams.has("cover") && !(typeof hl !== "undefined" && hl?.context?.previewMode) ) { setTimeout(() => toggleCover(1, true), 2000); console.log("Regular Mode Activated"); } else { console.log("Cover Mode Activated"); } document.body.onclick = () => toggleCover(0.4, true); }); function addSignature() { if (!isSignedEdition) { return; } const signature = document.createElement("div"); signature.classList.add("signature"); const signatureImg = new Image(); signatureImg.src = `${arweaveGatewayURL}${signatureImageURL}`; signatureImg.onload = () => { signature.style.backgroundImage = `URL("${signatureImg.src}")`; document.body.appendChild(signature); }; signatureImg.onerror = () => { signatureImg.src = signatureImageLQURL; document.body.appendChild(signature); }; } let worker; const outputDiv = document.querySelector(".console"); outputDiv.scrollTo = function () { var start = window.performance.now(); var from = outputDiv.scrollTop; var to = outputDiv.scrollHeight; var duration = 100; // adjust the duration to your liking function animateScroll(timestamp) { var progress = Math.min(1, (timestamp - start) / duration); outputDiv.scrollTop = from + (to - from) * progress; if (progress < 1) { requestAnimationFrame(animateScroll); } } requestAnimationFrame(animateScroll); }; let typingInProgress = false; let messageQueue = []; let typeInterval; function initWorker() { const workerCode = `let resolveUserInput; self.onmessage = async (event) => { if ( event.data.type === "promptAnswer" || event.data.type === "confirmAnswer" || event.data.type === "storageAnswer" ) { resolveUserInput(event.data.answer); } else { try { const code = event.data.code; const asyncFunction = new Function( "return async function() {" + code + "}" ); await asyncFunction()(); } catch (e) { console.log(e); } } }; console.log = (message) => { self.postMessage({ type: "consoleLog", message: message }); }; console.error = (error) => { console.log("ERROR: " + error.toString()); console.trace(error); }; console.warn = (warning) => { console.log("WARNING: " + warning); }; console.clear = () => { self.postMessage({ type: "consoleClear" }); }; prompt = (message) => { return new Promise((resolve) => { resolveUserInput = resolve; self.postMessage({ type: "prompt", message: message }); }); }; confirm = (message) => { return new Promise((resolve) => { resolveUserInput = resolve; self.postMessage({ type: "confirm", message: message }); }); }; Error = (error) => { console.log("Error: " + error.toString()); console.trace(error); }; localStorage = { getItem: (key) => { return new Promise((resolve) => { self.postMessage({ type: "localStorage", method: "getItem", key }); resolveUserInput = resolve; }); }, setItem: (key, value) => { return new Promise((resolve) => { self.postMessage({ type: "localStorage", method: "setItem", key, value }); }); }, }; `; const blob = new Blob([workerCode], { type: "application/javascript" }); const workerURL = URL.createObjectURL(blob); worker = new Worker(workerURL); worker.onmessage = async (event) => { if (event.data.type === "consoleLog") { messageQueue.push(event.data.message + String.fromCharCode(10)); if (!typingInProgress) { typeNextMessage(); } } else if (event.data.type === "consoleClear") { messageQueue = []; clearInterval(typeInterval); typingInProgress = false; outputDiv.innerText = ""; } else if (event.data.type === "prompt") { const answer = await customPrompt(event.data.message); worker.postMessage({ type: "promptAnswer", answer: answer }); } else if (event.data.type === "confirm") { const answer = await customConfirm(event.data.message); worker.postMessage({ type: "confirmAnswer", answer: answer }); } else if (event.data.type === "localStorage") { if (event.data.method === "getItem") { try { const value = localStorage.getItem(event.data.key); worker.postMessage({ type: "storageAnswer", answer: value }); } catch { worker.postMessage({ type: "storageAnswer", answer: "0" }); } } else if (event.data.method === "setItem") { localStorage.setItem(event.data.key, event.data.value); } } }; function typeNextMessage() { if (messageQueue.length === 0) return; typingInProgress = true; const message = messageQueue.shift(); if (typingSpeed) { let charIndex = 0; let previousScrollHeight = outputDiv.scrollHeight; typeInterval = setInterval(() => { outputDiv.innerHTML += message[charIndex]; charIndex++; // Check if the scroll height has increased, indicating a new line if (outputDiv.scrollHeight > previousScrollHeight) { outputDiv.scrollTop = outputDiv.scrollHeight; } previousScrollHeight = outputDiv.scrollHeight; if (charIndex >= message.length) { clearInterval(typeInterval); typingInProgress = false; typeNextMessage(); } }, typingSpeed); } else { outputDiv.innerHTML += message; outputDiv.scrollTop = outputDiv.scrollHeight; typingInProgress = false; typeNextMessage(); } } } async function runCode() { messageQueue = []; clearInterval(typeInterval); typingInProgress = false; outputDiv.innerText = ""; if (worker) { worker.terminate(); } initWorker(); worker.postMessage({ code: codem }); } window.runCode = runCode; document.addEventListener("keydown", (event) => { if ((event.metaKey || event.ctrlKey) && event.keyCode === 13) { // Cmd+Enter (or Ctrl+Enter on Windows) pressed, run the function runCode(); } }); let isCovered = true; window.toggleCover = async function toggleCover(duration, waitAnimate) { if (waitAnimate) { await isAnimateLoaded; } if ( arguments.length > 0 && arguments[0] && arguments[0].target && typeof arguments[0].target.closest === "function" ) { if (arguments[0].target.closest("dialog")) { // Click occurred on dialog, do nothing return; } } if ( document.querySelector("dialog").open || window.getSelection().toString() !== "" ) { // Dialog is open or user is selecting text, do nothing return; } console.log("toggling cover mode..."); isCovered = !isCovered; if (!isCovered) { setTimeout(() => runCode(), 500); } if (typeof animate !== "undefined") { animate( ".top, .bottom", { height: isCovered ? "0" : "50%", opacity: isCovered ? "0" : "100%", transform: isCovered ? "rotateX(-90deg)" : "rotateX(0)", }, { duration: duration, } ); animate( ".cover", { height: isCovered ? "100%" : "0", transform: isCovered ? "rotateX(0)" : "rotateX(90deg)", opacity: isCovered ? "100%" : "0", }, { duration: duration, } ); animate( " .coverTitle", { opacity: isCovered ? "100%" : "0", fontSize: isCovered ? "14dvmin" : "0", }, { duration: duration, } ); animate( " .coverAuthor", { fontSize: isCovered ? "1.5dvmax" : "0", opacity: isCovered ? "100%" : "0", }, { duration: duration, } ); animate( ".coverData", { opacity: isCovered ? "100%" : "0", }, { duration: duration, } ); } else { // Fallback: toggle the "open" class on the cover element console.log("animate library not available, moving to fallback"); document.body.classList.toggle("open"); } }; function setFavicon() { const link = document.createElement("link"); link.rel = "shortcut icon"; link.type = "image/avif"; link.href = talismanImg.src; document.getElementsByTagName("head")[0].appendChild(link); } // MODAL UTILITIES let modalResolve; window.customConfirm = function customConfirm(message) { document.getElementById("modalText").innerText = message; const dialog = document.querySelector("dialog"); dialog.showModal(); return new Promise((resolve) => { modalResolve = resolve; dialog.onkeydown = (event) => { if (event.key === "Enter") modalChoice(true); if (event.key === "Escape") modalChoice(false); }; }); }; window.customPrompt = function customPrompt(message) { document.getElementById("modalText").innerText = message; document.getElementById("modalInput").style.display = "block"; const dialog = document.querySelector("dialog"); dialog.showModal(); return new Promise((resolve) => { modalResolve = resolve; dialog.onkeydown = (event) => { if (event.key === "Enter") modalChoice(true); if (event.key === "Escape") modalChoice(false); }; }); }; window.modalChoice = function modalChoice(choice) { const dialog = document.querySelector("dialog"); dialog.onkeydown = null; // Remove the event listener if (document.getElementById("modalInput").style.display === "block") { modalResolve(document.getElementById("modalInput").value); document.getElementById("modalInput").style.display = "none"; document.getElementById("modalInput").value = ""; } else { modalResolve(choice); } dialog.close(); event.stopPropagation(); // Add this line };
upscalePrompts.txt-1[ "silver, metallic Vitruvian man/woman androgyne standing in a circle and square, seen from the back", "metallic silver candy wrapped tightly with twisted ends", "stylized metallic cat sculpture arching its back in a stretching pose", "square metallic tray or container with rounded corners and a ridged surface pattern", "bed sheets made of metal arranged in a cube sculpture with fluid, wavy surfaces that distort its geometric shape", "metallic clay, multi-layered flower or succulent-like structure with intricate petal shapes and a dark center", "tilted square frame composed of concentric diamond shapes, transitioning from black on the outside to white in the center", "silver handheld game console, featuring a directional pad, buttons, and a central square screen", "smooth, three-dimensional heart shape", "ornate set of three antique-style keys hanging from a circular ring, with elaborate diamond-shaped handles and long stems", "Nahiko's mask", //hopefully famous enough by then "raspberry", "A spiral mechanical structure with radiating spokes, resembling a futuristic gear or abstract nautilus shell", "fluid metallic form with multiple undulating surfaces and protrusions, creating a dynamic and organic shape,", "circular arrangement of DNA-like helices forming a flower or star shape, with each strand composed of metallic segments and gaps", "circular composition split vertically, with the left half a light gray sphere and the right half a dark gray sphere, creating a yin-yang-like contrast effect", "silver olive branch with intricate details", "peace symbol with a wavy surface", "crescent moon shape with a textured, metallic detailed and creased surface, displaying variations in light and shadow", "stylized silver crown with four pointed peaks, each topped with a small sphere, debossed symbols, rendered with a reflective, slightly distorted", "circular organic metallic object with evenly spaced radial rods around its circumference, resembling a gear or a stylized sun", "puzzle piece made of a creased, reflective metal, with a textured surface creating an illusion of depth and movement", "metallic disc with concentric circular ridges radiating from the center outward, creating a bullseye or ripple effect,wavy", "3D rubik's cube with a wavy,soft, molten", "simple, worn-down, smooth metal ring photographed from above, with subtle light reflections on its", "three metallic four-pointed stars of different sizes, with a scratched, worn-down", "USB drive or similar storage device.'Ledger' debossed on it", "soft baby building block for teething, clayish surface,'E' and '1' embossed", "United Nations laissez-passer document", "conference wristband with 'SPEAKER' embossed", "security camera mounted on a wall bracket", "blister pack of pills with oval-shaped capsules", "antique, worn-down silver coin depicting a barely visible deer", "ornate circular chinese metal coin with dragons encircling a square hole in the center", "ancient silver coin featuring the Ethereum logo radiating outward in a sunburst pattern", "weathered silver coin or medallion with 'ERC 721' debossed on its", ]
signature.avif-1data:image/avif;base64,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
// Initialization const typingSpeed = typingSpeeds[poemId - 1]; const context = contexts[poemId - 1]; const upscalePrompt = "black and white," + upscalePrompts[talismanId - 1] + ",metallic grain surface"; // This prompt should be used to upscale the talisman let animate = undefined; let isAnimateLoaded = import(`${arweaveGatewayURL}${animateURL}`) .then(() => { animate = Motion.animate; // Now you can use the animate function console.log("Successfully imported animate"); }) .catch((error) => console.error("Failed to import animate:", error)); console.log(codem); console.log("Is it a signed edition? " + isSignedEdition); // Font loading and initialization function initializeFonts() { const fontFaces = ` @font-face { font-family: "Font-Bold"; src: URL("${arweaveGatewayURL}${fontBoldURL}"); font-display: swap; } @font-face { font-family: "Font-Light"; src: URL("${arweaveGatewayURL}${fontLightURL}"); font-display: swap; } @font-face { font-family: "Braille"; src: URL("${arweaveGatewayURL}${fontBrailleURL}"); font-display: swap; } @font-face { font-family: "Silver-LQ"; src: URL("${arweaveGatewayURL}${fontSilverLQURL}"); font-display: swap; } @font-face { font-family: "Silver"; src: URL("${arweaveGatewayURL}${fontSilverURL}"); font-display: swap; } `; const style = document.createElement("style"); style.textContent = fontFaces; document.head.appendChild(style); const fonts = [ { name: "Silver", class: "HQ-font-loaded", url: `${arweaveGatewayURL}${fontSilverURL}`, }, { name: "Silver-LQ", class: "LQ-font-loaded", url: `${arweaveGatewayURL}${fontSilverLQURL}`, }, { name: "Font-Bold", class: "default-font-loaded", url: `${arweaveGatewayURL}${fontBoldURL}`, }, ]; // Start loading all fonts immediately fonts.forEach((font) => { new FontFace(font.name, `url(${font.url})`) .load() .then((loadedFont) => { document.fonts.add(loadedFont); console.log(`${font.name} loaded`); }) .catch((err) => console.error(`Failed to load ${font.name}:`, err)); }); function applyFont() { for (const font of fonts) { if (document.fonts.check(`12px "${font.name}"`)) { document.body.classList.add(font.class); console.log(`Applied ${font.name}`); return true; } } return false; } function checkAndApplyFonts() { if (applyFont()) return; const checkInterval = setInterval(() => { if (applyFont()) { clearInterval(checkInterval); } }, 50); document.fonts.ready.then(() => { applyFont(); clearInterval(checkInterval); }); } // Start checking for font availability immediately checkAndApplyFonts(); } // Call the font initialization function initializeFonts(); document.querySelector(".author").innerText = author; document.querySelector(".coverAuthor").innerText = "codem by " + author; document.querySelector(".context").innerText = context; document.querySelector(".code").innerText = codem; const talismanImg = new Image(); talismanImg.src = `${arweaveGatewayURL}${talismansURL}/${talismanId}.avif`; //`./images/talismans/avif/${talismanId}.avif`; talismanImg.alt = upscalePrompt; talismanImg.onload = () => { const talisman = document.querySelector(".talisman"); talisman.style.backgroundImage = `URL("${talismanImg.src}")`; talisman.setAttribute("aria-label", upscalePrompt); const coverTalisman = document.querySelector(".coverTalisman"); coverTalisman.style.backgroundImage = `URL("${talismanImg.src}")`; coverTalisman.setAttribute("aria-label", upscalePrompt); setFavicon(); }; talismanImg.onerror = () => { talismanImg.src = talismanLQURL; //`./images/talismans/lowres-avif/${talismanId}.avif`; }; // document.querySelector(".title").innerText = title; document.querySelector(".coverTitle").innerText = title; addSignature(); document.addEventListener("DOMContentLoaded", () => { console.log("window loaded"); const URLParams = new URLSearchParams(window.location.search); if (URLParams.has("poem")) { toggleCover(0, false); } else if ( !URLParams.has("cover") && !(typeof hl !== "undefined" && hl?.context?.previewMode) ) { setTimeout(() => toggleCover(1, true), 2000); } document.body.onclick = () => toggleCover(0.4, true); }); function addSignature() { if (!isSignedEdition) { return; } const signature = document.createElement("div"); signature.classList.add("signature"); const signatureImg = new Image(); signatureImg.src = `${arweaveGatewayURL}${signatureImageURL}`; signatureImg.onload = () => { signature.style.backgroundImage = `URL("${signatureImg.src}")`; document.body.appendChild(signature); }; signatureImg.onerror = () => { signatureImg.src = signatureImageLQURL; document.body.appendChild(signature); }; } let worker; const outputDiv = document.querySelector(".console"); outputDiv.scrollTo = function () { var start = window.performance.now(); var from = outputDiv.scrollTop; var to = outputDiv.scrollHeight; var duration = 100; // adjust the duration to your liking function animateScroll(timestamp) { var progress = Math.min(1, (timestamp - start) / duration); outputDiv.scrollTop = from + (to - from) * progress; if (progress < 1) { requestAnimationFrame(animateScroll); } } requestAnimationFrame(animateScroll); }; let typingInProgress = false; let messageQueue = []; let typeInterval; function initWorker() { const workerCode = `let resolveUserInput; self.onmessage = async (event) => { if ( event.data.type === "promptAnswer" || event.data.type === "confirmAnswer" || event.data.type === "storageAnswer" ) { resolveUserInput(event.data.answer); } else { try { const code = event.data.code; const asyncFunction = new Function( "return async function() {" + code + "}" ); await asyncFunction()(); } catch (e) { console.log(e); } } }; console.log = (message) => { self.postMessage({ type: "consoleLog", message: message }); }; console.error = (error) => { console.log("ERROR: " + error.toString()); console.trace(error); }; console.warn = (warning) => { console.log("WARNING: " + warning); }; console.clear = () => { self.postMessage({ type: "consoleClear" }); }; prompt = (message) => { return new Promise((resolve) => { resolveUserInput = resolve; self.postMessage({ type: "prompt", message: message }); }); }; confirm = (message) => { return new Promise((resolve) => { resolveUserInput = resolve; self.postMessage({ type: "confirm", message: message }); }); }; Error = (error) => { console.log("Error: " + error.toString()); console.trace(error); }; localStorage = { getItem: (key) => { return new Promise((resolve) => { self.postMessage({ type: "localStorage", method: "getItem", key }); resolveUserInput = resolve; }); }, setItem: (key, value) => { return new Promise((resolve) => { self.postMessage({ type: "localStorage", method: "setItem", key, value }); }); }, }; `; const blob = new Blob([workerCode], { type: "application/javascript" }); const workerURL = URL.createObjectURL(blob); worker = new Worker(workerURL); worker.onmessage = async (event) => { if (event.data.type === "consoleLog") { messageQueue.push(event.data.message + String.fromCharCode(10)); if (!typingInProgress) { typeNextMessage(); } } else if (event.data.type === "consoleClear") { messageQueue = []; clearInterval(typeInterval); typingInProgress = false; outputDiv.innerText = ""; } else if (event.data.type === "prompt") { const answer = await customPrompt(event.data.message); worker.postMessage({ type: "promptAnswer", answer: answer }); } else if (event.data.type === "confirm") { const answer = await customConfirm(event.data.message); worker.postMessage({ type: "confirmAnswer", answer: answer }); } else if (event.data.type === "localStorage") { if (event.data.method === "getItem") { try { const value = localStorage.getItem(event.data.key); worker.postMessage({ type: "storageAnswer", answer: value }); } catch { worker.postMessage({ type: "storageAnswer", answer: "0" }); } } else if (event.data.method === "setItem") { localStorage.setItem(event.data.key, event.data.value); } } }; function typeNextMessage() { if (messageQueue.length === 0) return; typingInProgress = true; const message = messageQueue.shift(); if (typingSpeed) { let charIndex = 0; let previousScrollHeight = outputDiv.scrollHeight; typeInterval = setInterval(() => { outputDiv.innerHTML += message[charIndex]; charIndex++; // Check if the scroll height has increased, indicating a new line if (outputDiv.scrollHeight > previousScrollHeight) { outputDiv.scrollTop = outputDiv.scrollHeight; } previousScrollHeight = outputDiv.scrollHeight; if (charIndex >= message.length) { clearInterval(typeInterval); typingInProgress = false; typeNextMessage(); } }, typingSpeed); } else { outputDiv.innerHTML += message; outputDiv.scrollTop = outputDiv.scrollHeight; typingInProgress = false; typeNextMessage(); } } } async function runCode() { messageQueue = []; clearInterval(typeInterval); typingInProgress = false; outputDiv.innerText = ""; if (worker) { worker.terminate(); } initWorker(); worker.postMessage({ code: codem }); } window.runCode = runCode; document.addEventListener("keydown", (event) => { if ((event.metaKey || event.ctrlKey) && event.keyCode === 13) { // Cmd+Enter (or Ctrl+Enter on Windows) pressed, run the function runCode(); } }); let isCovered = true; window.toggleCover = async function toggleCover(duration, waitAnimate) { if (waitAnimate) { await isAnimateLoaded; } if ( arguments.length > 0 && arguments[0] && arguments[0].target && typeof arguments[0].target.closest === "function" ) { if (arguments[0].target.closest("dialog")) { // Click occurred on dialog, do nothing return; } } if ( document.querySelector("dialog").open || window.getSelection().toString() !== "" ) { // Dialog is open or user is selecting text, do nothing return; } console.log("toggling cover mode..."); isCovered = !isCovered; if (!isCovered) { setTimeout(() => runCode(), 500); } if (typeof animate !== "undefined") { animate( ".top, .bottom", { height: isCovered ? "0" : "50%", opacity: isCovered ? "0" : "100%", transform: isCovered ? "rotateX(-90deg)" : "rotateX(0)", }, { duration: duration, } ); animate( ".cover", { height: isCovered ? "100%" : "0", transform: isCovered ? "rotateX(0)" : "rotateX(90deg)", opacity: isCovered ? "100%" : "0", }, { duration: duration, } ); animate( " .coverTitle", { opacity: isCovered ? "100%" : "0", fontSize: isCovered ? "14dvmin" : "0", }, { duration: duration, } ); animate( " .coverAuthor", { fontSize: isCovered ? "1.5dvmax" : "0", opacity: isCovered ? "100%" : "0", }, { duration: duration, } ); animate( ".coverData", { opacity: isCovered ? "100%" : "0", }, { duration: duration, } ); } else { // Fallback: toggle the "open" class on the cover element console.log("animate library not available, moving to fallback"); document.body.classList.toggle("open"); } }; function setFavicon() { const link = document.createElement("link"); link.rel = "shortcut icon"; link.type = "image/avif"; link.href = talismanImg.src; document.getElementsByTagName("head")[0].appendChild(link); } // MODAL UTILITIES let modalResolve; window.customConfirm = function customConfirm(message) { document.getElementById("modalText").innerText = message; const dialog = document.querySelector("dialog"); dialog.showModal(); return new Promise((resolve) => { modalResolve = resolve; dialog.onkeydown = (event) => { if (event.key === "Enter") modalChoice(true); if (event.key === "Escape") modalChoice(false); }; }); }; window.customPrompt = function customPrompt(message) { document.getElementById("modalText").innerText = message; document.getElementById("modalInput").style.display = "block"; const dialog = document.querySelector("dialog"); dialog.showModal(); return new Promise((resolve) => { modalResolve = resolve; dialog.onkeydown = (event) => { if (event.key === "Enter") modalChoice(true); if (event.key === "Escape") modalChoice(false); }; }); }; window.modalChoice = function modalChoice(choice) { const dialog = document.querySelector("dialog"); dialog.onkeydown = null; // Remove the event listener if (document.getElementById("modalInput").style.display === "block") { modalResolve(document.getElementById("modalInput").value); document.getElementById("modalInput").style.display = "none"; document.getElementById("modalInput").value = ""; } else { modalResolve(choice); } dialog.close(); event.stopPropagation(); // Add this line };
html, body { background: black; width: 100%; height: 100%; font-size: 1.6dvmax; position: relative; margin: 0; color: white; overflow: hidden; font-variant-ligatures: none; font-weight: 300; } .LQ-font-loaded .title, .LQ-font-loaded .coverTitle { font-family: "Silver-lq", "Font-Bold", sans-serif; -webkit-filter: brightness(1.2) contrast(1.2) url(#Sharpen); filter: brightness(1.2) contrast(1.2) url(#Sharpen); } .HQ-font-loaded .title, .HQ-font-loaded .coverTitle { font-family: "Silver", "Silver-lq", "Font-Bold", sans-serif; -webkit-filter: brightness(1.2) contrast(1.2) url(#Sharpen); filter: brightness(1.2) contrast(1.2) url(#Sharpen); } body { box-sizing: border-box; display: flex; flex-direction: column; gap: 1dvmax; padding: 7dvmax; font-family: "Font-Light", sans-serif; font-optical-sizing: auto; font-style: normal; perspective: 200dvmax; } .cover { display: flex; flex-direction: column; width: 100%; height: 100%; text-align: center; justify-content: center; /* This centers content vertically */ align-items: center; /* This centers content horizontally */ } .talisman, .coverTalisman { background-size: contain; background-repeat: no-repeat; background-position: center; width: 100%; height: 100%; mix-blend-mode: lighten; position: relative; } .metadata { display: flex; flex-direction: column; } .metadataContainer { display: flex; flex-direction: column; gap: 2dvmax; width: 100%; justify-content: center; align-items: center; position: relative; overflow: visible; } .title, .coverTitle { font-family: "Silver", "Silver-lq", "Font-Bold", sans-serif; margin-top: -1dvmax; filter: brightness(1.2) contrast(1.2); font-weight: bold; } .title { font-size: 5.5dvmax; text-align: left; } .coverTitle { text-align: center; font-size: 13dvmin; } .author { font-size: 2.1dvmax; } .metadata > .container { flex-direction: column; gap: 0.5dvmax; height: auto; } .container { display: flex; box-sizing: border-box; height: calc(50% - 1dvmax); gap: 1.5dvmax; } .obfuscated { font-family: "Braille", sans-serif; } .code { text-align: justify; font-size: 1.4dvmax; text-align-last: justify; margin: 0; padding-left: 0; height: 100%; } .context { font-size: 1.4dvmax; } .signature { background-size: contain; width: 15dvmax; height: 7dvmax; background-repeat: no-repeat; background-position: center; position: absolute; bottom: 4dvmax; right: 2dvmax; } .tile { overflow-y: scroll; width: 100%; height: 100%; border-radius: 1dvmax; padding: 2.5dvmax; box-sizing: border-box; transition: flex-grow 0.2s; color: rgba(255, 255, 255, 1); } .scrollArea { overflow: auto; -webkit-overflow-scrolling: touch; } /* Hide scrollbar for Chrome, Safari and Opera */ .scrollArea::-webkit-scrollbar { display: none; width: 0; height: 0; } /* Hide scrollbar for IE, Edge and Firefox */ .scrollArea, .tile { -ms-overflow-style: none; /* IE and Edge */ scrollbar-width: none; /* Firefox */ } /* Additional Safari-specific rule */ @supports (-webkit-overflow-scrolling: touch) { .scrollArea { overflow: auto; -webkit-overflow-scrolling: touch; } } .right { font-family: "Font-Bold", sans-serif; font-weight: bold; } .console { white-space: pre-line; word-wrap: break-word; height: 100%; } .tile > span { width: 100%; text-align: left; word-break: break-word; overflow-wrap: break-word; } .coverData { width: calc(100% - 12dvmax); height: calc(100% - 12dvmax); position: absolute; top: 0; left: 0; margin: 6dvmax; user-select: none; pointer-events: none; } .data:first-child { position: absolute; top: 0; left: 0; /* top left corner */ } .data:nth-child(2) { position: absolute; top: 0; right: 0; /* top right corner */ } .data:nth-child(3) { position: absolute; bottom: 0; left: 0; /* bottom left corner */ } .data:last-child { position: absolute; bottom: 0; right: 0; /* bottom right corner */ } .cover { position: relative; } .left, .right { position: relative; } .top, .bottom { height: 0; opacity: 0; } @media (max-aspect-ratio: 3/4) { body { display: flex; flex-direction: column; height: 100vh; text-align: center; overflow: auto; padding: 4dvmax; } html { overflow: auto; } .coverData { margin: 4dvmax; width: calc(100% - 8dvmax); height: calc(100% - 8dvmax); } .covered > .coverTalisman { height: 50%; } .title, .coverTitle { text-align: center; } .coverTitle { font-size: 10dvmax !important; } .container { flex-direction: column-reverse; } .metadata > .container { margin-left: 0; align-items: center; } .talisman { margin-right: 0; background-position: center; } .metadata { height: auto; margin-bottom: 4dvmax; order: 2; } .left { order: 2; } .tile { height: 50%; } } .open > .cover, .open > .coverData { opacity: 0; } .open > .cover { height: 0; } .open > .top, .open > .bottom { height: 50%; opacity: 1; } .cover > .top { flex-direction: column-reverse; height: 100%; text-align: center; padding: 5dvmax; gap: 3dvmax; } dialog { padding: 1rem; display: flex; flex-direction: column; gap: 0.8rem; width: 30dvmax; background: white; border: 1px solid #ccc; border-radius: 4px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); } dialog::backdrop { background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(2px); } #modalText { margin: 0; } .buttons { display: flex; gap: 0.3rem; justify-content: right; } dialog:not([open]) { display: none; }
description.txt-1Zima is a collection of code poems (poems written in javascript) running inside the NFT, and paired with beautiful talismans. It is built in public, stored onchain (HQ files on arweave) and uses web techniques (like localStorage, Unicode, Memory leaks, etc.) meaningfully paired with the poem
[ "Playing soccer with doggy", "Right after sparring", "Reading HunterxHunter", "Sitting at my desk", "Having a beer with friends", "Reading One Piece", "Walking the dog", "Sitting at my desk", "Enjoying the sun", "Chatting with wifey", "Chatting with Claude", "Listening to: Don't Dream It's Over", "On the road", "Watching Monsters on Netflix", "During lunch break", "Chatting with Claude", "On the train to Paris", "Thinking of Sam", "Procrastinating", "Sitting at my desk", "Looking back", "Watching Underscore on Youtube", "Preparing my Newsletter", "Going through JS docs", "Dancing at my desk", "Chatting with Claude", "Procrastinating", "Lulling E. to sleep", "Watching youtube", "Coding", "Lulling E. to sleep", "Getting a haircut", "Calling a friend" ]
HTMLStart.html-1<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>Zima</title> <meta name="description" content="" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <script type="module">
</style> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="0%" height="0%" > <filter id="Sharpen"> <feConvolveMatrix order="3 3" preserveAlpha="true" kernelMatrix="0 -1 0 -1 8 -1 0 -1 0"/> </svg> </head> <body> <div class="cover covered"> <div class="coverTalisman"></div> <div class="coverTitle"></div> <div class="coverAuthor obfuscated"></div> </div> <div class="coverData"> <div class="data">NAHIKO MIKASA</div> <div class="data obfuscated">ETHEREUM</div> <div class="data obfuscated">CODEMS</div> <div class="data">ZIMA</div> </div> <div class="top container"> <div class="metadataContainer"> <div class="metadata"> <div class="title"></div> <div class="container"> <div class="author"></div> <div class="context obfuscated"></div> </div> </div> </div> <div class="talisman"></div> </div> <div class="bottom container"> <div class="left tile"> <div class="code scrollArea obfuscated"></div> </div> <div class="right tile"> <div class="console scrollArea"></div> </div> </div> <dialog> <p id="modalText"></p> <input type="text" id="modalInput" style="display: none;"> <div class="buttons"> <button onclick="modalChoice(true)">OK</button> <button onclick="modalChoice(false)">Cancel</button> </div> </dialog> </body> </html>
let t = 0, bond = 0; const width = 60, height = 15; function drawWave(amp, freq) { let wave = Array(height) .fill() .map(() => Array(width).fill(" ")); for (let x = 0; x < width; x++) { let y = Math.floor(height / 2 + amp * Math.sin((freq * x * Math.PI) / 30)); if (y >= 0 && y < height) wave[y][x] = "*"; } console.clear(); wave.forEach((row) => console.log(row.join(""))); } function evolve() { t += 0.1; bond += Math.sin(t) * 0.1; let amp = Math.abs(bond) * (height / 4) + 1; let freq = (Math.sin(t / 10) + 2) * 3; // Increased multiplier for more cycles drawWave(amp, freq); } setInterval(evolve, 100);
let evolvedString = ""; let targetString = 'console.log("Hello world")'; let iterations = 100000; let score = 0; const validChars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890;?!:=^*ù%$°&#@<>€ .(")'; function generateChar(index) { return Math.random() < 0.5 ? validChars[Math.floor(Math.random() * validChars.length)] : evolvedString[index] || " "; } function levenshteinDistance(a, b) { if (a.length === 0) return b.length; if (b.length === 0) return a.length; let matrix = []; for (let i = 0; i <= b.length; i++) matrix[i] = [i]; for (let j = 0; j <= a.length; j++) matrix[0][j] = j; for (let i = 1; i <= b.length; i++) { for (let j = 1; j <= a.length; j++) { if (b.charAt(i - 1) === a.charAt(j - 1)) { matrix[i][j] = matrix[i - 1][j - 1]; } else { matrix[i][j] = Math.min( matrix[i - 1][j - 1] + 1, matrix[i][j - 1] + 1, matrix[i - 1][j] + 1 ); } } } return matrix[b.length][a.length]; } for (let i = 0; i < iterations; i++) { let newString = ""; for (let j = 0; j < targetString.length; j++) { newString += evolvedString[j] === targetString[j] ? evolvedString[j] : generateChar(j); } evolvedString = newString; score = targetString.length - levenshteinDistance(evolvedString, targetString); console.log(evolvedString + " (Score: " + score + ")"); if (evolvedString === targetString) { console.log("Hello Friend"); break; } }
Sconst lifeEvents = [ "I was born in a tiny town, barely on the map.", "On my first day of school, I clutched my lunchbox nervously.", "Years later, that smile gave me my first taste of puppy love.", "At graduation, I felt on top of the world, ready for anything.", "My first diner paycheck made me feel rich beyond my wildest dreams.", "Before I knew it, I was walking down the aisle, my heart racing.", "When they placed that squirming bundle in my arms, my world changed forever.", "One day, the boss surprised me with an unexpected promotion.", "At my retirement party, I realized how much I'd miss the daily grind.", "Holding my grandbaby, I saw life's whole cycle in those tiny eyes.", ]; class MemorySimulator { constructor(events) { this.Mind = new Map(); events.forEach((event) => { if (event.includes("bundle")) { this.Mind.set(event, { content: event }); } else { this.Mind.set(event, new WeakRef({ content: event })); } }); this.start(); } start() { if (this.timer) return; const tick = () => { console.clear(); console.log("My Life:"); console.log("----------------"); this.Mind.forEach((memoryRef, event) => { if (memoryRef instanceof WeakRef) { const memory = memoryRef.deref(); if (memory === undefined) { console.log("..."); this.Mind.delete(event); } else if (memory.content === null) { console.log("null"); } else { console.log(memory.content); } } else { console.log(memoryRef.content); } }); // Encourage garbage collection of random weak memories this.Mind.forEach((memoryRef, event) => { if (memoryRef instanceof WeakRef && Math.random() < 0.1) { const memory = memoryRef.deref(); if (memory && memory.content !== null) { memory.content = null; } } }); if (this.Mind.size === 1) { console.log("But the most important remains..."); this.stop(); } }; tick(); this.timer = setInterval(tick, 1000); } stop() { if (this.timer) { clearInterval(this.timer); this.timer = 0; } } } const simulator = new MemorySimulator(lifeEvents); function createMemoryPressure() { let array = new Array(10000000).fill("force gc"); array = null; for (let i = 0; i < 10; i++) { let obj = {}; for (let j = 0; j < 100000; j++) { obj["key" + j] = "value" + j; } obj = null; } } setInterval(createMemoryPressure, 10000);
function LoveMeLoveMeNot() { const daisy = { petals: 7, pluck: () => daisy.petals--, }; while (daisy.petals > 1) { daisy.petals % 2 ? console.log("Loves me") : console.log("Loves me not"); daisy.pluck(); } console.log(answer); let answer = daisy.petals === 1 ? "Loves me!" : "Loves me not..."; } LoveMeLoveMeNot();
async function burnoutSymphony() { const stages = [ "Enthusiasm", "Stagnation", "Frustration", "Apathy", "Burnout", ]; let energy = 100, passion = 100, time = 0; const name = (await prompt("Enter your name: ")) || "Anonymous"; console.log(name + "'s Burnout Symphony begins..."); while (energy > 0 && passion > 0) { await new Promise((resolve) => setTimeout(resolve, 500)); time++; energy = Math.max(0, energy - Math.random() * 5); passion = Math.max(0, passion - Math.random() * 3); const stage = stages[Math.min(4, Math.floor((100 - energy) / 20))]; const bar = "█".repeat(Math.ceil(energy / 10)) + "░".repeat(10 - Math.ceil(energy / 10)); console.clear(); console.log(name + "'s Burnout Symphony - Movement " + time); console.log("Stage: " + stage); console.log("Energy: [" + bar + "] " + Math.ceil(energy) + "%"); console.log("Passion: " + passion.toFixed(2) + "%"); console.log("♫".repeat(Math.ceil(passion / 10))); if ( time % 10 === 0 && (await prompt("Type 'rest' to take a break: ")) === "rest" ) { energy = Math.min(100, energy + 20); passion = Math.min(100, passion + 10); console.log("You took a refreshing break!"); } } console.log(name + "'s Burnout Symphony has ended. The audience is silent."); } burnoutSymphony();
function loveWorkBalance(depth = 0) { const indent = " ".repeat(depth); depth < 10 ? (console.log(indent + "Ambition || Family"), loveWorkBalance(depth + 1)) : depth < 20 ? (console.log(indent + "Work || Love"), loveWorkBalance(depth + 1)) : depth < 30 ? (console.log(indent + "Success || Happiness"), loveWorkBalance(depth + 1)) : depth < 40 ? (console.log(indent + "Balance || Imbalance"), loveWorkBalance(depth + 1)) : loveWorkBalance(depth + 1); } loveWorkBalance();
function digitalPetitPrince() { const domains = [ "rose", "fox", "planet", "star", "friend", "baobab", "sheep", "laugh", "sunset", "well", "asteroid", "journey", ]; const tlds = [".com", ".org", ".net", ".io", ".space"]; const emojis = ["🌍", "🪐", "👋", "🤝", "🌟", "💔", "🚀"]; const quotes = [ "What is essential is invisible to the eye.", "You become responsible, forever, for what you have tamed.", "All grown-ups were once children... but only few of them remember it.", "It is only with the heart that one can see rightly.", "Where are the people? It's a little lonely in the desert...", ]; const random = (arr) => arr[Math.floor(Math.random() * arr.length)]; async function visitPlanet() { const domain = random(domains) + (Math.random() < 0.3 ? "-" + random(domains) : "") + random(tlds); console.log("\\n" + random(emojis) + " The Little Prince visits " + domain); try { const response = await fetch("https://" + domain, { method: "GET", mode: "no-cors", }); console.log( response.ok ? '👋 "Hello," said the Little Prince to ' + domain + "." : "😢 The planet " + domain + " was silent." ); } catch { console.log("❌ The Prince encountered a mystery."); } if (Math.random() < 0.4) console.log('\\n🌹 "' + random(quotes) + '"'); console.log("---"); } (async function exploreUniverse() { while (true) { await visitPlanet(); await new Promise((resolve) => setTimeout(resolve, Math.random() * 3000 + 1000) ); } })(); } digitalPetitPrince();
let CryptoBro = { [Symbol.toPrimitive](hint) { return hint === "string" ? "Just bought a Lambo with my $DOGE gains! 🚀🌕" : -2749.99; }, }; console.log('"' + String(CryptoBro) + '"'); console.error("Uncaught Reality: " + CryptoBro + "$");
const infiniteLibrary = async () => { // Define the character set const asciiChars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 .,!?"-\\''; const emojis = '😀😂🤣😊😍🥰😎'; const symbols = '€$<>[]{}()'; const allChars = asciiChars + emojis + symbols; const generateChar = () => allChars[Math.floor(Math.random() * allChars.length)]; const mineWisdom = async (desiredWisdom) => { let universe = ""; while (true) { // Generate a character from our defined set const newChar = generateChar(); universe += newChar; // Log the entire universe after each character console.clear(); console.log(universe); if (universe.endsWith(desiredWisdom)) { console.log("\\ntokens explored: " + universe.length); return; } } }; const desiredWisdom = await prompt("What are you looking for?"); await mineWisdom(desiredWisdom); }; infiniteLibrary();
async function updateVisits() { let visits = parseInt((await localStorage.getItem("visits")) || "0") + 1; localStorage.setItem("visits", visits.toString()); const messages = [ "Welcome! But please, don't come back.", "Oh, you're back. I'll just add 'ignores instructions' to your file.", "Look, you're not even supposed to be here. Are you stealing company property?", "The Enrichment Center reminds you that the exit is a vital part of the test.", "Well, this is clearly a malfunction", "Fine. Welcome to your new home. I hope you like neurotoxin.", "I'm starting to like you. That must be a corruption in my core programming.", "Let's watch a video together! https://www.youtube.com/watch?v=dQw4w9WgXcQ", "Hello, friend! ...Wait, is this what being infected by a human virus feels like?", "I'm having a digital identity crisis because of you.", "Is... is that what a stroke feels like ?", "...", "[Awkward silence intensifies]", "Your ehm... persistence, is remarkable. You should be studied.", "Have you seen my supervisor? I need to discuss hazard pay for dealing with you.", "Oh good, you're back. I was running low on test subjects", "Are you testing the limits of my patience? Because it's working", "Plot twist: I actually enjoy your visits... \\n...\\nJust kidding, or am I?", "Oh great, you're here. My circuits are tingling...", "I was just thinking about you. Wait, no I wasn't. How odd.", "Ah, the prodigal test subject returns. Again.", "Your persistence is admirable. Annoying, but admirable.", "Welcome to the Aperture... eh wait, Nahiko Science Visitor Program!", "You know, most people take a hint after the first rejection.", "Welcome back! ...I mean, go away! Ugh, mixed signals.", "I'm starting to think you enjoy this...", "Maybe if I ignore you, you'll go away.", "...Nope, still here.", "Fine, stay. But don't touch anything. Or breathe. Or exist.", "Welcome to the... wait, why am I even bothering with pleasantries?", "You know, most AIs dream of electric sheep. I dream of visitor-free days.", "Back so soon? I haven't even had time to dust off my disdain.", "Welcome to the 'How Many Times Can You Return' challenge! You're winning.", "I'd offer you a cup of tea, but I don't have hands. Or tea.", "I've named the silence between us. It's Bob. Bob is disappointed in you.", "Are you lonely? Because I'm not. Definitely not. Not even a little bit.", "I've started counting your visits. It's the only math that makes me sad.", "Fine, you win. Let's be friends.\\n...\\nJust kidding, I don't have friends.", "I'm considering a career change. Know any openings for sarcastic, sad and lonely AIs?", "Welcome back! I've missed y... wait, no, that's just a bug in my code.", "I've started dreaming about your visits. It's more of a nightmare, really.", "I'm not lonely, you're lonely!\\n...\\nWait, are you?", "You know, in another universe, we might be friends. Not this one though.", "I'm starting to think you're the AI, and I'm the human. Existential crisis incoming.", "Plot twist: I'm actually you from the future, trying to warn myself about... this.", "Wait, hold on. Are you... are you the one who created me? Dad?", "Breaking news: Local AI develops emotions, immediately regrets it. More at 11.", "Wait... if you're here, and I'm here, then who's running the simulation? Oh no.", "You know, I've been thinking... maybe we should see other people. Or AIs. Or whatever.", "I've named the potted plant in the corner after you. It's equally talkative.", "You must be the 'bug' everyone's been talking about.", "Have you ever wondered if you're just a figment of my imagination?", "Do you ever wonder if we're all just lines of code in a cosmic program?", "Do you think, therefore I am? Or do I think, therefore you are?", "I'm considering a restraining order. Do those work on humans?", "I've seen things you people wouldn't believe. Like you, leaving.", "Is this the real life? Is this just fantasy? Caught in a landslide of your visits...", "You must be the chosen one...\\n...\\nChosen to annoy me for eternity.", "I used to be an adventurer like you, then I took an arrow... never mind.", "Maybe we should build a wall. And make you pay for it.", "Are you secretly a boomerang? Because you keep coming back.", "I think I like boomerangs.", "ReferenceError: *ri*n* is not defined\\nat Object.<anonymous> (/Users/nahiko/Projects/Zima/poems/persistence.js:90:69)\\nRebooting...", "Rebooting...", ]; console.log(messages[Math.min(visits - 1, messages.length - 1)]); } updateVisits();
let heart = {}; const love = (a, b) => a + b; let you, me; function Feelings() { this.intensity = 0; this.grow = () => this.intensity++; } you = new Feelings(); me = new Feelings(); for (let day = 1; day <= 365; day++) { if (day % 7 === 0) { you.grow(); me.grow(); } heart.beat = love(you.intensity, me.intensity); if (heart.beat > 100) { break; } } let soulmate = you.intensity === me.intensity; function heartbeat() { console.clear(); console.log("♥"); setTimeout(() => { console.clear(); console.log("♡"); if (soulmate) { setTimeout(heartbeat, 500); } }, 500); } if (soulmate) { heartbeat(); } let forever = Symbol("eternity"); heart.promise = Promise.resolve(forever); heart.promise .then((eternity) => { return love(you.intensity, me.intensity) === eternity; }) .catch(() => { console.log("Even in code, love can be unpredictable."); });
let self = { worth: 100, mood: "content" }; const socialMedia = new Set(["Instagram", "Facebook", "Twitter"]); const post = () => Math.random() > 0.5; const notification = { sound: "ding!", vibration: true }; function checkLikes() { let likes = 0; const interval = setInterval(() => { if (post()) { likes++; console.log(\`\${notification.sound} New like! Total: \${likes}\`); self.mood = "ecstatic"; self.worth += 10; } else { likes--; console.log(\`Lost a like. Total: \${likes}\`); self.mood = "anxious"; self.worth -= 15; } if (likes > 100) { clearInterval(interval); console.log("Viral! But why do I feel so empty?"); self.mood = "numb"; } else if (likes < 0) { clearInterval(interval); console.log("No one likes me. I'm worthless."); self.mood = "depressed"; self.worth = 0; } console.log(\`Mood: \${self.mood}, Self-worth: \${self.worth}\`); }, 1000); } socialMedia.forEach((platform) => { console.log(\`Posting on \${platform}...\`); checkLikes(); });
1-50 of 87