From 61cb8f66db7bb71e8bed00b1a730ab7db14745f6 Mon Sep 17 00:00:00 2001 From: Rémy Raes Date: Thu, 30 Mar 2023 01:34:33 +0200 Subject: refactor: Style (#247) * refactor: apply same style to all settings sections * refactor: only assign developer_mode through store mutation * refactor: remove useless credit mention * refactor: remove menu bar background layer * refactor: use same CSS style for both "no mod" messages For both local and thunderstore mods views. * fix: toggleDeveloperMode does not affect menu style by default * feat: adjust TS mod hint i18n regression --- src-vue/src/App.vue | 16 +++++- src-vue/src/plugins/store.ts | 17 +++---- src-vue/src/style.css | 5 ++ src-vue/src/views/SettingsView.vue | 66 ++++++++++++++----------- src-vue/src/views/mods/LocalModsView.vue | 60 +++++++++++----------- src-vue/src/views/mods/ThunderstoreModsView.vue | 21 +++----- 6 files changed, 102 insertions(+), 83 deletions(-) (limited to 'src-vue') diff --git a/src-vue/src/App.vue b/src-vue/src/App.vue index 86a1bb37..f80e000d 100644 --- a/src-vue/src/App.vue +++ b/src-vue/src/App.vue @@ -93,8 +93,20 @@ export default { top: 0; width: 100%; height: var(--fc-menu_height); - background-image: radial-gradient(transparent 1px); - backdrop-filter: saturate(50%) blur(4px); +} + +#fc__menu_bar::before { + position: absolute; + content: ""; + inset: 0; /* same as { top: 0; right: 0; bottom: 0; left: 0; } */ + background-image: linear-gradient(to bottom, red, orange); + z-index: 1; + opacity: 0; + transition: opacity 1s linear; +} + +#fc__menu_bar:hover::before { + opacity: 1; } /* Borders reset */ diff --git a/src-vue/src/plugins/store.ts b/src-vue/src/plugins/store.ts index 08f9b85f..60208879 100644 --- a/src-vue/src/plugins/store.ts +++ b/src-vue/src/plugins/store.ts @@ -51,6 +51,7 @@ export interface FlightCoreStore { let notification_handle: NotificationHandle; + export const store = createStore({ modules: { search: searchModule, @@ -87,13 +88,18 @@ export const store = createStore({ checkNorthstarUpdates(state) { _get_northstar_version_number(state); }, - toggleDeveloperMode(state) { + toggleDeveloperMode(state, affectMenuStyle = false) { state.developer_mode = !state.developer_mode; // Reset tab when closing dev mode. if (!state.developer_mode) { store.commit('updateCurrentTab', Tabs.PLAY); } + + let menu_bar_handle = document.querySelector('#fc_menu-bar'); + if (affectMenuStyle && menu_bar_handle !== null) { + menu_bar_handle.classList.toggle('developer_build'); + } }, initialize(state) { _initializeApp(state); @@ -331,14 +337,7 @@ export const store = createStore({ async function _initializeApp(state: any) { // Enable dev mode directly if application is in debug mode if (await invoke("is_debug_mode")) { - state.developer_mode = true; - - // Make menubar striped if debug build - let menu_bar_handle = document.querySelector('#fc_menu-bar'); - console.log(menu_bar_handle); - if (menu_bar_handle !== null) { - menu_bar_handle.classList.toggle('developer_build'); - } + store.commit('toggleDeveloperMode', true); } else { // Disable context menu in release build. document.addEventListener('contextmenu', event => event.preventDefault()); diff --git a/src-vue/src/style.css b/src-vue/src/style.css index 4401ac96..0366b0ed 100644 --- a/src-vue/src/style.css +++ b/src-vue/src/style.css @@ -41,3 +41,8 @@ body { height: 100%; color: white; } + +.noModMessage { + color: white; + margin: 30px 15px; +} diff --git a/src-vue/src/views/SettingsView.vue b/src-vue/src/views/SettingsView.vue index 9a92865d..e526f821 100644 --- a/src-vue/src/views/SettingsView.vue +++ b/src-vue/src/views/SettingsView.vue @@ -3,17 +3,18 @@
-

{{ $t('settings.manage_install') }}

- - - +
+

{{ $t('settings.manage_install') }}

+ + + +
@@ -40,25 +41,30 @@
-

{{ $t('settings.repair.title') }}

- - {{ $t('settings.repair.open_window') }} - + +
+

{{ $t('settings.repair.title') }}

+ + {{ $t('settings.repair.open_window') }} + +
-

{{ $t('settings.about') }}

+ +
+

{{ $t('settings.about') }}

+
+ {{ $t('settings.flightcore_version') }} {{ flightcoreVersion === '' ? 'Unknown version' : `${flightcoreVersion}` }} +
+
-
- {{ $t('settings.flightcore_version') }} {{ flightcoreVersion === '' ? 'Unknown version' : `${flightcoreVersion}` }} + +
+

{{ $t('settings.testing') }}

+ + {{ $t('settings.enable_test_channels') }} + +
-
-
- UI design inspired by TFORevive Launcher (not yet public) - -

{{ $t('settings.testing') }}

- - {{ $t('settings.enable_test_channels') }} - -
@@ -117,8 +123,8 @@ export default defineComponent({ methods: { activateDeveloperMode() { this.developerModeClicks += 1; - if (this.developerModeClicks >= 6) { - this.$store.state.developer_mode = true; + if (this.developerModeClicks >= 6 && !this.$store.state.developer_mode) { + this.$store.commit('toggleDeveloperMode'); ElNotification({ title: this.$t('settings.dev_mode_enabled_title'), message: this.$t('settings.dev_mode_enabled_text'), @@ -180,7 +186,7 @@ h3:first-of-type { /* Parameter panel styles */ .fc_parameter__panel { - margin: 30px 0; + margin-bottom: 30px; } .fc_parameter__panel h3 { diff --git a/src-vue/src/views/mods/LocalModsView.vue b/src-vue/src/views/mods/LocalModsView.vue index 4bc870fe..2cd253ae 100644 --- a/src-vue/src/views/mods/LocalModsView.vue +++ b/src-vue/src/views/mods/LocalModsView.vue @@ -1,33 +1,35 @@ diff --git a/src-vue/src/views/mods/ThunderstoreModsView.vue b/src-vue/src/views/mods/ThunderstoreModsView.vue index 0a0b9965..5a7270df 100644 --- a/src-vue/src/views/mods/ThunderstoreModsView.vue +++ b/src-vue/src/views/mods/ThunderstoreModsView.vue @@ -3,11 +3,17 @@
+ + +
+ {{ $t('mods.online.no_match') }}
+ {{ $t('mods.online.try_another_search') }} +
+
-
+
- -
- {{ $t('mods.online.no_match') }}
- {{ $t('mods.online.try_another_search') }} -
-
@@ -199,11 +199,6 @@ export default defineComponent({ margin: 0 0 0 10px !important; } -.modMessage { - color: white; - margin: 20px 5px; -} - .card-container { margin: 0 auto; } -- cgit v1.2.3