diff --git a/css/minecrafttooltips.css b/css/minecrafttooltips.css index 75256f9..e16de1e 100644 --- a/css/minecrafttooltips.css +++ b/css/minecrafttooltips.css @@ -381,25 +381,30 @@ border-style: solid none; } -.minecraft-text-input { - min-width: 500px; - min-height: 32px; - max-width: 95%; +.text-input, .minecraft-text-input { + width: 3em; + height: 1.4em; + max-width: 95vw; + max-width: 95svw; font-family: var(--default-font-family); background-color: var(--text-input-color); - border: 2px solid var(--text-input-color); - padding: 5px; + border: 2px solid var(--text-input-color); + padding: 0.5em; outline: none; border-radius: 32px; color: var(--default-text-color); - transition: background-color 0.2s; - padding-left: 10px; - padding-right: 10px; + transition: background-color 0.2s; + padding-left: 10px; + padding-right: 10px; +} + +.minecraft-text-input { + width: 40rem; } .dark-mode .minecraft-text-input { background-color: var(--dark-mode-text-input-color); - border: 2px solid var(--dark-mode-text-input-color); + border-color: var(--dark-mode-text-input-color); color: var(--dark-mode-text-color); } @@ -535,6 +540,7 @@ .download-overlay { position: fixed; + display: flex; height: 100vh; width: 100vw; top: 0; @@ -543,7 +549,6 @@ text-align: center; align-items: center; justify-content: center; - display: none; } .download-overlay-background { @@ -563,6 +568,7 @@ z-index: 9999; box-shadow: 0 0 5px #000; padding: 6px; + width: fit-content; } .dark-mode .download-overlay-window { diff --git a/css/senha.css b/css/senha.css index 9a51c56..47b514e 100644 --- a/css/senha.css +++ b/css/senha.css @@ -121,8 +121,8 @@ } .text-input { - min-width: 50px; - min-height: 32px; + width: 3em; + height: 1.4em; max-width: 95vw; max-width: 95svw; font-family: var(--default-font-family); diff --git a/css/style.css b/css/style.css index 70d13f5..8f68ca4 100644 --- a/css/style.css +++ b/css/style.css @@ -312,7 +312,7 @@ body { .website-divider { background-color: var(--primary-background-color); - min-height: 200px; + min-height: 1em; text-align: center; padding-top: 15px; padding-bottom: 15px; diff --git a/js/minecraft-tip-impl.js b/js/minecraft-tip-impl.js index 7dc161c..5dd3ea7 100644 --- a/js/minecraft-tip-impl.js +++ b/js/minecraft-tip-impl.js @@ -1,5 +1,6 @@ var apng2webp = window.apng2webp.default; +const downloadOverlay = document.getElementById("download-overlay"); const tooltipField = document.getElementById("minecraft-text-input"); let tooltip; new TranslatableText("minecrafttooltips-defaulttooltip").get().then(str => { @@ -37,7 +38,7 @@ setInterval(() => { const recordingText = document.getElementById("recording-text"); function recordPNG(exporter) { - if (!tooltip.dataset.text.includes("§j") && !tooltip.dataset.text.includes("§k")) { // temporary, if you're a beginner programmer PLEASE don't be inspired by this + if (getTooltipTimeLength() === 0) { let encoder = new APNGencoder(tooltip); encoder.start(); encoder.addFrame(); @@ -46,6 +47,7 @@ function recordPNG(exporter) { exporter(base64Out); } else { recordingText.classList.remove("hidden"); + downloadOverlay.classList.add("hidden"); let encoder = new APNGencoder(tooltip); encoder.setRepeat(0); encoder.setDelay(5); @@ -83,4 +85,24 @@ function exportWebP(data) { .catch(error => { console.error('Conversion failed:', error); }); +} + +function getTooltipTimeLength() { + const form = document.getElementById("tooltip-time-length"); + const custom = document.getElementById("download-tooltip-custom"); + const customInput = document.getElementById("download-tooltip-custom-input"); + + for (const child of form.children) { + if (child.checked) { + if (child === custom) { + console.log("Custom"); + console.log((customInput.value || 0) * 1000); + } else { + console.log(child); + console.log(child.value); + } + return child === custom ? (customInput.value || 0) * 1000 : parseInt(child.value); + } + } + return 0; } \ No newline at end of file diff --git a/language/en.json b/language/en.json index e5d52b5..52c9386 100644 --- a/language/en.json +++ b/language/en.json @@ -9,8 +9,12 @@ "mainpage-projects": "Fun Projects", "minecrafttooltips-title": "Minecraft Items", "minecrafttooltips-defaulttooltip": "Minecraft Item Tooltip", - "minecrafttooltips-downloadtooltip": "Download tooltip (.png)", + "minecrafttooltips-downloadtooltip": "Download tooltip", + "minecrafttooltips-downloadtooltip-png": "Download tooltip (.png)", "minecrafttooltips-downloadtooltip-webp": "Download tooltip (.webp)", + "minecrafttooltips-downloadtooltipstatic": "Static (one frame)", + "minecrafttooltips-downloadtooltipfullloop": "Full loop (2π s)", + "minecrafttooltips-downloadtooltipcustom": "Custom", "minecrafttooltips-uploaditem": "Upload item image", "minecrafttooltips-changeitem": "Change item image", "minecrafttooltips-downloaditem": "Download item", diff --git a/language/pt.json b/language/pt.json index bc3832d..6d82c59 100644 --- a/language/pt.json +++ b/language/pt.json @@ -9,8 +9,12 @@ "mainpage-projects": "Projetos divertidos", "minecrafttooltips-title": "Itens do Minecraft", "minecrafttooltips-defaulttooltip": "Nomes de itens do Minecraft", - "minecrafttooltips-downloadtooltip": "Baixar nome (.png)", + "minecrafttooltips-downloadtooltip": "Baixar nome", + "minecrafttooltips-downloadtooltip-png": "Baixar nome (.png)", "minecrafttooltips-downloadtooltip-webp": "Baixar nome (.webp)", + "minecrafttooltips-downloadtooltipstatic": "Estático (um quadro)", + "minecrafttooltips-downloadtooltipfullloop": "Loop completo (2π s)", + "minecrafttooltips-downloadtooltipcustom": "Outro", "minecrafttooltips-uploaditem": "Enviar imagem do item", "minecrafttooltips-changeitem": "Alterar imagem do item", "minecrafttooltips-downloaditem": "Baixar item", diff --git a/language/sl.json b/language/sl.json index e43c7b6..06d440d 100644 --- a/language/sl.json +++ b/language/sl.json @@ -9,8 +9,12 @@ "mainpage-projects": "Zabavni projekti", "minecrafttooltips-title": "Predmeti Minecrafta", "minecrafttooltips-defaulttooltip": "Opis orodja za predmet Minecraft", - "minecrafttooltips-downloadtooltip": "Prenesi opis orodja (.png)", + "minecrafttooltips-downloadtooltip": "Prenesi opis orodja", + "minecrafttooltips-downloadtooltip-png": "Prenesi opis orodja (.png)", "minecrafttooltips-downloadtooltip-webp": "Prenesi opis orodja (.webp)", + "minecrafttooltips-downloadtooltipstatic": "Statični (en okvir)", + "minecrafttooltips-downloadtooltipfullloop": "Celotna zanka (2π s)", + "minecrafttooltips-downloadtooltipcustom": "Drugo", "minecrafttooltips-uploaditem": "Naložite sliko predmeta", "minecrafttooltips-changeitem": "Spremenite sliko predmeta", "minecrafttooltips-downloaditem": "Prenesi predmet", diff --git a/minecrafttooltips.html b/minecrafttooltips.html index 65b4614..0eb469b 100644 --- a/minecrafttooltips.html +++ b/minecrafttooltips.html @@ -35,8 +35,21 @@


- +
+ +
+
@@ -74,27 +87,31 @@

-
+
-
@@ -105,41 +122,71 @@

- + -
+