summaryrefslogtreecommitdiff
path: root/components/FilePreview.vue
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2022-09-27 19:17:51 +0200
committerSanto Cariotti <santo@dcariotti.me>2022-09-27 19:17:51 +0200
commit6395d1ec4362fedd7854fc9a103bad8bf7ae5d3d (patch)
tree93a2d01ec76ef5b78e36d3f5f2ad284d1286d928 /components/FilePreview.vue
parent74f689fefb77328f22772bbdf9ebc6aefb01cdab (diff)
Dark mode
Diffstat (limited to 'components/FilePreview.vue')
-rw-r--r--components/FilePreview.vue10
1 files changed, 8 insertions, 2 deletions
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}"
)
</template>
@@ -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) {