From 6a0df8a49a63bb57e4eed79341dd0ca82c3cda67 Mon Sep 17 00:00:00 2001 From: Gregory Wells Date: Sun, 14 Jun 2026 09:46:55 -0400 Subject: [PATCH] change cursor for anchors --- static/javascript/resize_photo_dialouge.js | 12 ++++++++++++ static/profile_page.css | 17 ++++++++++++++++- 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/static/javascript/resize_photo_dialouge.js b/static/javascript/resize_photo_dialouge.js index 5aa7497..48feb81 100644 --- a/static/javascript/resize_photo_dialouge.js +++ b/static/javascript/resize_photo_dialouge.js @@ -39,7 +39,10 @@ resize_photo_box.addEventListener("mousedown", () => { set_cursor_state(CURSOR_GRABBING); }); +let unclickedMouse = false; resize_photo_box.addEventListener("mouseup", () => { + if (!unclickedMouse) return; + unclickedMouse = false; offsets = calculateOffsets(); startXOffset = offsets.x; @@ -47,6 +50,15 @@ resize_photo_box.addEventListener("mouseup", () => { }); document.body.addEventListener("mouseup", () => { + if (mouseClicked) unclickedMouse = true; mouseClicked = false; set_cursor_state(CURSOR_NORMAL); }); + +// handle anchors +resize_anchors = document.getElementsByClassName("resize_anchor"); +for (var i = 0; i < resize_anchors.length; i++) { + resize_anchors[i].addEventListener("mousedown", (e) => { + e.stopPropagation(); + }); +} diff --git a/static/profile_page.css b/static/profile_page.css index 9fcf208..8fd1351 100644 --- a/static/profile_page.css +++ b/static/profile_page.css @@ -205,21 +205,36 @@ width: 20px; height: 20px; position: absolute; - pointer-events: none; } #top_left_resize { transform: translateX(-50%) translateY(-50%); } +#top_left_resize:hover { + cursor: nw-resize !important; +} + #top_right_resize { transform: translateX(340px) translateY(-50%); } +#top_right_resize:hover { + cursor: ne-resize !important; +} + #bottom_left_resize { transform: translateY(340px) translateX(-50%); } +#bottom_left_resize:hover { + cursor: sw-resize !important; +} + #bottom_right_resize { transform: translateX(340px) translateY(340px); } + +#bottom_right_resize:hover { + cursor: se-resize !important; +}