|
| 1 | +<template> |
| 2 | + <div class="flex h-screen w-full select-none overflow-hidden"> |
| 3 | + <div class="relative flex w-full flex-col items-center justify-center gap-5 p-8"> |
| 4 | + <BackgroundGradients class="absolute top-0 left-0 h-full w-full" /> |
| 5 | + <div data-tauri-drag-region class="absolute top-0 right-0 bottom-0 left-0 z-0"></div> |
| 6 | + |
| 7 | + <div data-tauri-drag-region class="relative z-10 flex flex-col items-center"> |
| 8 | + <IconGhost :width="72" :height="72" /> |
| 9 | + <h1 class="mt-3 text-2xl font-bold text-gray-800">Syft Space</h1> |
| 10 | + </div> |
| 11 | + |
| 12 | + <div data-tauri-drag-region class="relative z-10 flex flex-col items-center gap-1 text-center text-sm text-gray-500"> |
| 13 | + <p>Version {{ version }}</p> |
| 14 | + <p>Built by <span class="font-medium text-gray-700">OpenMined</span></p> |
| 15 | + <a |
| 16 | + href="https://github.com/OpenMined/syft-space" |
| 17 | + class="mt-1 inline-flex items-center gap-1 text-xs text-gray-500 transition-colors hover:text-gray-700" |
| 18 | + > |
| 19 | + <ExternalLink class="h-3 w-3" /> |
| 20 | + github.com/OpenMined/syft-space |
| 21 | + </a> |
| 22 | + </div> |
| 23 | + |
| 24 | + <div class="relative z-10"> |
| 25 | + <button |
| 26 | + class="rounded-md border border-gray-400/50 bg-white/40 px-6 py-1.5 text-sm font-medium text-gray-700 backdrop-blur-sm transition-colors hover:bg-white/60" |
| 27 | + @click="closeWindow" |
| 28 | + > |
| 29 | + Close |
| 30 | + </button> |
| 31 | + </div> |
| 32 | + </div> |
| 33 | + </div> |
| 34 | +</template> |
| 35 | + |
| 36 | +<script setup lang="ts"> |
| 37 | +import { ref, onMounted } from 'vue' |
| 38 | +import { ExternalLink } from 'lucide-vue-next' |
| 39 | +import BackgroundGradients from '@/components/logo/BackgroundGradients.vue' |
| 40 | +import IconGhost from '@/components/logo/IconGhost.vue' |
| 41 | +
|
| 42 | +const version = ref('dev') |
| 43 | +
|
| 44 | +// eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 45 | +const tauri = (window as any).__TAURI__ as |
| 46 | + | { |
| 47 | + core: { invoke: <T>(cmd: string, args?: Record<string, unknown>) => Promise<T> } |
| 48 | + window: { getCurrentWindow: () => { close: () => void } } |
| 49 | + } |
| 50 | + | undefined |
| 51 | +
|
| 52 | +onMounted(async () => { |
| 53 | + if (tauri) { |
| 54 | + try { |
| 55 | + version.value = await tauri.core.invoke<string>('plugin:app|version') |
| 56 | + } catch { |
| 57 | + // keep fallback |
| 58 | + } |
| 59 | + } |
| 60 | +}) |
| 61 | +
|
| 62 | +const closeWindow = () => { |
| 63 | + if (tauri) { |
| 64 | + tauri.window.getCurrentWindow().close() |
| 65 | + } |
| 66 | +} |
| 67 | +</script> |
0 commit comments