|
3 | 3 | <div class="absolute inset-0"> |
4 | 4 | <img :src="backgroundImage" alt="background gradient" class="h-full w-full object-cover" /> |
5 | 5 | </div> |
6 | | - <div |
7 | | - :class="`bg-[url(${mapBackgroundImage})]`" |
8 | | - class="relative flex min-h-screen items-center justify-center bg-cover bg-center bg-no-repeat px-6 py-10 dark:bg-[#060818] sm:px-16" |
9 | | - > |
10 | | - <img :src="comingSoonObject1" alt="coming soon object 1" class="absolute left-0 top-1/2 h-full max-h-[893px] -translate-y-1/2" /> |
11 | | - <img :src="comingSoonObject2" alt="coming soon object 2" class="absolute left-24 top-0 h-40 md:left-[30%]" /> |
| 6 | + <div :class="`bg-[url(${mapBackgroundImage})]`" |
| 7 | + class="relative flex min-h-screen items-center justify-center bg-cover bg-center bg-no-repeat px-6 py-10 dark:bg-[#060818] sm:px-16"> |
| 8 | + <img :src="comingSoonObject1" alt="coming soon object 1" |
| 9 | + class="absolute left-0 top-1/2 h-full max-h-[893px] -translate-y-1/2" /> |
| 10 | + <img :src="comingSoonObject2" alt="coming soon object 2" |
| 11 | + class="absolute left-24 top-0 h-40 md:left-[30%]" /> |
12 | 12 | <img :src="comingSoonObject3" alt="coming soon object 3" class="absolute right-0 top-0 h-[300px]" /> |
13 | 13 | <img :src="polygonObject" alt="polygon object" class="absolute bottom-0 end-[28%]" /> |
14 | 14 | <div |
15 | | - class="relative flex w-full max-w-[1502px] flex-col justify-between overflow-hidden rounded-md bg-white/60 backdrop-blur-lg dark:bg-black/50 lg:min-h-[700px] lg:flex-row lg:gap-10 xl:gap-0" |
16 | | - > |
| 15 | + class="relative flex w-full max-w-[1502px] flex-col justify-between overflow-hidden rounded-md bg-white/60 backdrop-blur-lg dark:bg-black/50 lg:min-h-[700px] lg:flex-row lg:gap-10 xl:gap-0"> |
17 | 16 | <div |
18 | | - class="relative hidden w-full items-center justify-center bg-[#220660] p-5 lg:inline-flex lg:max-w-[835px] xl:-ms-28 ltr:xl:skew-x-[14deg] rtl:xl:skew-x-[-14deg]" |
19 | | - > |
| 17 | + class="relative hidden w-full items-center justify-center bg-[#220660] p-5 lg:inline-flex lg:max-w-[835px] xl:-ms-28 ltr:xl:skew-x-[14deg] rtl:xl:skew-x-[-14deg]"> |
20 | 18 | <div |
21 | | - class="absolute inset-y-0 w-8 from-primary/10 via-transparent to-transparent xl:w-16 ltr:-right-10 ltr:bg-gradient-to-r ltr:xl:-right-20 rtl:-left-10 rtl:bg-gradient-to-l rtl:xl:-left-20" |
22 | | - ></div> |
| 19 | + class="absolute inset-y-0 w-8 from-primary/10 via-transparent to-transparent xl:w-16 ltr:-right-10 ltr:bg-gradient-to-r ltr:xl:-right-20 rtl:-left-10 rtl:bg-gradient-to-l rtl:xl:-left-20"> |
| 20 | + </div> |
23 | 21 | <div class="ltr:xl:-skew-x-[14deg] rtl:xl:skew-x-[14deg]"> |
24 | 22 | <div class="w-full"> |
25 | 23 | <img :src="loginCover" alt="Cover Image" class="w-full" /> |
26 | 24 | </div> |
27 | 25 | </div> |
28 | 26 | </div> |
29 | | - <div class="relative flex w-full flex-col items-center justify-center gap-6 px-4 pb-16 pt-6 sm:px-6 lg:max-w-[667px]"> |
| 27 | + <div |
| 28 | + class="relative flex w-full flex-col items-center justify-center gap-6 px-4 pb-16 pt-6 sm:px-6 lg:max-w-[667px]"> |
30 | 29 | <div class="w-full max-w-[440px] lg:mt-16"> |
31 | 30 | <div class="mb-16 lg:mb-40"> |
32 | | - <h1 class="text-3xl font-extrabold uppercase !leading-snug text-primary md:text-4xl">{{ t('auth.signin') }}</h1> |
| 31 | + <h1 class="text-3xl font-extrabold uppercase !leading-snug text-primary md:text-4xl">{{ |
| 32 | + t('auth.signin') }}</h1> |
33 | 33 | <p class="text-base font-bold leading-normal text-white-dark"> |
34 | 34 | Use one of your social accounts to {{ t('auth.signin') }} / {{ t('auth.signup') }}. |
35 | 35 | </p> |
36 | 36 | </div> |
37 | 37 | <form class="space-y-5 dark:text-white" @submit.prevent="router.push('/')"> |
38 | | - <Button |
39 | | - @click="triggerGoogleLoginProcess" |
40 | | - color="gradient" |
41 | | - shadow |
42 | | - uppercase |
43 | | - block |
44 | | - iconName="IconGoogle" |
45 | | - :label="t('auth.signin_with_google')" |
46 | | - /> |
| 38 | + <Button @click="triggerGoogleLoginProcess" color="gradient" shadow uppercase block |
| 39 | + iconName="IconGoogle" :label="t('auth.signin_with_google')" /> |
47 | 40 | </form> |
48 | 41 | <div class="relative my-7 text-center md:mb-9"> |
49 | | - <span class="absolute inset-x-0 top-1/2 h-px w-full -translate-y-1/2 bg-white-light dark:bg-white-dark"></span> |
| 42 | + <span |
| 43 | + class="absolute inset-x-0 top-1/2 h-px w-full -translate-y-1/2 bg-white-light dark:bg-white-dark"></span> |
50 | 44 | </div> |
51 | 45 | <div class="text-center dark:text-white"> |
52 | 46 | Don't have an account ? |
|
60 | 54 | </template> |
61 | 55 |
|
62 | 56 | <script lang="ts" setup> |
63 | | - // import { useAppStore } from '@/stores/index'; |
64 | | - import { useRouter, useRoute } from 'vue-router'; |
65 | | - import { computed, onMounted } from 'vue'; |
66 | | - import { Button } from '@codebridger/lib-vue-components/elements.ts'; |
67 | | - import { authentication } from '@modular-rest/client'; |
68 | | -
|
69 | | - const { t } = useI18n(); |
70 | | -
|
71 | | - useHead({ title: t('auth.login_page') }); |
72 | | -
|
73 | | - const router = useRouter(); |
74 | | - const route = useRoute(); |
75 | | -
|
76 | | - definePageMeta({ |
77 | | - layout: 'auth', |
78 | | - }); |
79 | | -
|
80 | | - // const store = useAppStore(); |
81 | | - // const { setLocale } = useI18n(); |
82 | | -
|
83 | | - // multi language |
84 | | - // const changeLanguage = (item: any) => { |
85 | | - // appSetting.toggleLanguage(item, setLocale); |
86 | | - // }; |
87 | | -
|
88 | | - // const currentFlag = computed(() => { |
89 | | - // return `/assets/images/flags/${store.locale?.toUpperCase()}.svg`; |
90 | | - // }); |
91 | | -
|
92 | | - const backgroundImage = computed(() => '/assets/images/auth/bg-gradient.png'); |
93 | | - const comingSoonObject1 = computed(() => '/assets/images/auth/coming-soon-object1.png'); |
94 | | - const comingSoonObject2 = computed(() => '/assets/images/auth/coming-soon-object2.png'); |
95 | | - const comingSoonObject3 = computed(() => '/assets/images/auth/coming-soon-object3.png'); |
96 | | - const polygonObject = computed(() => '/assets/images/auth/polygon-object.svg'); |
97 | | - const mapBackgroundImage = computed(() => '/assets/images/auth/map.png'); |
98 | | - const loginCover = computed(() => '/assets/images/auth/login-cover.png'); |
99 | | -
|
100 | | - // Handle redirect parameter |
101 | | - onMounted(() => { |
102 | | - const redirectUrl = route.query.redirect as string; |
103 | | - if (redirectUrl) { |
104 | | - // Store redirect URL in session storage |
105 | | - sessionStorage.setItem('auth_redirect_url', redirectUrl); |
106 | | - } |
107 | | -
|
108 | | - authentication.loginAsAnonymous(); |
109 | | - }); |
110 | | -
|
111 | | - function triggerGoogleLoginProcess() { |
112 | | - const config = useRuntimeConfig(); |
113 | | - const redirectUrl = route.query.redirect as string; |
114 | | -
|
115 | | - let url = `${config.public.BASE_URL_API}/auth/google`; |
116 | | -
|
117 | | - // Pass redirect parameter to backend if present |
118 | | - if (redirectUrl) { |
119 | | - const urlParams = new URLSearchParams({ redirect: redirectUrl }); |
120 | | - url += `?${urlParams.toString()}`; |
121 | | - } |
122 | | -
|
123 | | - window.open(url, '_self'); |
| 57 | +// import { useAppStore } from '@/stores/index'; |
| 58 | +import { useRouter, useRoute } from 'vue-router'; |
| 59 | +import { computed, onMounted } from 'vue'; |
| 60 | +import { Button } from '@codebridger/lib-vue-components/elements.ts'; |
| 61 | +import { authentication } from '@modular-rest/client'; |
| 62 | +
|
| 63 | +const { t } = useI18n(); |
| 64 | +
|
| 65 | +useHead({ title: t('auth.login_page') }); |
| 66 | +
|
| 67 | +const router = useRouter(); |
| 68 | +const route = useRoute(); |
| 69 | +
|
| 70 | +definePageMeta({ |
| 71 | + layout: 'auth', |
| 72 | +}); |
| 73 | +
|
| 74 | +// const store = useAppStore(); |
| 75 | +// const { setLocale } = useI18n(); |
| 76 | +
|
| 77 | +// multi language |
| 78 | +// const changeLanguage = (item: any) => { |
| 79 | +// appSetting.toggleLanguage(item, setLocale); |
| 80 | +// }; |
| 81 | +
|
| 82 | +// const currentFlag = computed(() => { |
| 83 | +// return `/assets/images/flags/${store.locale?.toUpperCase()}.svg`; |
| 84 | +// }); |
| 85 | +
|
| 86 | +const backgroundImage = computed(() => '/assets/images/auth/bg-gradient.png'); |
| 87 | +const comingSoonObject1 = computed(() => '/assets/images/auth/coming-soon-object1.png'); |
| 88 | +const comingSoonObject2 = computed(() => '/assets/images/auth/coming-soon-object2.png'); |
| 89 | +const comingSoonObject3 = computed(() => '/assets/images/auth/coming-soon-object3.png'); |
| 90 | +const polygonObject = computed(() => '/assets/images/auth/polygon-object.svg'); |
| 91 | +const mapBackgroundImage = computed(() => '/assets/images/auth/map.png'); |
| 92 | +const loginCover = computed(() => '/assets/images/auth/login-cover.png'); |
| 93 | +
|
| 94 | +// Handle redirect parameter |
| 95 | +onMounted(() => { |
| 96 | + const redirectUrl = route.query.redirect as string; |
| 97 | + if (redirectUrl) { |
| 98 | + // Store redirect URL in session storage |
| 99 | + sessionStorage.setItem('auth_redirect_url', redirectUrl); |
124 | 100 | } |
| 101 | +
|
| 102 | + authentication.loginAsAnonymous(); |
| 103 | +}); |
| 104 | +
|
| 105 | +function triggerGoogleLoginProcess() { |
| 106 | + const config = useRuntimeConfig(); |
| 107 | + const redirectUrl = route.query.redirect as string; |
| 108 | +
|
| 109 | + let url = `${config.public.BASE_URL_API}/auth/google`; |
| 110 | +
|
| 111 | + // Pass redirect parameter to backend if present |
| 112 | + const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone; |
| 113 | + const params: Record<string, string> = { timezone: timeZone }; |
| 114 | +
|
| 115 | + if (redirectUrl) { |
| 116 | + params.redirect = redirectUrl; |
| 117 | + } |
| 118 | +
|
| 119 | + const urlParams = new URLSearchParams(params); |
| 120 | + url += `?${urlParams.toString()}`; |
| 121 | +
|
| 122 | + window.open(url, '_self'); |
| 123 | +} |
125 | 124 | </script> |
0 commit comments