From: Raphaƫl Jakse Date: Wed, 9 Dec 2020 21:29:04 +0000 (+0100) Subject: Design improvement X-Git-Url: https://secure.softndesign.org/git/?a=commitdiff_plain;h=7297e2de2ed58d3e446e629c6f389dd67482fa09;p=trivabble.git Design improvement --- diff --git a/l10n/po/fr/trivabble.po b/l10n/po/fr/trivabble.po index 35225d4..3bc6102 100644 --- a/l10n/po/fr/trivabble.po +++ b/l10n/po/fr/trivabble.po @@ -253,8 +253,8 @@ msgstr "Partie :" msgid "{0}d" msgstr "{0}j" -msgid "{0}h {0}' {1}''" -msgstr "{0} h {0} min {1} s" +msgid "{0}h {1}' {2}''" +msgstr "{0} h {1} min {2} s" msgid "{0}' {1}''" msgstr "{0} min {1}" diff --git a/l10n/pot/trivabble.pot b/l10n/pot/trivabble.pot index 030ffe0..b251758 100644 --- a/l10n/pot/trivabble.pot +++ b/l10n/pot/trivabble.pot @@ -258,7 +258,7 @@ msgstr "" msgid "{0}d" msgstr "" -msgid "{0}h {0}' {1}''" +msgid "{0}h {1}' {2}''" msgstr "" msgid "{0}' {1}''" diff --git a/public/index.html b/public/index.html index bdef669..01c4e8c 100644 --- a/public/index.html +++ b/public/index.html @@ -60,13 +60,13 @@

-

+

-

+

@@ -108,22 +108,27 @@
+
+
+
-

Number of tiles in the bag:
102

diff --git a/public/trivabble.css b/public/trivabble.css index fc1d491..e76665c 100644 --- a/public/trivabble.css +++ b/public/trivabble.css @@ -179,6 +179,7 @@ button { #rack { background:#EEC; + z-index:10; font-size:0; border-radius:4px; display:inline-block; @@ -733,14 +734,34 @@ button#next-help-msg:hover { flex-direction:column; } -#timer-turn, .timer-turn { - text-align: center; - font-size: small; - color: #333; +#rack-timer { + position:relative; } -#timer-game, .timer-game { - text-align: center; - font-size: x-small; - color: #AAA; +#timer { + position:absolute; + display:table; + top:0; + font-size:0.8em; + right: 0.8rem; + text-align:right; +} + +#timer > p { + margin:0; + display:table-row; + z-index:0; +} + +#timer > p > span { + display:table-cell; +} + +#timer > p > span:first-child { + color:gray; + padding-right: 1ex; +} + +#timer > p > span:last-child { + color:#333; } diff --git a/public/trivabble.js b/public/trivabble.js index 7dcab5c..3a146f9 100644 --- a/public/trivabble.js +++ b/public/trivabble.js @@ -162,8 +162,8 @@ const trivabble = window.trivabble = {l10n: _}; - function format(s, v1, v2) { - return s.replace("{0}", v1).replace("{1}", v2); + function format(s, v1, v2, v3) { + return s.replace("{0}", v1).replace("{1}", v2).replace("{2}", v3); } let board; @@ -2236,8 +2236,11 @@ const h = Math.floor((delta % (60 * 60 * 24)) / (60 * 60)); const m = Math.floor((delta % (60 * 60)) / 60); const s = Math.floor(delta % 60); + const sec = (s < 10) ? "0" + s : s; + const min = (m < 10) ? "0" + m : m; + const hour = (h < 10) ? "0" + h : h; return ((d > 0) ? format(_("{0}d "), d) : "") + - ((h > 0) ? format(_("{0}h {1}' {2}''"), h, m, s) : format(_("{0}' {1}''"), m, s)); + ((h + d > 0) ? format(_("{0}h {1}' {2}''"), (d > 0) ? hour : h, min, sec) : format(_("{0}' {1}''"), m, sec)); } function timerDate() { @@ -2264,7 +2267,7 @@ function setTimerState(state) { setSetting("TimerEnable", state); if (state) { - document.getElementById("timer").style.display = "block"; + document.getElementById("timer").hidden = false; document.getElementById("enable-timer").checked = true; setSetting("Timer", setInterval(function () { const currentTimer = timerDate();