diff --git a/static/cursor.css b/static/cursor.css new file mode 100644 index 0000000..ab2179d --- /dev/null +++ b/static/cursor.css @@ -0,0 +1,3 @@ +.cursor_grabbing { + cursor: grabbing; +} diff --git a/static/javascript/cursor.js b/static/javascript/cursor.js index a77ea19..c041f80 100644 --- a/static/javascript/cursor.js +++ b/static/javascript/cursor.js @@ -6,3 +6,15 @@ document.addEventListener("mousemove", (e) => { currentX = e.clientX; currentY = e.clientY; }); + +const CURSOR_NORMAL = "cursor_normal"; +const CURSOR_GRABBING = "cursor_grabbing"; + +document.body.classList.remove(CURSOR_NORMAL); + +let current_cursor_state = CURSOR_NORMAL; +function set_cursor_state(new_cursor_state) { + document.body.classList.remove(current_cursor_state); + document.body.classList.add(new_cursor_state); + current_cursor_state = new_cursor_state; +}