word input in color of user whose turn it is

This commit is contained in:
Tristan Schneider 2020-12-10 20:09:21 +01:00
parent c9c3ed7a59
commit 7545e83cfb
2 changed files with 13 additions and 1 deletions

View File

@ -73,7 +73,7 @@ $config_data = json_decode($raw_json_config, false);
<br><br> <br><br>
<form action="./#wordform" method="post" autocomplete="off" id="wordform"> <form action="./#wordform" method="post" autocomplete="off" id="wordform">
<table> <table>
<tr> <td>Nächstes Wort:</td> <td><input type="text" name="submitted"></td> </tr> <tr> <td>Nächstes Wort:</td> <td><input type="text" name="submitted" id="wordinput"></td> </tr>
<tr> <td></td> <td><input type="submit" value="senden"></td> </tr> <tr> <td></td> <td><input type="submit" value="senden"></td> </tr>
</table> </table>
</form> </form>
@ -102,6 +102,13 @@ $config_data = json_decode($raw_json_config, false);
} }
} }
previousTextLength = text.length; previousTextLength = text.length;
// color
var spans = document.querySelector(".sentences").getElementsByTagName("span");
// we expect this to be from the user who's turn it is now (3 users)
var histurnspan = spans[spans.length - 3];
//console.log(histurnspan.getAttribute("style"));
document.getElementById("wordinput").setAttribute("style", histurnspan.getAttribute("style"));
}); });
}); });
} }

View File

@ -19,6 +19,11 @@ a {
color: black; color: black;
} }
#wordinput {
color: black;
background-color: white;
}
table { table {
font-size: inherit; font-size: inherit;
} }