diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2024-01-21 14:48:35 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2024-01-21 14:48:35 +0100 |
| commit | 587d8fe65d61b8f7217b4e8850b44e43159c16fb (patch) | |
| tree | 8cd7ad359dbe79beff9e8288f97ee1277a3729f0 /src/lib/components/hud.svelte | |
| parent | e4e4b5202bf0039127f591941fddc1ff5ca09897 (diff) | |
Save WIP
Diffstat (limited to 'src/lib/components/hud.svelte')
| -rw-r--r-- | src/lib/components/hud.svelte | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/lib/components/hud.svelte b/src/lib/components/hud.svelte index ffea4de..a115c91 100644 --- a/src/lib/components/hud.svelte +++ b/src/lib/components/hud.svelte @@ -1,29 +1,26 @@ <script> - import { coordinateLength } from '$lib/config'; - import { canvas } from '$lib/stores/canvas'; + import { coordinateLength } from '$lib/config'; + import { canvas } from '$lib/stores/canvas'; - const kSeparatorRegex = /([0-9a-z]{2})/g; + const kSeparatorRegex = /([0-9a-z]{2})/g; - const formatCoordinate = function formatCoordinate(coordinate) { - return coordinate - .toString(16) - .padStart(coordinateLength, 0) - .replace(kSeparatorRegex, '$1 '); - } + const formatCoordinate = function formatCoordinate(coordinate) { + return coordinate.toString(16).padStart(coordinateLength, 0).replace(kSeparatorRegex, '$1 '); + }; </script> <div class="hud"> - { formatCoordinate($canvas.x) } × { formatCoordinate($canvas.y) } + {formatCoordinate($canvas.x)} × {formatCoordinate($canvas.y)} </div> <style> - .hud { - background-color: #fff; - padding: 4px; - position: fixed; - bottom: 2px; - right: 2px; - font-smooth: never; - -webkit-font-smoothing : none; - } + .hud { + background-color: #fff; + padding: 4px; + position: fixed; + bottom: 2px; + right: 2px; + font-smooth: never; + -webkit-font-smoothing: none; + } </style> |