From 43419ab4b616006e741972866bd4d68126515a29 Mon Sep 17 00:00:00 2001 From: Lan Hui <1348141770@qq.com> Date: Mon, 17 Jul 2023 16:28:08 +0800 Subject: [PATCH] Enlarge text difficult level for one second (make it work using vanilla JavaScript) --- app/templates/userpage_get.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/templates/userpage_get.html b/app/templates/userpage_get.html index b2d37a8..55875fd 100644 --- a/app/templates/userpage_get.html +++ b/app/templates/userpage_get.html @@ -204,8 +204,9 @@ $('#source').html(today_article['source']); $('#question').html(today_article["question"]); $('#answer').html(today_article["answer"]); - $('#text_level').classList.add('display-5'); // enlarge text difficult level for one second - setTimeOut(() => {$('#text_level').classList.remove('display-5');}, 1000); + document.querySelector('#text_level').classList.add('display-5'); // enlarge text difficult level for one second + + setTimeout(() => document.querySelector('#text_level').classList.remove('display-5'), 800); } function check_pre(visited_articles){