]> git.lizzy.rs Git - dragonblocks.git/commitdiff
Add splash texts
authorElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 27 Jun 2021 20:35:16 +0000 (22:35 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Sun, 27 Jun 2021 20:35:16 +0000 (22:35 +0200)
engine/mainmenu.js
splashes.json [new file with mode: 0644]

index 73d55f1ab9f10d65c7aa1deaa2e7561e6daf150e..5498ae34861d0196bbf4a9901f37d0ed0648ea85 100644 (file)
        let logo = center.appendChild(document.createElement("img"));
        logo.src = "textures/logo-mainmenu.png";
 
+       let splash = mainmenu.appendChild(document.createElement("div"));
+       splash.style.position = "absolute";
+       splash.style.transform = "rotate(-15deg)";
+       splash.style.color = "yellow";
+       splash.style.fontSize = "30px";
+
+       let splashes = $.getJSON("splashes.json").responseJSON;
+
        let status = center.appendChild(document.createElement("h1"));
        status.style.fontSize = "50px";
        status.style.display = "none";
                status.innerHTML = "Saving...";
        });
 
+       let updateSplash = _ => {
+               splash.style.left = (logo.x + logo.width - splash.clientWidth / 2) + "px";
+               splash.style.top = (logo.y + logo.height / 3 * 2 - splash.clientHeight / 2) + "px";
+       };
+
        let initMainMenu = _ => {
                document.body.style.backgroundColor = "skyblue";
                document.getElementById("elidragon").remove();
                content.style.width = logo.offsetWidth + "px";
                mainmenu.style.visibility = "visible";
 
+               splash.innerHTML = splashes[Math.floor(Math.random() * splashes.length)];
+               updateSplash();
+
+               let counter = 0;
+               setInterval(_ => {
+                       splash.style.fontSize = Math.sin(counter++ / 100 * Math.PI) * 5 + 30 + "px";
+                       updateSplash();
+               });
+
                dragonblocks.enterMainMenu();
        };
 
diff --git a/splashes.json b/splashes.json
new file mode 100644 (file)
index 0000000..0fe27b4
--- /dev/null
@@ -0,0 +1,57 @@
+[
+       "Also try Crafter",
+       "Also try MineClone2",
+       "Also try Veloren",
+       "Also try Snakeblocks",
+       "Also try Dragonfireclient",
+       "Fleckenstein has amazing hair!",
+       "I unplugged your wifi cable",
+       "Hakuna Matata",
+       "❤️ DerZombiiie",
+       "Is Lua a girl?",
+       "float gender;",
+       "rubenwardy is god",
+       "splashes[Math.floor(Math.random() * splashes.length)]",
+       "🏳‍🌈🏳‍🌈🏳‍🌈🏳‍🌈🏳‍🌈🏳‍🌈🏳‍🌈🏳‍🌈",
+       "Plopping tags",
+       "Made by Elidragon",
+       "qwertzuiopüasdfghjklöäyxcvbnm",
+       "Press Alt + F4 for good loot!",
+       "@everyone check this out",
+       "Since 2019",
+       "I hacked 127.0.0.1",
+       "Uwuntu",
+       "Open Source!",
+       "Frisscord.exe has stopped responding",
+       "Wuzzzzzzyyyyy",
+       "Ach neige, du Schmerzensreiche, dein Antlitz gnädig meiner Not!",
+       "Includes Mese!",
+       "Inspired by Minetest",
+       "I'm not on drugs, I have ADHD",
+       "Oops, I had a brainfart",
+       "It's simple: don't die.",
+       "git commit crime",
+       "<span style=\"opacity: 0%\">Fun Fact: you can't read this</span>",
+       "Clickbait: Does not include dragons",
+       "There is a C++ Edition of this",
+       "There is a 3D Edition of this written in C++",
+       "There is a 3D Edition of this written in Lua",
+       "There is a 3D Edition of this written in C",
+       "&amp;ensp;",
+       "Do you are have stupid?",
+       "Hello my name is bumblebee",
+       "splashes.json",
+       "Subscribe to PewDiePie",
+       "__Xx_GamergirlProYT_xX__",
+       "gdb dragonblocks",
+       "if (going to fail) don't();",
+       "<img src=\"nothing.png\" onerror=\"alert('XSS')\">",
+       "Absolutely no lag",
+       "Singleplayer!",
+       "Bonk get rekt",
+       "%APPDATA%",
+       "Uncaught TypeError: Cannot read property 'length' of undefined",
+       "Approved by HimbeerserverDE",
+       "You look funny",
+       "<a href=\"https://www.youtube.com/watch?v=dQw4w9WgXcQ\">Click here!</a>"
+]