Files
EZPPLauncher/src/lib/components/ui/titlebar/titlebar.svelte

66 lines
1.6 KiB
Svelte

<script lang="ts">
import Minimize from "lucide-svelte/icons/minus";
import Close from "lucide-svelte/icons/x";
import Logo from "$assets/logo.png";
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 z-[60] border-b border-theme-800/90">
<div class="mr-auto ms-2 flex flex-row gap-2 items-center text-[1.05rem] font-semibold">
<img src={Logo} alt="EZPP Launcher Logo" class="h-11 w-11 inline-block" />
<span>EZPPLauncher</span>
</div>
<div class="titlebar-button" id="titlebar-minimize">
<Minimize size={18} />
</div>
<div class="titlebar-button close rounded-tr" id="titlebar-close">
<Close size={18} />
</div>
</div>
<style lang="scss">
.titlebar {
height: 50px;
/* background: #040612; */
user-select: none;
display: flex;
justify-content: flex-end;
align-items: center;
position: fixed;
top: 0;
left: 0;
right: 0;
margin-bottom: 10px;
pointer-events: all !important;
}
.titlebar-button {
display: inline-flex;
justify-content: center;
align-items: center;
width: 60px;
height: 100%;
user-select: none;
-webkit-user-select: none;
}
.titlebar-button:hover {
&.close {
background: #c22e2e;
}
background: #2d3049;
}
</style>