From e7da81cb28bca12d28f282d9b5ffef0b91d63622 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 12 Jun 2024 15:15:27 +0000 Subject: fix(index.html): full default set on load --- index.html | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index 2d940f5..68dbfc9 100644 --- a/index.html +++ b/index.html @@ -241,11 +241,14 @@ const copyCodesInput = document.getElementById("copy-codes"); let inputValue = "demo"; let themeValue = "asoul"; + const setCopyCodes = () => { + copyCodesInput.innerText = `![${inputValue}](${image.src})\n\n${inputValue}`; + }; const set = () => { inputValue = idInput.value || "demo"; themeValue = themeSelect.value || "asoul"; image.src = `https://counter.due.moe/get/@${inputValue}?theme=${themeValue}`; - copyCodesInput.innerText = `![${inputValue}](${image.src})\n\n${inputValue}`; + setCopyCodes(); }; const mascots = [ { name: "Akaza Akari", image: "https://i.imgur.com/efamPLp.png" }, @@ -291,8 +294,7 @@ { name: "Yuzuki Yukari", image: "https://i.imgur.com/84HOYIc.png" }, ]; - copyCodesInput.innerText = `![${inputValue}](${image.src})\n\n${inputValue}`; - + set(); idInput.addEventListener("input", () => { clearTimeout(inputTimeout); -- cgit v1.2.3