<span data-l10n="text-content">Configuration window</span>
<span class="modal-button" id="modal-close-btn">×</span>
</h2>
- <div id="prefs-sound">
+ <div id="prefs">
<p><label><input type="checkbox" id="tiles-sound" checked="checked" /><span data-l10n="text-content">Sound of the tiles</span></label></p>
<p><label><input type="checkbox" id="msg-sound" checked="checked" /><span data-l10n="text-content">Sound of messages</span></label></p>
</div>
+ <hr/>
+ <div id="prefs">
+ <p><label>
+ <input type="number" size="4" min="500" max="5000" step="100" id="double-tap-duration"/>
+ <span data-l10n="text-content">Double tap duration</span>
+ <span data-l10n="text-content">(ms)</span>
+ </label></p>
+ <p><label>
+ <input type="number" size="4" min="500" max="5000" step="100" id="flash-light-duration"/>
+ <span data-l10n="text-content">Flash light duration</span>
+ <span data-l10n="text-content">(ms)</span>
+ </label></p>
+ </div>
</div>
</div>
return;
}
if (e.type === "touchstart") {
- if ((highlightTile.id !== id) || (Date.now() - highlightTile.date > Conf.DOUBLE_TAP_DURATION)) {
+ if ((highlightTile.id !== id) || (Date.now() - highlightTile.date > localStorage.doubleTapDuration)) {
highlightTile.id = id;
highlightTile.date = Date.now();
return;
setTimeout(
function (x) {
x.classList.remove("highlight");
- }, Conf.FLASH_LIGHT_DURATION*1/3, placeholder);
+ }, localStorage.flashLightDuration*1/3, placeholder);
setTimeout(
function (x) {
x.classList.add("highlight");
- }, Conf.FLASH_LIGHT_DURATION*1/2, placeholder);
+ }, localStorage.flashLightDuration*1/2, placeholder);
setTimeout(
function (x) {
x.classList.remove("highlight");
- }, Conf.FLASH_LIGHT_DURATION*2/3, placeholder);
+ }, localStorage.flashLightDuration*2/3, placeholder);
setTimeout(
function (x) {
x.classList.add("highlight");
- }, Conf.FLASH_LIGHT_DURATION*5/6, placeholder);
+ }, localStorage.flashLightDuration*5/6, placeholder);
setTimeout(
function (x) {
x.classList.remove("highlight");
- }, Conf.FLASH_LIGHT_DURATION*1, placeholder);
+ }, localStorage.flashLightDuration*1, placeholder);
}
function initChat() {
}
}
+ function initLaserPointer() {
+
+ if (!Object.prototype.hasOwnProperty.call(localStorage, "doubleTapDuration")) {
+ localStorage.doubleTapDuration = Conf.DOUBLE_TAP_DURATION;
+ }
+ const doubleTapDuration = document.getElementById("double-tap-duration");
+ if (doubleTapDuration) {
+ doubleTapDuration.value = localStorage.doubleTapDuration;
+ doubleTapDuration.onchange = function () {
+ localStorage.doubleTapDuration =
+ document.getElementById("double-tap-duration").value;
+ }
+ }
+
+ if (!Object.prototype.hasOwnProperty.call(localStorage, "flashLightDuration")) {
+ localStorage.flashLightDuration = Conf.FLASH_LIGHT_DURATION;
+ }
+ const flashLightDuration = document.getElementById("flash-light-duration");
+ if (flashLightDuration) {
+ flashLightDuration.value = localStorage.flashLightDuration;
+ flashLightDuration.onchange = function () {
+ localStorage.flashLightDuration =
+ document.getElementById("flash-light-duration").value;
+ }
+ }
+ }
+
function repromptName(f) {
if (localStorage.trivabblePlayerName && localStorage.trivabblePlayerName.trim()) {
f();
initChat();
initGame();
initSound();
+ initLaserPointer();
};
trivabble.l10nError = trivabble.run;