From 5d43da99f082d5e4109c2f5b1607b9d67a4cca4d Mon Sep 17 00:00:00 2001 From: Zhao Xin <7176466@qq.com> Date: Mon, 5 Sep 2022 18:09:43 +0800 Subject: [PATCH] update --- 课程表.html | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/课程表.html b/课程表.html index 299fa96..6914d1e 100644 --- a/课程表.html +++ b/课程表.html @@ -16,6 +16,10 @@ background-color: #eef; } + td { + font-weight: 900; + } + table { margin: 1rem auto; } @@ -188,10 +192,61 @@ const date = `${now.getFullYear()}年${now.getMonth() + 1}月${now.getDate()}日` document.getElementById("weekday1").innerText = date document.getElementById("weekday2").innerText = day + for (const td of document.querySelectorAll('td')) { + switch (td.innerText) { + case '数学': + td.style.backgroundColor = 'rgba(127, 255, 127, 0.4)' + break + case '研学': + td.style.backgroundColor = 'rgba(127, 255, 127, 0.4)' + break + case '语文': + td.style.backgroundColor = 'rgba(255, 127, 127, 0.4)' + break + case '班会': + td.style.backgroundColor = 'rgba(255, 127, 127, 0.4)' + break + case '英语': + td.style.backgroundColor = 'rgba(255, 255, 127, 0.4)' + break + case '叮当': + td.style.backgroundColor = 'rgba(255, 255, 127, 0.4)' + break + case '体育': + td.style.backgroundColor = 'rgba(127, 127, 255, 0.4)' + break + case '科学': + td.style.backgroundColor = 'rgba(255, 192, 127, 0.4)' + break + case '劳动': + td.style.backgroundColor = 'rgba(255, 192, 127, 0.4)' + break + case '美术': + td.style.backgroundColor = 'rgba(255, 192, 255, 0.4)' + break + case '德法': + td.style.backgroundColor = 'rgba(192, 127, 127, 0.4)' + break + case '音乐': + td.style.backgroundColor = 'rgba(127, 255, 255, 0.4)' + break + case '信息': + td.style.backgroundColor = 'gold' + break + case '综实': + td.style.backgroundColor = 'lightgreen' + break + case '🍚🥢': + td.style.backgroundColor = '#eef' + break + default: + break + } + } if (tomorrow > 0 && tomorrow < 6) document.querySelectorAll(`tr td:nth-child(${tomorrow + 1})`).forEach(cell => { - cell.style.color = "#ff7" - cell.style.background = "#66d" + cell.style.color = 'blue' + cell.style.textShadow = '0 0 2px skyblue' cell.style.fontWeight = 900 })