diff --git a/TODO b/TODO index 2f6912a..2c7c29a 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,2 @@ -* User-Provided Logos - * Default to Kitty - * Add Color Picker - * chrome.fileSystem.retainEntry - * onload handler: check if width=0 and height=0 - +* chrome.fileSystem.retainEntry? * use chrome.power to keep the display on diff --git a/manifest.json b/manifest.json index 6578ca5..a6345ea 100644 --- a/manifest.json +++ b/manifest.json @@ -4,7 +4,7 @@ "short_name": "__MSG_appShortName__", "description": "__MSG_appDesc__", "author": "Neale Pickett ", - "version": "6.2.1", + "version": "7.0β1", "app": { "background": { "scripts": ["res/background.js"] diff --git a/res/ic_picture.png b/res/ic_picture.png new file mode 100644 index 0000000..2bfaaa7 Binary files /dev/null and b/res/ic_picture.png differ diff --git a/res/kitty.js b/res/kitty.js index b391fe7..ea3b7bd 100644 --- a/res/kitty.js +++ b/res/kitty.js @@ -3,7 +3,7 @@ // If you are reading this, there's probably a nicer converter out now. // But this seems to work okay so it may not be worth the effort. -var kitty = function(ctx, kittyColor) { +function kitty(ctx, kittyColor) { var scaleBase = 0.1098503139616503 var scaleX = scaleBase * ctx.canvas.width / 100 diff --git a/res/scoreboard.css b/res/scoreboard.css index 7ea01df..7f327bb 100644 --- a/res/scoreboard.css +++ b/res/scoreboard.css @@ -61,21 +61,29 @@ input[readonly] { text-align: center; } +.logo { + text-align: center; +} + .logo img { max-width: 1.8em; max-height: 2em; + display: none; } .logo input { - position: absolute; - top: 0; + top: 30%; font-size: 10pt; + vertical-align: top; + max-height: 15pt; + border: none; } -.logo img { - display: none; +.setup { + background: rgba(0, 255,0, 0.3); } + .timeouts { position: absolute; font-size: 50%; @@ -147,7 +155,6 @@ input[readonly] { #preset { top: 40%; - color: cyan; } #jamtext { diff --git a/res/scoreboard.html b/res/scoreboard.html index 0b2b4f7..9fad9df 100644 --- a/res/scoreboard.html +++ b/res/scoreboard.html @@ -26,35 +26,37 @@
-

-

+ 3 - -

+
-

-

+ 3 - -

+
-

+

- -

+
diff --git a/res/scoreboard.js b/res/scoreboard.js index 5672964..120a072 100644 --- a/res/scoreboard.js +++ b/res/scoreboard.js @@ -58,8 +58,6 @@ var jamtext = [ var period = 0; var jamno = 0; -var colors = ["#666", "#ffffff"]; - var state = SETUP; var timer_updates = []; @@ -229,7 +227,13 @@ function transition(newstate) { // Reset lead jammer indicators e("jammer-a").className = ""; e("jammer-b").className = ""; - e("preset").style.display = "none"; + + var setupElements = document.getElementsByClassName("setup") + for (var i = 0; i < setupElements.length; i += 1) { + var el = setupElements[i] + + el.style.display = "none" + } save(); } @@ -301,7 +305,7 @@ function changeLogo(team) { function loaded(entry) { entry.file(setURL); e("kitty-" + team).style.display = "none" - element.style.display = "block" + element.style.display = "inline" } chrome.fileSystem.chooseEntry( @@ -320,7 +324,6 @@ function handle(event) { var adj = event.shiftKey?-1:1; var mod = (event.ctrlKey || event.altKey); var newstate; - console.log(tgt.id) switch (tgt.id) { case "load-a": @@ -506,7 +509,6 @@ function save() { chrome.storage.local.set( { "preset": e("preset").innerHTML, - "score_a": e("score-a").innerHTML, "score_b": e("score-b").innerHTML, "timeouts_a": e("timeouts-a").innerHTML, @@ -600,6 +602,9 @@ function start() { ei("close"); ei("preset"); + e("color-a").addEventListener("change", function() {rekitty("a")}, false); + e("color-b").addEventListener("change", function() {rekitty("b")}, false); + ei("periodtext").innerHTML = periodtext[period]; ei("jamtext").innerHTML = jamtext[3]; transition(); @@ -617,6 +622,16 @@ function start() { } +function rekitty(team) { + var i = e("img-" + team) + var k = e("kitty-" + team) + var color = e("color-" + team).value + + i.style.display = "none" + k.style.display = "inline" + kitty(k.getContext("2d"), color) +} + function resize() { var w = window.innerWidth / 7 var h = window.innerHeight / 5 @@ -625,16 +640,17 @@ function resize() { document.body.style.fontSize = Math.min(w, h) + 'px' // Now do kitty canvases - var kw = fs * 2 - var kh = fs * 1.8 + var kw = fs * 1.8 + var kh = kw * 0.6883 var kitties = document.getElementsByClassName("kitty") for (var i = 0; i < kitties.length; i += 1) { k = kitties[i] k.width = kw k.height = kh - kitty(k.getContext("2d"), colors[i]) } + rekitty("a") + rekitty("b") } window.onload = start;