add shadcn-svelte, add custom titlebar

This commit is contained in:
2024-12-10 10:08:23 +01:00
parent 99062d6bc8
commit 7b8ff2636c
23 changed files with 1221 additions and 208 deletions

View File

@@ -0,0 +1,57 @@
<script lang="ts">
import Minimize from "lucide-svelte/icons/minus";
import Close from "lucide-svelte/icons/x";
import { getCurrentWindow } from "@tauri-apps/api/window";
import { onMount } from "svelte";
onMount(() => {
const appWindow = getCurrentWindow();
document
.getElementById("titlebar-minimize")
?.addEventListener("click", () => appWindow.minimize());
document
.getElementById("titlebar-close")
?.addEventListener("click", () => appWindow.close());
});
</script>
<div data-tauri-drag-region class="titlebar">
<div class="titlebar-button" id="titlebar-minimize">
<Minimize size={14} />
</div>
<div class="titlebar-button close" id="titlebar-close">
<Close size={14} />
</div>
</div>
<style lang="scss">
.titlebar {
height: 30px;
background: #040612;
user-select: none;
display: flex;
justify-content: flex-end;
position: fixed;
top: 0;
left: 0;
right: 0;
margin-bottom: 10px;
}
.titlebar-button {
display: inline-flex;
justify-content: center;
align-items: center;
width: 35px;
height: 25px;
user-select: none;
-webkit-user-select: none;
}
.titlebar-button:hover {
&.close {
background: #c22e2e;
}
background: #2d3049;
}
</style>