Add today script
This commit is contained in:
parent
cdff7cffa5
commit
9493af369e
27
generate.py
27
generate.py
|
@ -277,10 +277,33 @@ master.append("""
|
||||||
}
|
}
|
||||||
document.onkeydown = key;
|
document.onkeydown = key;
|
||||||
document.onkeyup = keyup;
|
document.onkeyup = keyup;
|
||||||
|
|
||||||
|
var ol = function ol() {
|
||||||
|
request = new XMLHttpRequest();
|
||||||
|
request.onreadystatechange = function() {
|
||||||
|
if(request.readyState === 4) {
|
||||||
|
if(request.status === 200) {
|
||||||
|
var messages = request.responseText.split("\\n");
|
||||||
|
var div = document.getElementById("today")
|
||||||
|
for (var i = 0; i < messages.length; i++) {
|
||||||
|
if (messages[i].trim().length == 0) continue;
|
||||||
|
var span = document.createElement("span")
|
||||||
|
span.classList.add("message")
|
||||||
|
span.style.marginTop = (5 * i).toString() + "px";
|
||||||
|
span.innerText = messages[i]
|
||||||
|
div.appendChild(span);
|
||||||
|
div.appendChild(document.createElement("br"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
request.open('GET', 'http://127.0.0.1/today', true);
|
||||||
|
request.send(null);
|
||||||
|
}
|
||||||
</script></head>""")
|
</script></head>""")
|
||||||
master.append("""<body class=""><div id="content">""")
|
master.append("""<body class="" onLoad='ol();'><div id="content">""")
|
||||||
for f in l:
|
for f in l:
|
||||||
master.append(rhtml(f, ""))
|
master.append(rhtml(f, ""))
|
||||||
master.append("""</div><div id="pi" onclick='pi();'>π</div></body></html>""")
|
master.append("""</div><div id="today"></div><div id="pi" onclick='pi();'>π</div></body></html>""")
|
||||||
master = "\n".join(master)
|
master = "\n".join(master)
|
||||||
print(master)
|
print(master)
|
||||||
|
|
43
style.css
43
style.css
|
@ -1,22 +1,18 @@
|
||||||
body {
|
body {
|
||||||
font-family:helvetica;
|
font-family:helvetica;
|
||||||
background:url("background.png") no-repeat center/cover fixed;
|
background:url("background.png") no-repeat center/cover fixed;
|
||||||
}
|
|
||||||
#content {
|
|
||||||
width:90%;
|
|
||||||
margin-left:auto;
|
|
||||||
margin-right:auto;
|
|
||||||
top:50px;
|
|
||||||
font-family: "Camcorder Monospaced", "Helvetica", sans-serif;
|
|
||||||
height:90%;
|
|
||||||
/*color: #595959;*/
|
/*color: #595959;*/
|
||||||
/*color: #eeeeee;*/
|
/*color: #eeeeee;*/
|
||||||
color: rgba(238,238,238, 0.8);
|
color: rgba(238,238,238, 0.8);
|
||||||
|
}
|
||||||
|
#content {
|
||||||
|
margin-left: 5%;
|
||||||
|
margin-top: 50px;
|
||||||
|
font-family: "Camcorder Monospaced", "Helvetica", sans-serif;
|
||||||
position:relative;
|
position:relative;
|
||||||
top:50px;
|
font-size: 24px;
|
||||||
}
|
}
|
||||||
a {
|
a {
|
||||||
font-size: 24px;
|
|
||||||
/*color: #595959;*/
|
/*color: #595959;*/
|
||||||
color: #eeeeee;
|
color: #eeeeee;
|
||||||
transition: color .1s;
|
transition: color .1s;
|
||||||
|
@ -37,7 +33,7 @@ a:hover {
|
||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
font-size: 1.5em;
|
font-size: 1em;
|
||||||
outline: none;
|
outline: none;
|
||||||
border: solid 1px #ddd;
|
border: solid 1px #ddd;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
@ -46,3 +42,28 @@ input {
|
||||||
box-shadow: 0 0 10px 1px #27454F;
|
box-shadow: 0 0 10px 1px #27454F;
|
||||||
border: solid 4px #27454F;
|
border: solid 4px #27454F;
|
||||||
}
|
}
|
||||||
|
#today {
|
||||||
|
margin-left: 50px;
|
||||||
|
position: absolute;
|
||||||
|
bottom: 50px;
|
||||||
|
font-family: "Helvetica", sans-serif;
|
||||||
|
font-size: 16px;
|
||||||
|
/*
|
||||||
|
box-shadow: 0 0 10px 1px #27454F;
|
||||||
|
background-color: rgba(39, 69, 79, 0.9);
|
||||||
|
*/
|
||||||
|
padding: 8px;
|
||||||
|
display: inline-block;
|
||||||
|
/*font-weight: bold;**/
|
||||||
|
line-height: 1.6;
|
||||||
|
width: 80%;
|
||||||
|
/*color: lightred;*/
|
||||||
|
}
|
||||||
|
.message {
|
||||||
|
height: 0px;
|
||||||
|
position: absolute;
|
||||||
|
border-left: 25px solid rgba(238,238,238, 0.8);
|
||||||
|
border-bottom: 25px solid #1A1210;
|
||||||
|
padding-right: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue