fix: moved CSS and JS in files. #1

This commit is contained in:
Mindiell 2023-07-23 14:24:10 +02:00
parent 6cae30eab4
commit 2a3badc7f9
3 changed files with 38 additions and 40 deletions

16
static/styles.css Normal file
View File

@ -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}

20
static/utils.js Normal file
View File

@ -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";
}
}

View File

@ -4,46 +4,8 @@
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Logs du chan #afpy pour le </title>
<style type="text/css">
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}
</style>
<script type="text/javascript">
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";
}
}
</script>
<link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
<script src="{{ url_for('static', filename='utils.js') }}"></script>
</head>
<body>
<div id="calendar">