add color picker for username color

TODO: style properly
main
maia arson crimew 2022-01-18 13:06:57 +01:00
parent 244145696c
commit 1944b2824c
2 changed files with 3 additions and 5 deletions

View File

@ -32,11 +32,9 @@
<label for="join-session-colour">Colour:</label> <label for="join-session-colour">Colour:</label>
<input <input
type="text" type="color"
id="join-session-colour" id="join-session-colour"
placeholder="7ed0ff" value="#7ed0ff"
value="7ed0ff"
pattern="[a-fA-F\d]{6}"
required required
/> />

View File

@ -79,6 +79,6 @@ export const setupJoinSessionForm = () => {
saveNickname(nickname); saveNickname(nickname);
saveColour(colour); saveColour(colour);
joinSession(nickname.value, sessionId.value, colour.value); joinSession(nickname.value, sessionId.value, colour.value.replace(/^#/, ""));
}); });
}; };