From 6395d1ec4362fedd7854fc9a103bad8bf7ae5d3d Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Tue, 27 Sep 2022 19:17:51 +0200 Subject: Dark mode --- components/FilePreview.vue | 10 ++++++++-- components/ModelBoxCard.vue | 4 ++-- components/ModelForm.vue | 26 +++++++++++++------------- components/ModelReportsList.vue | 10 +++++----- components/VHeader.vue | 4 ++-- 5 files changed, 30 insertions(+), 24 deletions(-) (limited to 'components') 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 @@