1
1
<script lang="ts" setup>
2
2
import { NButton , NCard , NCheckbox , NFlex , NH4 , NText } from ' naive-ui' ;
3
3
4
- import { onMounted , ref , watch } from ' vue' ;
4
+ import { onMounted , ref , Transition , watch } from ' vue' ;
5
5
6
6
import { useRoute , useRouter } from ' vue-router' ;
7
7
8
+ import GridBackground from ' ~/components/common/background/GridBackground.vue' ;
8
9
import { TraktService } from ' ~/services/trakt.service' ;
9
10
import { useAuthSettingsStoreRefs } from ' ~/stores/settings/auth.store' ;
10
11
import { useI18n } from ' ~/utils' ;
@@ -21,11 +22,13 @@ const onRedirect = (authenticated = isAuthenticated.value) => {
21
22
return router .push ((route .query .redirect as string ) ?? ' /' );
22
23
};
23
24
25
+ const show = ref (false );
24
26
onMounted (() => {
25
27
onRedirect ();
26
28
watch (isAuthenticated , authenticated => {
27
29
onRedirect (authenticated );
28
30
});
31
+ show .value = ! isAuthenticated .value ;
29
32
});
30
33
31
34
const signUp = ref (false );
@@ -45,42 +48,50 @@ const onSignIn = async () => {
45
48
46
49
<template >
47
50
<NFlex vertical justify =" space-around" align =" center" >
48
- <NCard class =" card" :title =" i18n('title')" hoverable >
49
- <template #cover >
50
- <div class =" spacer" />
51
- <img
52
- alt =" Vue logo"
53
- class =" logo"
54
- src =" /assets/logo.svg"
55
- width =" 125"
56
- height =" 125"
57
- />
58
- </template >
59
-
60
- <NFlex vertical >
61
- <NH4 class =" title" prefix =" bar" >{{ i18n('sub_title') }}</NH4 >
62
-
63
- <NButton class =" button" @click =" onSignIn" >{{ i18n('sign_in') }}</NButton >
64
-
65
- <NFlex class =" checkboxes" vertical >
66
- <NCheckbox v-model:checked =" signUp" >
67
- {{ i18n('checkbox__sign_up_for') }}
68
- <NText type =" info" >{{ i18n('checkbox__new_account') }}</NText >
69
- !
70
- </NCheckbox >
71
- <NCheckbox v-model:checked =" useSession" >
72
- {{ i18n('checkbox__use') }}
73
- <NText type =" info" >{{ i18n('checkbox__active_user') }}</NText >
74
- {{ i18n('checkbox__session') }}
75
- </NCheckbox >
76
- </NFlex >
77
- </NFlex >
78
- </NCard >
51
+ <GridBackground :size =" 20" />
52
+
53
+ <Transition name =" scale" mode =" in-out" >
54
+ <div v-if =" show" >
55
+ <NCard class =" card" :title =" i18n('title')" hoverable >
56
+ <template #cover >
57
+ <div class =" spacer" />
58
+ <img
59
+ alt =" Vue logo"
60
+ class =" logo"
61
+ src =" /assets/logo.svg"
62
+ width =" 125"
63
+ height =" 125"
64
+ />
65
+ </template >
66
+
67
+ <NFlex vertical >
68
+ <NH4 class =" title" prefix =" bar" >{{ i18n('sub_title') }}</NH4 >
69
+
70
+ <NButton class =" button" @click =" onSignIn" >{{ i18n('sign_in') }}</NButton >
71
+
72
+ <NFlex class =" checkboxes" vertical >
73
+ <NCheckbox v-model:checked =" signUp" >
74
+ {{ i18n('checkbox__sign_up_for') }}
75
+ <NText type =" info" >{{ i18n('checkbox__new_account') }}</NText >
76
+ !
77
+ </NCheckbox >
78
+ <NCheckbox v-model:checked =" useSession" >
79
+ {{ i18n('checkbox__use') }}
80
+ <NText type =" info" >{{ i18n('checkbox__active_user') }}</NText >
81
+ {{ i18n('checkbox__session') }}
82
+ </NCheckbox >
83
+ </NFlex >
84
+ </NFlex >
85
+ </NCard >
86
+ </div >
87
+ </Transition >
79
88
</NFlex >
80
89
</template >
81
90
82
91
<style lang="scss" scoped>
83
- @use ' src/styles/mixin' as mixin ;
92
+ @use ' ~/styles/mixin' as mixin ;
93
+ @use ' ~/styles/transition' as transition ;
94
+ @include transition .scale (0.9 );
84
95
85
96
.card {
86
97
@include mixin .hover-background ;
0 commit comments