From 9493af369e6bae4b8ab92e36c4718af7a591d994 Mon Sep 17 00:00:00 2001 From: Niles Rogoff Date: Sun, 6 Aug 2017 22:48:02 -0700 Subject: [PATCH] Add today script --- generate.py | 27 +++++++++++++++++++++++++-- style.css | 43 ++++++++++++++++++++++++++++++++----------- 2 files changed, 57 insertions(+), 13 deletions(-) diff --git a/generate.py b/generate.py index cda2565..67b1d8f 100644 --- a/generate.py +++ b/generate.py @@ -277,10 +277,33 @@ master.append(""" } document.onkeydown = key; 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); +} """) -master.append("""
""") +master.append("""
""") for f in l: master.append(rhtml(f, "")) -master.append("""
π
""") +master.append("""
π
""") master = "\n".join(master) print(master) diff --git a/style.css b/style.css index 6bb45f2..0e7a401 100644 --- a/style.css +++ b/style.css @@ -1,22 +1,18 @@ body { font-family:helvetica; 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: #eeeeee;*/ color: rgba(238,238,238, 0.8); +} +#content { + margin-left: 5%; + margin-top: 50px; + font-family: "Camcorder Monospaced", "Helvetica", sans-serif; position:relative; - top:50px; + font-size: 24px; } a { - font-size: 24px; /*color: #595959;*/ color: #eeeeee; transition: color .1s; @@ -37,7 +33,7 @@ a:hover { } input { - font-size: 1.5em; + font-size: 1em; outline: none; border: solid 1px #ddd; padding: 10px; @@ -46,3 +42,28 @@ input { box-shadow: 0 0 10px 1px #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; +} +