From c21aee6d13de704552bcb3cb2e287fce0fe37e51 Mon Sep 17 00:00:00 2001 From: seung6lee Date: Tue, 7 Jul 2026 10:04:03 +0900 Subject: [PATCH] add author info --- main.js | 6 ++++++ style.css | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/main.js b/main.js index 7cdd9d3..e69325d 100644 --- a/main.js +++ b/main.js @@ -12,6 +12,7 @@ class TypingPractice extends HTMLElement { async render() { const raw = await fetch('https://korean-advice-open-api.vercel.app/api/advice') const res = await raw.json() + const author = `- ${res['author']} (${res['authorProfile']})` const sentence = res["message"] const sentence_jamo = decompose(sentence) let progress = 0 @@ -41,6 +42,10 @@ class TypingPractice extends HTMLElement { sentence_display.append(span) }) + const author_info = document.createElement('p') + author_info.className = 'author' + author_info.textContent = author + const updateColors = (has_error) => { ;[...sentence].forEach((_, idx) => { const span = sentence_display.children[idx] @@ -104,6 +109,7 @@ class TypingPractice extends HTMLElement { }) this.append(sentence_display) + this.append(author_info) this.append(input_box) } } diff --git a/style.css b/style.css index bfeb925..fd10521 100644 --- a/style.css +++ b/style.css @@ -88,3 +88,11 @@ input:focus { .dict-count { color: #888888; } + +.author { + display: flex; + justify-content: end; + color: #888888; + font-size: 20px; + letter-spacing: 0.02em; +} \ No newline at end of file