Skip to content

Commit 82b906e

Browse files
committed
feat(app): added theme automatization
1 parent ad74b78 commit 82b906e

File tree

11 files changed

+295
-858
lines changed

11 files changed

+295
-858
lines changed

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve --port 3000",
7+
"serve:dark": "VUE_APP_THEME='dark' yarn serve",
8+
"serve:light": "VUE_APP_THEME='light' yarn serve",
79
"serve:backend": "VUE_APP_BACKEND=true vue-cli-service serve --port 3000",
810
"build": "VUE_APP_BACKEND=true vue-cli-service build",
11+
"build:dark": "VUE_APP_THEME='dark' yarn build",
12+
"build:light": "VUE_APP_THEME='light' yarn build",
913
"lint": "vue-cli-service lint",
1014
"start": "node server.js"
1115
},

src/components/Helper/Helper.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
</div>
1111
<h6>Theme</h6>
1212
</header>
13-
<a href="#" class="theme-preview active">
13+
<a :href="theme === 'light' ? 'https://demo.flatlogic.com/light-blue-vue/dark' : '#'" class="theme-preview" :class="{active: theme !== 'light'}">
1414
<img src="../../assets/dark-theme.png" alt="Dark Theme" class="img-thumbnail">
1515
</a>
16-
<a href="https://demo.flatlogic.com/light-blue-vue/white" class="theme-preview">
16+
<a :href="theme !== 'light' ? 'https://demo.flatlogic.com/light-blue-vue/light' : '#'" class="theme-preview" :class="{active: theme === 'light'}">
1717
<img src="../../assets/white-theme.png" alt="White Theme" class="img-thumbnail">
1818
</a>
1919
<div class="widget-body mt-3">
@@ -68,10 +68,13 @@
6868
</template>
6969

7070
<script>
71+
import config from '../../config';
72+
7173
export default {
7274
name: 'Helper',
7375
data() {
7476
return {
77+
theme: config.theme,
7578
opened: false,
7679
}
7780
},

src/config.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,33 @@
11
const hostApi = process.env.NODE_ENV === "development" ? "http://localhost" : "https://flatlogic-node-backend.herokuapp.com";
22
const portApi = process.env.NODE_ENV === "development" ? 8080 : "";
33
const baseURLApi = `${hostApi}${portApi ? `:${portApi}` : ``}`;
4+
const chartColors = process.env.VUE_APP_THEME === 'light' ? {
5+
blue: '#196EFF',
6+
green: '#2ada7a',
7+
orange: '#ffc107',
8+
red: '#ff0115',
9+
purple: '#a700ae',
10+
dark: '#3c484f',
11+
teal: '#7f49fa',
12+
pink: '#e671b8',
13+
gray: '#d6dee5',
14+
textColor: '#444'
15+
} : {
16+
blue: '#2e74e3',
17+
green: '#25b932',
18+
orange: '#f0af03',
19+
red: '#db4a00',
20+
purple: '#a700ae',
21+
dark: '#3c484f',
22+
teal: '#14d3d3',
23+
pink: '#e671b8',
24+
gray: '#d6dee5',
25+
textColor: '#fff'
26+
};
427

528
export default {
29+
theme: process.env.VUE_APP_THEME,
30+
chartColors,
631
hostApi,
732
portApi,
833
baseURLApi,

0 commit comments

Comments
 (0)