authentication.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <script setup lang="ts">
  2. import { computed } from 'vue';
  3. import { $t } from '@vben/locales';
  4. import { preferences, usePreferences } from '@vben-core/preferences';
  5. import AuthenticationFromView from './from-view.vue';
  6. import SloganIcon from './icons/slogan.vue';
  7. import Toolbar from './toolbar.vue';
  8. defineOptions({
  9. name: 'Authentication',
  10. });
  11. const { authPanelCenter, authPanelLeft, authPanelRight } = usePreferences();
  12. const appName = computed(() => preferences.app.name);
  13. </script>
  14. <template>
  15. <div class="flex min-h-full flex-1 select-none overflow-x-hidden">
  16. <AuthenticationFromView
  17. v-if="authPanelLeft"
  18. class="-enter-x min-h-full w-2/5"
  19. transition-name="slide-left"
  20. />
  21. <div class="absolute left-0 top-0 z-10 flex flex-1">
  22. <div
  23. :class="
  24. authPanelLeft || authPanelCenter
  25. ? 'lg:text-foreground'
  26. : 'lg:text-white'
  27. "
  28. class="text-foreground ml-4 mt-4 flex flex-1 items-center sm:left-6 sm:top-6"
  29. >
  30. <img
  31. :alt="appName"
  32. :src="preferences.logo.source"
  33. :width="42"
  34. class="mr-2"
  35. />
  36. <p class="text-xl font-medium">
  37. {{ appName }}
  38. </p>
  39. </div>
  40. </div>
  41. <div v-if="!authPanelCenter" class="relative hidden w-0 flex-1 lg:block">
  42. <div class="bg-authentication absolute inset-0 h-full w-full">
  43. <div class="flex-col-center -enter-x mr-20 h-full">
  44. <SloganIcon :alt="appName" class="animate-float h-64 w-2/5" />
  45. <div class="text-1xl mt-6 font-sans text-white lg:text-2xl">
  46. {{ $t('authentication.page-title') }}
  47. </div>
  48. <div class="dark:text-muted-foreground mt-2 text-white/60">
  49. {{ $t('authentication.page-desc') }}
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <div v-if="authPanelCenter" class="flex-center bg-authentication w-full">
  55. <AuthenticationFromView
  56. 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"
  57. >
  58. <template #toolbar>
  59. <Toolbar class="bg-muted" />
  60. </template>
  61. </AuthenticationFromView>
  62. </div>
  63. <AuthenticationFromView
  64. v-if="authPanelRight"
  65. class="enter-x min-h-full w-2/5 flex-1"
  66. />
  67. </div>
  68. </template>