This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
CrunchyDL/components/MainHeader.vue

66 lines
2.3 KiB
Vue
Raw Normal View History

2024-04-16 20:20:30 +02:00
<template>
<div class="fixed w-full flex flex-row bg-[#111111] h-16 z-10" style="-webkit-app-region: drag">
2024-04-16 20:20:30 +02:00
<div class="w-full flex gap-10 flex-row items-center justify-center px-">
<button @click="openAddAnime" class="px-6 py-0.5 border-2 border-[#ce6104] rounded-xl" style="-webkit-app-region: no-drag">
<Icon name="ph:plus-bold" class="h-7 w-7 text-[#ce6104]" />
</button>
<button class="px-6 py-0.5 border-2 border-[#ce6104] rounded-xl" style="-webkit-app-region: no-drag">
<Icon name="material-symbols:globe" class="h-7 w-7 text-[#ce6104]" />
</button>
</div>
<div class="w-full flex flex-row items-center justify-center">
<div class="text-2xl text-white select-none">Crunchyroll Downloader</div>
</div>
<div class="w-full flex gap-4 flex-row items-center justify-start px-5">
<button class="px-6 py-0.5 border-2 border-[#ce6104] rounded-xl" style="-webkit-app-region: no-drag">
<Icon name="iconamoon:playlist" class="h-7 w-7 text-[#ce6104]" />
</button>
<button @click="openSettings" class="px-6 py-0.5 border-2 border-[#ce6104] rounded-xl" style="-webkit-app-region: no-drag">
<Icon name="ic:round-settings" class="h-7 w-7 text-[#ce6104]" />
</button>
</div>
</div>
</template>
<script lang="ts" setup>
import { checkAccount, crunchyLogin } from './Crunchyroll/Account'
import { openNewWindow } from './Functions/WindowHandler'
const isProduction = process.env.NODE_ENV !== 'development'
async function openSettings() {
(window as any).myAPI.openWindow({
title: "Settings",
url: isProduction ? 'http://localhost:8079/settings' : 'http://localhost:3000/settings',
width: 600,
height: 700,
backgroundColor: "#111111"
})
}
async function openAddAnime() {
const { data, error } = await checkAccount()
if (error.value) {
(window as any).myAPI.openWindow({
title: "Crunchyroll Login",
url: isProduction ? 'http://localhost:8079/crunchylogin' : 'http://localhost:3000/crunchylogin',
width: 600,
height: 300,
backgroundColor: "#111111"
})
return
}
(window as any).myAPI.openWindow({
title: "Add Anime",
url: isProduction ? 'http://localhost:8079/addanime' : 'http://localhost:3000/addanime',
width: 700,
height: 450,
2024-04-16 20:20:30 +02:00
backgroundColor: "#111111"
})
}
</script>
<style></style>