- Presentation a bit clearer.
- closing with escape now uses an event handler on window instead of body.
Chromium didn't like the latter.
- Improve the keyboard navigation
msgid "Look at:"
msgstr "Regardez ici :"
-msgid "Double tap duration"
-msgstr "Durée de la double tape"
+msgid "Double tap duration:"
+msgstr "Durée de la double tape :"
msgid "(slow)"
msgstr "(lent)"
msgid "(fast)"
msgstr "(rapide)"
-msgid "Flash light duration"
-msgstr "Durée du flash laser"
+msgid "Flash light duration:"
+msgstr "Durée du flash laser :"
msgid "Flash light color"
msgstr "Couleur du flash laser"
msgid "Look at:"
msgstr ""
-msgid "Double tap duration"
+msgid "Double tap duration:"
msgstr ""
msgid "(slow)"
msgid "(fast)"
msgstr ""
-msgid "Flash light duration"
+msgid "Flash light duration:"
msgstr ""
msgid "Flash light color"
<link rel="icon" type="image/png" href="logo/192.png" sizes="192x192" />
</head>
<body>
- <div id="menu">
+ <div id="menu" class="panel">
<button data-l10n="text-content" id="join-game">Join adversaries</button>
<p id="p-name"> <span data-l10n="text-content">You are:</span> <span id="name" data-l10n="text-content">(name to give)</span><br /><button class="minibutton" id="change-name" data-l10n="text-content">Change</button></p>
<button id="clear-game" data-l10n="text-content">Put back all the tiles in the bag</button>
</div>
</div>
- <div class="modal" id="modal-settings-dialog">
+ <section class="modal" id="modal-settings-dialog">
<div class="modal-content">
- <h2>
- <span data-l10n="text-content">Settings</span>
- <span class="modal-button" id="btn-settings-close">×</span>
- </h2>
- <div id="prefs">
+ <div class="modal-header">
+ <h1 data-l10n="text-content">Settings</h1>
+ <button class="modal-button" id="btn-settings-close">×</button>
+ </div>
+ <div>
<p><label><input type="checkbox" id="tiles-sound" /><span data-l10n="text-content">Sound of the tiles</span></label></p>
<p><label><input type="checkbox" id="msg-sound" /><span data-l10n="text-content">Sound of messages</span></label></p>
- <p><label><span data-l10n="text-content">(fast)</span><input type="range" min="0" max="0" id="double-tap-duration"/><span data-l10n="text-content">(slow)</span><br/><span data-l10n="text-content">Double tap duration</span></label></p>
- <p><label><span data-l10n="text-content">(fast)</span><input type="range" min="0" max="0" id="flash-light-duration"/><span data-l10n="text-content">(slow)</span><br/><span data-l10n="text-content">Flash light duration</span></label></p>
- <p id="flash-light-color-p"><label><input type="color" size="6" id="flash-light-color" /> <span data-l10n="text-content">Flash light color</span></label></p>
- </div>
+ </div>
+ <div>
+ <p>
+ <label for="double-tap-duration" data-l10n="text-content">Double tap duration:</label>
+ <span class="span-range">
+ <span data-l10n="text-content">(fast)</span>
+ <input type="range" min="0" max="0" id="double-tap-duration" />
+ <span data-l10n="text-content">(slow)</span><br/>
+ </span>
+ </p>
+ </div>
+ <div>
+ <p>
+ <label for="flash-light-duration" data-l10n="text-content">Flash light duration:</label>
+ <span class="span-range">
+ <span data-l10n="text-content">(fast)</span>
+ <input type="range" min="0" max="0" id="flash-light-duration" />
+ <span data-l10n="text-content">(slow)</span>
+ </span>
+ </p>
+ </div>
+ <div>
+ <p id="flash-light-color-p">
+ <label>
+ <input type="color" size="6" id="flash-light-color" />
+ <span data-l10n="text-content">Flash light color</span>
+ </label>
+ </p>
+ </div>
</div>
- </div>
+ </section>
<div id="content">
<table id="board">
</div>
</div>
- <div id="panel">
+ <div id="panel" class="panel">
<button id="btn-settings" data-l10n="text-content">Settings</button>
<div id="bag"></div>
<p><span data-l10n="text-content">Number of tiles in the bag:</span><br /><span id="remaining-letters">102</span></p>
flex-direction:column;
}
+
button {
+ border-radius: 2px;
+}
+
+.panel button {
margin: 0.25em 0;
min-height:3em;
background: #CFC;
border: 1px solid #8C8;
- border-radius: 2px;
cursor: pointer;
transition: 0.2s;
}
-button:hover {
+.panel button:hover {
background: #FD7;
border: 1px solid #CA5;
}
-button[disabled=disabled], button:disabled {
+.panel button[disabled=disabled], .panel button:disabled {
background:#AFA;
cursor:not-allowed;
}
font-size:small
}
-.minibutton {
+.panel .minibutton {
padding:0.25ex 0.5ex;
min-height:0;
font-size:small
min-width:2.5em;
}
-#participants .score-cell > span:hover, .turn-cell button:hover {
+#participants .score-cell > span:hover, #participants .turn-cell button:hover {
cursor:pointer;
background:#FFA
}
font-style:italic;
}
-.turn-cell button {
+#participants .turn-cell button {
padding:0 2px;
background:white;
min-height:1em;
display:flex;
}
-.turn-cell img {
+#participants .turn-cell img {
width:1em;
vertical-align: middle;
}
}
}
-#prefs {
- margin:1ex 0 0 0;
-}
-
-#prefs p {
+#modal-settings-dialog p {
margin:0;
padding:0;
- font-size:small
+ font-size:small;
}
-#prefs #lang-selectioninput, #prefs label {
- vertical-align:middle
+#modal-settings-dialog label span, #modal-settings-dialog label input {
+ display: inline-block;
+ vertical-align: middle;
}
#lang-selection {
transition: visibility 0s linear 0.25s, opacity 0.25s 0s, transform 0.25s;
z-index: 1;
}
+
+.modal-header {
+ display:flex;
+ flex-direction:row;
+}
+
+.modal-header h1 {
+ flex:1;
+}
+
.modal-content {
position: absolute;
top: 50%;
width: 24rem;
border-radius: 0.3rem;
}
-.modal-content h2 {
+
+#btn-settings-close {
+ font-weight: bold;
+ text-align: center;
+ border: 0;
+}
+
+.modal-content h1 {
margin: 0px;
font-weight: bold;
font-size: large;
}
+
.modal-button {
float: right;
width: 1.5rem;
transition: visibility 0s linear 0s, opacity 0.25s 0s, transform 0.25s;
}
+.modal-content > div:not(:last-child) {
+ margin-bottom: 1ex;
+}
+
+.span-range {
+ display:block;
+ text-align:center;
+}
+
+.span-range > span {
+ font-size:smaller;
+}
+
+.span-range > span, .span-range > input {
+ display:inline-block;
+ vertical-align: middle;
+}
+
.alert {
z-index: 2;
}
-#btn-settings {
+#panel #btn-settings {
background:lightgray;
color:black;
font-size:small;
align-items:center;
}
-#next-help-msg {
+button#next-help-msg {
border:0;
background:none;
color:#333;
padding:0;
}
-#next-help-msg:hover {
+button#next-help-msg:hover {
background:#CCC;
}
}
function showSettings() {
- document.querySelector(".modal").classList.add("show-modal");
+ const modal = document.querySelector(".modal");
+ modal.classList.add("show-modal");
+ modal.querySelector("button").focus();
}
function hideSettings() {
document.getElementById("btn-settings").onclick = showSettings;
document.getElementById("btn-settings-close").onclick = hideSettings;
document.getElementById("next-help-msg").onclick = nextHelpMessage;
- document.body.addEventListener("keydown", function (e) {
+ window.addEventListener("keydown", function (e) {
if (e.key === 'Escape') {
document.querySelector(".modal").classList.remove("show-modal");
}