The code for darkworld.download darkworld.download

feat: more deltarune

kris.darkworld.download e54aab28 5fa949ba

verified
+243 -89
+1 -3
README.md
··· 7 7 - DELTARUNE © 2025 Toby Fox 8 8 - ProphecyType (`assets/font/PROPHECYTYPE.ttf`) by u/RelevantAd2788 9 9 - Determination Sans (`assets/font/DTM-Sans.otf`) by Haley Wakamatsu 10 - 11 - The idea of prophecy panels inspired by 12 - https://github.com/HippoWaterMelon/deltaprophecy 10 + - Prophecy panels inspired by https://github.com/HippoWaterMelon/deltaprophecy
assets/88x31/kris.png

This is a binary file and will not be displayed.

assets/prophecy/end.png

This is a binary file and will not be displayed.

assets/prophecy/kris.png

This is a binary file and will not be displayed.

assets/prophecy/rude-buster.png

This is a binary file and will not be displayed.

assets/prophecy/susie.png

This is a binary file and will not be displayed.

+31 -7
build.ts
··· 1 1 #!/usr/bin/env bun 2 2 import plugin from "bun-plugin-tailwind"; 3 3 import { existsSync } from "fs"; 4 - import { rm } from "fs/promises"; 4 + import { mkdir, readFile, rm, writeFile } from "fs/promises"; 5 5 import path from "path"; 6 + import { createElement } from "react"; 7 + import { renderToString } from "react-dom/server"; 8 + import { App } from "./src/App"; 6 9 7 10 const outdir = path.join(process.cwd(), "dist"); 11 + const ssgDir = path.join(process.cwd(), ".ssg"); 12 + const ssgEntrypoint = path.join(ssgDir, "index.html"); 13 + 14 + if (existsSync(ssgDir)) { 15 + await rm(ssgDir, { recursive: true, force: true }); 16 + } 8 17 9 18 if (existsSync(outdir)) { 10 19 await rm(outdir, { recursive: true, force: true }); 11 20 } 12 21 13 - const entrypoints = [...new Bun.Glob("**.html").scanSync("src")] 14 - .map((a) => path.resolve("src", a)) 15 - .filter((dir) => !dir.includes("node_modules")); 16 - 17 - if (entrypoints.length === 0) { 18 - console.error("❌ No HTML entrypoints found in src/"); 22 + const indexHtml = path.resolve("src", "index.html"); 23 + if (!existsSync(indexHtml)) { 24 + console.error("❌ Missing src/index.html"); 19 25 process.exit(1); 20 26 } 21 27 28 + const htmlTemplate = await readFile(indexHtml, "utf8"); 29 + const appMarkup = renderToString(createElement(App)); 30 + const prerenderedHtml = htmlTemplate 31 + .replace('src="./frontend.tsx"', 'src="../src/frontend.tsx"') 32 + .replace( 33 + '<div id="root"></div>', 34 + `<div id="root" data-ssg="1">${appMarkup}</div>` 35 + ); 36 + 37 + await mkdir(ssgDir, { recursive: true }); 38 + await writeFile(ssgEntrypoint, prerenderedHtml, "utf8"); 39 + 40 + const entrypoints = [ssgEntrypoint]; 41 + 22 42 const result = await Bun.build({ 23 43 entrypoints, 24 44 outdir, ··· 34 54 if (!result.success) { 35 55 console.error("❌ Build failed"); 36 56 process.exit(1); 57 + } 58 + 59 + if (existsSync(ssgDir)) { 60 + await rm(ssgDir, { recursive: true, force: true }); 37 61 } 38 62 39 63 console.log(
+22 -22
package.json
··· 1 1 { 2 - "name": "bun-react-template", 3 - "version": "0.1.0", 4 - "private": true, 5 - "type": "module", 6 - "scripts": { 7 - "dev": "bun --hot src/index.tsx", 8 - "start": "NODE_ENV=production bun src/index.tsx", 9 - "build": "bun run build.ts" 10 - }, 11 - "dependencies": { 12 - "bun-plugin-tailwind": "^0.1.2", 13 - "react": "^19", 14 - "react-dom": "^19", 15 - "serve-static-bun": "^0.5.3", 16 - "tailwindcss": "^4.1.11" 17 - }, 18 - "devDependencies": { 19 - "@types/react": "^19", 20 - "@types/react-dom": "^19", 21 - "@types/bun": "latest" 22 - } 23 - } 2 + "name": "darkworld", 3 + "version": "0.1.0", 4 + "private": true, 5 + "type": "module", 6 + "scripts": { 7 + "dev": "bun --hot src/index.tsx", 8 + "start": "NODE_ENV=production bun src/index.tsx", 9 + "build": "bun run build.ts" 10 + }, 11 + "dependencies": { 12 + "bun-plugin-tailwind": "^0.1.2", 13 + "react": "^19", 14 + "react-dom": "^19", 15 + "serve-static-bun": "^0.5.3", 16 + "tailwindcss": "^4.1.11" 17 + }, 18 + "devDependencies": { 19 + "@types/react": "^19", 20 + "@types/react-dom": "^19", 21 + "@types/bun": "latest" 22 + } 23 + }
+63 -52
src/App.tsx
··· 1 - import "./index.css"; 2 - import { 3 - ProphecyPanel, 4 - ProphecyPanelVariant, 5 - type ProphecyPanelProps, 6 - } from "./components/ProphecyPanel"; 1 + import { ProphecyPanel } from "./components/ProphecyPanel"; 2 + import { our88x31s } from "./lib/88x31"; 3 + import { ATTRIBUTION_COPYRIGHT_NOTICE } from "./lib/DO_NOT_DELETE"; 4 + import { prophecies, theProphecy } from "./lib/prophecy"; 7 5 8 - const propheciesP: Partial<ProphecyPanelProps>[] = [ 6 + const links = [ 9 7 { 10 - text: `THE HOLY TRINITY OF OPEN SOCIAL.\n< AT PROTOCOL. >`, 11 - image: "/assets/prophecy/atproto.png", 8 + label: "bluesky", 9 + href: "https://bsky.app/profile/did:plc:s7cesz7cr6ybltaryy4meb6y", 12 10 }, 13 11 { 14 - text: `AN ATPROTO PDS SHALL AWAKEN.`, 15 - imageYOffset: 64 + 16, 16 - }, 17 - { 18 - text: `BUT LO, ON HOPES AND DREAMS THEY SEND,\nA NEW APP APPEARS.`, 19 - image: "/assets/prophecy/bluesky.png", 20 - }, 21 - { 22 - image: "/assets/prophecy/nix.png", 23 - text: `FROM FLAKES AND LOCKFILES SHALL ARISE,\nA WORLD WITHOUT IMPURE STATE.`, 24 - variant: ProphecyPanelVariant.FINAL_PROPHECY 25 - }, 26 - // { 27 - // text: `THE LEGEND OF THIS WORLD.\n< DELTARUNE. >`, 28 - // }, 12 + label: "discord", 13 + href: "https://discord.com/users/486147449703104523", 14 + } 29 15 ]; 30 16 31 - const prophecies: ProphecyPanelProps[] = propheciesP.map((a) => ({ 32 - variant: ProphecyPanelVariant.DEFAULT, 33 - panelScale: 2, 34 - ...a, 35 - })) as ProphecyPanelProps[]; 17 + const heroProphecy = prophecies[4] ?? prophecies[0]; 36 18 37 19 export function App() { 38 20 return ( 39 - <main className="px-2 pt-2 pb-0 text-white"> 40 - <div className="mx-auto flex max-w-4xl flex-col items-center gap-16"> 41 - <div className="h-16" /> 42 - {prophecies.map((a, idx) => ( 43 - <div 44 - className="w-screen h-screen flex items-center justify-center" 45 - key={idx} 46 - > 47 - <div 48 - style={{ 49 - transform: "translateY(-15%)", 50 - }} 51 - > 52 - <ProphecyPanel {...a} /> 53 - </div> 54 - </div> 55 - ))} 56 - <div 57 - className="w-screen h-screen flex items-center justify-center text-3xl" 58 - > 59 - And with it, Kris now resides in the{" "}<a className="underline pl-1" href="https://castletown.darkworld.download">castle town</a>. 60 - </div> 21 + <div className="min-h-screen bg-black px-3 py-3 text-white"> 22 + <div className="mx-auto flex w-full max-w-5xl flex-col gap-3"> 23 + <h1 className="pt-16 text-4xl">hi, i'm kris</h1> 24 + <p className="whitespace-pre-wrap"> 25 + i'm not the kris from deltarune, but you could probably guess my favorite character...{"\n"} 26 + check out my cool site..! 27 + </p> 28 + 29 + <main className="flex flex-col gap-3"> 30 + <section aria-label="links"> 31 + <ul className="mt-3 list-disc pl-6"> 32 + {links.map((link) => ( 33 + <li key={link.href}> 34 + <a className="underline" href={link.href} target="_blank" rel="noreferrer"> 35 + {link.label} 36 + </a> 37 + </li> 38 + ))} 39 + </ul> 40 + </section> 41 + 42 + <div className="h-8" /> 43 + <ProphecyPanel {...theProphecy.krisOrSusie} /> 44 + </main> 45 + 46 + <footer> 47 + <ul className="mt-3 flex flex-wrap gap-2"> 48 + {our88x31s.map((button) => ( 49 + <li key={button.title}> 50 + <a href={button.url} title={button.title}> 51 + <img 52 + src={`/assets/88x31/${button.img}`} 53 + alt={button.title} 54 + width={88} 55 + height={31} 56 + className="hover:scale-125 transition-transform" 57 + style={{ imageRendering: "pixelated" }} 58 + /> 59 + </a> 60 + </li> 61 + ))} 62 + </ul> 63 + <p className="text-lg antialiased"> 64 + <a href="https://tangled.org/kris.darkworld.download/darkworld" className="underline">source</a> 65 + <span className="text-sm"> - email: echo a3Jpc0BkYXJrd29ybGQuZG93bmxvYWQK | base64 -d</span> 66 + </p> 67 + {/** IMPORTANT NOTICE DO NOT DELETE THIS */} 68 + <p className="text-sm whitespace-pre-wrap" style={{ color: "gray" }}> 69 + {ATTRIBUTION_COPYRIGHT_NOTICE} 70 + </p> 71 + </footer> 61 72 </div> 62 - </main> 73 + </div> 63 74 ); 64 75 } 65 76
+14 -3
src/frontend.tsx
··· 5 5 * It is included in `src/index.html`. 6 6 */ 7 7 8 - import { createRoot } from "react-dom/client"; 8 + import { createRoot, hydrateRoot } from "react-dom/client"; 9 + import "./index.css"; 9 10 import { App } from "./App"; 10 11 11 12 function start() { 12 - const root = createRoot(document.getElementById("root")!); 13 - root.render(<App />); 13 + const container = document.getElementById("root"); 14 + if (!container) return; 15 + 16 + const isPrerendered = 17 + container.dataset.ssg === "1" && container.childElementCount > 0; 18 + 19 + if (isPrerendered) { 20 + hydrateRoot(container, <App />); 21 + return; 22 + } 23 + 24 + createRoot(container).render(<App />); 14 25 } 15 26 16 27 if (document.readyState === "loading") {
+4 -1
src/index.css
··· 14 14 font-display: block; 15 15 } 16 16 17 - :root { 17 + body { 18 18 font-family: "DTMSans", sans-serif; 19 19 background-color: #000000; 20 + -webkit-font-smoothing: none; 21 + -moz-osx-font-smoothing: grayscale; 22 + font-smooth: never; 20 23 } 21 24 22 25 /** PROPHECY.. PLZ DONT TOUCH */
+10 -1
src/index.tsx
··· 1 1 import { serve } from "bun"; 2 2 import index from "./index.html"; 3 + import { getState } from "./lib/currentStateSync"; 3 4 4 5 function safeAssetPath(pathname: string): string | null { 5 6 const assetPath = pathname.replace(/^\/assets\//, ""); ··· 8 9 } 9 10 return assetPath; 10 11 } 12 + 13 + const statesync = new Response(JSON.stringify(getState())); 14 + statesync.headers.append("Content-Type", "application/json;charset=utf-8"); 11 15 12 16 const server = serve({ 13 17 routes: { ··· 26 30 27 31 return new Response(file); 28 32 }, 29 - "/*": index, 33 + "/": index, 34 + "/xrpc/download.darkworld.site.getState": statesync, 35 + "/ocbwoy3": new Response("He does not exist."), 36 + "/ip": (a) => new Response(a.headers.get("cf-connecting-ip") || "127.0.0.1"), 37 + 30 38 }, 39 + reusePort: true, 31 40 development: process.env.NODE_ENV !== "production" && { 32 41 hmr: true, 33 42 console: true,
+15
src/lib/88x31.ts
··· 1 + type a88x31button = { 2 + title: string, 3 + url: string, 4 + img: string 5 + } 6 + 7 + function btn(title: string, website: string, img: string): a88x31button { 8 + return { 9 + title, url: website, img 10 + } 11 + } 12 + 13 + export const our88x31s: a88x31button[] = [ 14 + btn("Kris", "#", "kris.png") 15 + ]
+7
src/lib/DO_NOT_DELETE.ts
··· 1 + 2 + export const ATTRIBUTION_COPYRIGHT_NOTICE = [ 3 + `fanmade site, not affiliated with or endorsed by the game or its creators`, 4 + `deltarune and its assets & chars are (c) toby fox`, 5 + `prophecytype by u/relevantad2788`, 6 + `determination sans by haley wakamatsu` 7 + ].join("\n")
+9
src/lib/currentStateSync.ts
··· 1 + type State = { 2 + swapOutKrisWithSusie: boolean 3 + } 4 + 5 + export function getState(): State { 6 + return { 7 + swapOutKrisWithSusie: false 8 + } 9 + }
+67
src/lib/prophecy.ts
··· 1 + import { ProphecyPanelVariant, type ProphecyPanelProps } from "@/components/ProphecyPanel"; 2 + import { getState } from "./currentStateSync"; 3 + 4 + const state = await getState(); 5 + 6 + const propheciesP: Partial<ProphecyPanelProps>[] = [ 7 + { 8 + text: `THE HOLY TRINITY OF DECENTRALIZATION.\n< AT PROTOCOL. >`, 9 + image: "/assets/prophecy/atproto.png", 10 + }, 11 + { 12 + text: `AN ATPROTO PDS SHALL AWAKEN.`, 13 + imageYOffset: 64 + 16, 14 + }, 15 + { 16 + text: `BUT LO, ON HOPES AND DREAMS THEY SEND,\nA NEW APP APPEARS.`, 17 + image: "/assets/prophecy/bluesky.png", 18 + }, 19 + { 20 + text: 'AND LAST, WAS THE GIRL.\nAT LAST, WAS THE GIRL.', 21 + image: "/assets/prophecy/rude-buster.png", 22 + variant: ProphecyPanelVariant.SUSIE_DARKWORLD, 23 + imageYOffset: 12 24 + }, 25 + { 26 + text: state.swapOutKrisWithSusie ? 'THE SECOND HERO.\nTHE GIRL, WITH HOPE CROSSED ON HER HEART.' : `THE FIRST HERO.\nTHE CAGE, WITH HUMAN SOUL AND PARTS.`, 27 + image: state.swapOutKrisWithSusie ? "/assets/prophecy/susie.png" : "/assets/prophecy/kris.png", 28 + variant: ProphecyPanelVariant.SUSIE_DARKWORLD, 29 + // imageYOffset: 12 30 + }, 31 + { 32 + image: "/assets/prophecy/nix.png", 33 + text: `FROM FLAKES AND LOCKFILES SHALL ARISE,\nA WORLD WITHOUT IMPURE STATE.`, 34 + variant: ProphecyPanelVariant.FINAL_PROPHECY 35 + }, 36 + { 37 + text: "The final tragedy unveils.", 38 + image: "/assets/prophecy/end.png", 39 + imageYOffset: 64 + 32, 40 + variant: ProphecyPanelVariant.FINAL_PROPHECY 41 + }, 42 + { 43 + text: `THE LEGEND OF THIS WORLD.\n< DELTARUNE. >`, 44 + variant: ProphecyPanelVariant.FINAL_PROPHECY 45 + }, 46 + ]; 47 + 48 + export const prophecies: ProphecyPanelProps[] = propheciesP.map((a) => ({ 49 + variant: ProphecyPanelVariant.DEFAULT, 50 + panelScale: 2, 51 + ...a, 52 + })) as ProphecyPanelProps[]; 53 + 54 + export const theProphecy = { 55 + legendOfThisWorld: { 56 + text: `THE LEGEND OF THIS WORLD.\n< DELTARUNE. >`, 57 + variant: ProphecyPanelVariant.FINAL_PROPHECY, 58 + panelScale: 2, 59 + image: "/assets/prophecy/deltarune.png" 60 + } satisfies ProphecyPanelProps, 61 + krisOrSusie: { 62 + text: state.swapOutKrisWithSusie ? 'THE SECOND HERO.\nTHE GIRL, WITH HOPE CROSSED ON HER HEART.' : `THE FIRST HERO.\nTHE CAGE, WITH HUMAN SOUL AND PARTS.`, 63 + image: state.swapOutKrisWithSusie ? "/assets/prophecy/susie.png" : "/assets/prophecy/kris.png", 64 + variant: state.swapOutKrisWithSusie ? ProphecyPanelVariant.SUSIE_DARKWORLD : ProphecyPanelVariant.FINAL_PROPHECY, 65 + // imageYOffset: 12 66 + } satisfies ProphecyPanelProps, 67 + }