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