From 248da07bac4d126bae867cf35508b00ae5465fd9 Mon Sep 17 00:00:00 2001 From: Elijah Steres Date: Thu, 31 Dec 2020 01:33:03 -0500 Subject: [PATCH] move header out of grid, for my own sanity --- static/games_page.css | 11 ++++++----- static/loader.js | 8 ++++---- templates/index.html | 8 ++++---- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/static/games_page.css b/static/games_page.css index ed1fe4b..b7152b0 100644 --- a/static/games_page.css +++ b/static/games_page.css @@ -9,7 +9,7 @@ body { font-family: 'Alegreya', serif; display: grid; grid-template-columns: repeat(3, minmax(500px, 1fr)); - grid-template-rows: 100px 330px; + grid-template-rows: 330px; grid-gap: 50px 30px; /*space between rows, then columns*/ align-items: center; justify-items: center; @@ -17,12 +17,13 @@ body { grid-auto-flow: row; } -#title { - grid-column: 1 / 4; - grid-row: 1; +#header { + width: 100%; + height: 100px; + margin-bottom: 50px; } -#title > .page_header { +#header > .page_header { margin: auto } diff --git a/static/loader.js b/static/loader.js index 3872d6f..738fa9b 100644 --- a/static/loader.js +++ b/static/loader.js @@ -19,7 +19,7 @@ $(document).ready(function (){ for (const timestamp in json) { if (!gameslist.includes(timestamp)) { //adds game to list if not there already gameslist.push(timestamp) - for (var slotnum = 1; true; slotnum++) { //this is really a while loop but shh don't tell anyone + for (var slotnum = 0; true; slotnum++) { //this is really a while loop but shh don't tell anyone if (slotnum >= grid.children.length) { for (var i = 0; i < 3; i ++) { insertEmpty(grid); @@ -32,20 +32,20 @@ $(document).ready(function (){ }; }; - for (var slotnum = 1; slotnum < grid.children.length; slotnum++) { + for (var slotnum = 0; slotnum < grid.children.length; slotnum++) { if (grid.children[slotnum].timestamp == timestamp) { updateGame(grid.children[slotnum], json[timestamp]); }; }; }; - for (var slotnum = 1; slotnum < grid.children.length; slotnum++) { + for (var slotnum = 0; slotnum < grid.children.length; slotnum++) { if (grid.children[slotnum].className == "game" && !(Object.keys(json).includes(grid.children[slotnum].timestamp))) { grid.removeChild(grid.children[slotnum]); } } - var requiredcells = Math.max(4, (3 * Math.ceil(Object.keys(json).length/3))+1); + var requiredcells = Math.max(3, 3 * Math.ceil(Object.keys(json).length/3)); while (grid.children.length > requiredcells) { grid.removeChild(grid.children[requiredcells]); diff --git a/templates/index.html b/templates/index.html index c688b64..fabbe1f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -8,11 +8,11 @@ +
-
- - -