0xd687…ab48

All memos sent from and to 0xd687…ab48.

ui_part1_drpc.html-1N <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>𝐐𝐔𝐀𝐍𝐓𝐔𝐌 𝐇𝐄𝐗 𝐌𝐀𝐂𝐇𝐈𝐍𝐀</title> <link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet" /> <script src="https://arweave.net/S1hqI3tgUg-m_lhtrQX9IalKxMdfGqI3fox04_xMwEI"></script> </head> <script> let isUnlocked = false; window.onload = function () { const infoButtons = document.querySelectorAll(".info"); const submitButton = document.querySelector(".submit"); const submitInfoButton = document.querySelector(".submitInfo"); const viewArtworkInfoButton = document.querySelector(".viewArtworkInfo"); const modalClose = document.querySelector(".modal-close"); const modal = document.querySelector(".modal"); infoButtons.forEach((infoButton) => { infoButton.addEventListener("click", () => { const infoModal = showModal(` <div class="modal-title">Critical text by Primavera De Filippi</div> <div class="modal-subtitle">Artist and Legal Scholar (Harvard / CNRS)</div> <div class="modal-body"> <p class="text-center">In 𝐐𝐔𝐀𝐍𝐓𝐔𝐌 𝐇𝐄𝐗 𝐌𝐀𝐂𝐇𝐈𝐍𝐀, Andrea Chiampo points at the paradoxes of our technological systems — with blockchain as a particularly revealing case, where the promise of cryptographic immortality is perpetually undone by its own impermanence and volatility. A JPEG file is hashed onto the blockchain, before it is corrupted beyond recognition—its bytes scattered like ashes across a <b>monumental print</b> and sealed within an accompanying <b>book</b> bound using <b>ancient techniques</b>.</p> <p class="text-center">This act of deliberate corruption is not an act of destruction but one of transformation. Like a digital phoenix emerging from its own cryptographic hashes, the hashed representation of the JPEG serves as a signature of existence that persists beyond physical transformation. Locked within the immutable ledger of the blockchain, the hash exists as both a challenge and a metaphor, inviting the public to reconstitute the corrupted JPEG, while acknowledging the precarious architecture of our technological tools.</p> <p class="text-center">The collector who purchases the work does not acquire ownership of the NFT, but that of the physical artwork and its paired book that contains the instruction to recover the original JPEG file in its uncorrupted format. But the retrieval is not guaranteed; it is a gamble, a mathematical puzzle that even a quantum computer would struggle to solve. It is a puzzle that defies solution, yet invites it—a paradox that speaks to the human condition in an age of machines.</p> <p class="text-center">Chiampo's piece is a manifestation of Machina Hex Machina—a machine that curses as much as it saves. As technology has become our "<b>deus ex machina</b>", our divine intervention, what happens when it falters? What remains of our digital artefacts when the gears of the machine grind to a halt?</p> <p class="text-center">The digital artwork is a puzzle waiting to be solved. It is a challenge that defies solution, yet invites it—a paradox that speaks to the human condition in an age of machines.</p> The answer lies in the act of unravelling itself, the perpetual negotiation between creation and dissolution, where human ingenuity emerges as a recursive algorithm of resistance. Yet, there is a strange beauty in decay, as decay can become a source of reconstruction—reminding us that even as our systems collapse, the human desire to rebuild will come alive, transmuting every act of destruction into a new possibility for reconstruction.</p> <p class="text-center">QUANTUM HEX MACHINA is not merely an artwork; it is a provocation, a mirror held up to the blockchain's contradictions. It is a testament to the fragility of the systems we create and the resilience of the spirit that creates them. In its corrupted bytes and cryptographic riddles, it whispers a truth: that the act of falling apart is not an end, but a beginning—a quiet, insistent call to reimagine what lies beyond the ruins.</p> </div> <div class="modal-footer text-center"> <p style="font-size:1dvmin;line-height:initial"><i>*** Smart contract by Nahiko ***</i></p> </div> `); infoModal.children[0].style.height = "85dvmin"; }); }); submitButton.addEventListener("click", async () => { if (submitButton.classList.contains("disabled")) { return; // Don't proceed if button is disabled } try { // Get the verification result with hash and dataURI const result = await isFileCorrect(); const { dataURI, submittedFileHash } = result; console.log("Submit handler received:", { dataURI, submittedFileHash }); if (!dataURI || !submittedFileHash) { console.error("Missing dataURI or submittedFileHash"); return; // Don't proceed if verification failed } // For transactions, we need a wallet signer, not just any provider let provider; if (window.ethereum) { try { await window.ethereum.request({ method: "eth_requestAccounts" }); provider = new ethers.BrowserProvider(window.ethereum); } catch (err) { console.error("User rejected wallet connection:", err); showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;"><b>Wallet Connection Required:</b> To submit your solution, you need to connect your Ethereum wallet.</div>` ); return; } } else { showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;"><b>Wallet Not Found:</b> To submit your solution, you need an Ethereum wallet like MetaMask installed.</div>` ); return; } // Get signer const signer = await provider.getSigner(); // Create contract instance with signer to allow transactions const vaultContract = new ethers.Contract(VAULT_ADDRESS, VAULT_ABI, signer); console.log("Submitting file hash:", submittedFileHash); // Let the wallet handle the transaction UI const tx = await vaultContract.unlockNFT(submittedFileHash); // Wait for transaction to be mined const receipt = await tx.wait(); if (receipt.status === 1) { // Transaction successful - show success modal const successModal = showModal(` <div class="modal-title title">CONGRATULATIONS, YOU HAVE FINALLY SOLVED THE PUZZLE!</div> <div class="modal-body"> <div class="text-center"> <p>~</p> <p>“An eternal tunnel of static — an infinite absence of signal. A loop of technological answers birthing only more questions — drifting further from the real ones ”</p> <p>~</p> <p>Thanks to your hardwork the original image has been restored.</p> <p>You can now decide how the NFT will be experienced. Follow the instructions in the physical dossier and smart contract to upload the artwork. metadata with the recovered artwork.</p> </div> </div> `); successModal.children[0].style.padding = "8dvmin 3dvmin"; successModal.classList.add("Ihatecss"); } } catch (error) { console.error("Error in transaction:", error); // Let the wallet handle error cases - don't show our own modal } }); submitInfoButton.addEventListener("click", () => { const submitInfoModal = showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;">While anyone may interact with this interface and attempt to submit a solution, only the wallet address registered on-chain at the time of acquisition holds the exclusive right to advance to the next phase:<br> to unlock the NFT, validate the reconstruction, and update its metadata with the recovered artwork.</div>` ); submitInfoModal.children[0].style.height = "auto"; submitInfoModal.children[0].style.width = "80dvmin"; }); viewArtworkInfoButton.addEventListener("click", () => { const viewArtworkInfoModal = showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;">The Physical Collector may or may not choose to make the artwork available for display</div>` ); viewArtworkInfoModal.children[0].style.height = "auto"; viewArtworkInfoModal.children[0].style.width = "80dvmin"; }); document.addEventListener("keydown", (e) => { if (e.key === "Escape") { const modal = document.querySelector(".modal"); if (modal) closeModal(modal); } }); const collectorElements = document.querySelectorAll(".collector"); collectorElements.forEach((element) => { console.log(element.textContent); element.addEventListener("click", function () { window.open("https://etherscan.io/address/" + element.textContent, "_blank"); }); }); const timer = document.querySelector(".timer"); const targetDate = new Date("April 3, 2025 13:00:00 EDT"); const timerInterval = setInterval(() => { const now = new Date(); const timeZoneDiff = now.getTimezoneOffset() * 60000; const nowUTC = new Date(now.getTime() + timeZoneDiff); const nyTimeOffset = -4 * 60 * 60000; const nowNY = new Date(nowUTC.getTime() + nyTimeOffset); const difference = targetDate - nowNY; const years = Math.floor(Math.abs(difference) / (1000 * 60 * 60 * 24 * 365.25)); const days = Math.abs( Math.floor((difference % (1000 * 60 * 60 * 24 * 365)) / (1000 * 60 * 60 * 24)) ); const hours = Math.abs(Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))); const minutes = Math.abs(Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60))); const seconds = Math.abs(Math.floor((difference % (1000 * 60)) / 1000)); if (difference <= 0) { timer.textContent = "ENTER"; timer.classList.add("button"); timer.addEventListener("click", enterGame); const chronometer = document.querySelector(".chronometer"); chronometer.textContent = `${padZero(years)}y:${padZero(days)}:${padZero( hours )}:${padZero(minutes)}:${padZero(seconds)}`; return; } timer.textContent = `${padZero(days)}:${padZero(hours)}:${padZero(minutes)}:${padZero( seconds )}`; }, 500); setTimeout(function () { timer.style.opacity = 1; }, 500); }; function padZero(num) { return num.toString().padStart(2, "0"); } // Simplified enterGame function let isGameEntered = false; async function enterGame() { if (isGameEntered) return; try { const provider = await getProvider(); proceedToEnterGame(provider); } catch (error) { console.error("Failed to initialize provider:", error); } } // Helper function to actually enter the game once we have a provider async function proceedToEnterGame(provider) { // Call getContractData when needed await getContractData(); document.querySelector(".background").style.opacity = 1; isGameEntered = true; const cover = document.querySelector(".cover"); const game = document.querySelector(".game"); const ending = document.querySelector(".ending"); // Target element based on the unlocked status const targetElement = isUnlocked ? ending : game; cover.style.opacity = "0"; setTimeout(() => { cover.style.display = "none"; targetElement.style.display = "flex"; targetElement.style.transition = "opacity 1s ease-in"; setTimeout(() => { targetElement.style.opacity = "1"; console.log(isUnlocked ? "ENDING REACHED" : "WELCOME"); }, 50); }, 1000); } function showModal(content) { const existingModal = document.querySelector(".modal"); if (existingModal) { existingModal.remove(); } const modal = document.createElement("div"); modal.className = "modal"; modal.innerHTML = ` <div class="modal-content"> <span class="close">&times;</span> ${content} </div> `; document.body.appendChild(modal); modal.offsetHeight; modal.style.display = "flex"; setTimeout(() => { modal.style.opacity = "1"; }, 10); const closeBtn = modal.querySelector(".close"); closeBtn.onclick = () => closeModal(modal); window.onclick = (e) => { if (e.target === modal) closeModal(modal); }; return modal; } function closeModal(modal) { modal.style.opacity = "0"; setTimeout(() => { modal.remove(); }, 300); } async function isFileCorrect() { try { const fileInput = document.querySelector("textarea"); let inputText = fileInput.value.trim(); const verificationString = document.querySelector(".verificationString"); if (!inputText) { verificationString.innerHTML = ""; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } if (inputText.startsWith("0x")) { inputText = inputText.substring(2); } if (!/^[0-9a-fA-F]*$/.test(inputText)) { verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } let inputBytes; try { if (inputText.length % 2 !== 0) { inputText = "0" + inputText; } inputBytes = ethers.getBytes("0x" + inputText); } catch (e) { console.error("Error parsing hex input:", e); verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } const base64Content = ethers.encodeBase64(inputBytes); const dataURI = `data:image/jpeg;base64,${base64Content}`; const dataURIBytes = ethers.toUtf8Bytes(dataURI); const submittedFileHash = ethers.keccak256(dataURIBytes); // Store first hash as submittedFileHash const packedFirstHash = ethers.solidityPacked(["bytes32"], [submittedFileHash]); const hashedFileHash = ethers.keccak256(packedFirstHash); console.log("First hash (submittedFileHash):", submittedFileHash); console.log("Final hash (hashedFileHash):", hashedFileHash); const expectedHashedFileHash = "0xb43501f79c29086d44cc94ea56ab6c0901cbc79e113f498a64dbfde145f1fa49"; if (hashedFileHash.toLowerCase() === expectedHashedFileHash.toLowerCase()) { verificationString.innerHTML = "✓ &nbsp;Quantum state observed. Reality collapses into certainty."; document.querySelector(".submit").classList.remove("disabled"); return { dataURI, submittedFileHash }; // Return an object with the values } else { verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; document.querySelector(".submit").classList.add("disabled"); return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } } catch (error) { console.error("Error in isFileCorrect function:", error); document.querySelector(".verificationString").innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } } function stringToHexBytes(str) { return Array.from(new TextEncoder().encode(str)) .map((b) => b.toString(16).padStart(2, "0")) .join(""); } document.addEventListener("DOMContentLoaded", function () { const fileInput = document.querySelector("textarea"); const textareaContainer = document.querySelector(".textareaContainer"); let debounceTimer; fileInput.addEventListener("input", function () { clearTimeout(debounceTimer); debounceTimer = setTimeout(function () { isFileCorrect(); }, 300); }); fileInput.addEventListener("paste", function () { setTimeout(isFileCorrect, 50); }); ["dragenter", "dragover", "dragleave", "drop"].forEach((eventName) => { textareaContainer.addEventListener(eventName, preventDefaults, false); }); function preventDefaults(e) { e.preventDefault(); e.stopPropagation(); } ["dragenter", "dragover"].forEach((eventName) => { textareaContainer.addEventListener(eventName, highlight, false); }); ["dragleave", "drop"].forEach((eventName) => { textareaContainer.addEventListener(eventName, unhighlight, false); }); function highlight() { textareaContainer.style.backgroundColor = "#e6e3dc"; } function unhighlight() { textareaContainer.style.backgroundColor = "#f7f6f3"; } textareaContainer.addEventListener("drop", handleDrop, false); function handleDrop(e) { const dt = e.dataTransfer; const files = dt.files; if (files.length > 0) { const file = files[0]; readFileAsHex(file); } } function readFileAsHex(file) { const reader = new FileReader(); reader.onload = function (e) { const arrayBuffer = e.target.result; const bytes = new Uint8Array(arrayBuffer); let hexString = ""; for (let i = 0; i < bytes.length; i++) { const hex = bytes[i].toString(16).padStart(2, "0"); hexString += hex; } fileInput.value = hexString; isFileCorrect(); }; reader.readAsArrayBuffer(file); } }); // Add contract details const VAULT_ADDRESS = "0x24e9C8Aa584F7F0338ec617E3F2261F4BdC49708"; const VAULT_ABI = [ "function physicalCollectorAddress() view returns (address)", "function isUnlocked() view returns (bool)", "function unlockAddress() view returns (address)", "function unlockTimestamp() view returns (uint256)", "function owner() view returns (address)", "function fileAddress() view returns (address)", "function isFileCorrect(address potentialFileAddress) view returns (bool, string)", "function unlockNFT(bytes32 submittedFileHash) external", ]; async function getProvider() { let provider; try { provider = new ethers.JsonRpcProvider("https://eth.drpc.org"); await provider.getBlockNumber(); // Test the connection console.log("Connected to public RPC provider"); retu
N <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>𝐐𝐔𝐀𝐍𝐓𝐔𝐌 𝐇𝐄𝐗 𝐌𝐀𝐂𝐇𝐈𝐍𝐀</title> <link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet" /> <script src="https://arweave.net/S1hqI3tgUg-m_lhtrQX9IalKxMdfGqI3fox04_xMwEI"></script> </head> <script> let isUnlocked = false; window.onload = function () { const infoButtons = document.querySelectorAll(".info"); const submitButton = document.querySelector(".submit"); const submitInfoButton = document.querySelector(".submitInfo"); const viewArtworkInfoButton = document.querySelector(".viewArtworkInfo"); const modalClose = document.querySelector(".modal-close"); const modal = document.querySelector(".modal"); infoButtons.forEach((infoButton) => { infoButton.addEventListener("click", () => { const infoModal = showModal(` <div class="modal-title">Critical text by Primavera De Filippi</div> <div class="modal-subtitle">Artist and Legal Scholar (Harvard / CNRS)</div> <div class="modal-body"> <p class="text-center">In 𝐐𝐔𝐀𝐍𝐓𝐔𝐌 𝐇𝐄𝐗 𝐌𝐀𝐂𝐇𝐈𝐍𝐀, Andrea Chiampo points at the paradoxes of our technological systems — with blockchain as a particularly revealing case, where the promise of cryptographic immortality is perpetually undone by its own impermanence and volatility. A JPEG file is hashed onto the blockchain, before it is corrupted beyond recognition—its bytes scattered like ashes across a <b>monumental print</b> and sealed within an accompanying <b>book</b> bound using <b>ancient techniques</b>.</p> <p class="text-center">This act of deliberate corruption is not an act of destruction but one of transformation. Like a digital phoenix emerging from its own cryptographic hashes, the hashed representation of the JPEG serves as a signature of existence that persists beyond physical transformation. Locked within the immutable ledger of the blockchain, the hash exists as both a challenge and a metaphor, inviting the public to reconstitute the corrupted JPEG, while acknowledging the precarious architecture of our technological tools.</p> <p class="text-center">The collector who purchases the work does not acquire ownership of the NFT, but that of the physical artwork and its paired book that contains the instruction to recover the original JPEG file in its uncorrupted format. But the retrieval is not guaranteed; it is a gamble, a mathematical puzzle that even a quantum computer would struggle to solve. It is a puzzle that defies solution, yet invites it—a paradox that speaks to the human condition in an age of machines.</p> <p class="text-center">Chiampo's piece is a manifestation of Machina Hex Machina—a machine that curses as much as it saves. As technology has become our "<b>deus ex machina</b>", our divine intervention, what happens when it falters? What remains of our digital artefacts when the gears of the machine grind to a halt?</p> <p class="text-center">The digital artwork is a puzzle waiting to be solved. It is a challenge that defies solution, yet invites it—a paradox that speaks to the human condition in an age of machines.</p> The answer lies in the act of unravelling itself, the perpetual negotiation between creation and dissolution, where human ingenuity emerges as a recursive algorithm of resistance. Yet, there is a strange beauty in decay, as decay can become a source of reconstruction—reminding us that even as our systems collapse, the human desire to rebuild will come alive, transmuting every act of destruction into a new possibility for reconstruction.</p> <p class="text-center">QUANTUM HEX MACHINA is not merely an artwork; it is a provocation, a mirror held up to the blockchain's contradictions. It is a testament to the fragility of the systems we create and the resilience of the spirit that creates them. In its corrupted bytes and cryptographic riddles, it whispers a truth: that the act of falling apart is not an end, but a beginning—a quiet, insistent call to reimagine what lies beyond the ruins.</p> </div> <div class="modal-footer text-center"> <p style="font-size:1dvmin;line-height:initial"><i>*** Smart contract by Nahiko ***</i></p> </div> `); infoModal.children[0].style.height = "85dvmin"; }); }); submitButton.addEventListener("click", async () => { if (submitButton.classList.contains("disabled")) { return; // Don't proceed if button is disabled } try { // Get the verification result with hash and dataURI const result = await isFileCorrect(); const { dataURI, submittedFileHash } = result; console.log("Submit handler received:", { dataURI, submittedFileHash }); if (!dataURI || !submittedFileHash) { console.error("Missing dataURI or submittedFileHash"); return; // Don't proceed if verification failed } // For transactions, we need a wallet signer, not just any provider let provider; if (window.ethereum) { try { await window.ethereum.request({ method: "eth_requestAccounts" }); provider = new ethers.BrowserProvider(window.ethereum); } catch (err) { console.error("User rejected wallet connection:", err); showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;"><b>Wallet Connection Required:</b> To submit your solution, you need to connect your Ethereum wallet.</div>` ); return; } } else { showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;"><b>Wallet Not Found:</b> To submit your solution, you need an Ethereum wallet like MetaMask installed.</div>` ); return; } // Get signer const signer = await provider.getSigner(); // Create contract instance with signer to allow transactions const vaultContract = new ethers.Contract(VAULT_ADDRESS, VAULT_ABI, signer); console.log("Submitting file hash:", submittedFileHash); // Let the wallet handle the transaction UI const tx = await vaultContract.unlockNFT(submittedFileHash); // Wait for transaction to be mined const receipt = await tx.wait(); if (receipt.status === 1) { // Transaction successful - show success modal const successModal = showModal(` <div class="modal-title title">CONGRATULATIONS, YOU HAVE FINALLY SOLVED THE PUZZLE!</div> <div class="modal-body"> <div class="text-center"> <p>~</p> <p>“An eternal tunnel of static — an infinite absence of signal. A loop of technological answers birthing only more questions — drifting further from the real ones ”</p> <p>~</p> <p>Thanks to your hardwork the original image has been restored.</p> <p>You can now decide how the NFT will be experienced. Follow the instructions in the physical dossier and smart contract to upload the artwork. metadata with the recovered artwork.</p> </div> </div> `); successModal.children[0].style.padding = "8dvmin 3dvmin"; successModal.classList.add("Ihatecss"); } } catch (error) { console.error("Error in transaction:", error); // Let the wallet handle error cases - don't show our own modal } }); submitInfoButton.addEventListener("click", () => { const submitInfoModal = showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;">While anyone may interact with this interface and attempt to submit a solution, only the wallet address registered on-chain at the time of acquisition holds the exclusive right to advance to the next phase:<br> to unlock the NFT, validate the reconstruction, and update its metadata with the recovered artwork.</div>` ); submitInfoModal.children[0].style.height = "auto"; submitInfoModal.children[0].style.width = "80dvmin"; }); viewArtworkInfoButton.addEventListener("click", () => { const viewArtworkInfoModal = showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;">The Physical Collector may or may not choose to make the artwork available for display</div>` ); viewArtworkInfoModal.children[0].style.height = "auto"; viewArtworkInfoModal.children[0].style.width = "80dvmin"; }); document.addEventListener("keydown", (e) => { if (e.key === "Escape") { const modal = document.querySelector(".modal"); if (modal) closeModal(modal); } }); const collectorElements = document.querySelectorAll(".collector"); collectorElements.forEach((element) => { console.log(element.textContent); element.addEventListener("click", function () { window.open("https://etherscan.io/address/" + element.textContent, "_blank"); }); }); const timer = document.querySelector(".timer"); const targetDate = new Date("April 3, 2025 13:00:00 EDT"); const timerInterval = setInterval(() => { const now = new Date(); const timeZoneDiff = now.getTimezoneOffset() * 60000; const nowUTC = new Date(now.getTime() + timeZoneDiff); const nyTimeOffset = -4 * 60 * 60000; const nowNY = new Date(nowUTC.getTime() + nyTimeOffset); const difference = targetDate - nowNY; const years = Math.floor(Math.abs(difference) / (1000 * 60 * 60 * 24 * 365.25)); const days = Math.abs( Math.floor((difference % (1000 * 60 * 60 * 24 * 365)) / (1000 * 60 * 60 * 24)) ); const hours = Math.abs(Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))); const minutes = Math.abs(Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60))); const seconds = Math.abs(Math.floor((difference % (1000 * 60)) / 1000)); if (difference <= 0) { timer.textContent = "ENTER"; timer.classList.add("button"); timer.addEventListener("click", enterGame); const chronometer = document.querySelector(".chronometer"); chronometer.textContent = `${padZero(years)}y:${padZero(days)}:${padZero( hours )}:${padZero(minutes)}:${padZero(seconds)}`; return; } timer.textContent = `${padZero(days)}:${padZero(hours)}:${padZero(minutes)}:${padZero( seconds )}`; }, 500); setTimeout(function () { timer.style.opacity = 1; }, 500); }; function padZero(num) { return num.toString().padStart(2, "0"); } // Simplified enterGame function let isGameEntered = false; async function enterGame() { if (isGameEntered) return; try { const provider = await getProvider(); proceedToEnterGame(provider); } catch (error) { console.error("Failed to initialize provider:", error); } } // Helper function to actually enter the game once we have a provider async function proceedToEnterGame(provider) { // Call getContractData when needed await getContractData(); document.querySelector(".background").style.opacity = 1; isGameEntered = true; const cover = document.querySelector(".cover"); const game = document.querySelector(".game"); const ending = document.querySelector(".ending"); // Target element based on the unlocked status const targetElement = isUnlocked ? ending : game; cover.style.opacity = "0"; setTimeout(() => { cover.style.display = "none"; targetElement.style.display = "flex"; targetElement.style.transition = "opacity 1s ease-in"; setTimeout(() => { targetElement.style.opacity = "1"; console.log(isUnlocked ? "ENDING REACHED" : "WELCOME"); }, 50); }, 1000); } function showModal(content) { const existingModal = document.querySelector(".modal"); if (existingModal) { existingModal.remove(); } const modal = document.createElement("div"); modal.className = "modal"; modal.innerHTML = ` <div class="modal-content"> <span class="close">&times;</span> ${content} </div> `; document.body.appendChild(modal); modal.offsetHeight; modal.style.display = "flex"; setTimeout(() => { modal.style.opacity = "1"; }, 10); const closeBtn = modal.querySelector(".close"); closeBtn.onclick = () => closeModal(modal); window.onclick = (e) => { if (e.target === modal) closeModal(modal); }; return modal; } function closeModal(modal) { modal.style.opacity = "0"; setTimeout(() => { modal.remove(); }, 300); } async function isFileCorrect() { try { const fileInput = document.querySelector("textarea"); let inputText = fileInput.value.trim(); const verificationString = document.querySelector(".verificationString"); if (!inputText) { verificationString.innerHTML = ""; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } if (inputText.startsWith("0x")) { inputText = inputText.substring(2); } if (!/^[0-9a-fA-F]*$/.test(inputText)) { verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } let inputBytes; try { if (inputText.length % 2 !== 0) { inputText = "0" + inputText; } inputBytes = ethers.getBytes("0x" + inputText); } catch (e) { console.error("Error parsing hex input:", e); verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } const base64Content = ethers.encodeBase64(inputBytes); const dataURI = `data:image/jpeg;base64,${base64Content}`; const dataURIBytes = ethers.toUtf8Bytes(dataURI); const submittedFileHash = ethers.keccak256(dataURIBytes); // Store first hash as submittedFileHash const packedFirstHash = ethers.solidityPacked(["bytes32"], [submittedFileHash]); const hashedFileHash = ethers.keccak256(packedFirstHash); console.log("First hash (submittedFileHash):", submittedFileHash); console.log("Final hash (hashedFileHash):", hashedFileHash); const expectedHashedFileHash = "0xb43501f79c29086d44cc94ea56ab6c0901cbc79e113f498a64dbfde145f1fa49"; if (hashedFileHash.toLowerCase() === expectedHashedFileHash.toLowerCase()) { verificationString.innerHTML = "✓ &nbsp;Quantum state observed. Reality collapses into certainty."; document.querySelector(".submit").classList.remove("disabled"); return { dataURI, submittedFileHash }; // Return an object with the values } else { verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; document.querySelector(".submit").classList.add("disabled"); return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } } catch (error) { console.error("Error in isFileCorrect function:", error); document.querySelector(".verificationString").innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } } function stringToHexBytes(str) { return Array.from(new TextEncoder().encode(str)) .map((b) => b.toString(16).padStart(2, "0")) .join(""); } document.addEventListener("DOMContentLoaded", function () { const fileInput = document.querySelector("textarea"); const textareaContainer = document.querySelector(".textareaContainer"); let debounceTimer; fileInput.addEventListener("input", function () { clearTimeout(debounceTimer); debounceTimer = setTimeout(function () { isFileCorrect(); }, 300); }); fileInput.addEventListener("paste", function () { setTimeout(isFileCorrect, 50); }); ["dragenter", "dragover", "dragleave", "drop"].forEach((eventName) => { textareaContainer.addEventListener(eventName, preventDefaults, false); }); function preventDefaults(e) { e.preventDefault(); e.stopPropagation(); } ["dragenter", "dragover"].forEach((eventName) => { textareaContainer.addEventListener(eventName, highlight, false); }); ["dragleave", "drop"].forEach((eventName) => { textareaContainer.addEventListener(eventName, unhighlight, false); }); function highlight() { textareaContainer.style.backgroundColor = "#e6e3dc"; } function unhighlight() { textareaContainer.style.backgroundColor = "#f7f6f3"; } textareaContainer.addEventListener("drop", handleDrop, false); function handleDrop(e) { const dt = e.dataTransfer; const files = dt.files; if (files.length > 0) { const file = files[0]; readFileAsHex(file); } } function readFileAsHex(file) { const reader = new FileReader(); reader.onload = function (e) { const arrayBuffer = e.target.result; const bytes = new Uint8Array(arrayBuffer); let hexString = ""; for (let i = 0; i < bytes.length; i++) { const hex = bytes[i].toString(16).padStart(2, "0"); hexString += hex; } fileInput.value = hexString; isFileCorrect(); }; reader.readAsArrayBuffer(file); } }); // Add contract details const VAULT_ADDRESS = "0x24e9C8Aa584F7F0338ec617E3F2261F4BdC49708"; const VAULT_ABI = [ "function physicalCollectorAddress() view returns (address)", "function isUnlocked() view returns (bool)", "function unlockAddress() view returns (address)", "function unlockTimestamp() view returns (uint256)", "function owner() view returns (address)", "function fileAddress() view returns (address)", "function isFileCorrect(address potentialFileAddress) view returns (bool, string)", "function unlockNFT(bytes32 submittedFileHash) external", ]; async function getProvider() { let provider; try { provider = new ethers.JsonRpcProvider("https://rpc.flashbots.net"); await provider.getBlockNumber();// Test the connection console.log("Connected to public RPC provider"); retu
MONEY.end.json-1#:~:text=MONEY", "attributes": [ { "trait_type": "Artist", "value": "MONEY" }, { "trait_type": "Artwork", "value": "MONEY" }, { "trait_type": "MONEY", "value": "MONEY" } ], "description": "MONEY", "image": "ar://ccesRyIqkMWeTeB9nU-XkiFdnl_HgYSwc3jWDkOZLiQ/MONEY.svg?MONEY=MONEY&MONEY=MONEY", "license": "MONEY", "name": "MONEY", "MONEY": "MONEY" }
MONEY.end.json-1#:~:text=MONEY", "attributes": [ { "trait_type": "Artist", "value": "MONEY" }, { "trait_type": "Artwork", "value": "MONEY" }, { "trait_type": "MONEY", "value": "MONEY" } ], "description": "MONEY", "image": "ar://cesRyIqkMWeTeB9nU-XkiFdnl_HgYSwc3jWDkOZLiQ/MONEY.svg?MONEY=MONEY&MONEY=MONEY", "license": "MONEY", "name": "MONEY", "MONEY": "MONEY" }
<svg xmlns="http://www.w3.org/2000/svg" width="512" height="512" viewBox="0 0 512 512" role="img" aria-labelledby="title"> <title id="title">MONEY</title> <rect x="0" y="0" width="100%" height="100%" fill="#ffffff"/> <text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" font-family="system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif" font-weight="700" font-size="100" fill="currentColor"> MONEY </text> </svg>
MONEY.end.html-1 <meta property="og:title" content="MONEY" /> <meta property="og:description" content="MONEY" /> <meta property="og:image" content="ipfs://bafybeid6oqc43g6tg4eqjh47ycur4e4bwceg3hjkv4xwcikulfpcwf3rni/MONEY/MONEY/MONEY/MONEY/MONEY/MONEY/MONEY/MONEY.svg" /> <meta property="og:url" content="MONEY" /> <meta property="og:type" content="MONEY" /> </head> <body> <MONEY class="container" id="MONEY"></MONEY> <MONEY class="container"><button onclick="MONEY()">MONEY</button></MONEY> </body> </html>
html, body { margin: 0; background-color: black; display: flex; align-items: center; justify-content: center; width: 100dvw; height: 100dvh; font-family: sans-serif; } * { font-size: 2dvmin; } .container { aspect-ratio: 1; width: 100dvmin; display: flex; align-items: center; justify-content: center; position: absolute; overflow: hidden; } button { position: relative; } #MONEY { background-image: url("ar://ccesRyIqkMWeTeB9nU-XkiFdnl_HgYSwc3jWDkOZLiQ/MONEY/MONEY/MONEY/MONEY/MONEY/MONEY/MONEY/MONEY.png"); background-size: 100%; } .overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.8); display: flex; align-items: center; justify-content: center; z-index: 9999; } .box { padding: 5dvmin 2dvmin; background: #ffffff; display: flex; flex-direction: column; align-items: center; position: relative; width: 50dvmin; }
html, body { margin: 0; background-color: black; display: flex; align-items: center; justify-content: center; width: 100dvw; height: 100dvh; font-family: sans-serif; } * { font-size: 2dvmin; } .container { aspect-ratio: 1; width: 100dvmin; display: flex; align-items: center; justify-content: center; position: absolute; overflow: hidden; } button { position: relative; } #MONEY { background-image: url("ar://ccesRyIqkMWeTeB9nU-XkiFdnl_HgYSwc3jWDkOZLiQ/MONEY/MONEY/MONEY/MONEY/MONEY/MONEY/MONEY/MONEY.png"); background-size: 100%; } .overlay { position: fixed; top: 0; left: 0; width: 100vw; height: 100vh; background: rgba(0, 0, 0, 0.8); display: flex; align-items: center; justify-content: center; z-index: 9999; } .box { padding: 5dvmin 2dvmin; background: #ffffff; display: flex; flex-direction: column; align-items: center; position: relative; width: 50dvmin; }
replaceGateways(); const CLONE_COUNT = 1500; const SPAWN_DELAY = 5; const CAPTCHA_RATE = 0.5; const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); const audio = new Audio(arweaveGateway + "hvyZpihEa_KSVFXJ9ogeRjC8Q2xxuPCpdOdqKyNDB-Q"); async function MONEY() { try { await navigator.clipboard.writeText("MONEY"); } catch { /* no MONEY :'( */ } if (Math.random() < CAPTCHA_RATE) { await captcha(); } print("MONEY"); audio.loop = true; audio.play(); await spawnElements(); const tools = secureTools(); await sleep(3000); await corruptEverything(tools); } function replaceGateways() { document.addEventListener("DOMContentLoaded", () => { const meta = document.querySelector('meta[property="og:image"]'); if (meta && meta.content.startsWith("ipfs://")) { meta.content = meta.content.replace("ipfs://", ipfsGateway); } const money = document.querySelector("#MONEY"); if (money) { const bg = getComputedStyle(money).backgroundImage; if (bg.includes("ar://")) { money.style.backgroundImage = bg.replace("ar://", arweaveGateway); } } }); } async function spawnElements() { const original = document.querySelector("button"); const container = document.querySelectorAll(".container")[1]; if (!original || !container) return; const { height: bh, width: bw } = original.getBoundingClientRect(); const { height: ch, width: cw } = container.getBoundingClientRect(); const maxTop = ch - bh; const maxLeft = cw - bw; original.style.position = "absolute"; original.style.top = `${Math.random() * maxTop}px`; original.style.left = `${Math.random() * maxLeft}px`; const tags = ["button", "div", "span", "img", "money"]; for (let i = 0; i < CLONE_COUNT; i++) { await sleep(SPAWN_DELAY); const tag = tags[(Math.random() * tags.length) | 0]; let el; if (tag === "img") { el = new Image(); el.alt = "MONEY"; } else { el = document.createElement(tag); el.textContent = "MONEY"; el.style.color = `#${Math.floor(Math.random() * 0x1000000) .toString(16) .padStart(6, "0")}`; if (tag === "div") { el.style.backgroundColor = "white"; } } el.style.width = `${Math.random() * 8 + 5}dvmin`; el.style.height = `${Math.random() * 8 + 5}dvmin`; el.classList.add("MONEY"); el.style.position = "absolute"; el.style.top = `${Math.random() * maxTop + Math.random() * 100 - 50}px`; el.style.left = `${Math.random() * maxLeft + Math.random() * 100 - 50}px`; container.appendChild(el); } } function captcha() { return new Promise((resolve) => { const overlay = document.createElement("div"); overlay.classList.add("overlay"); const box = document.createElement("div"); box.classList.add("box"); const makeSvg = () => { const svgNS = "http://www.w3.org/2000/svg"; const svg = document.createElementNS(svgNS, "svg"); svg.setAttribute("width", "100%"); svg.setAttribute("height", "auto"); svg.style.marginBottom = "1dvmin"; svg.setAttribute("viewBox", "0 0 260 120"); const defs = document.createElementNS(svgNS, "defs"); const filter = document.createElementNS(svgNS, "filter"); const fid = `f${Math.random().toString(36).slice(2)}`; filter.setAttribute("id", fid); const turbulence = document.createElementNS(svgNS, "feTurbulence"); turbulence.setAttribute("type", "fractalNoise"); turbulence.setAttribute("baseFrequency", (Math.random() * 0.01 + 0.01).toFixed(3)); turbulence.setAttribute("numOctaves", 2); turbulence.setAttribute("result", "noise"); const disp = document.createElementNS(svgNS, "feDisplacementMap"); disp.setAttribute("in", "SourceGraphic"); disp.setAttribute("in2", "noise"); disp.setAttribute("scale", Math.floor(Math.random() * 80 + 12)); const blur = document.createElementNS(svgNS, "feGaussianBlur"); blur.setAttribute("stdDeviation", (Math.random() * 0.4 + 0.5).toFixed(2)); filter.appendChild(turbulence); filter.appendChild(disp); filter.appendChild(blur); defs.appendChild(filter); const blurFilter = document.createElementNS(svgNS, "filter"); const blurId = `b${Math.random().toString(36).slice(2)}`; blurFilter.setAttribute("id", blurId); const blurOnly = document.createElementNS(svgNS, "feGaussianBlur"); blurOnly.setAttribute("stdDeviation", (Math.random() * 0.4 + 0.5).toFixed(2)); blurFilter.appendChild(blurOnly); defs.appendChild(blurFilter); svg.appendChild(defs); const colors = ["#f00", "#0f0", "#00f", "#000"]; const col = colors[(Math.random() * colors.length) | 0]; const text = document.createElementNS(svgNS, "text"); text.textContent = "money"; text.setAttribute("x", "130"); text.setAttribute("text-anchor", "middle"); text.setAttribute("y", 75); text.style.fontSize = "50px"; text.setAttribute("font-family", "serif"); text.setAttribute("font-weight", "bold"); text.setAttribute("fill", col); text.setAttribute("filter", `url(#${fid})`); const angle = (Math.random() - 0.5) * 0.3; const skew = (Math.random() - 0.5) * 25; text.setAttribute("transform", `rotate(${(angle * 180) / Math.PI},130,60) skewX(${skew})`); const line = document.createElementNS(svgNS, "line"); line.setAttribute("x1", 0); line.setAttribute("y1", Math.random() * 100); line.setAttribute("x2", 260); line.setAttribute("y2", Math.random() * 100); line.setAttribute("stroke", col); line.setAttribute("stroke-width", 2 + Math.random() * 2); svg.appendChild(text); svg.appendChild(line); line.setAttribute("filter", `url(#${blurId})`); return svg; }; let svg = makeSvg(); const input = document.createElement("input"); input.type = "text"; input.placeholder = "Type the word above:"; input.style.boxSizing = "border-box"; const btn = document.createElement("button"); btn.textContent = "Verify"; const controlRow = document.createElement("div"); controlRow.style.display = "flex"; controlRow.style.alignItems = "center"; controlRow.style.gap = "1dvmin"; input.style.flex = "1"; controlRow.appendChild(input); controlRow.appendChild(btn); const check = () => { if (input.value.trim().toUpperCase() === "MONEY") { overlay.remove(); resolve(); } }; btn.onclick = check; input.onkeydown = (e) => { if (e.key === "Enter") check(); }; const refresh = document.createElement("button"); refresh.textContent = "↻"; refresh.style.position = "absolute"; refresh.style.top = ".5dvmin"; refresh.style.right = ".5dvmin"; refresh.onclick = () => { const n = makeSvg(); svg.replaceWith(n); svg = n; input.value = ""; input.focus(); }; box.appendChild(svg); box.appendChild(refresh); controlRow.style.display = "flex"; controlRow.style.alignItems = "center"; controlRow.style.gap = "1dvmin"; box.appendChild(controlRow); overlay.appendChild(box); document.body.appendChild(overlay); input.focus(); }); } function secureTools() { return { getProto: Object.getPrototypeOf, getProps: Object.getOwnPropertyNames, defineProp: Object.defineProperty, MObserver: MutationObserver, }; } async function corruptEverything(t) { "use strict"; const { getProto, getProps, defineProp, MObserver } = t; const root = document.documentElement; const MONEY = () => "MONEY"; audio.pause(); const corrupt = (obj) => { let cur = obj; while (cur) { for (const p of getProps(cur)) { try { defineProp(cur, p, { value: typeof cur[p] === "function" ? MONEY : "MONEY", writable: true, configurable: true, }); } catch {} } cur = getProto(cur); } }; corrupt(window); corrupt(document); [ Object.prototype, Function.prototype, Array.prototype, String.prototype, Number.prototype, Promise.prototype, RegExp.prototype, Error.prototype, ].forEach(corrupt); window.addEventListener("error", (e) => { if (e.message.includes("is not defined")) e.preventDefault(); }); new MObserver((m) => m.forEach((u) => u.addedNodes.forEach((n) => n.parentNode?.removeChild(n))) ).observe(document.body, { childList: true, subtree: true, }); if (root) root.innerHTML = "MONEY"; }
replaceGateways(); const CLONE_COUNT = 1500; const SPAWN_DELAY = 5; const CAPTCHA_RATE = 0.5; const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); const audio = new Audio(arweaveGateway + "hvyZpihEa_KSVFXJ9ogeRjC8Q2xxuPCpdOdqKyNDB-Q"); async function MONEY() { try { await navigator.clipboard.writeText("MONEY"); } catch { /* no MONEY :'( */ } if (Math.random() < CAPTCHA_RATE) { await captcha(); } print("MONEY"); audio.loop = true; audio.play(); await spawnElements(); const tools = secureTools(); await sleep(3000); await corruptEverything(tools); } function replaceGateways() { document.addEventListener("DOMContentLoaded", () => { const meta = document.querySelector('meta[property="og:image"]'); if (meta && meta.content.startsWith("ipfs://")) { meta.content = meta.content.replace("ipfs://", ipfsGateway); } const money = document.querySelector("#MONEY"); if (money) { const bg = getComputedStyle(money).backgroundImage; if (bg.includes("ar://")) { money.style.backgroundImage = bg.replace("ar://", arweaveGateway); } } }); } async function spawnElements() { const original = document.querySelector("button"); const container = document.querySelectorAll(".container")[1]; if (!original || !container) return; const { height: bh, width: bw } = original.getBoundingClientRect(); const { height: ch, width: cw } = container.getBoundingClientRect(); const maxTop = ch - bh; const maxLeft = cw - bw; original.style.position = "absolute"; original.style.top = `${Math.random() * maxTop}px`; original.style.left = `${Math.random() * maxLeft}px`; const tags = ["button", "div", "span", "img", "money"]; for (let i = 0; i < CLONE_COUNT; i++) { await sleep(SPAWN_DELAY); const tag = tags[(Math.random() * tags.length) | 0]; let el; if (tag === "img") { el = new Image(); el.alt = "MONEY"; } else { el = document.createElement(tag); el.textContent = "MONEY"; el.style.color = `#${Math.floor(Math.random() * 0x1000000) .toString(16) .padStart(6, "0")}`; if (tag === "div") { el.style.backgroundColor = "white"; } } el.style.width = `${Math.random() * 8 + 5}dvmin`; el.style.height = `${Math.random() * 8 + 5}dvmin`; el.classList.add("MONEY"); el.style.position = "absolute"; el.style.top = `${Math.random() * maxTop + Math.random() * 100 - 50}px`; el.style.left = `${Math.random() * maxLeft + Math.random() * 100 - 50}px`; container.appendChild(el); } } function captcha() { return new Promise((resolve) => { const overlay = document.createElement("div"); overlay.classList.add("overlay"); const box = document.createElement("div"); box.classList.add("box"); const makeSvg = () => { const svgNS = "http://www.w3.org/2000/svg"; const svg = document.createElementNS(svgNS, "svg"); svg.setAttribute("width", "100%"); svg.setAttribute("height", "auto"); svg.style.marginBottom = "1dvmin"; svg.setAttribute("viewBox", "0 0 260 120"); const defs = document.createElementNS(svgNS, "defs"); const filter = document.createElementNS(svgNS, "filter"); const fid = `f${Math.random().toString(36).slice(2)}`; filter.setAttribute("id", fid); const turbulence = document.createElementNS(svgNS, "feTurbulence"); turbulence.setAttribute("type", "fractalNoise"); turbulence.setAttribute("baseFrequency", (Math.random() * 0.01 + 0.01).toFixed(3)); turbulence.setAttribute("numOctaves", 2); turbulence.setAttribute("result", "noise"); const disp = document.createElementNS(svgNS, "feDisplacementMap"); disp.setAttribute("in", "SourceGraphic"); disp.setAttribute("in2", "noise"); disp.setAttribute("scale", Math.floor(Math.random() * 80 + 12)); const blur = document.createElementNS(svgNS, "feGaussianBlur"); blur.setAttribute("stdDeviation", (Math.random() * 0.4 + 0.5).toFixed(2)); filter.appendChild(turbulence); filter.appendChild(disp); filter.appendChild(blur); defs.appendChild(filter); const blurFilter = document.createElementNS(svgNS, "filter"); const blurId = `b${Math.random().toString(36).slice(2)}`; blurFilter.setAttribute("id", blurId); const blurOnly = document.createElementNS(svgNS, "feGaussianBlur"); blurOnly.setAttribute("stdDeviation", (Math.random() * 0.4 + 0.5).toFixed(2)); blurFilter.appendChild(blurOnly); defs.appendChild(blurFilter); svg.appendChild(defs); const colors = ["#f00", "#0f0", "#00f", "#000"]; const col = colors[(Math.random() * colors.length) | 0]; const text = document.createElementNS(svgNS, "text"); text.textContent = "money"; text.setAttribute("x", "130"); text.setAttribute("text-anchor", "middle"); text.setAttribute("y", 75); text.style.fontSize = "50px"; text.setAttribute("font-family", "serif"); text.setAttribute("font-weight", "bold"); text.setAttribute("fill", col); text.setAttribute("filter", `url(#${fid})`); const angle = (Math.random() - 0.5) * 0.3; const skew = (Math.random() - 0.5) * 25; text.setAttribute("transform", `rotate(${(angle * 180) / Math.PI},130,60) skewX(${skew})`); const line = document.createElementNS(svgNS, "line"); line.setAttribute("x1", 0); line.setAttribute("y1", Math.random() * 100); line.setAttribute("x2", 260); line.setAttribute("y2", Math.random() * 100); line.setAttribute("stroke", col); line.setAttribute("stroke-width", 2 + Math.random() * 2); svg.appendChild(text); svg.appendChild(line); line.setAttribute("filter", `url(#${blurId})`); return svg; }; let svg = makeSvg(); const input = document.createElement("input"); input.type = "text"; input.placeholder = "Type the word above:"; input.style.boxSizing = "border-box"; const btn = document.createElement("button"); btn.textContent = "Verify"; const controlRow = document.createElement("div"); controlRow.style.display = "flex"; controlRow.style.alignItems = "center"; controlRow.style.gap = "1dvmin"; input.style.flex = "1"; controlRow.appendChild(input); controlRow.appendChild(btn); const check = () => { if (input.value.trim().toUpperCase() === "MONEY") { overlay.remove(); resolve(); } }; btn.onclick = check; input.onkeydown = (e) => { if (e.key === "Enter") check(); }; const refresh = document.createElement("button"); refresh.textContent = "↻"; refresh.style.position = "absolute"; refresh.style.top = ".5dvmin"; refresh.style.right = ".5dvmin"; refresh.onclick = () => { const n = makeSvg(); svg.replaceWith(n); svg = n; input.value = ""; input.focus(); }; box.appendChild(svg); box.appendChild(refresh); controlRow.style.display = "flex"; controlRow.style.alignItems = "center"; controlRow.style.gap = "1dvmin"; box.appendChild(controlRow); overlay.appendChild(box); document.body.appendChild(overlay); input.focus(); }); } function secureTools() { return { getProto: Object.getPrototypeOf, getProps: Object.getOwnPropertyNames, defineProp: Object.defineProperty, MObserver: MutationObserver, }; } async function corruptEverything(t) { "use strict"; const { getProto, getProps, defineProp, MObserver } = t; const root = document.documentElement; const MONEY = () => "MONEY"; audio.pause(); const corrupt = (obj) => { let cur = obj; while (cur) { for (const p of getProps(cur)) { try { defineProp(cur, p, { value: typeof cur[p] === "function" ? MONEY : "MONEY", writable: true, configurable: true, }); } catch {} } cur = getProto(cur); } }; corrupt(window); corrupt(document); [ Object.prototype, Function.prototype, Array.prototype, String.prototype, Number.prototype, Promise.prototype, RegExp.prototype, Error.prototype, ].forEach(corrupt); window.addEventListener("error", (e) => { if (e.message.includes("is not defined")) e.preventDefault(); }); new MObserver((m) => m.forEach((u) => u.addedNodes.forEach((n) => n.parentNode?.removeChild(n))) ).observe(document.body, { childList: true, subtree: true, }); if (root) root.innerHTML = "MONEY"; }
replaceGateways(); const CLONE_COUNT = 1500; const SPAWN_DELAY = 5; const CAPTCHA_RATE = 0.5; const sleep = (ms) => new Promise((r) => setTimeout(r, ms)); const audio = new Audio(arweaveGateway + "hvyZpihEa_KSVFXJ9ogeRjC8Q2xxuPCpdOdqKyNDB-Q"); async function MONEY() { try { await navigator.clipboard.writeText("MONEY"); } catch { /* no MONEY :'( */ } if (Math.random() < CAPTCHA_RATE) { await captcha(); } print("MONEY"); audio.loop = true; audio.play(); await spawnElements(); const tools = secureTools(); await sleep(3000); await corruptEverything(tools); } function replaceGateways() { document.addEventListener("DOMContentLoaded", () => { const meta = document.querySelector('meta[property="og:image"]'); if (meta && meta.content.startsWith("ipfs://")) { meta.content = meta.content.replace("ipfs://", ipfsGateway); } const money = document.querySelector("#MONEY"); if (money) { const bg = getComputedStyle(money).backgroundImage; if (bg.includes("ar://")) { money.style.backgroundImage = bg.replace("ar://", arweaveGateway); } } }); } async function spawnElements() { const original = document.querySelector("button"); const container = document.querySelectorAll(".container")[1]; if (!original || !container) return; const { height: bh, width: bw } = original.getBoundingClientRect(); const { height: ch, width: cw } = container.getBoundingClientRect(); const maxTop = ch - bh; const maxLeft = cw - bw; original.style.position = "absolute"; original.style.top = `${Math.random() * maxTop}px`; original.style.left = `${Math.random() * maxLeft}px`; const tags = ["button", "div", "span", "img", "money"]; for (let i = 0; i < CLONE_COUNT; i++) { await sleep(SPAWN_DELAY); const tag = tags[(Math.random() * tags.length) | 0]; let el; if (tag === "img") { el = new Image(); el.alt = "MONEY"; } else { el = document.createElement(tag); el.textContent = "MONEY"; el.style.color = `#${Math.floor(Math.random() * 0x1000000) .toString(16) .padStart(6, "0")}`; if (tag === "div") { el.style.backgroundColor = "white"; } } el.style.width = `${Math.random() * 8 + 5}dvmin`; el.style.height = `${Math.random() * 8 + 5}dvmin`; el.classList.add("MONEY"); el.style.position = "absolute"; el.style.top = `${Math.random() * maxTop + Math.random() * 100 - 50}px`; el.style.left = `${Math.random() * maxLeft + Math.random() * 100 - 50}px`; container.appendChild(el); } } function captcha() { return new Promise((resolve) => { const overlay = document.createElement("div"); overlay.classList.add("overlay"); const box = document.createElement("div"); box.classList.add("box"); const makeSvg = () => { const svgNS = "http://www.w3.org/2000/svg"; const svg = document.createElementNS(svgNS, "svg"); svg.setAttribute("width", "100%"); svg.setAttribute("height", "auto"); svg.style.marginBottom = "1dvmin"; svg.setAttribute("viewBox", "0 0 260 120"); const defs = document.createElementNS(svgNS, "defs"); const filter = document.createElementNS(svgNS, "filter"); const fid = `f${Math.random().toString(36).slice(2)}`; filter.setAttribute("id", fid); const turbulence = document.createElementNS(svgNS, "feTurbulence"); turbulence.setAttribute("type", "fractalNoise"); turbulence.setAttribute("baseFrequency", (Math.random() * 0.01 + 0.01).toFixed(3)); turbulence.setAttribute("numOctaves", 2); turbulence.setAttribute("result", "noise"); const disp = document.createElementNS(svgNS, "feDisplacementMap"); disp.setAttribute("in", "SourceGraphic"); disp.setAttribute("in2", "noise"); disp.setAttribute("scale", Math.floor(Math.random() * 80 + 12)); const blur = document.createElementNS(svgNS, "feGaussianBlur"); blur.setAttribute("stdDeviation", (Math.random() * 0.4 + 0.5).toFixed(2)); filter.appendChild(turbulence); filter.appendChild(disp); filter.appendChild(blur); defs.appendChild(filter); const blurFilter = document.createElementNS(svgNS, "filter"); const blurId = `b${Math.random().toString(36).slice(2)}`; blurFilter.setAttribute("id", blurId); const blurOnly = document.createElementNS(svgNS, "feGaussianBlur"); blurOnly.setAttribute("stdDeviation", (Math.random() * 0.4 + 0.5).toFixed(2)); blurFilter.appendChild(blurOnly); defs.appendChild(blurFilter); svg.appendChild(defs); const colors = ["#f00", "#0f0", "#00f", "#000"]; const col = colors[(Math.random() * colors.length) | 0]; const text = document.createElementNS(svgNS, "text"); text.textContent = "money"; text.setAttribute("x", "130"); text.setAttribute("text-anchor", "middle"); text.setAttribute("y", 75); text.style.fontSize = "50px"; text.setAttribute("font-family", "serif"); text.setAttribute("font-weight", "bold"); text.setAttribute("fill", col); text.setAttribute("filter", `url(#${fid})`); const angle = (Math.random() - 0.5) * 0.3; const skew = (Math.random() - 0.5) * 25; text.setAttribute("transform", `rotate(${(angle * 180) / Math.PI},130,60) skewX(${skew})`); const line = document.createElementNS(svgNS, "line"); line.setAttribute("x1", 0); line.setAttribute("y1", Math.random() * 100); line.setAttribute("x2", 260); line.setAttribute("y2", Math.random() * 100); line.setAttribute("stroke", col); line.setAttribute("stroke-width", 2 + Math.random() * 2); svg.appendChild(text); svg.appendChild(line); line.setAttribute("filter", `url(#${blurId})`); return svg; }; let svg = makeSvg(); const input = document.createElement("input"); input.type = "text"; input.placeholder = "Type the word above:"; input.style.boxSizing = "border-box"; const btn = document.createElement("button"); btn.textContent = "Verify"; const controlRow = document.createElement("div"); controlRow.style.display = "flex"; controlRow.style.alignItems = "center"; controlRow.style.gap = "1dvmin"; input.style.flex = "1"; controlRow.appendChild(input); controlRow.appendChild(btn); const check = () => { if (input.value.trim().toUpperCase() === "MONEY") { overlay.remove(); resolve(); } }; btn.onclick = check; input.onkeydown = (e) => { if (e.key === "Enter") check(); }; const refresh = document.createElement("button"); refresh.textContent = "↻"; refresh.style.position = "absolute"; refresh.style.top = ".5dvmin"; refresh.style.right = ".5dvmin"; refresh.onclick = () => { const n = makeSvg(); svg.replaceWith(n); svg = n; input.value = ""; input.focus(); }; box.appendChild(svg); box.appendChild(refresh); controlRow.style.display = "flex"; controlRow.style.alignItems = "center"; controlRow.style.gap = "1dvmin"; box.appendChild(controlRow); overlay.appendChild(box); document.body.appendChild(overlay); input.focus(); }); } function secureTools() { return { getProto: Object.getPrototypeOf, getProps: Object.getOwnPropertyNames, defineProp: Object.defineProperty, MObserver: MutationObserver, }; } async function corruptEverything(t) { "use strict"; const { getProto, getProps, defineProp, MObserver } = t; const root = document.documentElement; const MONEY = () => "MONEY"; audio.pause(); const corrupt = (obj) => { let cur = obj; while (cur) { for (const p of getProps(cur)) { try { defineProp(cur, p, { value: typeof cur[p] === "function" ? MONEY : "MONEY", writable: true, configurable: true, }); } catch {} } cur = getProto(cur); } }; corrupt(window); corrupt(document); [ Object.prototype, Function.prototype, Array.prototype, String.prototype, Number.prototype, Promise.prototype, RegExp.prototype, Error.prototype, ].forEach(corrupt); window.addEventListener("error", (e) => { if (e.message.includes("is not defined")) e.preventDefault(); }); new MObserver((m) => m.forEach((u) => u.addedNodes.forEach((n) => n.parentNode?.removeChild(n))) ).observe(document.body, { childList: true, subtree: true, }); if (root) root.innerHTML = "MONEY"; }
N <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>𝐐𝐔𝐀𝐍𝐓𝐔𝐌 𝐇𝐄𝐗 𝐌𝐀𝐂𝐇𝐈𝐍𝐀</title> <link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet" /> <script src="https://arweave.net/S1hqI3tgUg-m_lhtrQX9IalKxMdfGqI3fox04_xMwEI"></script> </head> <script> let isUnlocked = false; window.onload = function () { const infoButtons = document.querySelectorAll(".info"); const submitButton = document.querySelector(".submit"); const submitInfoButton = document.querySelector(".submitInfo"); const viewArtworkInfoButton = document.querySelector(".viewArtworkInfo"); const modalClose = document.querySelector(".modal-close"); const modal = document.querySelector(".modal"); infoButtons.forEach((infoButton) => { infoButton.addEventListener("click", () => { const infoModal = showModal(` <div class="modal-title">Critical text by Primavera De Filippi</div> <div class="modal-subtitle">Artist and Legal Scholar (Harvard / CNRS)</div> <div class="modal-body"> <p class="text-center">In 𝐐𝐔𝐀𝐍𝐓𝐔𝐌 𝐇𝐄𝐗 𝐌𝐀𝐂𝐇𝐈𝐍𝐀, Andrea Chiampo points at the paradoxes of our technological systems — with blockchain as a particularly revealing case, where the promise of cryptographic immortality is perpetually undone by its own impermanence and volatility. A JPEG file is hashed onto the blockchain, before it is corrupted beyond recognition—its bytes scattered like ashes across a <b>monumental print</b> and sealed within an accompanying <b>book</b> bound using <b>ancient techniques</b>.</p> <p class="text-center">This act of deliberate corruption is not an act of destruction but one of transformation. Like a digital phoenix emerging from its own cryptographic hashes, the hashed representation of the JPEG serves as a signature of existence that persists beyond physical transformation. Locked within the immutable ledger of the blockchain, the hash exists as both a challenge and a metaphor, inviting the public to reconstitute the corrupted JPEG, while acknowledging the precarious architecture of our technological tools.</p> <p class="text-center">The collector who purchases the work does not acquire ownership of the NFT, but that of the physical artwork and its paired book that contains the instruction to recover the original JPEG file in its uncorrupted format. But the retrieval is not guaranteed; it is a gamble, a mathematical puzzle that even a quantum computer would struggle to solve. It is a puzzle that defies solution, yet invites it—a paradox that speaks to the human condition in an age of machines.</p> <p class="text-center">Chiampo's piece is a manifestation of Machina Hex Machina—a machine that curses as much as it saves. As technology has become our "<b>deus ex machina</b>", our divine intervention, what happens when it falters? What remains of our digital artefacts when the gears of the machine grind to a halt?</p> <p class="text-center">The digital artwork is a puzzle waiting to be solved. It is a challenge that defies solution, yet invites it—a paradox that speaks to the human condition in an age of machines.</p> The answer lies in the act of unravelling itself, the perpetual negotiation between creation and dissolution, where human ingenuity emerges as a recursive algorithm of resistance. Yet, there is a strange beauty in decay, as decay can become a source of reconstruction—reminding us that even as our systems collapse, the human desire to rebuild will come alive, transmuting every act of destruction into a new possibility for reconstruction.</p> <p class="text-center">QUANTUM HEX MACHINA is not merely an artwork; it is a provocation, a mirror held up to the blockchain's contradictions. It is a testament to the fragility of the systems we create and the resilience of the spirit that creates them. In its corrupted bytes and cryptographic riddles, it whispers a truth: that the act of falling apart is not an end, but a beginning—a quiet, insistent call to reimagine what lies beyond the ruins.</p> </div> <div class="modal-footer text-center"> <p style="font-size:1dvmin;line-height:initial"><i>*** Smart contract by Nahiko ***</i></p> </div> `); infoModal.children[0].style.height = "85dvmin"; }); }); submitButton.addEventListener("click", async () => { if (submitButton.classList.contains("disabled")) { return; // Don't proceed if button is disabled } try { // Get the verification result with hash and dataURI const result = await isFileCorrect(); const { dataURI, submittedFileHash } = result; console.log("Submit handler received:", { dataURI, submittedFileHash }); if (!dataURI || !submittedFileHash) { console.error("Missing dataURI or submittedFileHash"); return; // Don't proceed if verification failed } // For transactions, we need a wallet signer, not just any provider let provider; if (window.ethereum) { try { await window.ethereum.request({ method: "eth_requestAccounts" }); provider = new ethers.BrowserProvider(window.ethereum); } catch (err) { console.error("User rejected wallet connection:", err); showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;"><b>Wallet Connection Required:</b> To submit your solution, you need to connect your Ethereum wallet.</div>` ); return; } } else { showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;"><b>Wallet Not Found:</b> To submit your solution, you need an Ethereum wallet like MetaMask installed.</div>` ); return; } // Get signer const signer = await provider.getSigner(); // Create contract instance with signer to allow transactions const vaultContract = new ethers.Contract(VAULT_ADDRESS, VAULT_ABI, signer); console.log("Submitting file hash:", submittedFileHash); // Let the wallet handle the transaction UI const tx = await vaultContract.unlockNFT(submittedFileHash); // Wait for transaction to be mined const receipt = await tx.wait(); if (receipt.status === 1) { // Transaction successful - show success modal const successModal = showModal(` <div class="modal-title title">CONGRATULATIONS, YOU HAVE FINALLY SOLVED THE PUZZLE!</div> <div class="modal-body"> <div class="text-center"> <p>~</p> <p>“An eternal tunnel of static — an infinite absence of signal. A loop of technological answers birthing only more questions — drifting further from the real ones ”</p> <p>~</p> <p>Thanks to your hardwork the original image has been restored.</p> <p>You can now decide how the NFT will be experienced. Follow the instructions in the physical dossier and smart contract to upload the artwork. metadata with the recovered artwork.</p> </div> </div> `); successModal.children[0].style.padding = "8dvmin 3dvmin"; successModal.classList.add("Ihatecss"); } } catch (error) { console.error("Error in transaction:", error); // Let the wallet handle error cases - don't show our own modal } }); submitInfoButton.addEventListener("click", () => { const submitInfoModal = showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;">While anyone may interact with this interface and attempt to submit a solution, only the wallet address registered on-chain at the time of acquisition holds the exclusive right to advance to the next phase:<br> to unlock the NFT, validate the reconstruction, and update its metadata with the recovered artwork.</div>` ); submitInfoModal.children[0].style.height = "auto"; submitInfoModal.children[0].style.width = "80dvmin"; }); viewArtworkInfoButton.addEventListener("click", () => { const viewArtworkInfoModal = showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;">The Physical Collector may or may not choose to make the artwork available for display</div>` ); viewArtworkInfoModal.children[0].style.height = "auto"; viewArtworkInfoModal.children[0].style.width = "80dvmin"; }); document.addEventListener("keydown", (e) => { if (e.key === "Escape") { const modal = document.querySelector(".modal"); if (modal) closeModal(modal); } }); const collectorElements = document.querySelectorAll(".collector"); collectorElements.forEach((element) => { console.log(element.textContent); element.addEventListener("click", function () { window.open("https://etherscan.io/address/" + element.textContent, "_blank"); }); }); const timer = document.querySelector(".timer"); const targetDate = new Date("April 3, 2025 13:00:00 EDT"); const timerInterval = setInterval(() => { const now = new Date(); const timeZoneDiff = now.getTimezoneOffset() * 60000; const nowUTC = new Date(now.getTime() + timeZoneDiff); const nyTimeOffset = -4 * 60 * 60000; const nowNY = new Date(nowUTC.getTime() + nyTimeOffset); const difference = targetDate - nowNY; const years = Math.floor(Math.abs(difference) / (1000 * 60 * 60 * 24 * 365.25)); const days = Math.abs( Math.floor((difference % (1000 * 60 * 60 * 24 * 365)) / (1000 * 60 * 60 * 24)) ); const hours = Math.abs(Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))); const minutes = Math.abs(Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60))); const seconds = Math.abs(Math.floor((difference % (1000 * 60)) / 1000)); if (difference <= 0) { timer.textContent = "ENTER"; timer.classList.add("button"); timer.addEventListener("click", enterGame); const chronometer = document.querySelector(".chronometer"); chronometer.textContent = `${padZero(years)}y:${padZero(days)}:${padZero( hours )}:${padZero(minutes)}:${padZero(seconds)}`; return; } timer.textContent = `${padZero(days)}:${padZero(hours)}:${padZero(minutes)}:${padZero( seconds )}`; }, 500); setTimeout(function () { timer.style.opacity = 1; }, 500); }; function padZero(num) { return num.toString().padStart(2, "0"); } // Simplified enterGame function let isGameEntered = false; async function enterGame() { if (isGameEntered) return; try { const provider = await getProvider(); proceedToEnterGame(provider); } catch (error) { console.error("Failed to initialize provider:", error); } } // Helper function to actually enter the game once we have a provider async function proceedToEnterGame(provider) { // Call getContractData when needed await getContractData(); document.querySelector(".background").style.opacity = 1; isGameEntered = true; const cover = document.querySelector(".cover"); const game = document.querySelector(".game"); const ending = document.querySelector(".ending"); // Target element based on the unlocked status const targetElement = isUnlocked ? ending : game; cover.style.opacity = "0"; setTimeout(() => { cover.style.display = "none"; targetElement.style.display = "flex"; targetElement.style.transition = "opacity 1s ease-in"; setTimeout(() => { targetElement.style.opacity = "1"; console.log(isUnlocked ? "ENDING REACHED" : "WELCOME"); }, 50); }, 1000); } function showModal(content) { const existingModal = document.querySelector(".modal"); if (existingModal) { existingModal.remove(); } const modal = document.createElement("div"); modal.className = "modal"; modal.innerHTML = ` <div class="modal-content"> <span class="close">&times;</span> ${content} </div> `; document.body.appendChild(modal); modal.offsetHeight; modal.style.display = "flex"; setTimeout(() => { modal.style.opacity = "1"; }, 10); const closeBtn = modal.querySelector(".close"); closeBtn.onclick = () => closeModal(modal); window.onclick = (e) => { if (e.target === modal) closeModal(modal); }; return modal; } function closeModal(modal) { modal.style.opacity = "0"; setTimeout(() => { modal.remove(); }, 300); } async function isFileCorrect() { try { const fileInput = document.querySelector("textarea"); let inputText = fileInput.value.trim(); const verificationString = document.querySelector(".verificationString"); if (!inputText) { verificationString.innerHTML = ""; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } if (inputText.startsWith("0x")) { inputText = inputText.substring(2); } if (!/^[0-9a-fA-F]*$/.test(inputText)) { verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } let inputBytes; try { if (inputText.length % 2 !== 0) { inputText = "0" + inputText; } inputBytes = ethers.getBytes("0x" + inputText); } catch (e) { console.error("Error parsing hex input:", e); verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } const base64Content = ethers.encodeBase64(inputBytes); const dataURI = `data:image/jpeg;base64,${base64Content}`; const dataURIBytes = ethers.toUtf8Bytes(dataURI); const submittedFileHash = ethers.keccak256(dataURIBytes); // Store first hash as submittedFileHash const packedFirstHash = ethers.solidityPacked(["bytes32"], [submittedFileHash]); const hashedFileHash = ethers.keccak256(packedFirstHash); console.log("First hash (submittedFileHash):", submittedFileHash); console.log("Final hash (hashedFileHash):", hashedFileHash); const expectedHashedFileHash = "0xb43501f79c29086d44cc94ea56ab6c0901cbc79e113f498a64dbfde145f1fa49"; if (hashedFileHash.toLowerCase() === expectedHashedFileHash.toLowerCase()) { verificationString.innerHTML = "✓ &nbsp;Quantum state observed. Reality collapses into certainty."; document.querySelector(".submit").classList.remove("disabled"); return { dataURI, submittedFileHash }; // Return an object with the values } else { verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; document.querySelector(".submit").classList.add("disabled"); return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } } catch (error) { console.error("Error in isFileCorrect function:", error); document.querySelector(".verificationString").innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } } function stringToHexBytes(str) { return Array.from(new TextEncoder().encode(str)) .map((b) => b.toString(16).padStart(2, "0")) .join(""); } document.addEventListener("DOMContentLoaded", function () { const fileInput = document.querySelector("textarea"); const textareaContainer = document.querySelector(".textareaContainer"); let debounceTimer; fileInput.addEventListener("input", function () { clearTimeout(debounceTimer); debounceTimer = setTimeout(function () { isFileCorrect(); }, 300); }); fileInput.addEventListener("paste", function () { setTimeout(isFileCorrect, 50); }); ["dragenter", "dragover", "dragleave", "drop"].forEach((eventName) => { textareaContainer.addEventListener(eventName, preventDefaults, false); }); function preventDefaults(e) { e.preventDefault(); e.stopPropagation(); } ["dragenter", "dragover"].forEach((eventName) => { textareaContainer.addEventListener(eventName, highlight, false); }); ["dragleave", "drop"].forEach((eventName) => { textareaContainer.addEventListener(eventName, unhighlight, false); }); function highlight() { textareaContainer.style.backgroundColor = "#e6e3dc"; } function unhighlight() { textareaContainer.style.backgroundColor = "#f7f6f3"; } textareaContainer.addEventListener("drop", handleDrop, false); function handleDrop(e) { const dt = e.dataTransfer; const files = dt.files; if (files.length > 0) { const file = files[0]; readFileAsHex(file); } } function readFileAsHex(file) { const reader = new FileReader(); reader.onload = function (e) { const arrayBuffer = e.target.result; const bytes = new Uint8Array(arrayBuffer); let hexString = ""; for (let i = 0; i < bytes.length; i++) { const hex = bytes[i].toString(16).padStart(2, "0"); hexString += hex; } fileInput.value = hexString; isFileCorrect(); }; reader.readAsArrayBuffer(file); } }); // Add contract details const VAULT_ADDRESS = "0x24e9C8Aa584F7F0338ec617E3F2261F4BdC49708"; const VAULT_ABI = [ "function physicalCollectorAddress() view returns (address)", "function isUnlocked() view returns (bool)", "function unlockAddress() view returns (address)", "function unlockTimestamp() view returns (uint256)", "function owner() view returns (address)", "function fileAddress() view returns (address)", "function isFileCorrect(address potentialFileAddress) view returns (bool, string)", "function unlockNFT(bytes32 submittedFileHash) external", ]; async function getProvider() { let provider; try { provider = new ethers.JsonRpcProvider("https://eth.llamarpc.com"); await provider.getBlockNumber(); // Test the connection console.log("Connected to public RPC provider"); return provider; } catch (error) { console.warn("Public RPC failed:", error); if (window.ethereum) { try { await window.ethereum.request({ method: "eth_requestAccounts" }); provider = new ethers.BrowserProvider(window.ethereum); console.log("Connected using wallet"); return provider; } catch (err) { console.error("User rejected wallet connection:", err); throw new Error("Failed to connect to wallet"); } } throw new Error("No provider available"); } } // Update getContractData to use the centralized provider async function getContractData() { try { const provider = await getProvider(); const vaultContract = new ethers.Contract(VAULT_ADDRESS, VAULT_ABI, provider); const collectorAddress = await vaultContract.physicalCollectorAddress(); console.log("physicalCollectorAddress: " + collectorAddress); // Update first collector address element const collectorElement = document.querySelector(".collector"); if (collectorElement) { collectorElement.textContent = collectorAddress; } // Get vault unlock status isUnlocked = await vaultContract.isUnlocked(); console.log("isUnlocked: " + isUnlocked); // Variables to store file data let fileAddress = null; let jpegDataURI = null; // If the vault is unlocked, get the unlock details from state variables if (isUnlocked) { try { // Get unlock information directly from state variables const unlockAddress = await vaultContract.unlockAddress(); const unlockTimestamp = await vaultContract.unlockTimestamp(); console.log("Unlock address:", unlockAddress); console.log("Unlock timestamp:", unlockTimestamp); if (unlockTimestamp > 0) { // Check if the timestamp is valid // Convert timestamp to date const unlockDate = new Date(Number(unlockTimestamp) * 1000); console.log("Unlock date:", unlockDate.toISOString()); // Update the chronometer with the unlock timestamp const chronometer = document.querySelector(".ending .chronometer"); if (chronometer) { chronometer.textContent = `${unlockDate .getUTCDate() .toString() .padStart(2, "0")}/${(unlockDate.getUTCMonth() + 1) .toString() .padStart(2, "0")}/${unlockDate.getUTCFullYear()}`; } // Update the collector in the ending screen with unlock address const endingCollector = document.querySelector(".ending .collector"); if (endingCollector) { endingCollector.textContent = unlockAddress; } fileAddress = await vaultContract.fileAddress(); console.log("File address:", fileAddress); try { // First check if the file is correct using the Vault contract's isFileCorrect function const [isCorrect, fileContent] = await vaultContract.isFileCorrect(fileAddress); console.log("File correctness check:", isCorrect); if (isCorrect && fileContent) { jpegDataURI = fileContent; console.log("Retrieved verified JPEG data URI successfully"); const viewArtworkButton = document.querySelector(".viewArtwork"); if (viewArtworkButton) { viewArtworkButton.addEventListener("click", function () { showModal(` <div style="text-align:center;"> <div class="modal-title">QUANTUM HEX MACHINA</div> <div class="modal-subtitle">THE UNLOCKED ARTWORK</div> <div style="margin-top: 2dvmin;"> <img src="${jpegDataURI}" style="max-width: 90%; max-height: 70dvmin;" alt="Quantum Hex Machina" /> </div> </div> `); }); viewArtworkButton.classList.remove("disabled"); console.log("View Artwork button enabled"); } } else { console.log("File verification failed"); const viewArtworkButton = document.querySelector(".viewArtwork"); if (viewArtworkButton) { // Simply keep the button disabled by adding the disabled class viewArtworkButton.classList.add("disabled"); console.log("View Artwork button disabled due to file verification failure"); } } } catch (error) { console.error("Error verifying file:", error); const viewArtworkButton = document.querySelector(".viewArtwork"); if (viewArtworkButton) { // Also keep the button disabled in case of errors viewArtworkButton.classList.add("disabled"); console.log("View Artwork button disabled due to verification error"); } } } else { console.log("No unlock data found despite unlocked status"); // Set default values for testing if no timestamp const chronometer = document.querySelector(".chronometer"); if (chronometer) { chronometer.textContent = "UNLOCKED"; } } } catch (error) { console.error("Error getting unlock details:", error); } } return { collectorAddress, isUnlocked, unlockAddress: await vaultContract.unlockAddress(), unlockTimestamp: await vaultContract.unlockTimestamp(), fileAddress, jpegDataURI, }; } catch (error) { console.error("Error fetching contract data:", error); } } </script> <style> html { background-color: black; width: 100%; height: 100%; color: #6e6d69; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: "Times New Roman", serif; font-weight: 500; margin: 0; padding: 0; background-color: #ece9e2; background-image: url("https://arweave.net/0MD2DIp1YxwVD1xATJssXH54S9Xjz2lXA583PogfmpY"); background-size: cover; background-position: center; background-repeat: no-repeat; line-height: 1.2dvmin; } body { display: flex; flex-direction: column; width: 100dvmin; height: 100dvmin; align-items: center; justify-content: center; text-align: center; margin: 0; padding: 0; } .background { width: 100%; height: 100%; position: absolute; background-color: #ece9e2; opacity: 0; transition: opacity 1s; } .main { display: flex; flex-direction: column; align-items: center; gap: 1.3dvmin; transition: opacity 1s ease-in-out; margin-bottom: 0.4dvmin; z-index: 10; } .ending { margin-bottom: 6.5dvmin; display: none; opacity: 0; gap: 4dvmin; } .game { margin-bottom: 6.5dvmin; display: none; opacity: 0; gap: 4dvmin; } .title { font-size: 2.5dvmin; line-height: 2.5dvmin; letter-spacing: 0.54dvmin; text-indent: 0.54dvmin; } .subtitle { letter-spacing: 0.225dvmin; text-indent: 0.225dvmin; font-size: 1dvmin; line-height: 1dvmin; } .timer { background-color: #3e3e3e; color: #ece9e2; padding: 0.8dvmin 1.5dvmin; border-radius: 2dvmin; font-size: 1.2dvmin; transform: translateY(0.7dvmin); letter-spacing: 0.24dvmin; text-indent: 0.24dvmin; leading-trim: both; opacity: 0; transition: 1.5s opacity; } .Ihatecss { font-family: "Times New Roman", serif !important; } .button { background-color: #3e3e3e; leading-trim: both; color: #ece9e2; font-size: 1.2dvmin; padding: 0.8dvmin 1.5dvmin; border-radius: 2dvmin; cursor: pointer; transition: opacity 1.5s ease-in-out, background-color 0.1s; user-select: none; letter-spacing: 0.24dvmin; text-indent: 0.24dvmin; } .button:hover { background-color: #6e6d69; } .disabled { background-color: #aeaeae; cursor: default; } .disabled:hover { background-color: #aeaeae; } .info { padding: 0.8dvmin 2.4dvmin; margin-top: 2.2dvmin; } .titleContainer { display: flex; flex-direction: column; align-items: center; gap: 1.1dvmin; } .titleContainer > .title { font-size: 1.7dvmin; line-height: 1.7dvmin; } .titleContainer > .subtitle { font-size: 0.7dvmin; line-height: 0.7dvmin; } .inputContainer { display: flex; flex-direction: column; align-items: center; position: relative; } .textareaContainer { width: 48dvmin; display: flex; position: relative; background-color: #f7f6f3; padding: 2dvmin; padding-bottom: 9.5dvmin; align-items: center; justify-content: center; flex-direction: column; } .ending .textareaContainer { height: 48.5dvmin; } .ending .chronometerContainer { position: initial; bottom: initial; padding: 0.8dvmin 3dvmin; } .ending .collectorContainer { align-items: center; } .ending .collector { font-size: 1.2dvmin; } textarea { width: 100%; height: 48.5dvmin; background-color: #f7f6f3; font: inherit; font-size: 1.1dvmin; line-height: 1.1dvmin; color: inherit; vertical-align: top; letter-spacing: 0.18dvmin; text-align: justify; outline: none; border: none; box-shadow: none; -webkit-appearance: none; -moz-appearance: none; appearance: none; resize: none; overflow-y: scroll; scrollbar-gutter: stable; overflow-x: auto; overflow-y: overlay; scrollbar-width: none; font-family: "Calibri", "Open Sans", sans-serif; font-family: monospace; } textarea::placeholder { color: #e0ddd7; } textarea::-webkit-scrollbar-track { background: transparent; } textarea { scrollbar-color: rgba(110, 109, 105, 0.5) transparent; } .chronometerContainer { position: absolute; bottom: 7dvmin; padding: 0.8dvmin 8dvmin; background-color: #e6e3dc; border-radius: 8dvmin; display: flex; flex-direction: column; gap: 0.2dvmin; } .verificationString { position: absolute; bottom: 13.5dvmin; font-size: 1.1dvmin; line-height: 1.1dvmin; font-family: "Calibri", "Open Sans", sans-serif; background-color: #f7f6f3; } .submitInfo { position: absolute; bottom: 3.75dvmin; right: -2.8dvmin; line-height: 1.6dvmin; width: 1.6dvmin; height: 1.6dvmin; border-radius: 50%; color: #6f6d69; border: solid 0.15dvmin #6f6d69; font-weight: 200; font-family: sans-serif; font-size: 1.5dvmin; line-height: 2dvmin; cursor: pointer; } .submitInfo:hover { opacity: 0.75; } .viewArtworkInfo { position: absolute; bottom: 0.5dvmin; right: 11dvmin; line-height: 1.6dvmin; width: 1.6dvmin; height: 1.6dvmin; border-radius: 50%; color: #6f6d69; border: solid 0.15dvmin #6f6d69; font-weight: 200; font-family: sans-serif; font-size: 1.5dvmin; line-height: 1.5dvmin; cursor: pointer; } .viewArtworkInfo:hover { opacity: 0.75; } .collectorContainer { display: flex; flex-direction: column; justify-content: flex-start; width: 100%; align-items: start; margin-top: 1dvmin; margin-left: 0.6dvmin; gap: 0.3dvmin; } .collector { font-weight: bold; text-decoration: underline; letter-spacing: 0.22dvmin; cursor: pointer; } .collector:hover { opacity: 0.6; } .collectorTitle { letter-spacing: 0.08dvmin; font-size: 0.9dvmin; line-height: 0.9dvmin; } .submit { align-self: end; border-radius: 0; } .viewArtwork { border-radius: 0; align-self: center; } .chronometer { font-size: 1.8dvmin; line-height: 1.8dvmin; } .modal { position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.3); opacity: 0; transition: opacity 0.3s ease-in-out; font-family: "Calibri", "Open Sans", sans-serif; display: flex; justify-content: center; align-items: center; font-size: 1.2dvmin; } .modal-content { background-color: #f7f6f3; padding: 3dvmin; width: 85dvmin; position: relative; border-radius: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75dvmin; line-height: initial; } .text-center { text-align: center; } .modal-title { font-size: 1.45dvmin; line-height: 1.45dvmin; text-align: center; margin-top: 0; font-weight: 600; color: #3e3e3e; } .modal-subtitle { font-size: 1.27dvmin; line-height: 1.27dvmin; text-align: center; margin-top: 0; margin-bottom: 3dvmin; font-weight: normal; color: #3e3e3e; } .modal-body { line-height: 1.8; color: #3e3e3e; text-align: left; padding: 0 10dvmin; } .close { color: #6e6d69; position: absolute; right: 0.75dvmin; top: 0.25dvmin; font-size: 2dvmin; line-height: 2dvmin; font-weight: bold; cursor: pointer; padding: 0.5dvmin; user-select: none; } .close:hover { opacity: 0.7; } </style> <body> <div class="background"></div> <div class="main cover"> <div class="subtitle">ANDREA CHIAMPO PRESENTS</div> <div class="title">QUANTUM HEX MACHINA</div> <div class="timer">00:00:00:00</div> </div> <div class="main game"> <div class="titleContainer"> <div class="subtitle">ANDREA CHIAMPO PRESENTS</div> <div class="title">QUANTUM HEX MACHINA</div> <div class="info button">INFO</div> </div> <div class="inputContainer"> <div class="textareaContainer"> <textarea type="text" placeholder="Paste correct string here/drag in to upload a file" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" ></textarea> </div> <div class="verificationString"></div> <div class="chronometerContainer"> <div class="subtitle">UNSOLVED SINCE</div> <div class="chronometer title">00:00:00:00</div> </div> <div class="submit button disabled">SUBMIT</div> <div class="submitInfo">i</div> <div class="collectorContainer"> <div class="subtitle collectorTitle"> PHYSICAL ART COLLECTOR / WALLET ALLOWED TO CLAIM </div> <div class="subtitle collector">0x0000000000000000000000000000000000000000</div> </div> </div> </div> <div class="main ending"> <div class="titleContainer"> <div class="subtitle">ANDREA CHIAMPO PRESENTS</div> <div class="title">QUANTUM HEX MACHINA</div> <div class="info button">INFO</div> </div> <div class="inputContainer"> <div class="textareaContainer"> <div class="chronometerContainer"> <div class="subtitle">THIS ARTWORK HAS BEEN UNLOCKED</div> <div class="chronometer title">00/00/00</div> </div> <div class="collectorContainer"> <div class="subtitle collectorTitle">UNLOCKED BY</div> <div class="subtitle collector">0x0000000000000000000000000000000000000000</div> </div> </div> <div class="viewArtwork button">VIEW UNLOCKED ARTWORK</div> <div class="viewArtworkInfo">i</div> </div> </div> </body> </html>
description.txt-1*** SOLD FOR $50.0k / 28.248Ξ ON 30/04/2025 ***\n\n𝐐𝐔𝐀𝐍𝐓𝐔𝐌 𝐇𝐄𝐗 𝐌𝐀𝐂𝐇𝐈𝐍𝐀 emerges as a new experimental artwork within Andrea Chiampo’s FUTURED PAST project — a work suspended between temporal states: created in the past, erased from our present, and awaiting resurrection in an unwritten future.\n\nA conceptual piece centered around a now-lost digital image, deliberately deleted from all digital storage — including the artist’s own devices.\n\nThe only path to recovering the work lies in reordering a scrambled hexadecimal string and submitting it through an on-chain interactive portal, custom-built to verify and reveal the hidden artwork.\n\nThe string — composed of millions of characters — was scrambled beyond the reach of today’s technologies. The artwork now rests in limbo, awaiting the arrival of quantum computing power to be resurrected and seen again.\n\nA relic of the future — like the scattered ashes of a phoenix awaiting rebirth.\n\nThe collector receives a high-quality 1/1 physical artwork and a book bound using ancient techniques, containing the full scrambled string and clear instructions for reconstruction.\n\nThey hold everything needed to solve the puzzle — except for one missing element: computing power capable of processing the near-infinite permutations required to restore the original sequence.\n\nIn an innovative model of wrapped ownership, the NFT remains sealed within its smart contract and serves as a cryptographic portal.\n\nThrough it, the collector may verify the correct sequence (against the checksum hashed on-chain), unveiling the hidden artwork and making it publicly visible through the portal. In that moment, the NFT is fully unlocked and transferred into the collector’s complete ownership.\n\nUntil then — while anyone may interact with the portal — only the collector’s registered wallet holds the power to verify, claim, or transfer eligibility.\nMore than ownership: it’s guardianship — until revelation.\n\n*** Smart contract by Nahiko ***
description.txt-1*** SOLD FOR $50.0k / 28.248Ξ ON 30/04/2025 *** 𝐐𝐔𝐀𝐍𝐓𝐔𝐌 𝐇𝐄𝐗 𝐌𝐀𝐂𝐇𝐈𝐍𝐀 emerges as a new experimental artwork within Andrea Chiampo’s FUTURED PAST project — a work suspended between temporal states: created in the past, erased from our present, and awaiting resurrection in an unwritten future. A conceptual piece centered around a now-lost digital image, deliberately deleted from all digital storage — including the artist’s own devices. The only path to recovering the work lies in reordering a scrambled hexadecimal string and submitting it through an on-chain interactive portal, custom-built to verify and reveal the hidden artwork. The string — composed of millions of characters — was scrambled beyond the reach of today’s technologies. The artwork now rests in limbo, awaiting the arrival of quantum computing power to be resurrected and seen again. A relic of the future — like the scattered ashes of a phoenix awaiting rebirth. The collector receives a high-quality 1/1 physical artwork and a book bound using ancient techniques, containing the full scrambled string and clear instructions for reconstruction. They hold everything needed to solve the puzzle — except for one missing element: computing power capable of processing the near-infinite permutations required to restore the original sequence. In an innovative model of wrapped ownership, the NFT remains sealed within its smart contract and serves as a cryptographic portal. Through it, the collector may verify the correct sequence (against the checksum hashed on-chain), unveiling the hidden artwork and making it publicly visible through the portal. In that moment, the NFT is fully unlocked and transferred into the collector’s complete ownership. Until then — while anyone may interact with the portal — only the collector’s registered wallet holds the power to verify, claim, or transfer eligibility. More than ownership: it’s guardianship — until revelation. *** Smart contract by Nahiko ***
N <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>𝐐𝐔𝐀𝐍𝐓𝐔𝐌 𝐇𝐄𝐗 𝐌𝐀𝐂𝐇𝐈𝐍𝐀</title> <link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet" /> <script src="https://arweave.net/S1hqI3tgUg-m_lhtrQX9IalKxMdfGqI3fox04_xMwEI"></script> </head> <script> let isUnlocked = false; window.onload = function () { const infoButtons = document.querySelectorAll(".info"); const submitButton = document.querySelector(".submit"); const submitInfoButton = document.querySelector(".submitInfo"); const viewArtworkInfoButton = document.querySelector(".viewArtworkInfo"); const modalClose = document.querySelector(".modal-close"); const modal = document.querySelector(".modal"); infoButtons.forEach((infoButton) => { infoButton.addEventListener("click", () => { const infoModal = showModal(` <div class="modal-title">Critical text by Primavera De Filippi</div> <div class="modal-subtitle">Artist and Legal Scholar (Harvard / CNRS)</div> <div class="modal-body"> <p class="text-center">In 𝐐𝐔𝐀𝐍𝐓𝐔𝐌 𝐇𝐄𝐗 𝐌𝐀𝐂𝐇𝐈𝐍𝐀, Andrea Chiampo points at the paradoxes of our technological systems — with blockchain as a particularly revealing case, where the promise of cryptographic immortality is perpetually undone by its own impermanence and volatility. A JPEG file is hashed onto the blockchain, before it is corrupted beyond recognition—its bytes scattered like ashes across a monumental print and sealed within an accompanying physical pamphlet.</p> <p class="text-center">This act of deliberate corruption is not an act of destruction but one of transformation. Like a digital phoenix emerging from its own cryptographic hashes, the hashed representation of the JPEG serves as a signature of existence that persists beyond physical transformation. Locked within the immutable ledger of the blockchain, the hash exists as both a challenge and a metaphor, inviting the public to reconstitute the corrupted JPEG, while acknowledging the precarious architecture of our technological tools.</p> <p class="text-center">The collector who purchases the work does not acquire ownership of the NFT, but that of the physical artwork and it paired pamphlet that contains the instruction to recover the original JPEG file in its uncorrupted format. But the retrieval is not guaranteed; it is a gamble, a mathematical puzzle that even a quantum computer would struggle to solve. It is a puzzle that defies solution, yet invites it—a paradox that speaks to the human condition in an age of machines.</p> <p class="text-center">Chiampo's piece is a manifestation of Machina Hex Machina—a machine that curses as much as it saves. As technology has become our "<b>deus ex machina</b>", our divine intervention, what happens when it falters? What remains of our digital artefacts when the gears of the machine grind to a halt?</p> <p class="text-center">The digital artwork is a puzzle waiting to be solved. It is a challenge that defies solution, yet invites it—a paradox that speaks to the human condition in an age of machines.</p> The answer lies in the act of unravelling itself, the perpetual negotiation between creation and dissolution, where human ingenuity emerges as a recursive algorithm of resistance. Yet, there is a strange beauty in decay, as decay can become a source of reconstruction—reminding us that even as our systems collapse, the human desire to rebuild will come alive, transmuting every act of destruction into a new possibility for reconstruction.</p> <p class="text-center">QUANTUM HEX MACHINA is not merely an artwork; it is a provocation, a mirror held up to the blockchain's contradictions. It is a testament to the fragility of the systems we create and the resilience of the spirit that creates them. In its corrupted bytes and cryptographic riddles, it whispers a truth: that the act of falling apart is not an end, but a beginning—a quiet, insistent call to reimagine what lies beyond the ruins.</p> </div> <div class="modal-footer text-center"> <p style="font-size:1dvmin;line-height:initial"><i>*** Smart contract by Nahiko ***</i></p> </div> `); infoModal.children[0].style.height = "85dvmin"; }); }); submitButton.addEventListener("click", async () => { if (submitButton.classList.contains("disabled")) { return; // Don't proceed if button is disabled } try { // Get the verification result with hash and dataURI const result = await isFileCorrect(); const { dataURI, submittedFileHash } = result; console.log("Submit handler received:", { dataURI, submittedFileHash }); if (!dataURI || !submittedFileHash) { console.error("Missing dataURI or submittedFileHash"); return; // Don't proceed if verification failed } // For transactions, we need a wallet signer, not just any provider let provider; if (window.ethereum) { try { await window.ethereum.request({ method: "eth_requestAccounts" }); provider = new ethers.BrowserProvider(window.ethereum); } catch (err) { console.error("User rejected wallet connection:", err); showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;"><b>Wallet Connection Required:</b> To submit your solution, you need to connect your Ethereum wallet.</div>` ); return; } } else { showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;"><b>Wallet Not Found:</b> To submit your solution, you need an Ethereum wallet like MetaMask installed.</div>` ); return; } // Get signer const signer = await provider.getSigner(); // Create contract instance with signer to allow transactions const vaultContract = new ethers.Contract(VAULT_ADDRESS, VAULT_ABI, signer); console.log("Submitting file hash:", submittedFileHash); // Let the wallet handle the transaction UI const tx = await vaultContract.unlockNFT(submittedFileHash); // Wait for transaction to be mined const receipt = await tx.wait(); if (receipt.status === 1) { // Transaction successful - show success modal const successModal = showModal(` <div class="modal-title title">CONGRATULATIONS, YOU HAVE FINALLY SOLVED THE PUZZLE!</div> <div class="modal-body"> <div class="text-center"> <p>~</p> <p>“An eternal tunnel of static — an infinite absence of signal. A loop of technological answers birthing only more questions — drifting further from the real ones ”</p> <p>~</p> <p>Thanks to your hardwork the original image has been restored.</p> <p>You can now decide how the NFT will be experienced. Follow the instructions in the physical dossier and smart contract to upload the artwork. metadata with the recovered artwork.</p> </div> </div> `); successModal.children[0].style.padding = "8dvmin 3dvmin"; successModal.classList.add("Ihatecss"); } } catch (error) { console.error("Error in transaction:", error); // Let the wallet handle error cases - don't show our own modal } }); submitInfoButton.addEventListener("click", () => { const submitInfoModal = showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;">While anyone may interact with this interface and attempt to submit a solution, only the wallet address registered on-chain at the time of acquisition holds the exclusive right to advance to the next phase:<br> to unlock the NFT, validate the reconstruction, and update its metadata with the recovered artwork.</div>` ); submitInfoModal.children[0].style.height = "auto"; submitInfoModal.children[0].style.width = "80dvmin"; }); viewArtworkInfoButton.addEventListener("click", () => { const viewArtworkInfoModal = showModal( `<div style="text-align:left;font-size:1.5dvmin;line-height:initial;padding: 2dvmin 4dvmin;">The Physical Collector may or may not choose to make the artwork available for display</div>` ); viewArtworkInfoModal.children[0].style.height = "auto"; viewArtworkInfoModal.children[0].style.width = "80dvmin"; }); document.addEventListener("keydown", (e) => { if (e.key === "Escape") { const modal = document.querySelector(".modal"); if (modal) closeModal(modal); } }); const collectorElements = document.querySelectorAll(".collector"); collectorElements.forEach((element) => { console.log(element.textContent); element.addEventListener("click", function () { window.open("https://etherscan.io/address/" + element.textContent, "_blank"); }); }); const timer = document.querySelector(".timer"); const targetDate = new Date("April 3, 2025 13:00:00 EDT"); const timerInterval = setInterval(() => { const now = new Date(); const timeZoneDiff = now.getTimezoneOffset() * 60000; const nowUTC = new Date(now.getTime() + timeZoneDiff); const nyTimeOffset = -4 * 60 * 60000; const nowNY = new Date(nowUTC.getTime() + nyTimeOffset); const difference = targetDate - nowNY; const years = Math.floor(Math.abs(difference) / (1000 * 60 * 60 * 24 * 365.25)); const days = Math.abs( Math.floor((difference % (1000 * 60 * 60 * 24 * 365)) / (1000 * 60 * 60 * 24)) ); const hours = Math.abs(Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))); const minutes = Math.abs(Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60))); const seconds = Math.abs(Math.floor((difference % (1000 * 60)) / 1000)); if (difference <= 0) { timer.textContent = "ENTER"; timer.classList.add("button"); timer.addEventListener("click", enterGame); const chronometer = document.querySelector(".chronometer"); chronometer.textContent = `${padZero(years)}y:${padZero(days)}:${padZero( hours )}:${padZero(minutes)}:${padZero(seconds)}`; return; } timer.textContent = `${padZero(days)}:${padZero(hours)}:${padZero(minutes)}:${padZero( seconds )}`; }, 500); setTimeout(function () { timer.style.opacity = 1; }, 500); }; function padZero(num) { return num.toString().padStart(2, "0"); } // Simplified enterGame function let isGameEntered = false; async function enterGame() { if (isGameEntered) return; try { const provider = await getProvider(); proceedToEnterGame(provider); } catch (error) { console.error("Failed to initialize provider:", error); } } // Helper function to actually enter the game once we have a provider async function proceedToEnterGame(provider) { // Call getContractData when needed await getContractData(); document.querySelector(".background").style.opacity = 1; isGameEntered = true; const cover = document.querySelector(".cover"); const game = document.querySelector(".game"); const ending = document.querySelector(".ending"); // Target element based on the unlocked status const targetElement = isUnlocked ? ending : game; cover.style.opacity = "0"; setTimeout(() => { cover.style.display = "none"; targetElement.style.display = "flex"; targetElement.style.transition = "opacity 1s ease-in"; setTimeout(() => { targetElement.style.opacity = "1"; console.log(isUnlocked ? "ENDING REACHED" : "WELCOME"); }, 50); }, 1000); } function showModal(content) { const existingModal = document.querySelector(".modal"); if (existingModal) { existingModal.remove(); } const modal = document.createElement("div"); modal.className = "modal"; modal.innerHTML = ` <div class="modal-content"> <span class="close">&times;</span> ${content} </div> `; document.body.appendChild(modal); modal.offsetHeight; modal.style.display = "flex"; setTimeout(() => { modal.style.opacity = "1"; }, 10); const closeBtn = modal.querySelector(".close"); closeBtn.onclick = () => closeModal(modal); window.onclick = (e) => { if (e.target === modal) closeModal(modal); }; return modal; } function closeModal(modal) { modal.style.opacity = "0"; setTimeout(() => { modal.remove(); }, 300); } async function isFileCorrect() { try { const fileInput = document.querySelector("textarea"); let inputText = fileInput.value.trim(); const verificationString = document.querySelector(".verificationString"); if (!inputText) { verificationString.innerHTML = ""; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } if (inputText.startsWith("0x")) { inputText = inputText.substring(2); } if (!/^[0-9a-fA-F]*$/.test(inputText)) { verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } let inputBytes; try { if (inputText.length % 2 !== 0) { inputText = "0" + inputText; } inputBytes = ethers.getBytes("0x" + inputText); } catch (e) { console.error("Error parsing hex input:", e); verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } const base64Content = ethers.encodeBase64(inputBytes); const dataURI = `data:image/jpeg;base64,${base64Content}`; const dataURIBytes = ethers.toUtf8Bytes(dataURI); const submittedFileHash = ethers.keccak256(dataURIBytes); // Store first hash as submittedFileHash const packedFirstHash = ethers.solidityPacked(["bytes32"], [submittedFileHash]); const hashedFileHash = ethers.keccak256(packedFirstHash); console.log("First hash (submittedFileHash):", submittedFileHash); console.log("Final hash (hashedFileHash):", hashedFileHash); const expectedHashedFileHash = "0xb43501f79c29086d44cc94ea56ab6c0901cbc79e113f498a64dbfde145f1fa49"; if (hashedFileHash.toLowerCase() === expectedHashedFileHash.toLowerCase()) { verificationString.innerHTML = "✓ &nbsp;Quantum state observed. Reality collapses into certainty."; document.querySelector(".submit").classList.remove("disabled"); return { dataURI, submittedFileHash }; // Return an object with the values } else { verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; document.querySelector(".submit").classList.add("disabled"); return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } } catch (error) { console.error("Error in isFileCorrect function:", error); document.querySelector(".verificationString").innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } } function stringToHexBytes(str) { return Array.from(new TextEncoder().encode(str)) .map((b) => b.toString(16).padStart(2, "0")) .join(""); } document.addEventListener("DOMContentLoaded", function () { const fileInput = document.querySelector("textarea"); const textareaContainer = document.querySelector(".textareaContainer"); let debounceTimer; fileInput.addEventListener("input", function () { clearTimeout(debounceTimer); debounceTimer = setTimeout(function () { isFileCorrect(); }, 300); }); fileInput.addEventListener("paste", function () { setTimeout(isFileCorrect, 50); }); ["dragenter", "dragover", "dragleave", "drop"].forEach((eventName) => { textareaContainer.addEventListener(eventName, preventDefaults, false); }); function preventDefaults(e) { e.preventDefault(); e.stopPropagation(); } ["dragenter", "dragover"].forEach((eventName) => { textareaContainer.addEventListener(eventName, highlight, false); }); ["dragleave", "drop"].forEach((eventName) => { textareaContainer.addEventListener(eventName, unhighlight, false); }); function highlight() { textareaContainer.style.backgroundColor = "#e6e3dc"; } function unhighlight() { textareaContainer.style.backgroundColor = "#f7f6f3"; } textareaContainer.addEventListener("drop", handleDrop, false); function handleDrop(e) { const dt = e.dataTransfer; const files = dt.files; if (files.length > 0) { const file = files[0]; readFileAsHex(file); } } function readFileAsHex(file) { const reader = new FileReader(); reader.onload = function (e) { const arrayBuffer = e.target.result; const bytes = new Uint8Array(arrayBuffer); let hexString = ""; for (let i = 0; i < bytes.length; i++) { const hex = bytes[i].toString(16).padStart(2, "0"); hexString += hex; } fileInput.value = hexString; isFileCorrect(); }; reader.readAsArrayBuffer(file); } }); // Add contract details const VAULT_ADDRESS = "0x24e9C8Aa584F7F0338ec617E3F2261F4BdC49708"; const VAULT_ABI = [ "function physicalCollectorAddress() view returns (address)", "function isUnlocked() view returns (bool)", "function unlockAddress() view returns (address)", "function unlockTimestamp() view returns (uint256)", "function owner() view returns (address)", "function fileAddress() view returns (address)", "function isFileCorrect(address potentialFileAddress) view returns (bool, string)", "function unlockNFT(bytes32 submittedFileHash) external", ]; async function getProvider() { let provider; try { provider = new ethers.JsonRpcProvider("https://eth.llamarpc.com"); await provider.getBlockNumber(); // Test the connection console.log("Connected to public RPC provider"); return provider; } catch (error) { console.warn("Public RPC failed:", error); if (window.ethereum) { try { await window.ethereum.request({ method: "eth_requestAccounts" }); provider = new ethers.BrowserProvider(window.ethereum); console.log("Connected using wallet"); return provider; } catch (err) { console.error("User rejected wallet connection:", err); throw new Error("Failed to connect to wallet"); } } throw new Error("No provider available"); } } // Update getContractData to use the centralized provider async function getContractData() { try { const provider = await getProvider(); const vaultContract = new ethers.Contract(VAULT_ADDRESS, VAULT_ABI, provider); const collectorAddress = await vaultContract.physicalCollectorAddress(); console.log("physicalCollectorAddress: " + collectorAddress); // Update first collector address element const collectorElement = document.querySelector(".collector"); if (collectorElement) { collectorElement.textContent = collectorAddress; } // Get vault unlock status isUnlocked = await vaultContract.isUnlocked(); console.log("isUnlocked: " + isUnlocked); // Variables to store file data let fileAddress = null; let jpegDataURI = null; // If the vault is unlocked, get the unlock details from state variables if (isUnlocked) { try { // Get unlock information directly from state variables const unlockAddress = await vaultContract.unlockAddress(); const unlockTimestamp = await vaultContract.unlockTimestamp(); console.log("Unlock address:", unlockAddress); console.log("Unlock timestamp:", unlockTimestamp); if (unlockTimestamp > 0) { // Check if the timestamp is valid // Convert timestamp to date const unlockDate = new Date(Number(unlockTimestamp) * 1000); console.log("Unlock date:", unlockDate.toISOString()); // Update the chronometer with the unlock timestamp const chronometer = document.querySelector(".ending .chronometer"); if (chronometer) { chronometer.textContent = `${unlockDate .getUTCDate() .toString() .padStart(2, "0")}/${(unlockDate.getUTCMonth() + 1) .toString() .padStart(2, "0")}/${unlockDate.getUTCFullYear()}`; } // Update the collector in the ending screen with unlock address const endingCollector = document.querySelector(".ending .collector"); if (endingCollector) { endingCollector.textContent = unlockAddress; } fileAddress = await vaultContract.fileAddress(); console.log("File address:", fileAddress); try { // First check if the file is correct using the Vault contract's isFileCorrect function const [isCorrect, fileContent] = await vaultContract.isFileCorrect(fileAddress); console.log("File correctness check:", isCorrect); if (isCorrect && fileContent) { jpegDataURI = fileContent; console.log("Retrieved verified JPEG data URI successfully"); const viewArtworkButton = document.querySelector(".viewArtwork"); if (viewArtworkButton) { viewArtworkButton.addEventListener("click", function () { showModal(` <div style="text-align:center;"> <div class="modal-title">QUANTUM HEX MACHINA</div> <div class="modal-subtitle">THE UNLOCKED ARTWORK</div> <div style="margin-top: 2dvmin;"> <img src="${jpegDataURI}" style="max-width: 90%; max-height: 70dvmin;" alt="Quantum Hex Machina" /> </div> </div> `); }); viewArtworkButton.classList.remove("disabled"); console.log("View Artwork button enabled"); } } else { console.log("File verification failed"); const viewArtworkButton = document.querySelector(".viewArtwork"); if (viewArtworkButton) { // Simply keep the button disabled by adding the disabled class viewArtworkButton.classList.add("disabled"); console.log("View Artwork button disabled due to file verification failure"); } } } catch (error) { console.error("Error verifying file:", error); const viewArtworkButton = document.querySelector(".viewArtwork"); if (viewArtworkButton) { // Also keep the button disabled in case of errors viewArtworkButton.classList.add("disabled"); console.log("View Artwork button disabled due to verification error"); } } } else { console.log("No unlock data found despite unlocked status"); // Set default values for testing if no timestamp const chronometer = document.querySelector(".chronometer"); if (chronometer) { chronometer.textContent = "UNLOCKED"; } } } catch (error) { console.error("Error getting unlock details:", error); } } return { collectorAddress, isUnlocked, unlockAddress: await vaultContract.unlockAddress(), unlockTimestamp: await vaultContract.unlockTimestamp(), fileAddress, jpegDataURI, }; } catch (error) { console.error("Error fetching contract data:", error); } } </script> <style> html { background-color: black; width: 100%; height: 100%; color: #6e6d69; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: "Times New Roman", serif; font-weight: 500; margin: 0; padding: 0; background-color: #ece9e2; background-image: url("https://arweave.net/0MD2DIp1YxwVD1xATJssXH54S9Xjz2lXA583PogfmpY"); background-size: cover; background-position: center; background-repeat: no-repeat; line-height: 1.2dvmin; } body { display: flex; flex-direction: column; width: 100dvmin; height: 100dvmin; align-items: center; justify-content: center; text-align: center; margin: 0; padding: 0; } .background { width: 100%; height: 100%; position: absolute; background-color: #ece9e2; opacity: 0; transition: opacity 1s; } .main { display: flex; flex-direction: column; align-items: center; gap: 1.3dvmin; transition: opacity 1s ease-in-out; margin-bottom: 0.4dvmin; z-index: 10; } .ending { margin-bottom: 6.5dvmin; display: none; opacity: 0; gap: 4dvmin; } .game { margin-bottom: 6.5dvmin; display: none; opacity: 0; gap: 4dvmin; } .title { font-size: 2.5dvmin; line-height: 2.5dvmin; letter-spacing: 0.54dvmin; text-indent: 0.54dvmin; } .subtitle { letter-spacing: 0.225dvmin; text-indent: 0.225dvmin; font-size: 1dvmin; line-height: 1dvmin; } .timer { background-color: #3e3e3e; color: #ece9e2; padding: 0.8dvmin 1.5dvmin; border-radius: 2dvmin; font-size: 1.2dvmin; transform: translateY(0.7dvmin); letter-spacing: 0.24dvmin; text-indent: 0.24dvmin; leading-trim: both; opacity: 0; transition: 1.5s opacity; } .Ihatecss { font-family: "Times New Roman", serif !important; } .button { background-color: #3e3e3e; leading-trim: both; color: #ece9e2; font-size: 1.2dvmin; padding: 0.8dvmin 1.5dvmin; border-radius: 2dvmin; cursor: pointer; transition: opacity 1.5s ease-in-out, background-color 0.1s; user-select: none; letter-spacing: 0.24dvmin; text-indent: 0.24dvmin; } .button:hover { background-color: #6e6d69; } .disabled { background-color: #aeaeae; cursor: default; } .disabled:hover { background-color: #aeaeae; } .info { padding: 0.8dvmin 2.4dvmin; margin-top: 2.2dvmin; } .titleContainer { display: flex; flex-direction: column; align-items: center; gap: 1.1dvmin; } .titleContainer > .title { font-size: 1.7dvmin; line-height: 1.7dvmin; } .titleContainer > .subtitle { font-size: 0.7dvmin; line-height: 0.7dvmin; } .inputContainer { display: flex; flex-direction: column; align-items: center; position: relative; } .textareaContainer { width: 48dvmin; display: flex; position: relative; background-color: #f7f6f3; padding: 2dvmin; padding-bottom: 9.5dvmin; align-items: center; justify-content: center; flex-direction: column; } .ending .textareaContainer { height: 48.5dvmin; } .ending .chronometerContainer { position: initial; bottom: initial; padding: 0.8dvmin 3dvmin; } .ending .collectorContainer { align-items: center; } .ending .collector { font-size: 1.2dvmin; } textarea { width: 100%; height: 48.5dvmin; background-color: #f7f6f3; font: inherit; font-size: 1.1dvmin; line-height: 1.1dvmin; color: inherit; vertical-align: top; letter-spacing: 0.18dvmin; text-align: justify; outline: none; border: none; box-shadow: none; -webkit-appearance: none; -moz-appearance: none; appearance: none; resize: none; overflow-y: scroll; scrollbar-gutter: stable; overflow-x: auto; overflow-y: overlay; scrollbar-width: none; font-family: "Calibri", "Open Sans", sans-serif; font-family: monospace; } textarea::placeholder { color: #e0ddd7; } textarea::-webkit-scrollbar-track { background: transparent; } textarea { scrollbar-color: rgba(110, 109, 105, 0.5) transparent; } .chronometerContainer { position: absolute; bottom: 7dvmin; padding: 0.8dvmin 8dvmin; background-color: #e6e3dc; border-radius: 8dvmin; display: flex; flex-direction: column; gap: 0.2dvmin; } .verificationString { position: absolute; bottom: 13.5dvmin; font-size: 1.1dvmin; line-height: 1.1dvmin; font-family: "Calibri", "Open Sans", sans-serif; background-color: #f7f6f3; } .submitInfo { position: absolute; bottom: 3.75dvmin; right: -2.8dvmin; line-height: 1.6dvmin; width: 1.6dvmin; height: 1.6dvmin; border-radius: 50%; color: #6f6d69; border: solid 0.15dvmin #6f6d69; font-weight: 200; font-family: sans-serif; font-size: 1.5dvmin; line-height: 2dvmin; cursor: pointer; } .submitInfo:hover { opacity: 0.75; } .viewArtworkInfo { position: absolute; bottom: 0.5dvmin; right: 11dvmin; line-height: 1.6dvmin; width: 1.6dvmin; height: 1.6dvmin; border-radius: 50%; color: #6f6d69; border: solid 0.15dvmin #6f6d69; font-weight: 200; font-family: sans-serif; font-size: 1.5dvmin; line-height: 1.5dvmin; cursor: pointer; } .viewArtworkInfo:hover { opacity: 0.75; } .collectorContainer { display: flex; flex-direction: column; justify-content: flex-start; width: 100%; align-items: start; margin-top: 1dvmin; margin-left: 0.6dvmin; gap: 0.3dvmin; } .collector { font-weight: bold; text-decoration: underline; letter-spacing: 0.22dvmin; cursor: pointer; } .collector:hover { opacity: 0.6; } .collectorTitle { letter-spacing: 0.08dvmin; font-size: 0.9dvmin; line-height: 0.9dvmin; } .submit { align-self: end; border-radius: 0; } .viewArtwork { border-radius: 0; align-self: center; } .chronometer { font-size: 1.8dvmin; line-height: 1.8dvmin; } .modal { position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.3); opacity: 0; transition: opacity 0.3s ease-in-out; font-family: "Calibri", "Open Sans", sans-serif; display: flex; justify-content: center; align-items: center; font-size: 1.2dvmin; } .modal-content { background-color: #f7f6f3; padding: 3dvmin; width: 85dvmin; position: relative; border-radius: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.75dvmin; line-height: initial; } .text-center { text-align: center; } .modal-title { font-size: 1.45dvmin; line-height: 1.45dvmin; text-align: center; margin-top: 0; font-weight: 600; color: #3e3e3e; } .modal-subtitle { font-size: 1.27dvmin; line-height: 1.27dvmin; text-align: center; margin-top: 0; margin-bottom: 3dvmin; font-weight: normal; color: #3e3e3e; } .modal-body { line-height: 1.8; color: #3e3e3e; text-align: left; padding: 0 10dvmin; } .close { color: #6e6d69; position: absolute; right: 0.75dvmin; top: 0.25dvmin; font-size: 2dvmin; line-height: 2dvmin; font-weight: bold; cursor: pointer; padding: 0.5dvmin; user-select: none; } .close:hover { opacity: 0.7; } </style> <body> <div class="background"></div> <div class="main cover"> <div class="subtitle">ANDREA CHIAMPO PRESENTS</div> <div class="title">QUANTUM HEX MACHINA</div> <div class="timer">00:00:00:00</div> </div> <div class="main game"> <div class="titleContainer"> <div class="subtitle">ANDREA CHIAMPO PRESENTS</div> <div class="title">QUANTUM HEX MACHINA</div> <div class="info button">INFO</div> </div> <div class="inputContainer"> <div class="textareaContainer"> <textarea type="text" placeholder="Paste correct string here/drag in to upload a file" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" ></textarea> </div> <div class="verificationString"></div> <div class="chronometerContainer"> <div class="subtitle">UNSOLVED SINCE</div> <div class="chronometer title">00:00:00:00</div> </div> <div class="submit button disabled">SUBMIT</div> <div class="submitInfo">i</div> <div class="collectorContainer"> <div class="subtitle collectorTitle"> PHYSICAL ART COLLECTOR / WALLET ALLOWED TO CLAIM </div> <div class="subtitle collector">0x0000000000000000000000000000000000000000</div> </div> </div> </div> <div class="main ending"> <div class="titleContainer"> <div class="subtitle">ANDREA CHIAMPO PRESENTS</div> <div class="title">QUANTUM HEX MACHINA</div> <div class="info button">INFO</div> </div> <div class="inputContainer"> <div class="textareaContainer"> <div class="chronometerContainer"> <div class="subtitle">THIS ARTWORK HAS BEEN UNLOCKED</div> <div class="chronometer title">00/00/00</div> </div> <div class="collectorContainer"> <div class="subtitle collectorTitle">UNLOCKED BY</div> <div class="subtitle collector">0x0000000000000000000000000000000000000000</div> </div> </div> <div class="viewArtwork button">VIEW UNLOCKED ARTWORK</div> <div class="viewArtworkInfo">i</div> </div> </div> </body> </html>
N <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>𝐐𝐔𝐀𝐍𝐓𝐔𝐌 𝐇𝐄𝐗 𝐌𝐀𝐂𝐇𝐈𝐍𝐀</title> <link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link href="https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap" rel="stylesheet" /> <script src="https://arweave.net/S1hqI3tgUg-m_lhtrQX9IalKxMdfGqI3fox04_xMwEI"></script> </head> <script> let isUnlocked = false; window.onload = function () { const infoButtons = document.querySelectorAll(".info"); const submitButton = document.querySelector(".submit"); const submitInfoButton = document.querySelector(".submitInfo"); const viewArtworkInfoButton = document.querySelector(".viewArtworkInfo"); const modalClose = document.querySelector(".modal-close"); const modal = document.querySelector(".modal"); infoButtons.forEach((infoButton) => { infoButton.addEventListener("click", () => { const infoModal = showModal(` <div class="modal-title">Critical text by Primavera De Filippi</div> <div class="modal-subtitle">Artist and Legal Scholar (Harvard / CNRS)</div> <div class="modal-body"> <p class="text-center">In 𝐐𝐔𝐀𝐍𝐓𝐔𝐌 𝐇𝐄𝐗 𝐌𝐀𝐂𝐇𝐈𝐍𝐀, Andrea Chiampo points at the paradoxes of our technological systems — with blockchain as a particularly revealing case, where the promise of cryptographic immortality is perpetually undone by its own impermanence and volatility. A JPEG file is hashed onto the blockchain, before it is corrupted beyond recognition—its bytes scattered like ashes across a monumental print and sealed within an accompanying physical pamphlet.</p> <p class="text-center">This act of deliberate corruption is not an act of destruction but one of transformation. Like a digital phoenix emerging from its own cryptographic hashes, the hashed representation of the JPEG serves as a signature of existence that persists beyond physical transformation. Locked within the immutable ledger of the blockchain, the hash exists as both a challenge and a metaphor, inviting the public to reconstitute the corrupted JPEG, while acknowledging the precarious architecture of our technological tools.</p> <p class="text-center">The collector who purchases the work does not acquire ownership of the NFT, but that of the physical artwork and it paired pamphlet that contains the instruction to recover the original JPEG file in its uncorrupted format. But the retrieval is not guaranteed; it is a gamble, a mathematical puzzle that even a quantum computer would struggle to solve. It is a puzzle that defies solution, yet invites it—a paradox that speaks to the human condition in an age of machines.</p> <p class="text-center">Chiampo's piece is a manifestation of Machina Hex Machina—a machine that curses as much as it saves. As technology has become our "<b>deus ex machina</b>", our divine intervention, what happens when it falters? What remains of our digital artefacts when the gears of the machine grind to a halt?</p> <p class="text-center">The digital artwork is a puzzle waiting to be solved. It is a challenge that defies solution, yet invites it—a paradox that speaks to the human condition in an age of machines.</p> The answer lies in the act of unravelling itself, the perpetual negotiation between creation and dissolution, where human ingenuity emerges as a recursive algorithm of resistance. Yet, there is a strange beauty in decay, as decay can become a source of reconstruction—reminding us that even as our systems collapse, the human desire to rebuild will come alive, transmuting every act of destruction into a new possibility for reconstruction.</p> <p class="text-center">QUANTUM HEX MACHINA is not merely an artwork; it is a provocation, a mirror held up to the blockchain's contradictions. It is a testament to the fragility of the systems we create and the resilience of the spirit that creates them. In its corrupted bytes and cryptographic riddles, it whispers a truth: that the act of falling apart is not an end, but a beginning—a quiet, insistent call to reimagine what lies beyond the ruins.</p> </div> <div class="modal-footer text-center"> <p style="font-size:1dvmin;"><i>*** Smart contract by Nahiko ***</i></p> </div> `); infoModal.children[0].style.height = "85dvmin"; }); }); submitButton.addEventListener("click", async () => { if (submitButton.classList.contains("disabled")) { return; // Don't proceed if button is disabled } try { // Get the verification result with hash and dataURI const result = await isFileCorrect(); const { dataURI, submittedFileHash } = result; console.log("Submit handler received:", { dataURI, submittedFileHash }); if (!dataURI || !submittedFileHash) { console.error("Missing dataURI or submittedFileHash"); return; // Don't proceed if verification failed } // For transactions, we need a wallet signer, not just any provider let provider; if (window.ethereum) { try { await window.ethereum.request({ method: "eth_requestAccounts" }); provider = new ethers.BrowserProvider(window.ethereum); } catch (err) { console.error("User rejected wallet connection:", err); showModal( `<div style="text-align:left;font-size:1.5dvmin;padding: 2dvmin 4dvmin;"><b>Wallet Connection Required:</b> To submit your solution, you need to connect your Ethereum wallet.</div>` ); return; } } else { showModal( `<div style="text-align:left;font-size:1.5dvmin;padding: 2dvmin 4dvmin;"><b>Wallet Not Found:</b> To submit your solution, you need an Ethereum wallet like MetaMask installed.</div>` ); return; } // Get signer const signer = await provider.getSigner(); // Create contract instance with signer to allow transactions const vaultContract = new ethers.Contract(VAULT_ADDRESS, VAULT_ABI, signer); console.log("Submitting file hash:", submittedFileHash); // Let the wallet handle the transaction UI const tx = await vaultContract.unlockNFT(submittedFileHash); // Wait for transaction to be mined const receipt = await tx.wait(); if (receipt.status === 1) { // Transaction successful - show success modal const successModal = showModal(` <div class="modal-title title">CONGRATULATIONS, YOU HAVE FINALLY SOLVED THE PUZZLE!</div> <div class="modal-body"> <div class="text-center"> <p>~</p> <p>“An eternal tunnel of static — an infinite absence of signal. A loop of technological answers birthing only more questions — drifting further from the real ones ”</p> <p>~</p> <p>Thanks to your hardwork the original image has been restored.</p> <p>You can now decide how the NFT will be experienced. Follow the instructions in the physical dossier and smart contract to upload the artwork. metadata with the recovered artwork.</p> </div> </div> `); successModal.children[0].style.padding = "8dvmin 3dvmin"; successModal.classList.add("Ihatecss"); } } catch (error) { console.error("Error in transaction:", error); // Let the wallet handle error cases - don't show our own modal } }); submitInfoButton.addEventListener("click", () => { const submitInfoModal = showModal( `<div style="text-align:left;font-size:1.5dvmin;padding: 2dvmin 4dvmin;">While anyone may interact with this interface and attempt to submit a solution, only the wallet address registered on-chain at the time of acquisition holds the exclusive right to advance to the next phase:<br> to unlock the NFT, validate the reconstruction, and update its metadata with the recovered artwork.</div>` ); submitInfoModal.children[0].style.height = "auto"; submitInfoModal.children[0].style.width = "80dvmin"; }); viewArtworkInfoButton.addEventListener("click", () => { const viewArtworkInfoModal = showModal( `<div style="text-align:left;font-size:1.5dvmin;padding: 2dvmin 4dvmin;">The Physical Collector may or may not choose to make the artwork available for display</div>` ); viewArtworkInfoModal.children[0].style.height = "auto"; viewArtworkInfoModal.children[0].style.width = "80dvmin"; }); document.addEventListener("keydown", (e) => { if (e.key === "Escape") { const modal = document.querySelector(".modal"); if (modal) closeModal(modal); } }); const collectorElements = document.querySelectorAll(".collector"); collectorElements.forEach((element) => { console.log(element.textContent); element.addEventListener("click", function () { window.open("https://etherscan.io/address/" + element.textContent, "_blank"); }); }); const timer = document.querySelector(".timer"); const targetDate = new Date("April 3, 2025 13:00:00 EDT"); const timerInterval = setInterval(() => { const now = new Date(); const timeZoneDiff = now.getTimezoneOffset() * 60000; const nowUTC = new Date(now.getTime() + timeZoneDiff); const nyTimeOffset = -4 * 60 * 60000; const nowNY = new Date(nowUTC.getTime() + nyTimeOffset); const difference = targetDate - nowNY; const years = Math.floor(Math.abs(difference) / (1000 * 60 * 60 * 24 * 365.25)); const days = Math.abs( Math.floor((difference % (1000 * 60 * 60 * 24 * 365)) / (1000 * 60 * 60 * 24)) ); const hours = Math.abs(Math.floor((difference % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60))); const minutes = Math.abs(Math.floor((difference % (1000 * 60 * 60)) / (1000 * 60))); const seconds = Math.abs(Math.floor((difference % (1000 * 60)) / 1000)); if (difference <= 0) { timer.textContent = "ENTER"; timer.classList.add("button"); timer.addEventListener("click", enterGame); const chronometer = document.querySelector(".chronometer"); chronometer.textContent = `${padZero(years)}y:${padZero(days)}:${padZero( hours )}:${padZero(minutes)}:${padZero(seconds)}`; return; } timer.textContent = `${padZero(days)}:${padZero(hours)}:${padZero(minutes)}:${padZero( seconds )}`; }, 500); setTimeout(function () { timer.style.opacity = 1; }, 500); }; function padZero(num) { return num.toString().padStart(2, "0"); } // Simplified enterGame function let isGameEntered = false; async function enterGame() { if (isGameEntered) return; try { const provider = await getProvider(); proceedToEnterGame(provider); } catch (error) { console.error("Failed to initialize provider:", error); } } // Helper function to actually enter the game once we have a provider async function proceedToEnterGame(provider) { // Call getContractData when needed await getContractData(); document.querySelector(".background").style.opacity = 1; isGameEntered = true; const cover = document.querySelector(".cover"); const game = document.querySelector(".game"); const ending = document.querySelector(".ending"); // Target element based on the unlocked status const targetElement = isUnlocked ? ending : game; cover.style.opacity = "0"; setTimeout(() => { cover.style.display = "none"; targetElement.style.display = "flex"; targetElement.style.transition = "opacity 1s ease-in"; setTimeout(() => { targetElement.style.opacity = "1"; console.log(isUnlocked ? "ENDING REACHED" : "WELCOME"); }, 50); }, 1000); } function showModal(content) { const existingModal = document.querySelector(".modal"); if (existingModal) { existingModal.remove(); } const modal = document.createElement("div"); modal.className = "modal"; modal.innerHTML = ` <div class="modal-content"> <span class="close">&times;</span> ${content} </div> `; document.body.appendChild(modal); modal.offsetHeight; modal.style.display = "flex"; setTimeout(() => { modal.style.opacity = "1"; }, 10); const closeBtn = modal.querySelector(".close"); closeBtn.onclick = () => closeModal(modal); window.onclick = (e) => { if (e.target === modal) closeModal(modal); }; return modal; } function closeModal(modal) { modal.style.opacity = "0"; setTimeout(() => { modal.remove(); }, 300); } async function isFileCorrect() { try { const fileInput = document.querySelector("textarea"); let inputText = fileInput.value.trim(); const verificationString = document.querySelector(".verificationString"); if (!inputText) { verificationString.innerHTML = ""; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } if (inputText.startsWith("0x")) { inputText = inputText.substring(2); } if (!/^[0-9a-fA-F]*$/.test(inputText)) { verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } let inputBytes; try { if (inputText.length % 2 !== 0) { inputText = "0" + inputText; } inputBytes = ethers.getBytes("0x" + inputText); } catch (e) { console.error("Error parsing hex input:", e); verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } const base64Content = ethers.encodeBase64(inputBytes); const dataURI = `data:image/jpeg;base64,${base64Content}`; const dataURIBytes = ethers.toUtf8Bytes(dataURI); const submittedFileHash = ethers.keccak256(dataURIBytes); // Store first hash as submittedFileHash const packedFirstHash = ethers.solidityPacked(["bytes32"], [submittedFileHash]); const hashedFileHash = ethers.keccak256(packedFirstHash); console.log("First hash (submittedFileHash):", submittedFileHash); console.log("Final hash (hashedFileHash):", hashedFileHash); const expectedHashedFileHash = "0xb43501f79c29086d44cc94ea56ab6c0901cbc79e113f498a64dbfde145f1fa49"; if (hashedFileHash.toLowerCase() === expectedHashedFileHash.toLowerCase()) { verificationString.innerHTML = "✓ &nbsp;Quantum state observed. Reality collapses into certainty."; document.querySelector(".submit").classList.remove("disabled"); return { dataURI, submittedFileHash }; // Return an object with the values } else { verificationString.innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; document.querySelector(".submit").classList.add("disabled"); return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } } catch (error) { console.error("Error in isFileCorrect function:", error); document.querySelector(".verificationString").innerHTML = "✖ &nbsp;Wrong string. Entropy persists."; return { dataURI: "", submittedFileHash: "" }; // Return an object with empty values } } function stringToHexBytes(str) { return Array.from(new TextEncoder().encode(str)) .map((b) => b.toString(16).padStart(2, "0")) .join(""); } document.addEventListener("DOMContentLoaded", function () { const fileInput = document.querySelector("textarea"); const textareaContainer = document.querySelector(".textareaContainer"); let debounceTimer; fileInput.addEventListener("input", function () { clearTimeout(debounceTimer); debounceTimer = setTimeout(function () { isFileCorrect(); }, 300); }); fileInput.addEventListener("paste", function () { setTimeout(isFileCorrect, 50); }); ["dragenter", "dragover", "dragleave", "drop"].forEach((eventName) => { textareaContainer.addEventListener(eventName, preventDefaults, false); }); function preventDefaults(e) { e.preventDefault(); e.stopPropagation(); } ["dragenter", "dragover"].forEach((eventName) => { textareaContainer.addEventListener(eventName, highlight, false); }); ["dragleave", "drop"].forEach((eventName) => { textareaContainer.addEventListener(eventName, unhighlight, false); }); function highlight() { textareaContainer.style.backgroundColor = "#e6e3dc"; } function unhighlight() { textareaContainer.style.backgroundColor = "#f7f6f3"; } textareaContainer.addEventListener("drop", handleDrop, false); function handleDrop(e) { const dt = e.dataTransfer; const files = dt.files; if (files.length > 0) { const file = files[0]; readFileAsHex(file); } } function readFileAsHex(file) { const reader = new FileReader(); reader.onload = function (e) { const arrayBuffer = e.target.result; const bytes = new Uint8Array(arrayBuffer); let hexString = ""; for (let i = 0; i < bytes.length; i++) { const hex = bytes[i].toString(16).padStart(2, "0"); hexString += hex; } fileInput.value = hexString; isFileCorrect(); }; reader.readAsArrayBuffer(file); } }); // Add contract details const VAULT_ADDRESS = "0x24e9C8Aa584F7F0338ec617E3F2261F4BdC49708"; // TODO: UPDATE THIS const VAULT_ABI = [ "function physicalCollectorAddress() view returns (address)", "function isUnlocked() view returns (bool)", "function unlockAddress() view returns (address)", "function unlockTimestamp() view returns (uint256)", "function owner() view returns (address)", "function fileAddress() view returns (address)", "function isFileCorrect(address potentialFileAddress) view returns (bool, string)", "function unlockNFT(bytes32 submittedFileHash) external", ]; async function getProvider() { let provider; try { // TODO: REMOVE localhost when deploying provider = new ethers.JsonRpcProvider("https://eth.llamarpc.com"); //provider = new ethers.JsonRpcProvider("http://localhost:8545"); await provider.getBlockNumber(); // Test the connection console.log("Connected to public RPC provider"); return provider; } catch (error) { console.warn("Public RPC failed:", error); if (window.ethereum) { try { await window.ethereum.request({ method: "eth_requestAccounts" }); provider = new ethers.BrowserProvider(window.ethereum); console.log("Connected using wallet"); return provider; } catch (err) { console.error("User rejected wallet connection:", err); throw new Error("Failed to connect to wallet"); } } throw new Error("No provider available"); } } // Update getContractData to use the centralized provider async function getContractData() { try { const provider = await getProvider(); const vaultContract = new ethers.Contract(VAULT_ADDRESS, VAULT_ABI, provider); const collectorAddress = await vaultContract.physicalCollectorAddress(); console.log("physicalCollectorAddress: " + collectorAddress); // Update first collector address element const collectorElement = document.querySelector(".collector"); if (collectorElement) { collectorElement.textContent = collectorAddress; } // Get vault unlock status isUnlocked = await vaultContract.isUnlocked(); console.log("isUnlocked: " + isUnlocked); // Variables to store file data let fileAddress = null; let jpegDataURI = null; // If the vault is unlocked, get the unlock details from state variables if (isUnlocked) { try { // Get unlock information directly from state variables const unlockAddress = await vaultContract.unlockAddress(); const unlockTimestamp = await vaultContract.unlockTimestamp(); console.log("Unlock address:", unlockAddress); console.log("Unlock timestamp:", unlockTimestamp); if (unlockTimestamp > 0) { // Check if the timestamp is valid // Convert timestamp to date const unlockDate = new Date(Number(unlockTimestamp) * 1000); console.log("Unlock date:", unlockDate.toISOString()); // Update the chronometer with the unlock timestamp const chronometer = document.querySelector(".ending .chronometer"); if (chronometer) { chronometer.textContent = `${unlockDate .getUTCDate() .toString() .padStart(2, "0")}/${(unlockDate.getUTCMonth() + 1) .toString() .padStart(2, "0")}/${unlockDate.getUTCFullYear()}`; } // Update the collector in the ending screen with unlock address const endingCollector = document.querySelector(".ending .collector"); if (endingCollector) { endingCollector.textContent = unlockAddress; } fileAddress = await vaultContract.fileAddress(); console.log("File address:", fileAddress); try { // First check if the file is correct using the Vault contract's isFileCorrect function const [isCorrect, fileContent] = await vaultContract.isFileCorrect(fileAddress); console.log("File correctness check:", isCorrect); if (isCorrect && fileContent) { jpegDataURI = fileContent; console.log("Retrieved verified JPEG data URI successfully"); const viewArtworkButton = document.querySelector(".viewArtwork"); if (viewArtworkButton) { viewArtworkButton.addEventListener("click", function () { showModal(` <div style="text-align:center;"> <div class="modal-title">QUANTUM HEX MACHINA</div> <div class="modal-subtitle">THE UNLOCKED ARTWORK</div> <div style="margin-top: 2dvmin;"> <img src="${jpegDataURI}" style="max-width: 90%; max-height: 70dvmin;" alt="Quantum Hex Machina" /> </div> </div> `); }); viewArtworkButton.classList.remove("disabled"); console.log("View Artwork button enabled"); } } else { console.log("File verification failed"); const viewArtworkButton = document.querySelector(".viewArtwork"); if (viewArtworkButton) { // Simply keep the button disabled by adding the disabled class viewArtworkButton.classList.add("disabled"); console.log("View Artwork button disabled due to file verification failure"); } } } catch (error) { console.error("Error verifying file:", error); const viewArtworkButton = document.querySelector(".viewArtwork"); if (viewArtworkButton) { // Also keep the button disabled in case of errors viewArtworkButton.classList.add("disabled"); console.log("View Artwork button disabled due to verification error"); } } } else { console.log("No unlock data found despite unlocked status"); // Set default values for testing if no timestamp const chronometer = document.querySelector(".chronometer"); if (chronometer) { chronometer.textContent = "UNLOCKED"; } } } catch (error) { console.error("Error getting unlock details:", error); } } return { collectorAddress, isUnlocked, unlockAddress: await vaultContract.unlockAddress(), unlockTimestamp: await vaultContract.unlockTimestamp(), fileAddress, jpegDataURI, }; } catch (error) { console.error("Error fetching contract data:", error); } } </script> <style> html { background-color: black; width: 100%; height: 100%; color: #6e6d69; display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: "Times New Roman", serif; font-weight: 500; margin: 0; padding: 0; background-color: #ece9e2; background-image: url("https://arweave.net/0MD2DIp1YxwVD1xATJssXH54S9Xjz2lXA583PogfmpY"); background-size: cover; background-position: center; background-repeat: no-repeat; } body { display: flex; flex-direction: column; width: 100dvmin; height: 100dvmin; align-items: center; justify-content: center; text-align: center; margin: 0; padding: 0; } .background { width: 100%; height: 100%; position: absolute; background-color: #ece9e2; opacity: 0; transition: opacity 1s; } .main { display: flex; flex-direction: column; align-items: center; gap: 1.3dvmin; transition: opacity 1s ease-in-out; margin-bottom: 0.4dvmin; z-index: 10; } .ending { margin-bottom: 6.5dvmin; display: none; opacity: 0; gap: 4dvmin; } .game { margin-bottom: 6.5dvmin; display: none; opacity: 0; gap: 4dvmin; } .title { font-size: 2.5dvmin; letter-spacing: 0.54dvmin; text-indent: 0.54dvmin; } .subtitle { letter-spacing: 0.225dvmin; text-indent: 0.225dvmin; font-size: 1dvmin; } .timer { background-color: #3e3e3e; color: #ece9e2; padding: 0.8dvmin 1.5dvmin; border-radius: 2dvmin; font-size: 1.2dvmin; transform: translateY(0.7dvmin); letter-spacing: 0.24dvmin; text-indent: 0.24dvmin; leading-trim: both; opacity: 0; transition: 1.5s opacity; } .Ihatecss { font-family: "Times New Roman", serif !important; } .button { background-color: #3e3e3e; leading-trim: both; color: #ece9e2; font-size: 1.2dvmin; padding: 0.8dvmin 1.5dvmin; border-radius: 2dvmin; cursor: pointer; transition: opacity 1.5s ease-in-out, background-color 0.1s; user-select: none; letter-spacing: 0.24dvmin; text-indent: 0.24dvmin; } .button:hover { background-color: #6e6d69; } .disabled { background-color: #aeaeae; cursor: default; } .disabled:hover { background-color: #aeaeae; } .info { padding: 0.8dvmin 2.4dvmin; margin-top: 2.2dvmin; } .titleContainer { display: flex; flex-direction: column; align-items: center; gap: 1.1dvmin; } .titleContainer > .title { font-size: 1.7dvmin; } .titleContainer > .subtitle { font-size: 0.7dvmin; } .inputContainer { display: flex; flex-direction: column; align-items: center; position: relative; } .textareaContainer { width: 48dvmin; display: flex; position: relative; background-color: #f7f6f3; padding: 2dvmin; padding-bottom: 9.5dvmin; align-items: center; justify-content: center; flex-direction: column; } .ending .textareaContainer { height: 48.5dvmin; } .ending .chronometerContainer { position: initial; bottom: initial; padding: 0.8dvmin 3dvmin; } .ending .collectorContainer { align-items: center; } .ending .collector { font-size: 1.2dvmin; } textarea { width: 100%; height: 48.5dvmin; background-color: #f7f6f3; font: inherit; font-size: 1.1dvmin; line-height: 1.1dvmin; color: inherit; vertical-align: top; letter-spacing: 0.18dvmin; text-align: justify; outline: none; border: none; box-shadow: none; -webkit-appearance: none; -moz-appearance: none; appearance: none; resize: none; overflow-y: scroll; scrollbar-gutter: stable; overflow-x: auto; overflow-y: overlay; scrollbar-width: none; font-family: "Calibri", "Open Sans", sans-serif; font-family: monospace; } textarea::placeholder { color: #e0ddd7; } textarea::-webkit-scrollbar-track { background: transparent; } textarea { scrollbar-color: rgba(110, 109, 105, 0.5) transparent; } .chronometerContainer { position: absolute; bottom: 7.5dvmin; padding: 0.8dvmin 8dvmin; background-color: #e6e3dc; border-radius: 8dvmin; display: flex; flex-direction: column; gap: 0.2dvmin; } .verificationString { position: absolute; bottom: 13.5dvmin; font-size: 1.1dvmin; font-family: "Calibri", "Open Sans", sans-serif; background-color: #f7f6f3; } .submitInfo { position: absolute; bottom: 4dvmin; right: -2.8dvmin; line-height: 1.6dvmin; width: 1.6dvmin; height: 1.6dvmin; border-radius: 50%; color: #6f6d69; border: solid 0.15dvmin #6f6d69; font-weight: 200; font-family: sans-serif; font-size: 1.5dvmin; cursor: pointer; } .submitInfo:hover { opacity: 0.75; } .viewArtworkInfo { position: absolute; bottom: 0.5dvmin; right: 11dvmin; line-height: 1.6dvmin; width: 1.6dvmin; height: 1.6dvmin; border-radius: 50%; color: #6f6d69; border: solid 0.15dvmin #6f6d69; font-weight: 200; font-family: sans-serif; font-size: 1.5dvmin; cursor: pointer; } .viewArtworkInfo:hover { opacity: 0.75; } .collectorContainer { display: flex; flex-direction: column; justify-content: flex-start; width: 100%; align-items: start; margin-top: 1dvmin; margin-left: 0.6dvmin; gap: 0.3dvmin; } .collector { font-weight: bold; text-decoration: underline; letter-spacing: 0.22dvmin; cursor: pointer; } .collector:hover { opacity: 0.6; } .collectorTitle { letter-spacing: 0.08dvmin; font-size: 0.9dvmin; } .submit { align-self: end; border-radius: 0; } .viewArtwork { border-radius: 0; align-self: center; } .chronometer { font-size: 1.8dvmin; } .modal { position: fixed; z-index: 100; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.3); opacity: 0; transition: opacity 0.3s ease-in-out; font-family: "Calibri", "Open Sans", sans-serif; display: flex; justify-content: center; align-items: center; font-size: 1.2dvmin; } .modal-content { background-color: #f7f6f3; padding: 3dvmin; width: 85dvmin; position: relative; border-radius: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; } .text-center { text-align: center; } .modal-title { font-size: 1.45dvmin; text-align: center; margin-top: 0; font-weight: 600; color: #3e3e3e; } .modal-subtitle { font-size: 1.27dvmin; text-align: center; margin-top: 0; margin-bottom: 3dvmin; font-weight: normal; color: #3e3e3e; } .modal-body { line-height: 1.8; color: #3e3e3e; text-align: left; padding: 0 10dvmin; } .close { color: #6e6d69; position: absolute; right: 0.75dvmin; top: 0.25dvmin; font-size: 2dvmin; font-weight: bold; cursor: pointer; padding: 0.5dvmin; user-select: none; } .close:hover { opacity: 0.7; } </style> <body> <div class="background"></div> <div class="main cover"> <div class="subtitle">ANDREA CHIAMPO PRESENTS</div> <div class="title">QUANTUM HEX MACHINA</div> <div class="timer">00:00:00:00</div> </div> <div class="main game"> <div class="titleContainer"> <div class="subtitle">ANDREA CHIAMPO PRESENTS</div> <div class="title">QUANTUM HEX MACHINA</div> <div class="info button">INFO</div> </div> <div class="inputContainer"> <div class="textareaContainer"> <textarea type="text" placeholder="Paste correct string here/drag in to upload a file" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" ></textarea> </div> <div class="verificationString"></div> <div class="chronometerContainer"> <div class="subtitle">UNSOLVED SINCE</div> <div class="chronometer title">00:00:00:00</div> </div> <div class="submit button disabled">SUBMIT</div> <div class="submitInfo">i</div> <div class="collectorContainer"> <div class="subtitle collectorTitle"> PHYSICAL ART COLLECTOR / WALLET ALLOWED TO CLAIM </div> <div class="subtitle collector">0x0000000000000000000000000000000000000000</div> </div> </div> </div> <div class="main ending"> <div class="titleContainer"> <div class="subtitle">ANDREA CHIAMPO PRESENTS</div> <div class="title">QUANTUM HEX MACHINA</div> <div class="info button">INFO</div> </div> <div class="inputContainer"> <div class="textareaContainer"> <div class="chronometerContainer"> <div class="subtitle">THIS ARTWORK HAS BEEN UNLOCKED</div> <div class="chronometer title">00/00/00</div> </div> <div class="collectorContainer"> <div class="subtitle collectorTitle">UNLOCKED BY</div> <div class="subtitle collector">0x0000000000000000000000000000000000000000</div> </div> </div> <div class="viewArtwork button">VIEW UNLOCKED ARTWORK</div> <div class="viewArtworkInfo">i</div> </div> </div> </body> </html>
description.txt-1**PLEASE READ CAREFULLY**\n\n𝐐𝐔𝐀𝐍𝐓𝐔𝐌 𝐇𝐄𝐗 𝐌𝐀𝐂𝐇𝐈𝐍𝐀 is both a cryptographic puzzle and a conceptual artwork that challenges the boundaries of technology, ownership, and autonomy. \n\nAn encrypted image suspended in cryptographic limbo, a sealed contract, a puzzle of near-infinite complexity. This NFT is an access portal to a digital artwork that cannot be viewed — not yet.\n\nThe image has been scrambled at the byte level using arithmetic JPEG encoding. Its hexadecimal order is broken, but its soul remains intact — waiting to be reassembled.\n\nExclusive access to the full scrambled string is granted to the holder of the physical piece, together with technical instructions and an off-chain verification script, all included in a physical dossier delivered upon acquisition.\n \nDISCLAIMER: \nThis challenge is beyond the reach of traditional computing. Solving it may require quantum-level processing power. \n\nThis NFT functions as a certificate of ownership for the physical artwork, tying the collector’s wallet address to the tangible piece and granting exclusive rights to eventually unlock, claim, and complete the digital artwork.\n\nIn the meantime, the collector will hold something just as rare:\nA unique physical artwork that serves as a vessel, a printed embodiment of an unsolved digital riddle. Whether the puzzle is solved tomorrow or in a hundred years, their piece will remain: a rare artifact from a world in transition. A relic of the future — waiting to be unlocked.\n\nIf Deus ex Machina once symbolized divine intervention to resolve the unsolvable — has technology now taken its place, becoming our Machina Hex Machina?\n\n*** Smart contract by Nahiko ***\n\nPLEASE NOTE: This artwork cannot be acquired via direct offer on the NFT, as it is currently locked within a smart contract. To inquire about acquiring the physical piece and its dossier — and to become the sole custodian eligible to unlock the NFT — please contact: offline@superrare.com
N !function(){"use strict";function e(e){const t=[[[0,-.07,6],[.02,.015,0],.07,0,[3,1.4,2]],[[.035,-.06,6],[.03,.09,-.02],.06,0,[-.3,3.2,.95]],[[.04,-.07,6],[0,.1,-.1],.06,-.02,[.3,2.7]],[[-.03,-.02,6],[-.04,-.07,.03],.087,-0,[-2.2,1,2]],[[.03,-.1,6],[-.07,-.01,.04],.08,-0,[1,2.5,1.5]],[[.03,.015,6],[.05,.04,-.03],.09,-0,[-.7,3.1,1.5]],[[-.05,-.14,4],[-.03,-.12,.09],.1,-.04,[-3,.9,2]],[[.01,-.05,8.5],[-.06,-.055,.03],.056,0,[1.5,2.5,2.5]],[[.01,.01,10],[.14,.05,.1],.04,0,[0,3.6,1]],[[-0,-.07,8],[-.07,-.1,.03],.059,0,[-3,1.2,1.5]],[[0,-.06,3],[.06,.09,-.04],.2,.04,[-4,1,5]],[[-.05,-.07,3],[.09,-.09,0],.14,.04,[3.2,1,2]],[[-.03,-.03,9],[.1,-.1,-.01],.052,0,[3.3,.6,2]],[[-.023,-.008,9],[.1,-.07,-.07],.038,.02,[3.5,.7,2.1]],[[-.03,-.01,9],[.16,-.17,-.07],.032,.11,[3,.8,1.6]],[[.03,-.04,6],[.02,.15,0],.067,-.12,[1.7,3,1.1]],[[-.01,-.023,9],[.11,-.07,-.14],.03,.13,[3,.7,1]],[[.01,-.05,4],[.04,.06,-.03],.11,.01,[-3.2,1.5,10]],[[-.015,-.037,9],[.01,-.09,-.22],.032,.224,[2,.7,3]],[[0,-.09,4],[-.07,.04,-.09],.125,.06,[0,2.2,20]],[[.04,.015,8],[.08,.08,-.09],.061,.09,[3.5,.5,2]],[[-.04,0,7.6],[.06,-.09,.09],.06,-.08,[-3.25,.35,3]],[[.035,-.06,8],[-.06,.04,-.02],.06,0,[-.5,1.6,2]],[[.028,-.1,6],[-.1,.02,-.04],.062,-.04,[-2.3,1.8,2.5]],[[.07,-.1,3],[.02,.1,-.1],.18,.08,[-.5,2.6,5]],[[-.08,-.1,4],[-.04,-.13,.03],.09,.02,[2.6,1.6,3]],[[-.01,-.005,9],[.05,.1,-.04],.051,-.015,[-4,1.2,10]],[[-.005,.006,9],[.09,.11,0],.057,-.015,[-3,1.2,100]],[[.07,-.1,3],[.06,.08,-.1],.16,.08,[-.5,2.8,5]],[[-.01,-.05,6],[-.03,-.03,.04],.072,.01,[-2.9,1.16,2]],[[-0,-.03,6],[.05,-.044,-.04],.082,0,[-3,1.5,1.7]],[[.04,-.03,6],[-.03,.07,-.03],.09,0,[-4,1.8,1.8]],[[0,-0,8],[.02,.02,0],.05,-.01,[.6,3,2.8]],[[-0,-.02,4],[.02,.02,0],.11,-.02,[.4,2.5,10]],[[.05,-.07,6],[.13,.09,-.09],.06,.03,[-.1,3.4,2]],[[.045,-.03,6],[0,.07,-.1],.065,.09,[3.2,.7,30]],[[-.01,-.14,3],[.02,-.03,0],.17,.012,[3.9,1.5,2]],[[.025,.005,9],[.05,.1,-.04],.057,-.015,[-4,1.2,10]],[[0,-.01,8],[-.05,0,0],.055,-.01,[.3,3,.8]],[[.02,-.01,8],[-.04,-.03,-.06],.052,.01,[-1.3,3,1]],[[.052,-.04,6],[.04,.1,-.05],.077,.01,[-8,2.8,20]],[[.02,-.01,6],[.13,-.05,-.07],.055,.09,[3.7,.75,50.6]],[[-.09,-.14,3],[-.06,-.11,-.01],.13,.035,[2.3,.9,1.2]],[[-.02,-.05,6],[-.05,-.044,-.04],.085,0,[-2,2,2.6]],[[0,-.09,4],[.03,.12,-.09],.125,.02,[-.5,2.3,10]],[[.02,-.02,6],[.11,.06,-.04],.09,-.02,[-3.6,1.5,10]],[[-.04,-.03,7.6],[-.01,-.11,.12],.06,-.08,[-3.25,.85,30]],[[.01,-.06,6],[-.05,.02,.02],.076,-.06,[-2.5,1.3,1000.6]],[[-0,-.06,4],[.02,-.02,0],.11,.02,[.5,2.4,10]],[[-0,.014,7],[.1,.02,.08],.06,0,[.2,3.3,1.3]],[[-.005,.005,9],[.09,.1,0],.057,-.015,[-3.5,1.3,4]],[[.03,-.06,4],[-.07,.07,-.03],.115,0,[-5,1.8,1.4]],[[0,.01,9],[.11,-.02,0],.04,.01,[4.4,.9,2]],[[-.005,.002,9],[.09,.1,0],.057,-.015,[-3,1.2,10]],[[-.02,-.1,4],[-.06,-.08,.05],.122,0,[-2.8,1.2,4.5]],[[-.004,-.019,10],[.02,-.01,.07],.05,-.02,[-3.1,1.4,2.4]]][e];return[(new THREE.Vector3).copy(new THREE.Vector3(0,0,-4)),t[2],t[3],n(...t[4]).negate(),n(...t[0]),b(...t[1])]}function n(e,n,t=1){e=u/4*e+u/2;let r=d(n*=u/4);return new THREE.Vector3(r*d(e),i(n),r*i(e)).multiplyScalar(t)}var t=Math.ceil,r=Math.round,c=Math.exp,v=Math.pow,o=Math.min,a=Math.floor,l=Math.sqrt,s=Math.abs,p=Math.max,i=Math.sin,d=Math.cos,u=Math.PI;const m=l(2),f=1080,x=1/l(2),h=e=>2*a(e/2),y=(e,n,t)=>p(o(e,t),n),S=e=>2*s(e-a(e+.5)),w=()=>{let e=window.innerWidth,n=window.innerHeight;if(e/x<n){const n=h(e);return[n,a(n/x)]}{const e=h(n);return[a(e*x),e]}},E=(e,n,t)=>{const r=`//!S:${n}`,c=[`${r}`,`${r}:${t}`,`${r}:${t+1}`,`${r}:END`],v=c.map((n=>e.indexOf(n)));return-1===v[1]||-1===v[3]?e:e.slice(0,v[0])+e.slice(v[1]+c[1].length,void 0===v[2]?v[3]:0<=v[2]?v[2]:v[3])+e.slice(v[3]+c[3].length)},g=(e,n,t,r)=>{let c=e;for(;(()=>{const e=`/*!${n}:${t}*/`,v=c.indexOf(e);return-1!==v&&(c=`${c.slice(0,v)}${r}${c.slice(v+e.length)}`,!0)})(););return c},R=(e,n,t)=>g(e,"F",n,`${t}${0==a(t)-t?".":""}`),T=(e,n,t)=>g(e,"V3",n,`vec3(${t.x},${t.y},${t.z})`),b=(e,n,t)=>M(e).multiply(F(n)).multiply(U(t)),M=e=>{const n=i(-e*u*2),t=d(-e*u*2);return(new THREE.Matrix3).set(1,0,0,0,t,-n,0,n,t)},F=e=>{const n=i(-e*u*2),t=d(-e*u*2);return(new THREE.Matrix3).set(t,0,n,0,1,0,-n,0,t)},U=e=>{const n=i(-e*u*2),t=d(-e*u*2);return(new THREE.Matrix3).set(t,-n,0,n,t,0,0,0,1)},C=[(e,n)=>p(.6*v(e,.5),.2)*n,(e,n)=>p(.5*v(e,.25),.1)*n,(e,n)=>p(.5*v(e,.25),.1)*n,(e,n)=>p(c(2*e-2.5),.1)*n,(e,n)=>p(c(2*i(1.6*e-.3)-2.6),0)*n+.028],X=[(e,n,t,r)=>{e[0]=hl.random(),e[1]=1+r-y(n/(t-1)+(2*hl.random()-1)*(2/t),0,1)*(1+r)},(e,n,t,r)=>{e[0]=(1.8*hl.random()-.9)*(1.8*hl.random()-.9)+.5,e[1]=1+r-y(n/(t-1)+(2*hl.random()-1)*(2/t),0,1)*(1+r)},(e,n,t,r)=>{e[0]=(1.5*hl.random()-.75)*(1.5*hl.random()-.75)+.5,e[1]=1+r-y(n/(t-1)+(2*hl.random()-1)*(2/t),0,1)*(1+r)}],z=[[.95,!1,2,.125],[.95,!1,8,.5],[.95,!0,1,.05],[.95,!0,4,.5],[.85,!1,2,.125],[.99,!1,2,.25]],P=[[[14270913,12755875,11044998,9334893,7626072,6180166,5062970,4406324,4275508,4473401,4934466,5526604,6184791,6842723,7631983,6184794,5000777,4079675,3290673,2698537,2238243,1843486,1514522,1185814,856850,593165,329736,131844,131587],14204589],[[14074805,10393979,5987914,3882288,1647392],16764064],[[16578028,11128776,2198136,3890996,12295204,15119706,15979691,15780248,14985834,14060107,13201988,12740426,12740947,12081735,10964801,9651263,8076094,5582648,3548205],8834744],[[11712474,11383511,10527950,9277631,7829417,6380426,4997478,3942979,3678251,4663847,6242098,7886146,9529683,10844771,11765875,10713697,9596242,8413254,7230266,6047279,4929829,3812123,2760210,1774089,853507,328195,525582],14667720],[[16777215,8624357,8295393,7374296,6123717,4675492,3161720,1581894,132876,1513736,3684123,5591854,7237187,8619352,9607022,10265225,9869700,9211514,8421743,7565923,6579029,5526344,4539450,3487021,2565920,1645077,855563,263428,197635,197636],15983070],[[11770775,11639189,11309968,10848906,10322308,9796224,9467521,9270918,9337743,9602202,9997991,10394290,10724540,10923459,11056329,10465489,9676495,8624328,7440318,6124462,4874136,3754622,2700897,1778757,922410,197389,131328],16767687],[[10911809,10846274,10715204,10452548,10058307,9466944,8612411,7560500,6114346,4404766,2366221,262661,2435650,5266044,9410478,7896720,6580343,5461859,4540754,3882309,3290170,2829618,2500396,2303016,2105637,2039843,1974050,1973794,1973794],15983838],[[8361299,8294477,8227655,8160833,8159547,8092470,8025393,8023852,7956775,8020771,8084766,8345369,8933908,10243088,16394500,9652528,7422254,5978667,4862759,4074788,3418145,2892830,2498844,2235931,2039066,1907481,1841945,1841689,1841689],16632752],[[13160150,13226199,13291993,13357786,13358043,13292507,13095386,12766680,12175315,11321035,10203583,8889006,7508121,6521220,6521466,9086867,7111794,6255972,5663065,5136209,4675401,4345666,4016188,3752503,3489074,3291182,3093290,2895655,2763813,2697763,2631713],15979707],[[15636355,15635583,15567734,15499369,15364441,15229513,15094841,15026476,14959396,14567207,13977899,13191472,12339252,11617336,11157820,11091265,10960193,10566977,9977153,9124672,8141117,6960441,5779764,4664110,3679784,2892323,2367263],15636355],[[14931056,14931054,14931051,14865765,14800478,14669398,14078540,13159493,11911999,10271037,8104513,6003529,3968592,2459481,2788718,4036233,3576706,3050874,2917488,2848869,2779737,2710093,2574913,2505782,2306093,2172710,2040097,1973790,1973533],14283451],[[16444130,14734806,12435663,9610695,7048131,5535420,4747195,4548783,4349854,4150666,3819893,3423324,2895939,2434350,2039328,1907740],14734806],[[14672597,11844259,9212796,6910045,4936260,3357233,2238499,1580572,1383194,1448474],9212796],[[11128773,9815742,8502712,7254963,6007471,4891052,3774634,3116708,3113108,3108223,2970979,2571074,2040868,2236445,5980448,14121254,12741672,11559212,10573872,9851443,9326134,8866616,8472890,8079419,7751483,7358012,7030332,6636860,6243644,5915964,5522748],15979707],[[11314331,11116951,10919571,10787983,10590860,10393480,10130307,9670268,9078388,8223593,7171419,5790539,4278588,3227449,4018001,6913673,5794933,4938852,4214614,3556425,3029567,2634038,2239022,1975080,1777443,1711136,1776672,1973537,2236708,2631208],15979707],[[16576733,15330023,10468821,6395850,4228807,2984646,3833027,4353206,4610721,4475011,3881058,3618643,3355717,3092537,2697518,1907741],15591385],[[14537937,13284524,12162436,10713953,9069893,7361071,5652766,3944464,2170373,133891],15578992],[[13160909,9940641,7179384,5008212,3493428,2438171,1842953,1445378],7179384],[[13552567,13224890,12700091,11978171,10993594,9812153,8368311,6858422,5217716,3773617,3180965,2915731,2649982,2450024,2119250,1854786,1854271,1853500,1852216,1915956,1979951,1978155,2042150,2040867,1974304,1973790,1973533],15979707],[[14875330,15006401,15202495,15463868,15724734,15854528,15722176,15523774,15128763,14667958,13944495,13155239,12102812,10721674,7432798,9012855,8882553,8028530,6910822,5792600,4674378,3753021,2897456,2239014,1646621,1185814,856848,659213,593420],15979707],[[3126230,2794955,2595009,2460857,2326707,2192815,2255277,2579628,3231147,4013475,4795793,5447798,6297432,7609152,9842995,12802871,11685170,10633775,9713964,8794922,7941672,7154213,6367010,5645342,4923931,4267799,3677460,3087121,2562319,2168590,1840653],15979707],[[13025713,12894642,12566194,12237488,11711917,11120297,10528165,9870496,9146780,8488599,7829906,7237005,6840964,6510714,6114927,5588580,4996439,4404812,3878978,3353401,2959153,2630955,2368295,2237222,2171428,2106147,2106659,2107172,2107429],15979707],[[13748943,12169915,10196385,8288644,6578282,5262422,4472905,4078146,3683644,3025970,2499625,2302245,2104866,1907487,1710364,1578777],16205382],[[16580607,15988477,14804985,13687286,12569075,11582192,10660332,9869288,9274338,8744921,8346314,7947954,7484819,7087728,6823242,7414826,11693617,9522982,8667940,8010532,7419171,6828067,6302754,5711904,5121053,4530202,3939095,3282707,2691854,2035465,1444613,919811,657924],16771030],[[16777215,16777215,16777215,16381942,15065050,13484987,11773341,9930881,8154472,6510421,5392200,4735044,4735559,5065040,5394519,5592412,5395803,5330011,5132633,4803926,4409169,3948875,3488068,2961980,2501171,1974827,1448482,987673,527120,197639,65794,0,0],16767687]],L=[(e,n,t,c,v)=>v[r((.5*(1-t)+.5*n)*v.length)%v.length],(e,n,t,c,v)=>v[r((.45*(1-t)+.05*(1-c)+.5*n)*v.length)%v.length],(e,n,t,c,v)=>v[r(n*(v.length-1))%v.length],(e,n,t,c,v)=>v[r((.2*(1-t)+.8*n)*(v.length-1))%v.length],(e,n,t,c,o)=>o[r((.5*v(1-t,.75)+.5*n)*o.length)%o.length],(e,n,t,c,v)=>v[r((.75*(1-t)+.25*n)*v.length)%v.length]],A=[[1e5,220,400,3,.82,.8,.5,0,.8,.1,4],[24e4,350,[160,100],[1.2,0],.6,[.75,.6],.58,.2,.4,.06,1],[3e5,400,[250,150],2,.6,.6,.7,0,.4,.1,1],[2e5,200,160,3,.9,.6,.6,[.3,.5],.9,.09,3],[2e5,200,260,4,.9,.6,.4,[.3,.5],.6,.1,3],[14e4,160,200,[3,1],.82,.7,.59,.3,.8,.08,3],[3e5,100,600,1,.2,.6,.25,[.1,.5],.5,.1,2],[3e5,250,600,2,.65,.6,.8,[.1,.5],.4,.1,2],[3e5,200,500,3,.3,.6,.9,[.1,.5],.9,.12,3],[3e5,400,250,[5,.5],[.45,.5],.61,[.76,0],.3,.7,.1,3],[2e5,250,600,2.5,.75,.66,.3,[.2,.5],.4,.08,0],[1e5,420,400,3,.82,.8,.45,.3,.8,.1,4],[3e5,400,250,[4,.5],.75,.6,[.46,0],.1,.7,.1,3]],B=[null,[9,2,32,.4,1.5],[7,1.7,72,.5,2.5]],H=[[[-.01,.0035,.0023,1160],[1,.3,.2],[0,0,0],[0,0,0],!1],[[-.01,.0033,.0023,1300],[1.5,.29,.05],[0,0,-.03],[0,0,0],!1],[[-.012,.0032,.003,650],[1,.32,.13],[0,0,-.02],[0,.11,.21],!1],[[-.01,.002,.0026,520],[1,.27,.13],[-.02,.16,-.22],[.25,-.06,.5],!1],[[-.0145,.0035,.0023,492],[.8,.21,.1],[0,-.18,-.3],[.75,-.32,.78],!1],[[-94e-5,.0035,.0023,1290],[.8,.3,.17],[0,-.12,-.3],[0,-.03,.03],!1],[[-8e-4,.0035,.003,950],[1,.222,.05],[0,-.12,-.2],[.2,.03,0],!1],[[-.02,.0035,.0023,945],[.7,.3,.06],[-.02,.1,-.02],[-.05,.15,.5],!1],[[-.02,.0035,.0023,955],[.7,.3,.05],[0,.08,-.02],[.05,-.3,0],!1],[[-98e-5,.0035,.0023,1290],[1,.3,.18],[.05,-.08,-.2],[-.03,.03,0],!1],[[-.00101,.0035,.0023,1500],[.7,.3,.11],[0,0,-.14],[.19,.2,0],!1],[[-.002,-.0054,.0023,1576],[1,.24,.06],[-.03,-.07,-.19],[.03,0,-.03],!0],[[-.002,-.0059,.00225,3657],[.9,.25,.035],[.04,-.02,-.1],[.2,.2,.2],!0],[[-.002,-.00556,.0023,5467],[.9,.2,.07],[-.015,-.1,-.3],[-.14,.11,.042],!0],[[-.002,-.00547,.0023,5889],[.9,.26,.05],[-.1,-.04,-.25],[-.17,.3,.1],!0],[[-.002,-.005495,.0023,8930],[.9,.3,.07],[0,.15,-.1],[.18,.2,-.02],!1],[[-.002,-.00552,.0023,8930],[.9,.3,.05],[.1,.15,-.15],[.18,.1,-.02],!1],[[-.002005,-.0055,.0023,10170],[.9,.25,.15],[-.1,.08,-.3],[.25,.65,-.21],!0],[[-.01,-.0055,.0023,460],[1.1,.24,.08],[0,.1,-.07],[-.14,-.13,.19],!0],[[-.00199,-.00546,.00231,11562],[1,.3,.05],[.01,.12,-.18],[.13,-.02,.3],!0],[[-.002,-.0055,.00231,20997],[.9,.25,.12],[0,-.02,-.1],[0,.1,0],!0],[[-.00199,-.0055,.0025,20917],[.9,.25,.12],[0,0,-.04],[-.2,-.3,.5],!0],[[-.001998,-.0055,.0023,22540],[1,.25,.15],[.01,0,-.01],[0,.1,-.1],!0],[[.004,-.0075,-.0063,1170],[1,.26,.1],[.1,.1,-.18],[.76,.43,.35],!0],[[.00453,-.00739,-.00619,5260],[.9,.25,.04],[0,.03,-.1],[0,0,.2],!0],[[.00453,-.00739,-.00619,5270],[.95,.28,.08],[.1,.15,-.04],[.1,-.03,.3],!0],[[.00458,-.00746,-.00622,5248],[.75,.28,.07],[.03,.1,-.1],[.12,-.37,-.05],!0]],Y={type:THREE.UnsignedByteType,format:THREE.RGBAFormat,antialias:!1,precision:"highp",stencil:!1,depth:!1,minFilter:THREE.NearestFilter,magFilter:THREE.NearestFilter,wrapS:THREE.ClampToEdgeWrapping,wrapT:THREE.ClampToEdgeWrapping,alpha:!1};let Z,N,k,V,q,I,$,O,D,G,W,_,J,j,K,Q,ee,ne,te,re,ce,ve,oe,ae,le,se,pe,ie,de=window,ue=document;const me=(e,n)=>1/(n*l(2*u))*c(-v(e,2)/(2*v(n,2))),fe=()=>{[ee,ne]=(()=>{let e=h(f);return[a(e*x),e]})(),[_,J]=w(),[j,K]=[a(1024*x),1024],Q=J/ne;let e=de.devicePixelRatio??1;Z.setRenderTarget(null),Z.setPixelRatio(de.devicePixelRatio),Z.setClearColor(0,1);let n=2160;8192>Z.capabilities.maxTextureSize&&(n=2048);let t=o(2*_*2/e,2*a(n*x)/e),r=o(2*J*2/e,2*n/e);Z.setSize(t,r),Z.clear(),W.style=`aspect-ratio: auto ${_}/${J};width:${_}px;height:${J}px;`,W.id="defaultCanvas",N=new THREE.OrthographicCamera(-j/2,j/2,K/2,-K/2,.01,100),N.position.z=.1,N.lookAt(new THREE.Vector3(0,0,0)),k=new THREE.OrthographicCamera(0,_,J,0,.01,100),k.position.z=.1,k.lookAt(new THREE.Vector3(0,0,0)),G=function(e,n,t){let r="\nuniform float uS;\nuniform vec3 uR;\n\n#define PI 3.1415926536\n#define UF float(0xffffffffU)\n#define C clamp\n#define F floor\n#define S smoothstep\n#define fseed uS*1e-4\n\nvarying vec2 vU;\n\nuint hi(uint x){x^=x>>16;x*=0x45d9f3bU;x^=x>>16;x*=0x45d9f3bU;x^=x>>16;return x;}\nvec2 h22(uvec2 p){uint n=uint(p.x)*1597334677U^uint(p.y)*3812015801U;return vec2(hi(n)*uvec2(0x1U,0x1ffU))/UF;}\nvec3 h32(uvec2 p){uint n=uint(p.x)*1597334677U^uint(p.y)*3812015801U;return vec3(hi(n)*uvec3(0x1U,0x1ffU,0x3ffffU))/UF;}\nfloat v2d(in vec2 p,float u,float v){p+=fseed;float k=1.+63.*pow(1.-v,6.);vec2 i=F(p),f=fract(p),a=vec2(0);for(int y=-2;y<=2;y++)for(int x=-2;x<=2;x++){vec2 g=vec2(x,y);vec3 o=h32(uvec2(ivec2(i+g)))*vec3(u,u,1.);vec2 d=g-f+o.xy;float w=pow(1.-S(0.,1.414,length(d)),k);a+=vec2(o.z*w,w);}return a.x/a.y;}\nfloat mag(vec2 x){return dot(x,x);}\nfloat w2d(vec2 x){x+=fseed;uvec2 p=uvec2(int(F(x.x)),int(F(x.y)));vec2 f=fract(x);float res=1e30;vec3 fb=vec3(-1,0,1);uvec3 ub=uvec3(-1,0,1);res=min(mag(fb.xx-f+h22(p+ub.xx)),res);res=min(mag(fb.xy-f+h22(p+ub.xy)),res);res=min(mag(fb.xz-f+h22(p+ub.xz)),res);res=min(mag(fb.yx-f+h22(p+ub.yx)),res);res=min(mag(fb.yy-f+h22(p+ub.yy)),res);res=min(mag(fb.yz-f+h22(p+ub.yz)),res);res=min(mag(fb.zx-f+h22(p+ub.zx)),res);res=min(mag(fb.zy-f+h22(p+ub.zy)),res);res=min(mag(fb.zz-f+h22(p+ub.zz)),res);return sqrt(res);}\nmat2 rot=mat2(.6,.8,-.8,.6);\nfloat vFbm(in vec2 p,float u,float v){float r=v2d(p,u,v)*.5;p=p*rot*2.;r+=v2d(p,u,v)*.25;p=p*rot*2.;r+=v2d(p,u,v)*.125;p=p*rot*2.;r+=v2d(p,u,v)*.0625;return r/.9375;}\nfloat wFbm(in vec2 p){float r=w2d(p)*.6;p=p*rot*2.3;r+=w2d(p)*.25;p=p*rot*2.3;r+=w2d(p)*.25;p=p*rot*2.3;r+=w2d(p)*.0625;return r/.9375;}\nvoid hfast(vec2 g,out vec4 h0,out vec4 h1){const vec2 o=vec2(26.,161.);const float d=71.;const vec2 f=vec2(951.135664,642.949883);vec4 P=vec4(g.xy,g.xy+1.);P=P-F(P*(1./d))*d+o.xyxy;P*=P;P=P.xzxz*P.yyww;h0=fract(P/f.x);h1=fract(P/f.y);}\nfloat qh2d(float x,float i0,float i1,float e0,float e1){vec3 h=(((vec3(-15.,8.,7.)+vec3(6.,-3.,-3.)*x)*x)+vec3(10.,-6.,-4.))*(x*x*x);return i0+dot(vec3((i1-i0),e0,e1),h.xyz+vec3(0.,x,0.));}\nvec4 qh2d(float x,vec2 i0,vec2 i1,vec2 e0,vec2 e1){vec3 h=(((vec3(-15.,8.,7.)+vec3(6.,-3.,-3.)*x)*x)+vec3(10.,-6.,-4.))*(x*x*x);return vec4(e1,i0)*vec4(h.zz,1.,1.)+vec4(e0,h.xx)*vec4(vec2(h.y+x),(i1-i0));}\nfloat h2d(vec2 P){P+=fseed;vec2 Pi=F(P),Pf=P-Pi;vec4 hgx,hgy;hfast(Pi,hgx,hgy);hgx=hgx-.49999;hgy=hgy-.49999;vec4 norm=inversesqrt(hgx*hgx+hgy*hgy);hgx*=norm;hgy*=norm;vec4 qr=qh2d(Pf.y,hgx.xy,hgx.zw,hgy.xy,hgy.zw);return qh2d(Pf.x,qr.x,qr.y,qr.z,qr.w)*2.2627416997969520780827019587355;}\nfloat c2d(vec2 P){P+=fseed;vec2 Pi=F(P),Pf=P-Pi;vec4 hx,hy;hfast(Pi,hx,hy);const float J=.4;hx=hx*J*2.+vec4(-J,1.-J,-J,1.-J);hy=hy*J*2.+vec4(-J,-J,1.-J,1.-J);vec4 dx=Pf.xxxx-hx;vec4 dy=Pf.yyyy-hy;vec4 d=dx*dx+dy*dy;d.xy=min(d.xy,d.zw);return min(d.x,d.y)*(1./1.125);}\n\nvoid main(){\n vec2 uv=vU*.5;\n //!S:B:0\n vec3 col=vec3(pow(wFbm(uv*5.)+.1,2.));\n //!S:B:1\n vec3 col=vec3(pow(wFbm(uv*vec2(20,3))+.09,2.));\n //!S:B:2\n vec3 col=vec3(pow(wFbm(uv*vec2(60,3))+.1,3.));\n //!S:B:3\n vec3 col=vec3(pow(wFbm(uv*vec2(10))+.05,2.));\n //!S:B:4\n vec3 col=vec3(pow(wFbm(uv*vec2(3)+vFbm(uv*vec2(4,12),.2,.5))+.2,2.));\n //!S:B:5\n vec3 col=vec3(pow(wFbm(uv*vec2(2,4)+vFbm(uv*vec2(3,15),.8,.2))+.15,2.));\n //!S:B:6\n vec3 col=vec3(pow(wFbm(uv*vec2(2,5)+wFbm(uv*vec2(5,12.5)))+.2,2.5));\n //!S:B:7\n vec3 col=vec3(pow(wFbm(uv*vec2(5,10)+wFbm(uv*vec2(1,5)))+.2,2.5));\n //!S:B:8\n vec3 col=vec3(pow(wFbm(uv*vec2(5,15)+wFbm(uv*vec2(1,5)))+.2,2.5));\n //!S:B:9\n vec3 col=vec3(pow(vFbm(uv*vec2(11,33)+7.*wFbm(uv*vec2(2,4)),0.,.3)+.2,2.5));\n //!S:B:10\n vec3 col=vec3(pow(wFbm(uv*7.+8.*wFbm(uv*4.))+.17,3.));\n //!S:B:11\n vec3 col=vec3(pow(wFbm(uv*vec2(10.)+wFbm(uv*vec2(6.)+vFbm(uv*vec2(3.),.2,.5)))+.05,2.));\n //!S:B:12\n vec3 col=vec3(pow(wFbm(uv*vec2(2.)+wFbm(uv*vec2(2.)+vFbm(uv*vec2(1.),.5,.5)))+.05,2.));\n //!S:B:13\n vec3 col=vec3(pow(wFbm(uv*vec2(4.)+wFbm(uv*vec2(2.)+vFbm(uv*vec2(1.),.5,.5)))+.05,2.));\n //!S:B:14\n vec3 col=vec3(pow(wFbm(uv*vec2(2.)+wFbm(uv*vec2(8.)+vFbm(uv*vec2(4.),0.,.5)))+.05,2.));\n //!S:B:END\n uv=uv*vec2(.8,1.2);\n //!S:FT:0\n float fdXY=-1.3*S(.1,.9,min(w2d(99.*uv*vec2(1.6,1.))*1.2,v2d(40.*uv*vec2(1.,2.),.5,.75)));\n float fdYZ= 1.4*S(.1,.9,max(w2d(86.*(uv+vec2(41.3))*vec2(2.,1.))*1.2,v2d(22.5*(uv+vec2(41.3))*vec2(1.,2.),.3,.75)));\n //!S:FT:1\n float fdXY=1.6*S(0.,1.,max(w2d(115.*uv*vec2(2.,1.))*.4,v2d(30.*uv*vec2(1.,2.),.3,.75)));\n float fdYZ=1.*S(.4,1.,max(w2d(115.*(uv+vec2(41.3))*vec2(2.,1.))*1.2,v2d(30.*(uv+vec2(41.3))*vec2(1.,2.),.3,.75)));\n //!S:FT:2\n float fdXY=1.125*S(.1,1.,max(w2d(99.*uv*vec2(2.,1.)),.8*v2d(22.*uv*vec2(1.,2.),.3,.75)));\n float fdYZ=1.4*S(.1,1.,max(w2d(99.*(uv+vec2(41.3))*vec2(2.,1.)),.8*v2d(38.*(uv+vec2(41.3))*vec2(1.,2.),.3,.75)));\n //!S:FT:3\n float fdXY=1.5*S(0.,1.,min(1.-w2d(55.*uv*vec2(2.,1.)),v2d(64.*uv*vec2(2.,1.),.9,.75)));\n float fdYZ=1.2*S(0.,1.,min(1.-w2d(35.*(uv+vec2(41.3))*vec2(3.,1.)),v2d(94.*(uv+vec2(41.3))*vec2(2.,1.),.3,.75)));\n //!S:FT:4\n float fdXY=.9*S(0.,1.,max(c2d(85.*uv*vec2(1.,1.5))*2.2,v2d(30.*uv*vec2(1.,2.),.8,.5)));\n float fdYZ=1.*S(0.,1.,min(c2d(100.*(uv+vec2(41.3)))*2.2,v2d(64.*(uv+vec2(41.3))*vec2(1.,2.),.3,.75)));\n //!S:FT:5\n float fdXY=1.1*S(0.,1.,max(h2d(87.5*uv),1.5*c2d(62.5*uv*vec2(2.5,1.5))));\n float fdYZ=.8*S(0.,1.,max(h2d(97.5*(uv+vec2(41.3)))*1.,1.8*c2d(52.5*(uv+vec2(41.3))*vec2(1.,1.5))));\n //!S:FT:6\n float fdXY=1.*S(0.,1.,max(c2d(97.5*uv)*1.,1.8*c2d(52.5*uv*vec2(1.,1.5))));\n float fdYZ=1.1*S(0.,1.,max(h2d(117.5*(uv+vec2(41.3)))*1.,1.8*c2d(52.5*(uv+vec2(41.3))*vec2(1.,1.5))));\n //!S:FT:7\n float fdXY=1.1*S(0.,1.,max(c2d(160.*uv),1.2*h2d(37.5*uv*vec2(1.,1.5))));\n float fdYZ=-1.2*S(0.,1.,max(c2d(160.*(uv+vec2(41.3))),1.2*h2d(37.5*(uv+vec2(41.3))*vec2(1.,1.5))));\n //!S:FT:END\n //!S:BI:0\n gl_FragColor=vec4(vec3(C(col.r,0.,1.),fdXY,fdYZ),1.);\n //!S:BI:1\n gl_FragColor=vec4(vec3(1.-C(col.r,0.,1.),fdXY,fdYZN ),1.);\n //!S:BI:END\n}";r=E(r,"B",s(e[7])),r=E(r,"BI",0<=e[7]?0:1),r=E(r,"FT",e[11]);const c=new THREE.PlaneGeometry(n,t),v=new THREE.ShaderMaterial({uniforms:{uS:{value:e[15]},uR:{value:new THREE.Vector3(n,t,1800)}},vertexShader:"varying vec2 vU;\nvoid main(){vU=uv;gl_Position=projectionMatrix*modelViewMatrix*vec4(position,1.);}",fragmentShader:r,transparent:!1,depthTest:!1,depthWrite:!1});return new THREE.Mesh(c,v)}(le,j,K),[O,V]=function(e,n,t,r){const c=[new THREE.WebGLRenderTarget(t,r,Y),new THREE.WebGLRenderTarget(t,r,Y),new THREE.WebGLRenderTarget(t,r,{type:THREE.FloatType,format:THREE.RGBAFormat,antialias:!1,precision:"highp",stencil:!1,depth:!1,minFilter:THREE.LinearFilter,magFilter:THREE.LinearFilter,wrapS:THREE.MirroredRepeatWrapping,wrapT:THREE.MirroredRepeatWrapping,alpha:!1})];c.forEach((n=>{e.setRenderTarget(n),e.clearColor()}));let v="// technical\nuniform vec4 uT;\n#define FRAME int(uT.x)\n#define FRAMES uT.y\n#define SEED uT.w\n\nuniform vec3 uR;\nuniform sampler2D uPF;\nuniform sampler2D uPB;\nuniform vec3 uCT;\nuniform float uCF;\nuniform float uCA;\nuniform mat3 uSR;\nvarying vec2 vU;\n\nconst float\nPI=3.14159265359,\nTAU=PI*2.,\nTMIN=1./2048.,\nTMAX=10.,\nBLUR=5.,\nES=.062,\nM1=1.,\nM2=2.,\nM3=3.;\nconst vec3\nST=/*!V3:ST*/,\nRC=vec3(0.,-.25,.3);\nconst vec2\nDOF=vec2(ST.z-.4,.02);\n\n#define L length\n#define N normalize\n#define F floor\n#define C clamp\n#define UF float(0xffffffffU)\n\nuint hi(uint x){x^=x>>16;x*=0x45d9f3bU;x^=x>>16;x*=0x45d9f3bU;x^=x>>16;return x;}\nuvec2 s=uvec2(0);\nvoid srnd(){s=uvec2(vU*uR.xy*54.279)+uvec2(SEED,uint(FRAME));}\nfloat rnd(){s+=uvec2(1);return float(hi(s.x+(s.y<<16)))/UF;}\nvec2 rnd2(){s+=uvec2(1);return vec2(hi(s.x+(s.y<<16))*uvec2(0x1U,0x1ffU))/UF;}\nvec2 h22(uvec2 p){uint n=uint(p.x)*1597334677U^uint(p.y)*3812015801U;return vec2(hi(n)*uvec2(0x1U,0x1ffU))/UF;}\nfloat noise2(vec2 p){uvec2 c=uvec2(int(F(p.x)),int(F(p.y)));vec2 f=fract(p);f=f*f*(3.-2.*f);return mix(mix(h22(c).x,h22(c+uvec2(1,0)).x,f.x),mix(h22(c+uvec2(0,1)).x,h22(c+uvec2(1,1)).x,f.x),f.y);}\n\nvec2 CS(float x){vec2 si=fract(vec2(.5,1.)-x*2.)*2.-1.,so=sign(.5-fract(vec2(.25,.5)-x));return (20./(si*si+4.)-4.)*so;}\nmat2 m2(float y){return mat2(sin(y),cos(y),-cos(y),sin(y));}\nmat3 RX(float t){vec4 cs=vec4(CS(t),0,1);return mat3(cs.wzz,vec3(cs.zx,-cs.y),cs.zyx);}\nmat3 RY(float t){vec4 cs=vec4(CS(t),0,1);return mat3(cs.xzy,cs.zwz,vec3(-cs.y,cs.zx));}\nmat3 RZ(float t){vec4 cs=vec4(CS(t),0,1);return mat3(vec3(cs.x,-cs.y,cs.z),cs.yxz,cs.zzw);}\nmat3 RZYX(float tz,float ty,float tx){vec2 Z=CS(tz),Y=CS(ty);Y.y=-Y.y;vec3 X=vec3(CS(tx),0);return mat3(Y.xxy*vec3(Z.x,-Z.y,-1),-X.yyy*Y.yyx*vec3(Z.x,-Z.y,1)+X.xxz*Z.yxx,X.xxx*Y.yyx*vec3(Z.x,-Z.y,1)+X.yyz*Z.yxx);}\nmat3 cLAM(vec3 o,vec3 t){vec3 ww=N(t-o),uu=N(cross(ww,vec3(0,1,0))),vv=N(cross(uu,ww));return mat3(uu,vv,ww);}\nfloat SRBGtoL(float v){v=C(v,0.,1.);return mix(pow(((v+.055)/1.055),2.4),v/12.92,step(v,.04045));}\nvec3 dUv(vec2 uv, float fov){return N(vec3((uv*2.-1.)*fov,1.));}\nvec3 toLC(vec3 p){return ((p+ST-RC)*uSR+RC)*vec3(1,.97,1);}\nvec2 opU(vec2 d1,vec2 d2){return d1.x<d2.x?d1:d2;}\nvec2 opS(vec2 d1,vec2 d2){return -d1.x>=d2.x?vec2(-d1.x,d1.y):d2;}\nvec2 opSU(vec2 d1,vec2 d2,float k){float h=max(k-abs(d1.x-d2.x),0.)/k,m=h*h*h*.5,s=m*k*(1./3.);return (d1.x<d2.x)?vec2(d1.x-s,(m<.5?d1.y:d2.y)):vec2(d2.x-s,(1.-m<.5?d1.y:d2.y));}\nvec2 opSS(vec2 d1,vec2 d2,float k){float h=C(.5-.5*(d2.x+d1.x)/k,0.,1.);return vec2(mix(d2.x,-d1.x,h)+k*h*(1.-h),(h>.5?d1.y:d2.y));}\nvec3 opB(vec3 p,float k){float c=cos(k*p.x),s=sin(k*p.x);mat2 m=mat2(c,-s,s,c);vec3 q=vec3(m*p.xy,p.z);return q;}\nvec3 opSmX(vec3 p){return vec3(abs(p.x),p.yz);}\nvec3 opSSmX(vec3 p, float s){return vec3(sqrt(p.x*p.x+4.*s*s),p.yz);}\nvec2 sdSp(vec3 p,float s,float m){return vec2(L(p)-s,m);}\nvec2 sdEl(vec3 p,vec3 r,float m){float k0=L(p/r),k1=L(p/(r*r));return vec2(k0*(k0-1.)/k1,m);}\nvec2 sdEy(vec3 p,float s,float m){vec2 q=vec2(L(p.xz),p.y);float t=L(q-vec2(ES-.002,0))-.009,r=max(-s*q.x*q.x+s*s*(s-2.*q.y),-s*q.y);r=(r<0.?L(q)-s:(q.x<s)?-q.y:L(q-vec2(s,0)))-.001;float k=.015,h=C(.5+.5*(r-t)/k,0.,1.);return vec2(mix(r,t,h)-k*h*(1.-h),m);}\nvec2 sdRb(vec3 p,vec3 b,float r,float m){return vec2(L(max(abs(p)-b,0.))-r,m);}\nvec2 sdTo(vec3 p,vec2 t,float m){return vec2(L(vec2(L(p.xz)-t.x,p.y))-t.y,m);}\nvec2 sdCa(vec3 p,vec3 a,vec3 b,float r,float m){vec3 pa=p-a,ba=b-a;float h=C(dot(pa,ba)/dot(ba,ba),0.,1.);return vec2(L(pa-ba*h)-r,m);}\nvec2 sdCy(vec3 p,float h,float r,float m){vec2 d=abs(vec2(L(p.xz),p.y))-vec2(r,h);return vec2(C(d.x,d.y,0.)+L(max(d,0.)),m);}\nvec2 sdKIFS(vec2 res,vec3 p,vec4 m,vec3 s,float ab){mat2 ma=m2(m.x*m.w),mb=m2(m.y*m.w),mc=m2(m.z*m.w);float d=L(p);for(int i=0;i<10;i++){s.y=s.y*.66;p.xy=ma*p.xy;p.yz=mix(mb*p.yz,abs(mb*p.yz),ab*/*!F:ABS*/);p.zx=abs(mc*p.zx)-s.y;}return opSU(res,vec2(min(d,L(p)-s.x*s.y),M1),s.z);}\n\nvec2 map(vec3 p){\n p=toLC(p);\n vec2 res=sdRb(opB((p+vec3(0,.05,-.435))*RZYX(0.,0.,.266), 2.3),vec3(.145,.065,.13),.065,M1);\n res=opSU(res,opSU(sdRb(opB((opSSmX(p,.009)+vec3(-.095,.426,-.37))*RZYX(-.109,-.16,-.13),.7),vec3(.1195,.054,.004),.052,M1),sdCa(p+vec3(0,.46,-.51),vec3(0,-.01,0),vec3(0,-.045,.01),.065,M1),.1025),.41);\n res=opSU(opSU(res,sdEl(p+vec3(0.,.03,-.28),vec3(.29,.32,.31),M1),.06),sdEl(p+vec3(0.,.062,-.16),vec3(.29,.35,.3245),M1),.055);\n res=opSU(res,sdEl(p+vec3(0,.43,-.24),vec3(.12,.1,.24),M1),.11);\n if(L(opSmX(p)+vec3(-.28,.205,-.15))<.128){\n res=opSS(opSU(sdEl((opSmX(p)+vec3(-.305,.19,-.15))*RZYX(.04,.035,-.05),vec3(.035,.07,.06),M1),sdEl((opSmX(p)+vec3(-.265,.24,-.155))*RZYX(.055,.035,.19),vec3(.04,.04,.03),M1),.04),opSU(res,opSU(sdEl((opSmX(p)+vec3(-.3,.17,-.14))*RZYX(.04,.035,-.025),vec3(.024,.075,.064),M1),sdEl((opSmX(p)+vec3(-.26,.26,-.14))*RZYX(.055,.045,.09),vec3(.02,.075,.04),M1),.09),.027),.019);\n res=opSU(res,sdTo((opSmX(p)+vec3(-.25,.21,-.17))*RZYX(.27,-.05,-.104),vec2(.079,.009), M1),.033);\n res=opSU(res,sdEl((opSmX(p)+vec3(-.265,.27,-.14))*RZYX(.05,.055,.1),vec3(.015,.038,.025),M1),.015);\n res=opSU(res,opSU(sdTo((opSmX(p)+vec3(-.27,.15,-.16))*RZYX(.22,.12,.1),vec2(.04,.006),M1),opSU(sdTo((opSmX(p)+vec3(-.24,.22,-.17))*RZYX(.36,.0,.02),vec2(.04,.01),M1),sdEl((opSmX(p)+vec3(-.267,.23,-.19))*RZYX(.08,.13,.04),vec3(.005,.015,.01),M1),.02),.02),.029);\n }\n vec2 mv=sdEl(p+vec3(0,.39,-.5),vec3(.11,.13,.065),M1);\n mv.x+=.05*(cos(200.*mv.x-2.)*.5+.5)*pow(p.y+.7,2.);\n res=opSU(res,mv,.1);\n res=opSU(res,sdRb((opSSmX(p,.005)+vec3(-.04-cos((1./(1.+exp((abs(p.y+.2)-.2)*20.)))*p.y*50.-2.2)*.008*step(p.y,.2),.2,-.52))*RZYX(-.04,.08,.081),vec3(.0035,.13,.06),.03,M1),.04);\n res=opSU(res,opSU(sdSp(p+vec3(0.,.295,-.63),.028,M1),sdEl(opSSmX(p,.005)+vec3(-.047,.29,-.61),vec3(.018,.019,.02),M1),.056),.051);\n res=opSS(sdEl((opSmX(p)+vec3(-.036,.32,-.63))*RZYX(0.,-.12,0.),vec3(.0222,.0207,.0082),M1),res,.015);\n res=opSS(sdEl((opSSmX(p,.005)+vec3(-.13,.145,-.53))*RZYX(-.01,.01,.0),vec3(.044,.022,.033),M1),res,.14);\n res=opSU(res,sdTo((opSSmX(p,.005)+vec3(-.07,.08,-.44))*RZYX(.01,0.1,.03),vec2(.1,.042),M1),.05);\n if(L(p+vec3(0,.403,-.583))<.13){\n vec2\n ls=sdEl((opSSmX(p,.005)+vec3(-.046,.403,-.583))*RZYX(.05,-.12,-.14),vec3(.05,.023,.013),M1),\n ul=opSU(ls,opSU(sdRb(opB((p+vec3(-.045,.364,-.555)),-1.)*RZYX(.03,-.11,.08),vec3(.05,.04,.02),.008,M1),sdRb(opB((vec3(-p.x,p.yz)+vec3(-.045,.364,-.555)),-1.)*RZYX(.03,-.11,.08),vec3(.05,.04,.02),.008,M1),.0767),.035),\n ll=sdTo(opB(opSSmX(p,.002)+vec3(-.01,.421,-.542),0.)*RZYX(0.,0.,-.07),vec2(.055,.022),M1); \n res=opSU(res,opSU(ul,ll,.003),.026);\n }\n float eb=0.;\n vec3 p2=vec3(abs(p.x),p.yz)-vec3(.12,-.081,.59);\n if(L(p2-vec3(.035,0.,0.))<.12){\n p2.xy=m2(-33.*p2.x*p2.x+1.82)*p2.xy;\n p2.x+=.037;\n p2.xz=m2(-5.*p2.x+1.57)*p2.xz;\n vec2 de=sdEl(p2,vec3(.035,.02,.015),M1);\n de=opSU(de,sdEl(p2+vec3(-.075,0,0),vec3(.08,.01,.01),M1),.04);\n eb=-110.*(de.x-.007)+.5*noise2(((sin(p2.x*28.+1.1)*.5+.5)*.1+vec2(p2.x*.35,p2.y*3.5))*150.);\n eb=smoothstep(.0,4.,eb);\n }\n res.x-=.01*texture2D(uPB,(p+vec3(.5)-RC).xy).y*(.5+.5*(1.-smoothstep(.5,1.,p.y)))*(dot(vec3(0,-0.1,.6),p))*(1.-C(eb,0.,1.));\n res.x-=.01*texture2D(uPB,(p+vec3(.5)-RC).yz).z*(.5+.5*(1.-smoothstep(.5,1.,p.x)))*(dot(vec3(2,-.2,0),p))*(1.-C(eb,0.,1.));\n res.x-=.019*eb;\n vec3 ep=vec3(-.114,.142,-.47);\n if(L(opSmX(p)+ep)<.11){\n vec3 epr=p+ep*vec3(-1,1,1),epl=p+ep,tgt=toLC(vec3(0))*vec3(.5,-.8,1.);\n bool isc=/*!I:ET*/==0;\n if(abs(dot(N(tgt),vec3(1,0,0)))>.5||abs(dot(N(tgt),N(vec3(0,1,-0.0625))))>.58)isc=true;\n vec2 ebl=sdSp(opSmX(p)+ep,ES,M2);\n ebl=opS(opU(sdSp(epr+vec3(-.08,.03,-1.)*cLAM(epr,tgt)*.176,ES*1.93,M3),sdSp(epl+vec3(.08,.03,-1.)*cLAM(epl,tgt)*.176,ES*1.93,M3)),ebl);\n float a=C(.5+dot(N(tgt-epr),vec3(0,1,0)),0.,1.);\n vec3 eyl=vec3(mix(.1,.02,a),mix(.445,.39,a),-.02);\n if(/*!I:ET*/>0)eyl=vec3(mix(.095,.0,a),mix(.455,.39,a),mix(-.03,-.02,a));\n if(isc)eyl=vec3(-.048,.422,-.009);\n vec2 s=vec2(abs(p.x),p.y)-vec2(.13,-.155);\n float l=L(s*vec2(.25,1.)),l2=L(s*vec2(.5,1.)),xx=.008*(sin(l*l*1.5e4)*pow(1.-l2,140.)*.5);\n vec2 lel=sdEy((opSmX(p)+ep)*RX(eyl.y)*RY(-.15)*RZ(-.011),ES+.0015,M1);\n lel.x+=.002*cos(180.*lel.x+.3);\n res=opSU(res,opU(ebl,opU(sdEy((opSmX(p)+ep)*RX(eyl.x)*RY(-.15)*RZ(eyl.z),ES+.0015,M1)-vec2(xx,0.),lel)),.039);\n res=opSU(res,sdCy(opB((opSmX(p)+ep+vec3(-.005,.005,-.02))*RX(.01)*RX(eyl.x)*RY(-.15)*RZ(eyl.z),-1.),.0002,.055,M1),.009);\n }\n res=opSU(res,sdEl((opSSmX(p,.005)+vec3(-.125,.3,-.47))*RZYX(0.,-.17,-.02),vec3(.1,.1,.05),M1),.045);\n vec4 m=/*!V4:OGI*/;vec3 s=/*!V3:OGS*/,r=/*!V3:OGR*/;\n res=sdKIFS(res,(p+/*!V3:OGO*/)*RZYX(r.z,r.y,r.x),m,s,1.);\n vec4 m2=vec4(-.03,.0055,.0024,2500);vec3 s2=vec3(1,.36,.05);\n res=sdKIFS(res,p+vec3(0,.9,0),m2,s2,0.);\n return res*vec2(.99,1);\n}\n\nfloat shadow(vec3 ro, vec3 rd){float t=TMIN;int s=0;while(s<40){float h=map(ro+t*rd).x;t+=h;if(h<TMIN*t||t>TMAX){break;}s++;}return step(TMAX,t);}\nvec3 raymarch(vec3 ro, vec3 rd){float t=TMIN,near=TMAX,m=0.;for(int s=0;s<70;s++){vec2 d=map(ro+t*rd);near=min(d.x,near);m=d.y;t+=d.x;if(abs(d.x)<TMIN*t){break;}if(t>TMAX||s==70-1)return vec3(0,0,near);}return vec3(C(t,TMIN,TMAX),m,near);}\n\nconst float n=.0005;\nvec3 cNor(vec3 p){vec2 e=vec2(n,-n);return N(e.xyy*map(p+e.xyy).x+e.yyx*map(p+e.yyx).x+e.yxy*map(p+e.yxy).x+e.xxx*map(p+e.xxx).x);}\nvec3 uVec(void){float phi=rnd()*TAU,x=rnd()*2.-1.;return pow(rnd(),.33)*vec3(sqrt(1.-x*x)*vec2(sin(phi),cos(phi)),x);}\nvec3 cosDir(vec3 n,float strength){float u=(rnd()*2.-1.)*strength,v=rnd()*TAU;return N(n+vec3(sqrt(1.-u*u)*vec2(cos(v),sin(v)),u));}\nfloat getBg(vec3 d,vec3 lp){float dl=dot(d,lp);return (dl<0.?/*!F:LA*/:mix(1.,.2,1./(1.+exp((-(1.-dl)+/*!F:LS*/)*42.))));}\n\nvec3 cCol(vec3 ro, vec3 rd, vec3 lp){\n vec3 campos=ro,res;\n float ret=0.,thr=1.,rbg=0.,shar=0.;\n for (int i=0;i<3;i++){\n res=raymarch(ro,rd);\n if(res.x<TMIN){rbg=step(float(i),0.);ret+=SRBGtoL(getBg(rd,lp))*thr;break;}\n ro+=res.x*rd;vec3 nor=cNor(ro);float sha=shadow(ro+nor*3e-4,lp+cosDir(lp,1.)*.25);\n if(i==0)shar=sha;\n float ma=0.,me=0.,mr=.0,msp=.0,ms=0.;\n if(res.y<M1+.5){ma=.951;me=/*!F:EM*/;mr=.77;msp=.31;ms=.951;}else if(res.y<M2+.5){ma=.951;me=.1;mr=.77;msp=.31;ms=.951;}else if(res.y<M3+.5){if(/*!I:ET*/==1){ma=.951;me=.1;mr=.77;msp=.31;ms=.951;}else{ma=.73;me=0.;mr=1.;msp=.5;ms=0.;}}\n float doS=step(rnd(),msp),rp=max(doS*msp+(1.-doS)*(1.-msp),1e-3);vec3 drd=N(nor+uVec()),srd=reflect(rd,nor);srd=N(mix(srd,drd,mr*mr));rd=mix(drd,srd,doS);ret+=me*thr;thr=thr*mix(ma,ms,doS)/rp*(sha*.5+.5);float p=thr;\n if(rnd()>p)break;\n thr*=1./p;ro+=nor*(1e-3/abs(dot(rd,nor)));\n }\n if(rbg==1.){\n //!S:O:0\n return vec3(0);\n //!S:O:1\n return vec3(0,1.-pow(C(res.z/.014,0.,1.),6.),0)*step(0.,res.x);\n //!S:O:2\n return vec3(0,1.-pow(C(res.z/.03,0.,1.),.9),0)*step(0.,res.x);\n //!S:O:END\n } else {\n return vec3(ret,step(0.,res.y),0);\n }\n}\n\nvec3 powRand(vec3 axis,float fpow){vec3 r=uVec();float d=dot(r,axis);r=N(r-d*axis);r*=sqrt(1.-pow(d*.5+.5,2./(fpow+1.)));return r+axis*sqrt(1.-dot(r,r));}\nvec2 rPIP(float s){vec2 r=rnd2();float a1=(F(rnd()*s)/s)*TAU;vec2 s1=CS(a1),s2=CS(a1+TAU/s);return r.x+r.y>1.?s1*(1.-r.x)+s2*(1.-r.y):s1*r.x+s2*r.y;}\n\nvec3 calculateColorPixel(in vec2 uv){\n vec3 ro=vec3(0),ww=N(uCT-ro),uu=N(cross(ww,vec3(0,1,0))),vv=N(cross(uu,ww)),rd=dUv(uv+vec2(rnd()-.5,rnd()-.5)*BLUR/uR.zz,uCF)*RZ(uCA)*mat3(uu,vv,ww),fp=ro+rd*DOF.x;\n vec2 p=rPIP(6.);ro+=(uu*p.x+vv*p.y)*DOF.y;rd=N(fp-ro);float r=rnd();\n if(r<.15)rd=powRand(rd,2e6);else if(r<.25)rd=powRand(rd,5e5);\n return cCol(ro,rd,/*!V3:LP*/);\n}\n\nvoid main(){\n srnd();\n vec3 prev=texture2D(uPF,vU).rgb;\n vec2 uv=vU;\n uv.y=(uv.y-.5)*(uR.y/uR.x)+.5;\n vec3 col=C(min(calculateColorPixel(uv),1.),0.,1.);\n gl_FragColor=C(vec4(prev+vec3(col.r/FRAMES,col.g,0),1),0.,1.);\n}";var o,l,s;v=E(v,"O",n[13]),v=R(v,"ABS",n[12][4]?1:0),o=v,l="OGI",s=(new THREE.Vector4).fromArray(n[12][0]),v=g(o,"V4",l,`vec4(${s.x},${s.y},${s.z},${s.w})`),v=T(v,"OGS",(new THREE.Vector3).fromArray(n[12][1])),v=T(v,"OGO",(new THREE.Vector3).fromArray(n[12][2])),v=T(v,"OGR",(new THREE.Vector3).fromArray(n[12][3])),v=T(v,"LP",n[5][3]),v=T(v,"ST",n[5][4]),v=R(v,"LA",n[3][7]),v=R(v,"LS",n[3][8]),v=R(v,"EM",n[3][9]),v=((e,n,t)=>g(e,"I",n,`${a(t)}`))(v,"ET",n[14]);const p=new THREE.PlaneGeometry(t,r),i=new THREE.ShaderMaterial({uniforms:{uT:{value:new THREE.Vector4(0,18,0,n[16])},uR:{value:new THREE.Vector3(t,r,1800)},uPF:{value:null},uPB:{value:null},uCT:{value:n[5][0]},uCF:{value:n[5][1]},uCA:{value:n[5][2]},uSR:{value:n[5][5]}},vertexShader:"varying vec2 vU;\nvoid main(){vU=uv;gl_Position=projectionMatrix*modelViewMatrix*vec4(position,1.);}",fragmentShader:v,transparent:!1,depthTest:!1,depthWrite:!1});return[new THREE.Mesh(p,i),c]}(Z,le,j,K),D=function(e,n){const t=new THREE.ShaderMaterial({vertexShader:"varying vec3 vC;\nvoid main(){vC=instanceColor;gl_Position=projectionMatrix*modelViewMatrix*instanceMatrix*vec4(position,1.);}",fragmentShader:"varying vec3 vC;\nvoid main(){gl_FragColor=vec4(vC,1.);}",transparent:!1,depthTest:!0,depthWrite:!0}),r=((e,n=4)=>{let t=[],r=[];const c=a(n);t.push(0,0,-1);for(let n=0;n<c;n++){const v=n/c*u*2;t.push(e*d(v+u/4),e*i(v+u/4),-1),r.push(0,n+1,(n+1)%c+1)}let v=new THREE.BufferGeometry;return v.setAttribute("position",new THREE.BufferAttribute(new Float32Array(t),3)),v.setIndex(new THREE.BufferAttribute(new Uint16Array(r),1)),v})(m*n);return new THREE.InstancedMesh(r,t,e[3][0])}(le,Q)},xe=()=>{Z.setAnimationLoop(we),te=0,re=ce=ve=oe=ae=!1,O=V=I=$=null,O&&(O.clear(),O.geometry.dispose(),O.material&&O.material.dispose()),D&&(D.clear(),D.geometry.dispose(),D.material&&D.material.dispose()),G&&(G.clear(),G.geometry.dispose(),G.material&&G.material.dispose()),Z.dispose(),fe()},he=()=>{var e;!1===ve?($=((e,n=4,r=4,c=null)=>{let v=0,o=0,l=0,s=0,p=0,i=0,d=[];return{read:a=>{if(0===l&&(v=a.width,o=a.height,s=t(a.height/n),p=s*r*v,i=s-(s*n-a.height)),l<n){let t=new Float32Array(p);const r=l===n-1?i:s;return e.readRenderTargetPixels(a,0,l*s,v,r,t),d.push(c?t.map(((e,n)=>c(e,n))):t),l++,l<n}return!1},getValues:(e,n)=>{let t=a(S(.5*n[0])*(v-1));const c=(a(S(.5*n[1])*(o-1))*v+t)*r,l=a(c/p),s=c%p;e[0]=d[l][s],e[1]=d[l][s+1],e[2]=d[l][s+2],e[3]=d[l][s+3]},reset:()=>{d=[],l=0}}})(Z,4,4),Z.setRenderTarget(V[2]),Z.render(G,N),ve=!0):!1===ce?te<18&&(e=18,0===te&&(I=((e,n=4,r=4,c=null)=>{let v=0,o=0,l=0,s=0,p=0,i=0,d=[];return{read:a=>{if(0===l&&(v=a.width,o=a.height,s=t(a.height/n),p=s*r*v,i=s-(s*n-a.height)),l<n){let t=new Uint8Array(p);const r=l===n-1?i:s;return e.readRenderTargetPixels(a,0,l*s,v,r,t),d.push(c?t.map(((e,n)=>c(e,n))):t),l++,l<n}return!1},getValues:(e,n)=>{let t=a(S(.5*n[0])*(v-1));const c=(a(S(.5*n[1])*(o-1))*v+t)*r,l=a(c/p),s=c%p;e[0]=d[l][s]/255,e[1]=d[l][s+1]/255,e[2]=d[l][s+2]/255,e[3]=d[l][s+3]/255},reset:()=>{d=[],l=0}}})(Z,4,4)),te<e&&(O.material.uniforms.uPF.value=V[0].texture,O.material.uniforms.uPF.needsUpdate=!0,O.material.uniforms.uPB.value=V[2].texture,O.material.uniforms.uPB.needsUpdate=!0,O.material.uniforms.uT.value.x=te,O.material.uniforms.uT.needsUpdate=!0,Z.setRenderTarget(V[1]),Z.render(O,N),[V[0],V[1]]=[V[1],V[0]],te===e-1&&(q=V[0])),te++,te>=18&&(ce=!0,(e=>{const n=new THREE.Matrix4,t=new THREE.Color;n.makeScale(f*x*2,2160,1),n.setPosition(0,0,-98),D.setMatrixAt(0,n),t.setRGB(e.r,e.g,e.b),D.setColorAt(0,t),D.count=1,D.instanceMatrix.needsUpdate=!0,D.instanceColor.needsUpdate=!0,Z.setRenderTarget(null),Z.render(D,k)})(le[8]),te=0)):ce&&ve&&!1===oe?I.read(q)&$.read(V[2])||(te<le[3][2]?(Se(),te++):oe=!0):re&&ae?ge():re||(re=!0,hl.token.capturePreview())},ye=(e,n,t,r,c,l=null)=>{var s=Math.sign;const[p,i,d,u,m,x,h,S,w,E,g]=t,R=new THREE.Matrix4,T=new THREE.Color,b=[0,0],M=[0,0],F=[0,0],U=[0,0,0,0],C=[0,0,0,0],X=[0,0,0,0];let z=0,P=le[6];if(n){let t=a(p/i);for(let e=0;e<t;e++){le[2](b,te,d,le[10]),M[0]=b[0],M[1]=b[1],n.getValues(U,b);let p=1;if(l&&null!==se){let e=0;p=0;let n=se[0];for(let t=0;t<n*n;t++)if(t!=(n*n-1)/2){let r=(n-1)/2;F[0]=b[0]+(t%n-r)/(2*_)*se[2],F[1]=b[1]+(a(t/n)-r)/(2*J)*se[2],l.getValues(C,F),e+=C[0]*ie[t],p+=((C[1]>=.99?1:0)*(1-se[3])+se[3])*ie[t]}p=v((1-y(e,0,1))*y(p,0,1),se[4])}if(0<U[0]){let d=a(v(U[0],u)*i)*p;d=o(d,i);for(let o=0;o<d;o++){n.getValues(C,M),P&&hl.random()<(P[1]?o/d*(o/d):1)*(1-P[0])&&(M[0]+=s(hl.random()-.5)*v(o/d,P[2])*P[3]);let a=!1;if(l&&(l.getValues(X,b),.99<X[1]&&(a=!0)),!a){if(M[1]+=-m/f/(C[0]*h+(1-h)),0>M[0]||0>M[1]||1<=M[0]||1.05<=M[1])break;const n=g(U[0],x),v=c(e/t,o/d,U[0],C[0],r);R.makeScale(n,n,1),R.setPosition(M[0]*_,M[1]*J,-2),D.setMatrixAt(z,R),T.setRGB(v.r,v.g,v.b),D.setColorAt(z,T),z++}}}}0<z&&(D.count=z,D.instanceMatrix.needsUpdate=!0,D.instanceColor.needsUpdate=!0,Z.setRenderTarget(null),Z.render(D,e))}},Se=function(){return $&&ye(k,$,le[[4]],le[0],le[1],I),void(I&&ye(k,I,le[3],le[0],le[1]))},we=()=>{he(),requestAnimationFrame(we)},Ee=()=>{let[e,n]=w();n===J||(Z.setAnimationLoop(we),xe())},ge=()=>{Re(),ae=!1},Re=()=>{const e=Z.domElement.toDataURL("image/png");if(e){const n=de.atob(e.split(",")[1]),t=new ArrayBuffer(n.length),r=new Uint8Array(t);for(let e=0;e<n.length;e++)r[e]=n.charCodeAt(e);const c=new Blob([t],{type:"image/png"}),v=ue.createElement("a");v.href=URL.createObjectURL(c),v.download=Te(".png"),v.click()}},Te=e=>`${(new Date).toLocaleDateString()} ${(new Date).toLocaleTimeString()}${e}`.replace(/\//g,"-").replace(/:/g,".");let be;de.addEventListener("resize",(()=>{de.clearTimeout(be),be=de.setTimeout(Ee,500)}),!1),de.addEventListener("keydown",(e=>{"KeyS"===e.code&&(ae=!0)})),(()=>{W=ue.createElement("canvas");const n=W.getContext("webgl2",{antialias:!1,precision:"highp",stencil:!1,depth:!1,preserveDrawingBuffer:!0,alpha:!1,premultipliedAlpha:!1});Z=new THREE.WebGLRenderer({canvas:W,context:n}),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!0),n.getExtension("EXT_color_buffer_float"),Z.outputEncoding=THREE.LinearEncoding,Z.autoClear=!1,le=function(){const n=1e5*hl.random();let t=[[0,2,1,1],[1,4,2,0],[2,0,0,0],[2,0,1,0],[11,2,1,1],[3,1,0,0],[4,1,0,0],[5,1,2,1],[6,2,2,0],[7,2,0,0],[8,2,1,0],[9,3,0,0],[10,2,1,0],[12,5,0,1]],r=[[0,52,6,6,21,null,7,1,1,13e4],[11,23,23,0,11,1,2,0,0,299e3],[7,10,12,-1,26,1,1,0,1,840800],[1,6,7,3,19,0,2,0,0,223e3],[3,11,8,10,0,null,5,1,2,74e4],[3,19,24,11,18,2,4,2,2,1e5],[6,25,19,-10,3,1,0,0,0,714e3],[2,1,15,13,9,5,2,2,2,838e3],[2,15,14,4,20,5,5,1,2,487e3],[2,26,0,-14,14,4,6,0,2,398e3],[3,4,13,1,13,null,0,2,1,1e5],[3,0,9,-5,9,null,5,0,1,61e4],[7,3,21,-1,13,null,2,0,1,2e5],[2,18,7,12,11,2,0,0,2,722e3],[3,32,10,-14,1,3,0,0,0,556e3],[2,17,0,12,4,4,2,0,1,5e3],[6,20,19,-14,12,0,0,1,1,886500],[2,21,22,8,9,5,2,2,2,139400],[12,51,20,-3,7,null,1,1,1,425e3],[7,16,17,0,21,5,2,0,1,881e3],[10,54,1,-1,22,null,2,0,1,32e4],[9,50,18,14,0,4,6,0,1,657e3],[7,13,0,-14,17,3,0,0,1,456e3],[9,9,2,0,9,2,2,0,1,2e5],[2,27,17,14,3,0,5,0,2,220500],[12,29,16,14,4,1,4,1,0,114e3],[4,31,24,-14,9,null,2,1,1,2e3],[10,22,0,-14,8,5,5,0,1,729e3],[0,28,3,-14,13,null,0,0,0,712e3],[2,7,9,-14,15,6,5,0,1,3e4],[7,5,22,-3,9,null,7,1,1,5e5],[12,34,17,6,1,3,4,1,0,114e3],[7,14,19,12,17,5,0,0,1,255e3],[6,12,5,-14,4,null,1,2,1,237e3],[9,8,1,12,16,5,6,0,0,1e4],[0,33,4,-3,9,null,2,0,1,304e3],[12,44,6,-14,26,2,2,2,1,74e4],[12,30,16,14,23,5,0,0,1,147e3],[3,36,4,12,12,2,4,1,1,1e5],[6,35,7,-1,4,null,5,0,2,236e3],[8,53,22,-1,4,1,7,2,2,2e5],[7,47,4,2,4,null,7,1,2,53e4],[7,37,19,-9,10,1,1,0,1,9e4],[5,24,0,6,5,5,2,0,2,265e3],[12,10,0,-14,17,1,2,0,0,698e3],[10,39,3,-14,24,1,7,0,2,988e3],[9,38,16,-14,10,null,7,0,2,716e3],[7,40,7,-9,2,null,7,0,1,945e3],[12,43,12,3,18,0,7,0,2,861e3],[12,45,4,-6,7,3,5,0,0,614e3],[11,48,24,-12,1,null,3,1,1,394e3],[2,46,11,-9,18,null,3,1,2,118e3],[9,49,0,12,21,4,6,0,2,349500],[13,55,3,14,21,null,2,0,1,2e5],[6,41,19,-3,22,null,2,0,1,26e4],[6,42,20,-3,21,null,0,0,2,292e3],[10,26,16,-2,25,null,1,1,2,336e3]],c=r[p(hl.tx.tokenId-1,0)%r.length],v=c[2],o=A[t[c[0]][0]];o[10]=C[o[10]];let a=[];return o.forEach(((e,n)=>{"object"==typeof e?(a.push(e[1]),o[n]=e[0]):a.push(e)})),[(l=P[v][0],l.map(((e,n)=>l[l.length-1-n]))).map((e=>new THREE.Color(e))),L[t[c[0]][1]],X[c[7]],o,a,e(c[1]),z[c[5]],c[3],new THREE.Color(P[v][1]),B[t[c[0]][2]],.04,c[6],H[c[4]],t[c[0]][3],c[8],c[9],n];var l}(),ue.body.appendChild(Z.domElement),xe(),(()=>{if(se=le[9],null!==se){pe=se[0],ie=Array(pe*pe).fill(0);for(let e=0;e<pe*pe;e++)if(e!=(pe*pe-1)/2){let n=e%pe,t=a(e/pe),r=(pe-1)/2;ie[e]=me((n-r)/(2*_)*16,se[1])*me((t-r)/(2*J)*16,se[1])}}})(),we()})()}();
<!DOCTYPE html> <html lang=""> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" /> <title>Virga</title> <head> <style> html, body { height: 100%; min-height: 100%; margin: 0; padding: 0; } canvas { display: block; position: absolute; top: 0; bottom: 0; left: 0; right: 0; padding: 0; margin: auto; } </style> </head> <body> <script src="hl-gen.js"></script> <script src="three-v0.144.0.js"></script> <script src="main.min.js"></script> </body> </html>
// 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,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGNbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAADxgAABbcAAgAAAAEAAAG1AAACEQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAAw2lwcnAAAACdaXBjbwAAABRpc3BlAAAAAAAAAPoAAAB3AAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAOcGl4aQAAAAABCAAAAAxhdjFDgQAcAAAAADhhdXhDAAAAAHVybjptcGVnOm1wZWdCOmNpY3A6c3lzdGVtczphdXhpbGlhcnk6YWxwaGEAAAAAHmlwbWEAAAAAAAAAAgABBAECgwQAAgQBBYYHAAAH0G1kYXQSAAoGGB2+e3KoMoQEFsBMwKT+kbz3n+g4rrSLoBxeGeM+mvBnMxS0f4swWUmyjyhFrtdlDXceWgdH7TWYg15qZfjSTkvVjh/GeOCtgWrGKCZMaI4UTB9zrBZQLXT1SqixYF0GIe0BJtQtq1I+bDxkt+O81fAWmoeRz5OZZh/Wqb077y76Px6pwF+yC9DoI0FOHbVKAjHJyKcp9DdCUYG2yijZxsPohL0IGhSjXxRI5e3D74jgLzORcXnT8bl2ELs2EgvT23uAsMxt4V8wlOBRv8HBzsF4I8Ie2jhkqOiK3xS7Pj9gaO7d/yW+55YJcYyPLw4or1iKdz6m86pB3/nw+YyNewkp7Erk0tFm9LN3xof7LSRC1CyYT/rpSWCuR+8BAsEZwxwDv37iZTEpwsDbtcZOhrdet4iE3DxLh1YbOpaDHBxtlpgtJ5qqMTdpucI3JGlyZSrVZpNbP1eBZdL4njQQHcZFeOSYhAaLF5LExjMVpH4WSOdzWfkobwE1obqVZ11T8C9Qp/8LDPdXl0kvmrMQfDW4d+mmcpxqQLMVUYagLJwxS1oqUGOD6E/9ESjMWs6vK/4rM00cdKLrcPHwxuNxjwhe29/k2O40nO5simxslN8EAKoj6VNeI6rSggXYGYkPimYWiot8g1/rnGDzOZl+3JKTEweYIzIVU+8DtZbWr3Fz6T5wu+EVlwEL5s0UEgAKCRgdvntyQICBoTKnCxbAA8AAAoEA4ChX0rrBU7/TccVJDavZP4GvZD4NDPsMF0HAdutRdiqnucY7CFdRTxS7hqhL7P23IDEmGZJDhKgFNGgDHpumt0cEhNlrnY5hiypoWF+JTFpUbzNOXPjx1oOrpVmFFdfYIiYDKv2hf2NeGgP748lCM/MrAElraOk3UlW191FU0JBuhHzSJs0mM+N4jd9m1uN7RADvBiiHEioAQw6tkH0KlZAqEE8xR5KPpzmbBteaDNFjW3YDj1gqipohEwLXkAvTQa1BP/v3K/ZLkCqXtdZPn2s15u6JDMI8Y3HLarzWzAmXPTmkX+A8pcGuL0UvemN/IN6V5v1Hzc/G80wEp0CJsJNBvBzbq/NhgxqKH5ESOP+6+vIKxg1AyR4kbGrTgGRvkkXXonC+jLwXvll3m5ZZb5b9sjHcXXNfB5b1cbuqRUbErwsQ38zMW39GKQrM+bfmEtnxnCOXlplRHw3StmnoLwOs8+IhKajUd98eVeCUrkATdBUicqv5uCiebXr/xtD4MEMm76bCdyG6iA/8eff8cKScEeabq5yZ5YlKhnYW22aBtoskzyaqbphlZMv3FQbM0rQja4cbcwffQZyPIkTu4QnSfwnEAEHtFU+oLlAFb+SVJG6AWoFPhImOI4mVRU13O1RcWo6hqnp5Cn2iOXF4apz4CE0NwuwHv+bwxA8hwOU2lTVI3+ieM9ICJhJGHWW4z7bIPeYwA7CihdosjJvzti7C73KE6D7Tmd0puQtBsOQZECpaqk0CxR/zBVgJ2ajoOHLpgbMPOhcER9+5oE4o5j3/toPDKo06KzrmD/OBSXf4UmjwrWLQFSdwG3JzAoBIek/8zzRIHGurt4mJpdGNoGqTo/7F4Re7lH2nQZkcNgLMwrO295p06cE7hiJoM4o5RXFNOeg6x5latRgqSOfxkW7YU20zmdOFZ2NoqUXnP+1aFvy6hDsqXgo74WXuRDUAQPb5TjmybNYYyLc1jKDCFBYZyxoG6p5bvvCR9aswzaIhhXJ7o/Bx4qTLZ2Lysmmz0XMdSHLaiG/Zo+noNwk0CYZ50c7lzj+uUq75JBqKAE5hgFLuXQ6qdqEJGnZYnRSBu8RrEo9azBW0nomdG0Ch0hL6uCY7+TYeUtEw/0mMzGQRDQQDX1VAAI5LYuBwEdT3f36i0h7m/wcEaIU8GChsT6VmUh6xxbxAFD4DtuXG2fKXqzDYSVP+SFHNGQw7HRYkmRp+HOXp8KwlECzezDJeINXRD5E8P5l7WwYWfeUjjg4tvVexTATXpY9oDOE/AusOo6ePlZxstKllznPpZh7/qZA+LuAnQdObgQAvUrMQIpvSxopSjPI2ClLZObwTPbrCquAe/cLgPB2VfltUqA2Sosa/5ta9tc6Qni/6OUtWeJSFvSahpyEEK+b60PXMFWwBTInxvJRvolEa0KH5xe4a4MvzDf8twRhEmYoS0YFWJIq9E/tgXD5GsWSuPafZFHstcCS08hdaAGiXqYMLNNrg9Ba5sv70d1IW4DzGHDydfIXIexb+87jiJ6TfrMxlSQfue7/HOELUbCRB3BDVjyT3JlX0ubu7VQs1Rn238kJEz+fiBV9FjlABa0TY3qtWlHmII0mBhCOhYU5pq0uae6dhWWrKphJRirEgAMr/QsADFMcKUpNvjyEq0bhwh0d9rQnVP560YjrBU8x9JC53EpfXXbOwOcQS+Hy+SP4no37Vy8b5ohScag88wdz26ZroNpHvMks246a2jDcRd14vUNE7bIV1z/jUPWvRBWAdQEGfpIcHriCfkTYkehoL8gmI6MpTtBWbgu1anyX2mu8ejuY+b1D7JiIGEmRjMJoowQ1HUpo4KMgnPRsjjWEHdd/fke667Ehb7C/aRVQMjul5Y+5A4aC60bh28Ek+x+uJG6OkiQrKYKzsZQnJbcZoHmKHiHQ=
// 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();
1-50 of 172