Skip to content

Open source personal finance application

Refactor Login, Welcome: edit styles, move copyright to own component

Ilya Komichev7fca965a946f
diff --git a/src/components/login/Login.vue b/src/components/login/Login.vue
index 1512774b..c42b5e31 100644
--- a/src/components/login/Login.vue
+++ b/src/components/login/Login.vue
@@ -1,11 +1,15 @@
<script>
import { auth } from 'firebase/app'
import AppName from '@/components/shared/appName/AppName'
+import Button from '@/components/shared/button/Button'
+import Copyright from '@/components/shared/copyright/Copyright'
import Spiner from '@/components/shared/spiner/Spiner'
export default {
components: {
AppName,
+ Button,
+ Copyright,
Spiner
},
@@ -44,32 +48,29 @@ export default {
</script>
<template lang="pug">
-.login
- //- theme changer
- .login__themeChanger
- .themeChanger(@click="$store.dispatch('changeTheme')")
- .themeChanger__icon: .mdi.mdi-palette
- .themeChanger__text Change theme
-
- .login__wrap
+.tab
+ .themeChanger
+ Button(
+ icon="mdi mdi-palette"
+ title="Change theme"
+ v-on:onClick="$store.dispatch('changeTheme')")
+
+ .tab__content
AppName
- //- button
- .login__button(
+ .loginButton(
@click.prevent="signInWithGoogle"
:class="{ _loading: loading }")
transition(name="fadeIn")
- .login__button-spiner(v-if="loading"): Spiner
- .login__button-text Login with Google
+ .loginButton__spiner(v-if="loading")
+ Spiner
+ .loginButton__text Login with Google
transition(name="slide")
- .login__error(v-if="error") {{ error }}
+ .loginError(v-if="error") {{ error }}
- //- copy
- a(href="https://ilko.me").login__copy
- | Made with
- .login__heart.mdi.mdi-heart
- | by Ilya Komichev
+ .copyright
+ Copyright
</template>
<style lang="stylus" scoped>
@@ -77,104 +78,85 @@ export default {
@import "~@/stylus/variables/fonts"
@import "~@/stylus/variables/margins"
@import "~@/stylus/variables/media"
-
-.login
- position relative
- display flex
- flex-flow column
+@import "~@/stylus/variables/scrollbar"
+
+.tab
+ display grid
+ overflow-x hidden
+ overflow-y scroll
+ scrollbar()
+ position absolute
+ left 0
+ top 0
width 100%
- height 100vh
- min-height 300px
- align-items center
- justify-content center
- padding 0 $m7
+ height 100%
+ padding-bottom $m10
- &__themeChanger
- position absolute
- right $m7
- top $m7
+ &__content
+ display-flex(column, grow)
+ align-self center
+ margin 0 auto
+ padding 100px $m9
- &__wrap
- display flex
- flex-flow column wrap
- align-items center
+.themeChanger
+ position absolute
+ right $m7
+ top $m7
- &__copy
- position fixed
- display flex
- align-items center
- justify-content center
- left 0
- bottom 0
- width 100%
- margin-top auto
- padding $mn1
- color var(--c-font-2)
- text-decoration none
-
- @media $media-laptop
- bottom $mn2
-
- &__heart
- display inline-flex
- margin 0 $m5
- color rgba(210, 0, 20, 1)
- font-size $font-size-nb
- animation heartbeat 3s ease-in-out infinite
-
- &__error
+ @media $media-laptop
+ right $m9
+ top $m9
+
+.loginButton
+ position relative
+ overflow hidden
+ cursor pointer
+ margin-top $mb1
+ padding $m7 $m9
+ typo-btn(var(--c-font-1))
+ background var(--c-red-1)
+ border-radius 3px
+ text-align center
+
+ @media $media-laptop
+ margin-top $mb2
+
+ &._loading
+ cursor default
+ background var(--c-red-2)
+
+ &__text
+ anim()
+ ^[0]._loading &
+ opacity 0
+
+ &__spiner
position absolute
left 0
- bottom 150px
+ top 0
width 100%
- padding $m7 50px
- font-size 12px
- border-left 2px solid var(-c-expenses)
-
- &__button
- position relative
- overflow hidden
- cursor pointer
- margin-top $mb1
- padding $m7 $m9
- typo-btn(var(--c-font-1))
- background var(--c-red-1)
- border-radius 3px
-
- @media $media-laptop
- margin-top $mb2
-
- &._loading
- cursor default
- background var(--c-red-2)
-
- &-text
- anim()
-
- ^[1]._loading &
- opacity 0
-
- &-spiner
- position absolute
- left 0
- top 0
- width 100%
- height 100%
- display flex
- align-items center
- justify-content center
-
-@keyframes heartbeat
- 0%
- transform:scale(.75)
- 20%
- transform:scale(1)
- 40%
- transform:scale(.75)
- 60%
- transform:scale(1.1)
- 80%
- transform:scale(.75)
- 100%
- transform:scale(.75)
+ height 100%
+ display flex
+ align-items center
+ justify-content center
+
+.loginError
+ position absolute
+ left 0
+ bottom 150px
+ width 100%
+ padding $m7 50px
+ font-size 12px
+ border-left 2px solid var(-c-expenses)
+
+.copyright
+ position fixed
+ left 0
+ bottom 0
+ width 100%
+ padding-bottom $m7
+ background var(--c-bg-1)
+
+ @media $media-laptop
+ padding-bottom $m9
</style>
diff --git a/src/components/login/login.styl b/src/components/login/login.styl
index 3ffe56b1..8c86892d 100644
--- a/src/components/login/login.styl
+++ b/src/components/login/login.styl
@@ -1,97 +1,97 @@
-.login
- position relative
- display flex
- flex-flow column
- width 100%
- height 100vh
- min-height 300px
- align-items center
- justify-content center
- padding 0 $m7
+// .login
+// position relative
+// display flex
+// flex-flow column
+// width 100%
+// height 100vh
+// min-height 300px
+// align-items center
+// justify-content center
+// padding 0 $m7
- &__themeChanger
- position absolute
- right $m7
- top $m7
+// &__themeChanger
+// position absolute
+// right $m7
+// top $m7
- &__wrap
- display flex
- flex-flow column wrap
- align-items center
+// &__wrap
+// display flex
+// flex-flow column wrap
+// align-items center
- &__copy
- position fixed
- display flex
- align-items center
- justify-content center
- left 0
- bottom 0
- width 100%
- margin-top auto
- padding $mn1
- color var(--c-font-2)
- text-decoration none
+// &__copy
+// position fixed
+// display flex
+// align-items center
+// justify-content center
+// left 0
+// bottom 0
+// width 100%
+// margin-top auto
+// padding $mn1
+// color var(--c-font-2)
+// text-decoration none
- @media $media-laptop
- bottom $mn2
+// @media $media-laptop
+// bottom $mn2
- &__heart
- display inline-flex
- margin 0 $m5
- color rgba(210, 0, 20, 1)
- font-size $font-size-nb
- animation heartbeat 3s ease-in-out infinite
+// &__heart
+// display inline-flex
+// margin 0 $m5
+// color rgba(210, 0, 20, 1)
+// font-size $font-size-nb
+// animation heartbeat 3s ease-in-out infinite
- &__error
- position absolute
- left 0
- bottom 150px
- width 100%
- padding $m7 50px
- font-size 12px
+// &__error
+// position absolute
+// left 0
+// bottom 150px
+// width 100%
+// padding $m7 50px
+// font-size 12px
- &__button
- position relative
- overflow hidden
- cursor pointer
- margin-top $mb1
- padding $m7 $m9
- typo-btn(var(--c-font-1))
- background var(--c-red-1)
- border-radius 3px
+// &__button
+// position relative
+// overflow hidden
+// cursor pointer
+// margin-top $mb1
+// padding $m7 $m9
+// typo-btn(var(--c-font-1))
+// background var(--c-red-1)
+// border-radius 3px
- @media $media-laptop
- margin-top $mb2
+// @media $media-laptop
+// margin-top $mb2
- &._loading
- background var(--c-red-2)
+// &._loading
+// background var(--c-red-2)
- &-text
- anim()
+// &-text
+// anim()
- ^[1]._loading &
- opacity 0
+// ^[1]._loading &
+// opacity 0
- &-spiner
- position absolute
- left 0
- top 0
- width 100%
- height 100%
- display flex
- align-items center
- justify-content center
+// &-spiner
+// position absolute
+// left 0
+// top 0
+// width 100%
+// height 100%
+// display flex
+// align-items center
+// justify-content center
-@keyframes heartbeat
- 0%
- transform:scale(.75)
- 20%
- transform:scale(1)
- 40%
- transform:scale(.75)
- 60%
- transform:scale(1.1)
- 80%
- transform:scale(.75)
- 100%
- transform:scale(.75)
+// @keyframes heartbeat
+// 0%
+// transform:scale(.75)
+// 20%
+// transform:scale(1)
+// 40%
+// transform:scale(.75)
+// 60%
+// transform:scale(1.1)
+// 80%
+// transform:scale(.75)
+// 100%
+// transform:scale(.75)
diff --git a/src/components/shared/copyright/Copyright.vue b/src/components/shared/copyright/Copyright.vue
new file mode 100644
index 00000000..6eeafce9
--- /dev/null
+++ b/src/components/shared/copyright/Copyright.vue
@@ -0,0 +1,48 @@
+<script>
+export default {
+
+}
+</script>
+
+<template lang="pug">
+a(href="https://ilko.me").copyright
+ | Made with
+ .copyright__heart.mdi.mdi-heart
+ | by Ilya Komichev
+</template>
+
+<style lang="stylus" scoped>
+@import "~@/stylus/variables/animations"
+@import "~@/stylus/variables/fonts"
+@import "~@/stylus/variables/margins"
+@import "~@/stylus/variables/scrollbar"
+
+.copyright
+ display flex
+ align-items center
+ justify-content center
+ padding $m6
+ color var(--c-font-2)
+ text-decoration none
+
+ &__heart
+ display inline-flex
+ margin 0 $m5
+ color rgba(210, 0, 20, 1)
+ font-size $font-size-nb
+ animation heartbeat 3s ease-in-out infinite
+
+@keyframes heartbeat
+ 0%
+ transform:scale(.75)
+ 20%
+ transform:scale(1)
+ 40%
+ transform:scale(.75)
+ 60%
+ transform:scale(1.1)
+ 80%
+ transform:scale(.75)
+ 100%
+ transform:scale(.75)
+</style>
diff --git a/src/components/welcome/Welcome.vue b/src/components/welcome/Welcome.vue
index bbb211ed..7e7205f9 100644
--- a/src/components/welcome/Welcome.vue
+++ b/src/components/welcome/Welcome.vue
@@ -1,12 +1,14 @@
<script>
import Button from '@/components/shared/button/Button'
import CategoryForm from '@/components/categories/form/CategoryForm'
+import Copyright from '@/components/shared/copyright/Copyright'
import WalletForm from '@/components/wallets/form/WalletForm'
export default {
components: {
Button,
CategoryForm,
+ Copyright,
WalletForm
},
@@ -33,11 +35,11 @@ export default {
template(v-if="!showWalletForm && !$store.getters.hasWallets")
.tab
.tab__content
- .welcome__header
- .welcome__header__title Welcome to Finapp
- .welcome__header__desc Powerfull personal finance application
- .welcome__text Let's start with create first Wallet
- .welcome__btn
+ .header
+ .header__title Welcome to Finapp
+ .header__desc Powerfull personal finance application
+ .text Let's start with create first Wallet
+ .button
Button._blue(
title="Create wallet"
v-on:onClick="showWalletForm = true")
@@ -47,9 +49,9 @@ export default {
template(v-if="!showWalletForm && !showCategoryForm && $store.getters.hasWallets && !$store.getters.hasCategories")
.tab
.tab__content
- .welcome__icon: .mdi.mdi-chart-bubble
- .welcome__text Great! Now Let's create first category
- .welcome__btn
+ .icon: .mdi.mdi-chart-bubble
+ .text Great! Now Let's create first category
+ .button
Button._blue(
title="Create category"
v-on:onClick="showCategoryForm = true")
@@ -57,19 +59,15 @@ export default {
transition(name="fadeInSlow")
.tab(v-if="showWalletForm")
.tab__content
- WalletForm(
- v-on:callback="showWalletForm = false")
+ WalletForm(v-on:callback="showWalletForm = false")
transition(name="fadeInSlow")
.tab(v-if="showCategoryForm")
.tab__content
- CategoryForm(
- v-on:callback="categoryCreatedCallback")
+ CategoryForm(v-on:callback="categoryCreatedCallback")
- a(href="https://ilko.me").welcome__copy.login__copy
- | Made with
- .login__heart.mdi.mdi-heart
- | by Ilya Komichev
+ .copyright
+ Copyright
</template>
<style lang="stylus" scoped>
@@ -103,59 +101,49 @@ export default {
margin 0 auto
padding $m9
padding-bottom 100px
-
.component
padding 0
-.welcome
- .login__copy
- color var(--c-font-4)
-
- .login__heart
- opacity .8
-
- &__themeChanger
- padding-top $m9
+.header
+ padding-bottom $mb2
- &__copy
- margin 0
- padding $m9 0
- bottom 0
- background var(--c-bg-1)
-
- &__header
- padding-bottom $mb2
-
- &__title
+ &__title
+ font-size 28px
+ font-weight 500
+ letter-spacing 1px
+ @media $media-laptop
font-size 28px
- font-weight 500
- letter-spacing 1px
-
- @media $media-laptop
- font-size 28px
- letter-spacing 3px
+ letter-spacing 3px
- &__desc
- padding-top $m5
- font-size 12px
- color var(--c-font-4)
-
- @media $media-laptop
- padding-top $m7
- font-size 14px
-
- &__icon
- padding-bottom $m5
- text-align center
+ &__desc
+ padding-top $m5
+ font-size 12px
color var(--c-font-4)
- font-size 96px
-
@media $media-laptop
- padding-bottom $m7
+ padding-top $m7
+ font-size 14px
+
+.text
+ padding-bottom $m9
+ @media $media-laptop
+ padding-bottom $m10
+
+.icon
+ padding-bottom $m5
+ text-align center
+ color var(--c-font-4)
+ font-size 96px
+ @media $media-laptop
+ padding-bottom $m7
+
+.copyright
+ position fixed
+ left 0
+ bottom 0
+ width 100%
+ padding-bottom $m7
+ background var(--c-bg-1)
- &__text
+ @media $media-laptop
padding-bottom $m9
-
- @media $media-laptop
- padding-bottom $m10
</style>
diff --git a/src/stylus/common/themeChanger.styl b/src/stylus/common/themeChanger.styl
deleted file mode 100644
index e4e9c7f6..00000000
--- a/src/stylus/common/themeChanger.styl
+++ /dev/null
@@ -1,21 +0,0 @@
-.themeChanger
- display flex
- align-items center
- padding $m7
- border-radius 3px
- border 1px solid transparent
- color var(--c-main)
-
- @media $media-phone
- &:active
- border-color var(--c-red-1)
-
- @media $media-laptop
- &:hover
- cursor pointer
- border-color var(--c-red-1)
-
- &__icon
- margin-right $m5
- font-size 18px
- opacity .8