feat: make windows movable

This commit is contained in:
dusk 2024-11-01 16:19:11 +03:00
parent e1fd76a9c3
commit b92a335e50
Signed by: dusk
SSH Key Fingerprint: SHA256:Abmvag+juovVufZTxyWY8KcVgrznxvBjQpJesv071Aw
3 changed files with 6 additions and 1 deletions

BIN
bun.lockb

Binary file not shown.

View File

@ -40,6 +40,7 @@
"type": "module", "type": "module",
"dependencies": { "dependencies": {
"@atproto/api": "^0.13.12", "@atproto/api": "^0.13.12",
"@neodrag/svelte": "^2.0.6",
"@std/toml": "npm:@jsr/std__toml", "@std/toml": "npm:@jsr/std__toml",
"base64url": "^3.0.1", "base64url": "^3.0.1",
"nanoid": "^5.0.8", "nanoid": "^5.0.8",

View File

@ -1,4 +1,6 @@
<script lang="ts"> <script lang="ts">
import { draggable } from '@neodrag/svelte';
export let title: string | undefined = undefined; export let title: string | undefined = undefined;
export let iconUri: string = ''; export let iconUri: string = '';
export let id: string = ''; export let id: string = '';
@ -22,6 +24,7 @@
</script> </script>
<div <div
use:draggable={{applyUserSelectHack: true, handle: '.window-titlebar'}}
class=" class="
flex flex-col {sticky ? 'md:sticky md:-top-9' : ''} {center ? "mx-auto" : ""} flex flex-col {sticky ? 'md:sticky md:-top-9' : ''} {center ? "mx-auto" : ""}
max-w-screen-md xl:max-w-screen-lg 2xl:max-w-screen-xl min-w-[30ch] lg:min-w-[40ch] w-full md:w-fit [height:fit-content] max-w-screen-md xl:max-w-screen-lg 2xl:max-w-screen-xl min-w-[30ch] lg:min-w-[40ch] w-full md:w-fit [height:fit-content]
@ -33,8 +36,9 @@
{#if title !== undefined} {#if title !== undefined}
<div <div
class=" class="
p-1 border-ralsei-white border-8 window-titlebar p-1 border-ralsei-white border-8
bg-gradient-to-l from-ralsei-pink-neon to-ralsei-black to-75% bg-gradient-to-l from-ralsei-pink-neon to-ralsei-black to-75%
cursor-move
" "
style="border-style: hidden hidden ridge hidden;" style="border-style: hidden hidden ridge hidden;"
> >