diff --git a/common/main.css b/common/main.css index ceb50f1..cc9e0c8 100644 --- a/common/main.css +++ b/common/main.css @@ -3,7 +3,7 @@ --button-color-dark: #045d56; --text-accent-color-dark: #1eb980; --table-border-dark: #00000000; - --tr-color-dark: #1e1e1e; + --tr-color-dark: #1b1b1b; --tr-nth-color-dark: #121212; --table-highlight-dark: #616161; --dark-background-color: #121212; @@ -98,8 +98,8 @@ th { } h4 { font-size: 20px; - margin-bottom: 6px; - margin-top: 20px; + margin-bottom: auto; + margin-top: auto; margin-left: 1rem; font-weight: 600; } @@ -228,36 +228,54 @@ h4 { color: var(--text-accent-color); text-align: center; display: inline-block; - border: 4px solid var(--button-color); + border: thin solid #3c4043; font-weight: 700; border-radius: 0.25rem; - transition: 0.05s; + transition: all 0.2s ease 0s;; margin: 0.4rem; -} -.fancy-button:link, -.fancy-button:visited { - color: #7986cb; - padding: 10px 20px; - text-align: center; - text-decoration: underline; - display: inline-block; - border: 4px solid var(--button-color); - font-weight: 700; + padding-top: 0.2rem; + padding-bottom: 0.2rem; + } -.fancy-button:hover, -.fancy-button:active { + +@media (hover: hover) { +.fancy-button:hover { color: white; background-color: var(--button-color); - border: 4px solid var(--button-color); + border: thin solid var(--button-color); font-weight: 700; box-shadow: 0 .5rem 1rem rgba(0,0,0,.15) !important; + transition: all 0.4s ease 0s; } +} + +.fancy-button:active{ + background-color: var(--accent-color); + box-shadow:0px 10px 13px -6px rgba(0, 0, 0, 0.2),0px 20px 31px 3px rgba(0, 0, 0, 0.14),0px 8px 38px 7px rgba(0,0,0,.12); + transform: translateY(3px); + color: var(--dark-text-color); +} +.fancy-button:focus{ + outline: none; +} + + @media only screen and (max-width: 600px) { header { + flex-direction: column; flex-wrap: wrap; padding-left: 0.2rem; padding-right: 0.2rem; + max-height: 5rem; + } + .header-column{ + display: flex; + flex-direction: column; + flex-basis: 100%; + flex: 1; + width: fit-content; + justify-items: left; } .status-div{ margin-left: auto; diff --git a/index.php b/index.php index 70aa498..b82a69b 100755 --- a/index.php +++ b/index.php @@ -13,13 +13,17 @@
-
+
+
- Liveresultater
-
+
+
+
+
status
status
+
" splitTimes += "" - console.log(splitTimes) let pClassName = classesArray[i].replace(/ |\//g, "_"); resultTableA = '

'+xmlObj.ClassResult[i].Class.Name+'

'+''+resultTable; - let resultTableB = '

'+xmlObj.ClassResult[i].Class.Name+'

LøperKlubbTidDiff
'+''+resultTable; + let resultTableB = '

'+xmlObj.ClassResult[i].Class.Name+'

LøperKlubbTidDiff
'+''+resultTable; splitTimes = '
'+splitTimes; document.getElementById(pClassName).innerHTML = resultTableB+splitTimes; @@ -185,8 +196,6 @@ function loadresults() { resultTable = ""; splitTimes = ""; } - - //console.log(xmlObj) } }; xmlhttp.open("GET", "xmlToJson.php", true); @@ -195,7 +204,7 @@ function loadresults() { loadresults() -function mkTimeStr(timestmp) { +function mkDateStr(timestmp) { var date = new Date(timestmp * 1000); // Hours part from the timestamp var hours = date.getHours(); @@ -215,14 +224,14 @@ var lastUpdate; if (typeof(EventSource) !== "undefined") { var source = new EventSource("updater.php"); source.onmessage = function(event) { - //console.log(event); + ////console.log(event); statusArray = event.data.split(","); lastMessage = parseInt(statusArray[3], 10); - console.log(statusArray); - document.getElementById("lastUpdate").innerHTML = "Siste oppdatering: " + mkTimeStr(statusArray[1]); - document.getElementById("lastMessage").innerHTML = "Siste sjekket: " + mkTimeStr(statusArray[2]); + //console.log(statusArray); + document.getElementById("lastUpdate").innerHTML = "Siste oppdatering: " + mkDateStr(statusArray[1]); + document.getElementById("lastMessage").innerHTML = "Siste sjekket: " + mkDateStr(statusArray[2]); updateInt = parseInt(statusArray[0], 10); - console.log(updateInt); + //console.log(updateInt); //check if update has accured if (parseInt(statusArray[1], 10) + 6 > parseInt(statusArray[2], 10)) { updateInt = 1; @@ -230,18 +239,16 @@ if (typeof(EventSource) !== "undefined") { if (lastUpdate == undefined) { window.lastUpdate == parseInt(statusArray[1], 10) } - console.log(statusArray); + //console.log(statusArray); //update results if (updateInt == 1) { loadresults() - console.log("Update!!!!! :=)"); + //console.log("Update!!!!! :=)"); window.lastUpdate = parseInt(statusArray[1], 10); - var jdata = JSON.parse(statusArray[3]); - console.log(jdata); } else { - console.log("No update"); + //console.log("No update"); } }; @@ -251,7 +258,6 @@ if (typeof(EventSource) !== "undefined") { const checkConnection = async function() { cTime = Math.round(Date.now() / 1000); - if (cTime > lastMessage + 30) { //mistet tilkobling var element = document.getElementById("ConnectionAlert"); @@ -275,4 +281,4 @@ function showHideSplits(className) { } } -var interval = setInterval(checkConnection, 10000); +var interval = setInterval(checkConnection, 10000); \ No newline at end of file
LøperKlubbTidDiff