authentication.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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
  16. class="bg-background flex min-h-full flex-1 select-none overflow-x-hidden"
  17. >
  18. <AuthenticationFromView
  19. v-if="authPanelLeft"
  20. class="-enter-x min-h-full w-2/5"
  21. transition-name="slide-left"
  22. />
  23. <div class="absolute left-0 top-0 z-10 flex flex-1">
  24. <div
  25. :class="
  26. authPanelLeft || authPanelCenter
  27. ? 'lg:text-foreground'
  28. : 'lg:text-white'
  29. "
  30. class="text-foreground ml-4 mt-4 flex flex-1 items-center sm:left-6 sm:top-6"
  31. >
  32. <img
  33. :alt="appName"
  34. :src="preferences.logo.source"
  35. :width="42"
  36. class="mr-2"
  37. />
  38. <p class="text-xl font-medium">
  39. {{ appName }}
  40. </p>
  41. </div>
  42. </div>
  43. <div v-if="!authPanelCenter" class="relative hidden w-0 flex-1 lg:block">
  44. <div
  45. class="absolute inset-0 h-full w-full bg-[var(--color-authentication)]"
  46. >
  47. <div class="flex-col-center -enter-x mr-20 h-full">
  48. <SloganIcon :alt="appName" class="animate-float h-64 w-2/5" />
  49. <div class="text-1xl mt-6 font-sans text-white lg:text-2xl">
  50. {{ $t('authentication.layout-title') }}
  51. </div>
  52. <div class="dark:text-muted-foreground mt-2 text-white/60">
  53. {{ $t('authentication.layout-desc') }}
  54. </div>
  55. </div>
  56. </div>
  57. </div>
  58. <div
  59. v-if="authPanelCenter"
  60. class="flex-center w-full dark:bg-[var(--color-authentication)]"
  61. >
  62. <AuthenticationFromView
  63. 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"
  64. >
  65. <template #toolbar>
  66. <Toolbar class="bg-muted" />
  67. </template>
  68. </AuthenticationFromView>
  69. </div>
  70. <AuthenticationFromView
  71. v-if="authPanelRight"
  72. class="enter-x min-h-full w-2/5 flex-1"
  73. />
  74. </div>
  75. </template>