From 78e3f6ea427a10edaeac1c056f8a3ab5640e2a0c Mon Sep 17 00:00:00 2001 From: user Date: Fri, 19 Jul 2024 23:32:40 +0200 Subject: Initial commit - displays events --- src/static/favicon.ico | Bin 0 -> 15406 bytes src/static/main.css | 72 ++++++++++++++++++++++++++++++++++++++++++ src/static/main.js | 31 ++++++++++++++++++ src/static/news_headline.png | Bin 0 -> 2597 bytes src/static/title_headline.png | Bin 0 -> 2255 bytes 5 files changed, 103 insertions(+) create mode 100644 src/static/favicon.ico create mode 100644 src/static/main.css create mode 100644 src/static/main.js create mode 100644 src/static/news_headline.png create mode 100644 src/static/title_headline.png (limited to 'src/static') diff --git a/src/static/favicon.ico b/src/static/favicon.ico new file mode 100644 index 0000000..653155d Binary files /dev/null and b/src/static/favicon.ico differ diff --git a/src/static/main.css b/src/static/main.css new file mode 100644 index 0000000..e4d5aef --- /dev/null +++ b/src/static/main.css @@ -0,0 +1,72 @@ +body { + color: white; + background: black; + image-rendering: pixelated; + zoom: 2; +} + +#root-container { + margin: auto; + text-align: center; + width: min-content; +} + +.content { + margin-top: 0.1em; +} + +#top { + font-size: 1.36em; + color: grey; +} + +#program { + font-size: 1.64em; +} + +#news { + font-size: 1.36em; + text-align: left; +} + +.grey { + color: grey !important; +} + +input { + width: 80%; + height: 200%; + font-size: 1em; +} + +#news_input_label { + font-size: 0.7em; +} + +input[type=submit] { + width: fit-content; +} + + +progress { + -webkit-appearance: none; + background: #000; + border: none; + width: 93%; +} + +progress::-moz-progress-bar { background: #006688; } + +#progress-bar span { + position: absolute; + display: inline-block; + color: #fff; + text-align: right; +} + +#progress-bar { + display: block; + position: relative; + width: 100%; +} + diff --git a/src/static/main.js b/src/static/main.js new file mode 100644 index 0000000..7bea389 --- /dev/null +++ b/src/static/main.js @@ -0,0 +1,31 @@ +const url = '/text'; +const parts = ["top", "program"]; +const elements = {}; + +function get_element(part){ + elements[part] = document.getElementById(part); +} + +const program_element = parts.forEach(get_element); + +function set_element_text(part, text){ + elements[part].innerHTML = text; +} + +async function getEvents() { + try { + const response = await fetch(url); + if (!response.ok) { + throw new Error(`Response status: ${response.status}`); + } + + const events = await response.json(); + console.log(events) + + } catch (error) { + console.error(error.message); + } +} + +getEvents(); + diff --git a/src/static/news_headline.png b/src/static/news_headline.png new file mode 100644 index 0000000..f9876a1 Binary files /dev/null and b/src/static/news_headline.png differ diff --git a/src/static/title_headline.png b/src/static/title_headline.png new file mode 100644 index 0000000..dec80be Binary files /dev/null and b/src/static/title_headline.png differ -- cgit v1.2.3