Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions src/table.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
let refreshTimeout = null
let refreshTimeout = null
let warningFlashTimeout = null
let warningCanFlash = false

Expand All @@ -23,6 +23,9 @@ function main()
"Type in the results here, or load an example below.\n\n" +
"If you have a saved MK8D screenshot, upload it at the bottom of the page.\n\n" +
"If you have copied an MK8D screenshot to the clipboard, just hit Ctrl+V anywhere."

if (sessionStorage.getItem("players"))
document.getElementById("textareaData").value = sessionStorage.getItem("players")

document.getElementById("tableTotals").innerHTML =
"<tr style='font-size:1.25em;'><td>MK8D Point Totals</td><td>1 Race</td><td>12 Races</td></tr>" +
Expand All @@ -49,6 +52,12 @@ function queueRefresh()
refreshTimeout = setTimeout(refreshFromData, 500)
}

function styleChange(style)
{
window.history.replaceState(null, null, style === "default" ? window.location.toString().substring(0, window.location.toString().indexOf("?")) : "?style=" + style)
sessionStorage.setItem("players", document.getElementById("textareaData").value)
location.reload()
}

function refreshFromData()
{
Expand Down Expand Up @@ -1886,4 +1895,4 @@ function getURLQueryParameter(name)
return "";

return decodeURIComponent(results[2].replace(/\+/g, " "));
}
}
17 changes: 11 additions & 6 deletions table.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
<div id="divGameAd">
<table style="margin-left:auto; margin-right:auto; padding:0;">
<tr style="padding:0;"><td style="padding:0;">
<img src="assets/ninjin.png"></img>
<img src="assets/ninjin.png">
</td><td style="padding:0;">
Check out my new game, <span class="adName">Ninjin: Clash of Carrots!</span>
<br>
Expand All @@ -136,11 +136,11 @@
<span class="adDate">OUT NOW! <span class="adDemo">DEMO AVAILABLE!</span></span>
<br>
Steam /
<img src="https://seeklogo.com/images/N/nintendo-switch-logo-38D4F5C7E7-seeklogo.com.png" style="width:1em; position:relative; top:0.1em;"></img> Nintendo Switch /
<img src="https://logodownload.org/wp-content/uploads/2017/05/playstation-4-logo-ps4-6.png" style="width:1em; position:relative; top:0.05em;"></img> PS4 /
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/f9/Xbox_one_logo.svg/1024px-Xbox_one_logo.svg.png" style="width:1em; position:relative; top:0.1em;"></img> Xbox One
<img src="https://seeklogo.com/images/N/nintendo-switch-logo-38D4F5C7E7-seeklogo.com.png" style="width:1em; position:relative; top:0.1em;"> Nintendo Switch /
<img src="https://logodownload.org/wp-content/uploads/2017/05/playstation-4-logo-ps4-6.png" style="width:1em; position:relative; top:0.05em;"> PS4 /
<img src="https://upload.wikimedia.org/wikipedia/commons/thumb/f/f9/Xbox_one_logo.svg/1024px-Xbox_one_logo.svg.png" style="width:1em; position:relative; top:0.1em;"> Xbox One
</td><td style="padding:0;">
<img src="assets/akai.png"></img>
<img src="assets/akai.png">
</td></tr>
</table>
</div>
Expand All @@ -163,9 +163,14 @@
<td>
<span>Right-click and select "Copy Image" to share!</span>
<br>
<button onclick="styleChange('default')">Default</button>
<button onclick="styleChange('mku')">MKU</button>
<button onclick="styleChange('200l')">200L</button>
<button onclick="styleChange('americas')">Americas Cup</button>
<br>
<canvas id="canvasTable" width="860" height="520" style="display:none;"></canvas>
<div id="divTable">
<img id="imgTable"></img>
<img id="imgTable">
</div>
<span id="spanTotal"></span>
<span id="spanWarning"></span>
Expand Down