| 1 | <template> |
| 2 | <div class="page-auth"> |
| 3 | <div v-if="!isLogged" class="wrapper flex justify-center"> |
| 4 | <div v-if="align === 'right'" class="image-box basis-2/3" /> |
| 5 | <div class="form-box flex basis-1/3 items-center justify-center" :class="{ centered: align === 'center' }"> |
| 6 | <AuthForm :type /> |
| 7 | </div> |
| 8 | <div v-if="align === 'left'" class="image-box basis-2/3"></div> |
| 9 | </div> |
| 10 | </div> |
| 11 | </template> |
| 12 | |
| 13 | <script lang="ts" setup> |
| 14 | import type { FormType } from "@/components/auth/types" |
| 15 | import { computed, onBeforeMount, ref, toRefs } from "vue" |
| 16 | import { useRoute } from "vue-router" |
| 17 | import AuthForm from "@/components/auth/AuthForm.vue" |
| 18 | import { useAuthStore } from "@/stores/auth" |
| 19 | import { useThemeStore } from "@/stores/theme" |
| 20 | |
| 21 | type Align = "left" | "center" | "right" |
| 22 | |
| 23 | const props = defineProps<{ |
| 24 | formType?: FormType |
| 25 | }>() |
| 26 | const { formType } = toRefs(props) |
| 27 | |
| 28 | const route = useRoute() |
| 29 | const align = ref<Align>("left") |
| 30 | const type = ref<FormType | undefined>(formType.value || undefined) |
| 31 | |
| 32 | const themeStore = useThemeStore() |
| 33 | const activeColor = computed(() => themeStore.style["primary-color"]) |
| 34 | const authStore = useAuthStore() |
| 35 | const isLogged = computed(() => authStore.isLogged) |
| 36 | |
| 37 | onBeforeMount(() => { |
| 38 | if (route.query.step) { |
| 39 | const step = route.query.step as FormType |
| 40 | type.value = step |
| 41 | } |
| 42 | }) |
| 43 | </script> |
| 44 | |
| 45 | <style lang="scss" scoped> |
| 46 | .page-auth { |
| 47 | min-height: 100svh; |
| 48 | |
| 49 | .wrapper { |
| 50 | min-height: 100svh; |
| 51 | |
| 52 | .image-box { |
| 53 | position: relative; |
| 54 | background-color: v-bind(activeColor); |
| 55 | |
| 56 | &::after { |
| 57 | content: ""; |
| 58 | width: 100%; |
| 59 | height: 100%; |
| 60 | position: absolute; |
| 61 | top: 0; |
| 62 | left: 0; |
| 63 | background-image: url(@/assets/images/customer-portal-login.webp); |
| 64 | background-size: cover; |
| 65 | background-position: center center; |
| 66 | } |
| 67 | |
| 68 | /* |
| 69 | video { |
| 70 | position: absolute; |
| 71 | top: 0; |
| 72 | left: 0; |
| 73 | width: 100%; |
| 74 | height: 100%; |
| 75 | object-fit: cover; |
| 76 | object-position: center; |
| 77 | } |
| 78 | */ |
| 79 | } |
| 80 | |
| 81 | .form-box { |
| 82 | padding: 50px; |
| 83 | |
| 84 | &.centered { |
| 85 | flex-basis: 100%; |
| 86 | |
| 87 | .form-wrap { |
| 88 | padding: 60px; |
| 89 | width: 100%; |
| 90 | max-width: 500px; |
| 91 | } |
| 92 | |
| 93 | @media (max-width: 600px) { |
| 94 | padding: 4%; |
| 95 | .form-wrap { |
| 96 | padding: 8%; |
| 97 | } |
| 98 | } |
| 99 | } |
| 100 | } |
| 101 | } |
| 102 | |
| 103 | @media (max-width: 800px) { |
| 104 | .wrapper { |
| 105 | .image-box { |
| 106 | display: none; |
| 107 | } |
| 108 | |
| 109 | .form-box { |
| 110 | flex-basis: 100%; |
| 111 | } |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | </style> |