2024-04-26 07:54:02 +02:00
|
|
|
<template>
|
2024-11-30 00:58:04 +01:00
|
|
|
<Sidebar>
|
2024-12-07 18:26:52 +01:00
|
|
|
<slot v-if="!route.meta.requiresAuth || identity" />
|
|
|
|
|
<Card v-else class="shadow-none bg-transparent border-none p-4 max-w-md mx-auto">
|
|
|
|
|
<CardHeader class="text-center gap-y-4">
|
2024-12-07 22:17:22 +01:00
|
|
|
<CardTitle>{{ m.sunny_quick_lionfish_flip() }}</CardTitle>
|
2024-12-07 18:26:52 +01:00
|
|
|
<CardDescription>
|
2024-12-07 22:17:22 +01:00
|
|
|
{{ m.brave_known_pelican_drip() }}
|
2024-12-07 18:26:52 +01:00
|
|
|
</CardDescription>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardFooter>
|
|
|
|
|
<Button variant="secondary" class="w-full" @click="signInAction">
|
2024-12-07 22:17:22 +01:00
|
|
|
{{ m.fuzzy_sea_moth_absorb() }}
|
2024-12-07 18:26:52 +01:00
|
|
|
</Button>
|
|
|
|
|
</CardFooter>
|
|
|
|
|
</Card>
|
2024-11-30 00:58:04 +01:00
|
|
|
</Sidebar>
|
2024-12-26 14:34:59 +01:00
|
|
|
<MobileNavbar v-if="identity" />
|
2024-11-30 19:15:23 +01:00
|
|
|
<ComposerDialog />
|
2024-04-26 07:54:02 +02:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
2024-11-30 19:15:23 +01:00
|
|
|
import ComposerDialog from "~/components/composer/dialog.vue";
|
2024-12-09 16:52:04 +01:00
|
|
|
import MobileNavbar from "~/components/navigation/mobile-navbar.vue";
|
2024-11-30 00:58:04 +01:00
|
|
|
import Sidebar from "~/components/sidebars/sidebar.vue";
|
2024-12-07 18:26:52 +01:00
|
|
|
import { Button } from "~/components/ui/button";
|
|
|
|
|
import {
|
|
|
|
|
Card,
|
|
|
|
|
CardDescription,
|
|
|
|
|
CardFooter,
|
|
|
|
|
CardHeader,
|
|
|
|
|
CardTitle,
|
|
|
|
|
} from "~/components/ui/card";
|
2024-12-07 22:17:22 +01:00
|
|
|
import * as m from "~/paraglide/messages.js";
|
2024-12-15 16:16:16 +01:00
|
|
|
import { SettingIds } from "~/settings";
|
2024-04-26 07:54:02 +02:00
|
|
|
|
2024-12-07 18:26:52 +01:00
|
|
|
const appData = useAppData();
|
2025-01-29 04:39:33 +01:00
|
|
|
const signInAction = () => signIn(appData, new URL(useBaseUrl().value));
|
2024-12-25 17:39:22 +01:00
|
|
|
const colorMode = useColorMode();
|
|
|
|
|
const themeSetting = useSetting(SettingIds.Theme);
|
|
|
|
|
const { n, d } = useMagicKeys();
|
2024-06-19 08:16:28 +02:00
|
|
|
const activeElement = useActiveElement();
|
|
|
|
|
const notUsingInput = computed(
|
|
|
|
|
() =>
|
|
|
|
|
activeElement.value?.tagName !== "INPUT" &&
|
2024-12-25 18:51:52 +01:00
|
|
|
activeElement.value?.tagName !== "TEXTAREA" &&
|
|
|
|
|
activeElement.value?.contentEditable !== "true",
|
2024-06-19 08:16:28 +02:00
|
|
|
);
|
2024-04-28 07:02:27 +02:00
|
|
|
|
2024-12-15 16:16:16 +01:00
|
|
|
const backgroundImage = useSetting(SettingIds.BackgroundURL);
|
|
|
|
|
const canParseUrl = URL.canParse;
|
|
|
|
|
|
2024-12-07 18:26:52 +01:00
|
|
|
const route = useRoute();
|
|
|
|
|
|
2024-12-25 18:51:52 +01:00
|
|
|
watch([n, notUsingInput, d], async () => {
|
2024-06-19 08:16:28 +02:00
|
|
|
if (n?.value && notUsingInput.value) {
|
2024-05-12 06:34:03 +02:00
|
|
|
// Wait 50ms
|
|
|
|
|
await new Promise((resolve) => setTimeout(resolve, 50));
|
2024-04-28 07:02:27 +02:00
|
|
|
useEvent("composer:open");
|
|
|
|
|
}
|
2024-12-25 17:39:22 +01:00
|
|
|
|
2024-12-25 18:51:52 +01:00
|
|
|
if (d?.value && notUsingInput.value && !colorMode.forced) {
|
2024-12-25 17:39:22 +01:00
|
|
|
// Swap theme from dark to light or vice versa
|
|
|
|
|
if (colorMode.value === "dark") {
|
|
|
|
|
colorMode.preference = "light";
|
|
|
|
|
themeSetting.value.value = "light";
|
|
|
|
|
} else {
|
|
|
|
|
colorMode.preference = "dark";
|
|
|
|
|
themeSetting.value.value = "dark";
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-04-28 07:02:27 +02:00
|
|
|
});
|
2024-12-25 17:39:22 +01:00
|
|
|
</script>
|