Skip to content
This repository was archived by the owner on Mar 27, 2023. It is now read-only.

Commit 4a61bda

Browse files
committed
wip added ui components, dark mode
1 parent d5f7381 commit 4a61bda

File tree

20 files changed

+188
-53
lines changed

20 files changed

+188
-53
lines changed

quasar/src/App.vue

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<template>
22
<div id="q-app">
3-
<router-view />
3+
<transition name="fade" mode="out-in">
4+
<router-view />
5+
</transition>
46
</div>
57
</template>
68

@@ -24,4 +26,16 @@ export default {
2426
};
2527
</script>
2628

27-
<style></style>
29+
<style scoped>
30+
.fade-enter-active,
31+
.fade-leave-active {
32+
transition-duration: 0.15s;
33+
transition-property: opacity;
34+
transition-timing-function: ease;
35+
}
36+
37+
.fade-enter,
38+
.fade-leave-active {
39+
opacity: 0;
40+
}
41+
</style>

quasar/src/boot/components.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ import BasePage from "components/ui/BasePage.vue";
22
import DarkMode from "components/ui/DarkMode.vue";
33
import LeftMenuLink from "components/LeftMenuLink.vue";
44
import MainHeader from "layouts/primary/MainHeader.vue";
5+
import PageHeader from "components/ui/PageHeader.vue";
6+
import PageSubHeader from "components/ui/PageSubHeader.vue";
7+
import PageText from "components/ui/PageText.vue";
8+
import BaseBtn from "components/ui/BaseBtn.vue";
59
import MainLeftDrawer from "layouts/primary/MainLeftDrawer.vue";
610
import MainCarousel from "components/MainCarousel.vue";
711
import { Emoji } from "emoji-mart-vue";
@@ -13,6 +17,10 @@ export default async ({ Vue }) => {
1317
Vue.component("DarkMode", DarkMode);
1418
Vue.component("LeftMenuLink", LeftMenuLink);
1519
Vue.component("MainHeader", MainHeader);
20+
Vue.component("PageHeader", PageHeader);
21+
Vue.component("PageSubHeader", PageSubHeader);
22+
Vue.component("PageText", PageText);
23+
Vue.component("BaseBtn", BaseBtn);
1624
Vue.component("MainLeftDrawer", MainLeftDrawer);
1725
Vue.component("MainCarousel", MainCarousel);
1826
};

quasar/src/components/MainCarousel.vue

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
padding
1212
arrows
1313
height="300px"
14-
class="bg-primary text-white shadow-1 rounded-borders"
14+
:class="
15+
`text-white shadow-1 rounded-borders ${
16+
$store.getters.isDark ? 'carousel-dark' : 'carousel-light'
17+
}`
18+
"
1519
>
1620
<q-carousel-slide name="style" class="column no-wrap flex-center">
1721
<q-icon name="layers" size="56px" />
@@ -48,4 +52,11 @@ export default {
4852
};
4953
</script>
5054

51-
<style lang="scss" scoped></style>
55+
<style scoped>
56+
.carousel-light {
57+
background: linear-gradient(270deg, red, orange);
58+
}
59+
.carousel-dark {
60+
background: linear-gradient(270deg, purple, teal);
61+
}
62+
</style>
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<template>
2+
<q-btn :color="color" text-color="black"><slot></slot></q-btn>
3+
</template>
4+
5+
<script>
6+
export default {
7+
props: {
8+
color: {
9+
type: String,
10+
default: "white"
11+
}
12+
},
13+
textColor: {
14+
type: String,
15+
default: "black"
16+
}
17+
};
18+
</script>
19+
20+
<style lang="scss" scoped></style>

quasar/src/components/ui/BasePage.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div :style-fn="getStyle">
3-
<q-page-container>
4-
<q-page padding>
3+
<q-page-container :class="$store.getters.isDark ? 'bg-grey-10' : ''">
4+
<q-page padding :class="$store.getters.isDark ? 'bg-grey-10' : ''">
55
<slot></slot>
66
</q-page>
77
</q-page-container>
@@ -18,4 +18,4 @@ export default {
1818
};
1919
</script>
2020

21-
<style lang="scss" scoped></style>
21+
<style></style>

quasar/src/components/ui/DarkMode.vue

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,13 @@
11
<template>
2-
<q-toggle v-model="dark" color="black" />
2+
<q-toggle v-model="dark" :color="$store.getters.isDark ? 'black' : 'white'" />
33
</template>
44

55
<script>
66
export default {
7-
data() {
8-
return {
9-
darkMode: true
10-
};
11-
},
127
computed: {
138
dark: {
149
get() {
15-
return this.$store.getters.isDarkMode;
10+
return this.$store.getters.isDark;
1611
},
1712
set() {
1813
this.$store.commit("toggleDarkMode");
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<h3 :class="$store.getters.isDark ? 'dark-mode' : 'light-mode'">
3+
<slot></slot>
4+
</h3>
5+
</template>
6+
7+
<script>
8+
export default {};
9+
</script>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<template>
2+
<h4 :class="$store.getters.isDark ? 'dark-mode' : 'light-mode'">
3+
<slot></slot>
4+
</h4>
5+
</template>
6+
7+
<script>
8+
export default {};
9+
</script>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<template>
2+
<p
3+
:style="`font-size:${size}rem`"
4+
:class="$store.getters.isDark ? 'dark-mode' : 'light-mode'"
5+
>
6+
<slot></slot>
7+
</p>
8+
</template>
9+
10+
<script>
11+
export default {
12+
props: {
13+
size: {
14+
type: Number,
15+
default: 1.25
16+
}
17+
}
18+
};
19+
</script>

quasar/src/css/app.styl

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,17 @@
11
// app global css
2+
3+
.light-mode {
4+
color: black;
5+
}
6+
7+
.dark-mode {
8+
color: white;
9+
}
10+
11+
12+
.dark-mode::selection {
13+
background: teal; /* WebKit/Blink Browsers */
14+
}
15+
.dark-mode::-moz-selection {
16+
background: teal; /* Gecko Browsers */
17+
}

0 commit comments

Comments
 (0)