From d52bc47dfc26fff399fcf4b1d253d5c2f6c0c67e Mon Sep 17 00:00:00 2001 From: HearMeWhisper Date: Mon, 8 Nov 2021 14:20:53 -0500 Subject: [PATCH] fixed MTG first load --- MTG/script.js | 8 ++++++-- MTG/style.css | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/MTG/script.js b/MTG/script.js index 14655b5..631c4bc 100644 --- a/MTG/script.js +++ b/MTG/script.js @@ -8,12 +8,16 @@ window.onunload = function(){ window.onload = function(){ localStorage.getItem('playerCount'); for (i=1; i<9; i++){ + if (localStorage.getItem('playerName'+i)){ document.getElementById('name'+i).innerHTML = localStorage.getItem('playerName'+i); - document.getElementById('lifeCount'+i).innerHTML = 20 - if (document.getElementById('lifeCount'+i).innerHTML != ""){ + console.log(document.getElementById('name'+i).innerHTML) + } + + if (localStorage.getItem('lifeCount'+i)){ document.getElementById('lifeCount'+i).innerHTML = localStorage.getItem('lifeCount'+i) } + } }; diff --git a/MTG/style.css b/MTG/style.css index 27477d8..6e5beee 100644 --- a/MTG/style.css +++ b/MTG/style.css @@ -129,9 +129,11 @@ #buttonWrapper{ display: flex; flex-direction: row; - justify-content: space-evenly; + justify-content:space-around; position: fixed; bottom: 0; + right: 0; + left: 0; width: 100%; margin-top: auto; }