diff options
| -rw-r--r-- | minecraft/index.html | 17 | ||||
| -rw-r--r-- | style.css | 22 |
2 files changed, 36 insertions, 3 deletions
diff --git a/minecraft/index.html b/minecraft/index.html index 1e082b9..9a5abab 100644 --- a/minecraft/index.html +++ b/minecraft/index.html | |||
| @@ -12,6 +12,22 @@ | |||
| 12 | <title>Minecraft server list</title> | 12 | <title>Minecraft server list</title> |
| 13 | </head> | 13 | </head> |
| 14 | 14 | ||
| 15 | <script> | ||
| 16 | function add2whitelist() { | ||
| 17 | username = document.getElementById("username").value; | ||
| 18 | button = document.getElementById("add-button"); | ||
| 19 | fetch("https://mc.igorek.dev/whitelist", { | ||
| 20 | method: "POST", | ||
| 21 | body: username, | ||
| 22 | }).then((response) => { | ||
| 23 | response.text().then((text) => { | ||
| 24 | button.textContent = `[${text}]`; | ||
| 25 | setTimeout(() => (button.textContent = "[+ add]"), 2000); | ||
| 26 | }); | ||
| 27 | }); | ||
| 28 | } | ||
| 29 | </script> | ||
| 30 | |||
| 15 | <body> | 31 | <body> |
| 16 | <pre style="font-size: clamp(0.25em, 1.5vw, 0.75em)"> | 32 | <pre style="font-size: clamp(0.25em, 1.5vw, 0.75em)"> |
| 17 | 33 | ||
| @@ -42,6 +58,7 @@ | |||
| 42 | Version: <a href="https://minecraft.wiki/w/Java_Edition_1.20.4">1.20.4</a> | 58 | Version: <a href="https://minecraft.wiki/w/Java_Edition_1.20.4">1.20.4</a> |
| 43 | Map: <a href="https://mc.igorek.dev">https://mc.igorek.dev</a> | 59 | Map: <a href="https://mc.igorek.dev">https://mc.igorek.dev</a> |
| 44 | IP: <span class="copy" copy-text="mc.igorek.dev:25565">mc.igorek.dev:25565</span> | 60 | IP: <span class="copy" copy-text="mc.igorek.dev:25565">mc.igorek.dev:25565</span> |
| 61 | Whitelist: <input type="text" id="username" placeholder="username"> <span id="add-button" class="add" onclick="add2whitelist()">[+ add]</span> | ||
| 45 | Recommended mods: <a href="https://modrinth.com/plugin/simple-voice-chat">Simple Voice Chat</a> | 62 | Recommended mods: <a href="https://modrinth.com/plugin/simple-voice-chat">Simple Voice Chat</a> |
| 46 | </pre> | 63 | </pre> |
| 47 | <pre> | 64 | <pre> |
| @@ -1,10 +1,11 @@ | |||
| 1 | @font-face { | 1 | @font-face { |
| 2 | font-family: Noto Sans Mono; | ||
| 3 | src: url(font.ttf); | 2 | src: url(font.ttf); |
| 3 | font-family: Noto Sans Mono; | ||
| 4 | } | 4 | } |
| 5 | 5 | ||
| 6 | * { | 6 | * { |
| 7 | font-family: Noto Sans Mono; | 7 | font-family: Noto Sans Mono; |
| 8 | text-decoration-thickness: 0.01em; | ||
| 8 | } | 9 | } |
| 9 | 10 | ||
| 10 | @media screen and (max-width: 700px) { | 11 | @media screen and (max-width: 700px) { |
| @@ -33,14 +34,29 @@ | |||
| 33 | } | 34 | } |
| 34 | } | 35 | } |
| 35 | 36 | ||
| 37 | input { | ||
| 38 | border: none; | ||
| 39 | color: #7587a6; | ||
| 40 | background: none; | ||
| 41 | |||
| 42 | border-bottom: 0.01em solid#7587a6; | ||
| 43 | } | ||
| 44 | |||
| 45 | input::placeholder { | ||
| 46 | opacity: 1; | ||
| 47 | font-style: italic; | ||
| 48 | } | ||
| 49 | |||
| 36 | a, | 50 | a, |
| 37 | .copy { | 51 | .copy, |
| 52 | .add { | ||
| 38 | cursor: pointer; | 53 | cursor: pointer; |
| 39 | color: #7587a6; | 54 | color: #7587a6; |
| 40 | } | 55 | } |
| 41 | 56 | ||
| 42 | a:active, | 57 | a:active, |
| 43 | .copy:hover { | 58 | .copy:hover, |
| 59 | .add:hover { | ||
| 44 | cursor: pointer; | 60 | cursor: pointer; |
| 45 | color: #9b859d; | 61 | color: #9b859d; |
| 46 | } | 62 | } |
