admin-vben5/packages/business/layouts/src/authentication/authentication.vue

87 lines
2.4 KiB
Vue
Raw Normal View History

2024-05-19 21:20:42 +08:00
<script setup lang="ts">
2024-06-01 23:15:29 +08:00
import { preferences, usePreferences } from '@vben-core/preferences';
2024-05-19 21:20:42 +08:00
import { $t } from '@vben/locales';
2024-06-01 23:15:29 +08:00
import { computed } from 'vue';
2024-05-19 21:20:42 +08:00
import AuthenticationFromView from './from-view.vue';
import SloganIcon from './icons/slogan.vue';
import Toolbar from './toolbar.vue';
defineOptions({
name: 'Authentication',
});
2024-06-01 23:15:29 +08:00
const { authPanelCenter, authPanelLeft, authPanelRight } = usePreferences();
const appName = computed(() => preferences.app.name);
2024-05-19 21:20:42 +08:00
</script>
<template>
2024-05-28 23:38:36 +08:00
<div
class="bg-background flex min-h-full flex-1 select-none overflow-x-hidden"
>
2024-05-19 21:20:42 +08:00
<AuthenticationFromView
v-if="authPanelLeft"
2024-05-28 23:38:36 +08:00
class="min-h-full w-2/5"
2024-05-19 21:20:42 +08:00
transition-name="slide-left"
/>
<div class="absolute left-0 top-0 z-10 flex flex-1">
<div
2024-05-28 23:38:36 +08:00
class="text-foreground ml-4 mt-4 flex flex-1 items-center sm:left-6 sm:top-6"
2024-05-19 21:20:42 +08:00
:class="
authPanelLeft || authPanelCenter
? 'lg:text-foreground'
: 'lg:text-white'
"
>
<img
2024-06-01 23:15:29 +08:00
:alt="appName"
:src="preferences.logo.source"
2024-05-19 21:20:42 +08:00
:width="42"
class="mr-2"
/>
<p class="text-xl font-medium">
2024-06-01 23:15:29 +08:00
{{ appName }}
2024-05-19 21:20:42 +08:00
</p>
</div>
</div>
<div v-if="!authPanelCenter" class="relative hidden w-0 flex-1 lg:block">
<div
2024-05-28 23:38:36 +08:00
class="absolute inset-0 h-full w-full bg-[var(--color-authentication)]"
2024-05-19 21:20:42 +08:00
>
2024-05-28 23:53:15 +08:00
<div class="flex-col-center mr-20 h-full">
2024-06-01 23:15:29 +08:00
<SloganIcon :alt="appName" class="animate-float h-64 w-2/5" />
2024-05-28 23:38:36 +08:00
<div class="text-1xl mt-6 font-sans text-white lg:text-2xl">
2024-05-19 21:20:42 +08:00
{{ $t('authentication.layout-title') }}
</div>
2024-05-28 23:38:36 +08:00
<div class="dark:text-muted-foreground mt-2 text-white/60">
2024-05-19 21:20:42 +08:00
{{ $t('authentication.layout-desc') }}
</div>
</div>
</div>
</div>
<div
v-if="authPanelCenter"
2024-05-28 23:38:36 +08:00
class="flex-center w-full dark:bg-[var(--color-authentication)]"
2024-05-19 21:20:42 +08:00
>
<AuthenticationFromView
class="enter-y md:bg-background w-full rounded-3xl pb-20 shadow-2xl md:w-2/3 lg:w-1/2 xl:w-2/5"
>
<template #toolbar>
<Toolbar class="bg-muted" />
</template>
</AuthenticationFromView>
</div>
<AuthenticationFromView
v-if="authPanelRight"
2024-05-28 23:38:36 +08:00
class="min-h-full w-2/5 flex-1"
2024-05-19 21:20:42 +08:00
/>
</div>
</template>
<!-- background-image: radial-gradient(
rgba(255, 255, 255, 0.1) 1px,
transparent 1px
); -->