diff options
| author | Fuwn <[email protected]> | 2024-06-12 08:15:27 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-06-12 08:15:27 -0700 |
| commit | 29304b05ad2c5b14731f2423be1b2afe5a72d6c5 (patch) | |
| tree | 9eba433134259f8150d764a84a05a3cfa7cc935e /index.html | |
| parent | 410405380eacb6cbf510100de5a104e5ff9746d4 (diff) | |
| download | mayu-29304b05ad2c5b14731f2423be1b2afe5a72d6c5.tar.xz mayu-29304b05ad2c5b14731f2423be1b2afe5a72d6c5.zip | |
fix(index.html): full default set on load
Diffstat (limited to 'index.html')
| -rw-r--r-- | index.html | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -241,11 +241,14 @@ const copyCodesInput = document.getElementById("copy-codes"); let inputValue = "demo"; let themeValue = "asoul"; + const setCopyCodes = () => { + copyCodesInput.innerText = `\n\n<img src="${image.src}" alt="${inputValue}" />`; + }; const set = () => { inputValue = idInput.value || "demo"; themeValue = themeSelect.value || "asoul"; image.src = `https://counter.due.moe/get/@${inputValue}?theme=${themeValue}`; - copyCodesInput.innerText = `\n\n<img src="${image.src}" alt="${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 = `\n\n<img src="${image.src}" alt="${inputValue}" />`; - + set(); idInput.addEventListener("input", () => { clearTimeout(inputTimeout); |