From a04cfa4863da43953bd935f22383de6680d6a46f Mon Sep 17 00:00:00 2001 From: Avris Date: Tue, 26 Oct 2021 20:13:42 +0200 Subject: [PATCH] [zine] inversible .svg --- components/Icon.vue | 3 +- components/LinksNav.vue | 14 +++++++- components/ModeSwitch.vue | 1 + components/Submenu.vue | 8 ++--- routes/zine.vue | 8 ++++- static/img/zine-inverse.svg | 67 +++++++++++++++++++++++++++++++++++++ store/index.js | 4 +++ 7 files changed, 98 insertions(+), 7 deletions(-) create mode 100644 static/img/zine-inverse.svg diff --git a/components/Icon.vue b/components/Icon.vue index a362c460..981cb59a 100644 --- a/components/Icon.vue +++ b/components/Icon.vue @@ -9,6 +9,7 @@ v: { required: true }, set: { default: 'l' }, size: { default: 1 }, + inverse: { type: Boolean } }, computed: { valueParts() { @@ -22,7 +23,7 @@ }, iconSource() { if (this.v.endsWith('.svg')) { - return `/img/${this.v}`; + return `/img/${this.inverse ? this.v.replace('.svg', '-inverse.svg') : this.v}`; } if (this.v.startsWith('https://')) { return this.v; diff --git a/components/LinksNav.vue b/components/LinksNav.vue index 114178c1..ce9a34f1 100644 --- a/components/LinksNav.vue +++ b/components/LinksNav.vue @@ -3,9 +3,21 @@ {name: 'links.links', route: config.links.route, icon: 'bookmark', condition: config.links.links.length > 0}, {name: 'links.academic', route: config.links.academicRoute, icon: 'vial', condition: config.links.academic.length > 0}, {name: 'links.blog', route: config.links.blogRoute, icon: 'pen-nib', condition: config.links.blog}, - {name: 'links.zine.header', route: config.links.zine.route, icon: 'zine.svg', condition: config.links.zine && config.links.zine.enabled}, + {name: 'links.zine.header', route: config.links.zine.route, icon: 'zine.svg', iconInverse: darkMode, condition: config.links.zine && config.links.zine.enabled}, {name: 'links.mediaShort', route: config.links.mediaRoute, icon: 'tv', condition: config.links.mediaGuests.length > 0 || config.links.mediaMentions.length > 0}, {name: 'faq.header', route: config.faq.route, icon: 'map-marker-question', condition: config.faq.enabled}, {name: 'english.header', route: config.english.route, icon: 'globe-americas', condition: config.english.enabled}, ]"/> + + diff --git a/components/ModeSwitch.vue b/components/ModeSwitch.vue index 32ee621b..d347cbf9 100644 --- a/components/ModeSwitch.vue +++ b/components/ModeSwitch.vue @@ -38,6 +38,7 @@ isDark(dark) { this.$eventHub.$emit('mode-changed', dark); this.setMode(dark); + this.$store.commit('setDarkMode', dark); } } } diff --git a/components/Submenu.vue b/components/Submenu.vue index e6623b40..740c8fe9 100644 --- a/components/Submenu.vue +++ b/components/Submenu.vue @@ -1,20 +1,20 @@