From 309f071f1f3be42648596acb9079175f2e3b2d0e Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein Date: Sun, 27 Jun 2021 22:35:16 +0200 Subject: [PATCH] Add splash texts --- engine/mainmenu.js | 22 ++++++++++++++++++ splashes.json | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 splashes.json diff --git a/engine/mainmenu.js b/engine/mainmenu.js index 73d55f1..5498ae3 100644 --- a/engine/mainmenu.js +++ b/engine/mainmenu.js @@ -32,6 +32,14 @@ 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"; @@ -414,12 +422,26 @@ 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 index 0000000..0fe27b4 --- /dev/null +++ b/splashes.json @@ -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", + "Fun Fact: you can't read this", + "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", + " ", + "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();", + "", + "Absolutely no lag", + "Singleplayer!", + "Bonk get rekt", + "%APPDATA%", + "Uncaught TypeError: Cannot read property 'length' of undefined", + "Approved by HimbeerserverDE", + "You look funny", + "Click here!" +] -- 2.44.0