From 5a4eda81f07f6324fc78452823afb6764d819dd7 Mon Sep 17 00:00:00 2001 From: Laurent Mazet Date: Tue, 15 Sep 2020 22:35:47 +0200 Subject: [PATCH] help messages change every 10s --- public/index.html | 2 +- public/trivabble.css | 11 ++++++++++- public/trivabble.js | 21 +++++++++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) diff --git a/public/index.html b/public/index.html index d57dc94..15b87bf 100644 --- a/public/index.html +++ b/public/index.html @@ -78,7 +78,7 @@ ParticipantRackScoreTurn Waiting for other participants… -
+

Click on the bag to take one tile.

Click on someone's score to change it.

Who's turn? Click on the Turn button!

diff --git a/public/trivabble.css b/public/trivabble.css index f29f610..990c949 100644 --- a/public/trivabble.css +++ b/public/trivabble.css @@ -47,7 +47,7 @@ html, #board, [draggable], .tile { color: green; } -#clear-game, #help-message, #clear-rack { +#clear-game, #clear-rack { white-space:pre-wrap; } @@ -562,3 +562,12 @@ td.blink { #info-spell-checking a { color:black; } + +#help-messages { + border:1px solid silver; + box-sizing:border-box; + overflow:auto; + width: 20em; + margin-bottom:1px; + height:5em; +} diff --git a/public/trivabble.js b/public/trivabble.js index 2be3b7d..d378966 100644 --- a/public/trivabble.js +++ b/public/trivabble.js @@ -1953,6 +1953,27 @@ } } + function changeHelpMessage() { + if (typeof changeHelpMessage.index === "undefined") { + changeHelpMessage.index = -1; + } + + const helpMessages = document.getElementById("help-messages"); + if (helpMessages) { + const listOfMessages = helpMessages.getElementsByTagName("p"); + if ((changeHelpMessage.index >= 0) && (changeHelpMessage.index