diff --git a/README.md b/README.md index 4c0068f..aa482a4 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,8 @@ Release: - Be able to have multiple "current" strokes per player. In case of bad internet this can happen! * Missing features I do not consider bonus + Player pointers - - Player screens + - Player list + - Follow player - Eraser - Line drawing - Follow player (like Ligma) diff --git a/client/aux.js b/client/aux.js index 332e489..7b81a18 100644 --- a/client/aux.js +++ b/client/aux.js @@ -161,10 +161,21 @@ function HTML(html) { return template.content.firstChild; } -function insert_player_cursor(player_id) { - const color = color_from_u32(player_id); - const cursor = HTML(`
`); - cursor.style.background = color; +function insert_player_cursor(state, player_id) { + const color = random_bright_color_from_seed(parseInt(player_id)); + const path_copy = state.cursor_path.cloneNode(); + path_copy.style.fill = color; + const cursor = HTML(``); document.querySelector('.html-hud').appendChild(cursor); return cursor; } + +async function load_player_cursor_template(state) { + const resp = await fetch('icons/player-cursor.svg'); + const text = await resp.text(); + const parser = new DOMParser(); + const parsed_xml = parser.parseFromString(text, 'image/svg+xml'); + const path = parsed_xml.querySelector('path'); + + state.cursor_path = path; +} diff --git a/client/default.css b/client/default.css index 8833166..bd9507b 100644 --- a/client/default.css +++ b/client/default.css @@ -65,7 +65,6 @@ canvas.mousemoving { position: absolute; width: 16px; height: 16px; - background: red; } .tools-wrapper { diff --git a/client/icons/player-cursor.svg b/client/icons/player-cursor.svg new file mode 100644 index 0000000..e7afe8f --- /dev/null +++ b/client/icons/player-cursor.svg @@ -0,0 +1,54 @@ + + + + diff --git a/client/index.html b/client/index.html index 1d9a745..2723500 100644 --- a/client/index.html +++ b/client/index.html @@ -29,10 +29,6 @@ - -