aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2019-08-28 11:52:42 +0200
committerHarald Eilertsen <haraldei@anduin.net>2019-08-28 11:52:42 +0200
commit2cd7b738c839eb7bef075f6438d276eefc74950f (patch)
treece66e2f88a55a247db38f7d9e5977f095b4161c9
parent896b30421727b7625d02cae375544dc1d542e9a5 (diff)
downloadramaskrik-social-2cd7b738c839eb7bef075f6438d276eefc74950f.tar.gz
ramaskrik-social-2cd7b738c839eb7bef075f6438d276eefc74950f.tar.bz2
ramaskrik-social-2cd7b738c839eb7bef075f6438d276eefc74950f.zip
Brushing up a bit and prepare for deploy.
use relative links to resources, so we can deploy to sub-url. explicitly set colours for canvas elements, styling did not work in all browsers. also make it white on black. tighten fonts and make screening titles bigger.
-rw-r--r--public/app.css4
-rw-r--r--public/index.html10
-rw-r--r--public/js/app.js15
3 files changed, 15 insertions, 14 deletions
diff --git a/public/app.css b/public/app.css
index 72b178b..91af939 100644
--- a/public/app.css
+++ b/public/app.css
@@ -9,10 +9,6 @@ body {
font-size: 10pt;
}
-canvas {
- background-color: white;
-}
-
a {
color: wheat;
}
diff --git a/public/index.html b/public/index.html
index 3fe7200..862a260 100644
--- a/public/index.html
+++ b/public/index.html
@@ -1,9 +1,10 @@
<!DOCTYPE html>
<html>
<head>
+ <meta charset="utf-8">
<title>Ravenheart 2019 Program</title>
- <link rel="stylesheet" href="/app.css">
- <script type="text/javascript" src="/js/app.js"></script>
+ <link rel="stylesheet" href="app.css">
+ <script type="text/javascript" src="js/app.js"></script>
</head>
<body>
<h1>Ravenheart 2019</h1>
@@ -15,9 +16,8 @@
<div id="program"></div>
<footer>
- <a rel="license" href="http://creativecommons.org/licenses/by-sa/4.0/">
- <img alt="Creative Commons-lisens" style="border-width:0"
- src="https://i.creativecommons.org/l/by-sa/4.0/88x31.png">
+ <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">
+ <img alt="Creative Commons-lisens" style="border-width:0" src="license.png">
</a>
<span id="copyright-text">
<span xmlns:dct="http://purl.org/dc/terms/" property="dct:title">
diff --git a/public/js/app.js b/public/js/app.js
index 606e21f..f5970ae 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -27,7 +27,7 @@ function fetch_rooms(data_done) {
function load_screenings(data_done) {
let req = new XMLHttpRequest()
req.addEventListener("load", data_done)
- req.open("GET", "http://localhost:8000/ravenheart-2019.json")
+ req.open("GET", "ravenheart-2019.json")
req.responseType = "json"
req.send()
}
@@ -129,7 +129,7 @@ window.addEventListener("load", function() {
function draw_timescale(c, start, end) {
let dur = Math.ceil((end - start) / 30)
- c.font = '10px Helvetica'
+ c.font = '10px sans-serif'
c.lineWidth = 'thin'
c.strokeStyle = '#ccc'
@@ -145,7 +145,7 @@ window.addEventListener("load", function() {
function draw_room_headers(c, rooms) {
let x = 0;
- c.font = '15px sans-serif'
+ c.font = 'bold 15px sans-serif'
for (let r of [...rooms]) {
center_text(c, r, 50 + x, 15, 100)
@@ -156,7 +156,7 @@ window.addEventListener("load", function() {
function draw_screenings(c, screenings, start_time, rooms) {
let r = [...rooms]
- c.strokeStyle = '#000'
+ c.strokeStyle = '#cfc'
for (let s of screenings) {
let ystart = Math.ceil((_time_to_sec(s.start_time) - start_time) / 30) + margin;
@@ -164,10 +164,11 @@ window.addEventListener("load", function() {
let ri = s.room.id - 1
let xstart = xmargin + ri * 150
- c.fillStyle = '#ec9'
+ c.fillStyle = '#eca'
c.fillRect(xstart, ystart, 100, height)
c.strokeRect(xstart, ystart, 100, height)
+ c.font = '12px sans-serif'
c.fillStyle = '#000'
break_text(c, s.film.title, xstart + 5, ystart + 15, 90)
}
@@ -208,7 +209,11 @@ window.addEventListener("load", function() {
let canvas = document.getElementById('canvas-' + date_str)
let c = canvas.getContext('2d');
+ c.fillStyle = '#000'
+ c.fillRect(0, 0, 350, canvas_height);
+
let rooms = new Set(s.map( el => el.room.name ))
+ c.fillStyle = '#fff'
draw_room_headers(c, rooms)
draw_timescale(c, start_time, end_time)
draw_screenings(c, s, start_time, rooms)