From 6395d1ec4362fedd7854fc9a103bad8bf7ae5d3d Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 27 Sep 2022 19:17:51 +0200 Subject: Dark mode --- assets/sass/main.sass | 6 ++++++ components/FilePreview.vue | 10 +++++++-- components/ModelBoxCard.vue | 4 ++-- components/ModelForm.vue | 26 +++++++++++------------ components/ModelReportsList.vue | 10 ++++----- components/VHeader.vue | 4 ++-- layouts/default.vue | 18 +++++++++++++++- nuxt.config.js | 6 +++++- package-lock.json | 47 +++++++++++++++++++++++++++++++++++------ package.json | 1 + pages/create.vue | 4 ++-- pages/models/_id/edit.vue | 4 ++-- pages/models/_id/index.vue | 22 +++++++++---------- pages/settings.vue | 26 +++++++++++++++++------ pages/signin.vue | 4 ++-- pages/signup.vue | 4 ++-- pages/user/_id.vue | 6 +++--- tailwind.config.js | 6 ++++++ 18 files changed, 147 insertions(+), 61 deletions(-) create mode 100644 tailwind.config.js diff --git a/assets/sass/main.sass b/assets/sass/main.sass index 04466c1..d0c5159 100644 --- a/assets/sass/main.sass +++ b/assets/sass/main.sass @@ -10,3 +10,9 @@ body .border-1 border-width: 1px + +body.dark + background-color: #111827 + +.dark\:border-b-1 + border-bottom-width: 1px diff --git a/components/FilePreview.vue b/components/FilePreview.vue index 3892857..878ca5b 100644 --- a/components/FilePreview.vue +++ b/components/FilePreview.vue @@ -8,13 +8,13 @@ v-else-if="isStl(path)" :rotate="rotate" :src="baseAPI + '' + path" - :backgroundColor="bg ? bg : '#D1D5DB'" + :backgroundColor="color ? color : '#D1D5DB'" :controlsOptions="{'enablePan': controls ? true : false, 'enableZoom': controls ? true : false, 'enableRotate': controls ? true : false}" ) model-obj( v-else-if="isObj(path)" :src="baseAPI + '' + path" - :backgroundColor="bg ? bg : '#D1D5DB'" + :backgroundColor="color ? color : '#D1D5DB'" :controlsOptions="{'enablePan': controls ? true : false, 'enableZoom': controls ? true : false, 'enableRotate': controls ? true : false}" ) @@ -33,6 +33,7 @@ export default { y: 0, z: 0, }, + color: "", }; }, components: { @@ -41,6 +42,11 @@ export default { }, created() { this.baseAPI = this.$config.api; + if (this.$colorMode.preference == "light") { + this.color = this.bg; + } else { + this.color = "#ecfdf5"; + } }, methods: { checkExt(path, ext) { diff --git a/components/ModelBoxCard.vue b/components/ModelBoxCard.vue index 110c234..bdd8a8f 100644 --- a/components/ModelBoxCard.vue +++ b/components/ModelBoxCard.vue @@ -1,6 +1,6 @@