From 2a3badc7f9a4b9e4fc1b43abff7479e4405344bd Mon Sep 17 00:00:00 2001 From: Mindiell Date: Sun, 23 Jul 2023 14:24:10 +0200 Subject: [PATCH] fix: moved CSS and JS in files. #1 --- static/styles.css | 16 ++++++++++++++++ static/utils.js | 20 ++++++++++++++++++++ template.html | 42 ++---------------------------------------- 3 files changed, 38 insertions(+), 40 deletions(-) create mode 100644 static/styles.css create mode 100644 static/utils.js diff --git a/static/styles.css b/static/styles.css new file mode 100644 index 0000000..d41babe --- /dev/null +++ b/static/styles.css @@ -0,0 +1,16 @@ +body {background-color: #000; color: #fff; font-family: "Verdana"} +.time {color: #ffd738; font-size: .9em; font-weight: bold} +.bracket {color: #ccc; font-size: .8em} +.nick {color: #dAa642} +.message {color: #eaeaea} +.action {color: #a4c} +.click {cursor: pointer} +.off {display: none} +.on {display: block} +#content a {color: #ffd738; font-size: .9em; font-weight: bold; text-decoration: none} +#content a:hover {text-decoration: underline} +.calendar {color: #ffd738} +.day {font-weight: bold} +#calendar {padding-bottom: .6em; margin-bottom: .6em; border-bottom: 1px dashed #ffd738} +#calendar a {color: #ffd738; text-decoration: none} +#calendar a:hover {text-decoration: underline} diff --git a/static/utils.js b/static/utils.js new file mode 100644 index 0000000..e6342cd --- /dev/null +++ b/static/utils.js @@ -0,0 +1,20 @@ +function hide(id) { + var els = document.getElementsByClassName("on"); + [].forEach.call(els, function (el){ + console.log(el.id); + console.log(id); + console.log(id.substr(0, el.id.length)); + console.log(id.substr(0, el.id.length) != el.id); + if (el.id != id.substr(0, el.id.length)) { + el.className = "off"; + } + }); +} + +function display(id) { + hide(id.toString()); + var el = document.getElementById(id); + if (el!=null) { + el.className = "on"; + } +} diff --git a/template.html b/template.html index 2b43c96..69c6f2f 100644 --- a/template.html +++ b/template.html @@ -4,46 +4,8 @@ Logs du chan #afpy pour le - - + +