diff options
-rw-r--r-- | neo/src/index.html | 14 | ||||
-rw-r--r-- | neo/src/index.js | 12 |
2 files changed, 12 insertions, 14 deletions
diff --git a/neo/src/index.html b/neo/src/index.html index ec90934..a8e112f 100644 --- a/neo/src/index.html +++ b/neo/src/index.html @@ -6,20 +6,6 @@ <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1"> <title>Yuuta Liang</title> - <script> - document.addEventListener("DOMContentLoaded", () => { - fetch('https://yuuta.moe/quote/') - .then((response) => response.json()) - .then((data) => { - const q = document.querySelector('#quote'); - q.title = data.text_zh; - q.innerHTML = data.text; - const t = document.querySelector('#quote_title'); - t.title = data.title_zh; - t.innerHTML = data.title; - }); - }); - </script> </head> <body> diff --git a/neo/src/index.js b/neo/src/index.js index e69de29..1b3c3ff 100644 --- a/neo/src/index.js +++ b/neo/src/index.js @@ -0,0 +1,12 @@ +document.addEventListener("DOMContentLoaded", () => { + fetch('https://yuuta.moe/quote/') + .then((response) => response.json()) + .then((data) => { + const q = document.querySelector('#quote'); + q.title = data.text_zh; + q.innerHTML = `「${data.text}」`; + const t = document.querySelector('#quote_title'); + t.title = data.title_zh; + t.innerHTML = `—— ${data.title}`; + }); +}); |