From 477c730cee86fd953ce86e36d5e8369faf1da3b8 Mon Sep 17 00:00:00 2001 From: TerraMaster85 Date: Sat, 6 Jan 2024 18:48:00 -0500 Subject: [PATCH] Format --- .../src/components/ui/Popup.svelte | 20 +++--- .../src/icons/MovableIcon.svelte | 70 +++++++++---------- 2 files changed, 44 insertions(+), 46 deletions(-) diff --git a/starkingdoms-client/src/components/ui/Popup.svelte b/starkingdoms-client/src/components/ui/Popup.svelte index 5bf1557c87cec5af67dc93756c12f48c77a8d232..b3ba3d848fb8add73a43cb2d52af597c397512ea 100644 --- a/starkingdoms-client/src/components/ui/Popup.svelte +++ b/starkingdoms-client/src/components/ui/Popup.svelte @@ -5,7 +5,7 @@ import ChevronUp from "../../icons/ChevronUp.svelte"; import Button from "./Button.svelte"; import createDebug from "debug"; - + let clazz = ""; export { clazz as class }; @@ -31,9 +31,9 @@ if (draggable) { pos1 = parseInt(window.localStorage.getItem(`pop-${id}top`)); pos2 = parseInt(window.localStorage.getItem(`pop-${id}left`)); - + // Correct illegally placed draggables - [pos1, pos2, ] = dragBoundsEnforce(); + [pos1, pos2] = dragBoundsEnforce(); // I hate JS for letting me pull crap like this popup.style.top = `${pos1}px`; @@ -76,15 +76,15 @@ let top = pos2; let popup_dimensions = popup.getBoundingClientRect(); - + let snap_distance = 16; let bounds = { - "top": 8 + snap_distance, - "left": 8 + snap_distance, - "bottom": window.innerHeight - popup_dimensions.height - 8 - snap_distance, - "right": window.innerWidth - popup_dimensions.width - 8 - snap_distance - } - + top: 8 + snap_distance, + left: 8 + snap_distance, + bottom: window.innerHeight - popup_dimensions.height - 8 - snap_distance, + right: window.innerWidth - popup_dimensions.width - 8 - snap_distance, + }; + let bounds_violated = false; // Add cases for snapping here diff --git a/starkingdoms-client/src/icons/MovableIcon.svelte b/starkingdoms-client/src/icons/MovableIcon.svelte index 04d15d4dc304fa38f35bbb1349f124e9baf38179..ac9474dd9d4d6f6939c94e6fca6fb7116d853a44 100644 --- a/starkingdoms-client/src/icons/MovableIcon.svelte +++ b/starkingdoms-client/src/icons/MovableIcon.svelte @@ -4,47 +4,45 @@ - - + width="1rem" + height="1rem" + viewBox="0 0 32 32" + version="1.1" + id="svg1" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + + + id="rect1-5" + style="fill:#ffffff;fill-opacity:1;stroke-width:0" + d="M 6,22 0,16 6,10 Z" /> + id="rect1-5-6" + style="fill:#ffffff;fill-opacity:1;stroke-width:0" + d="M 10,6 16,0 22,6 Z" /> + id="rect1-5-61" + style="fill:#ffffff;fill-opacity:1;stroke-width:0" + d="M 26,10 32,16 26,22 Z" /> + id="rect1-5-2" + style="fill:#ffffff;fill-opacity:1;stroke-width:0" + d="M 22,26 16,32 10,26 Z" /> + style="fill:#ffffff;fill-opacity:1;stroke-width:0" + id="rect1" + width="4" + height="24" + x="14" + y="4" /> + style="fill:#ffffff;fill-opacity:1;stroke-width:0" + id="rect1-7" + width="4" + height="24" + x="14" + y="-28" + transform="rotate(90)" />