From 9fb914fb702a13970dd164fc7ad4682ffeafc35c Mon Sep 17 00:00:00 2001 From: Samuel Elliott Date: Wed, 14 Feb 2018 17:55:10 +0000 Subject: [PATCH 1/5] Add settings schemes --- client/src/modules/contentmanager.js | 1 + client/src/modules/plugin.js | 1 + client/src/modules/theme.js | 1 + .../src/styles/partials/bdsettings/index.scss | 1 + .../partials/bdsettings/settings-schemes.scss | 47 ++++++++++ client/src/ui/components/BdSettings.vue | 2 +- client/src/ui/components/bd/SettingsPanel.vue | 87 +++++++++++++++---- .../ui/components/bd/modals/SettingsModal.vue | 2 +- client/src/ui/modals.js | 8 +- tests/plugins/Depend Error Test/config.json | 6 +- tests/plugins/Example 2/config.json | 2 +- tests/plugins/Example 2/index.js | 2 +- tests/themes/Example/config.json | 82 +++++++++++++++-- 13 files changed, 206 insertions(+), 36 deletions(-) create mode 100644 client/src/styles/partials/bdsettings/settings-schemes.scss diff --git a/client/src/modules/contentmanager.js b/client/src/modules/contentmanager.js index c53bbaf1..2a806b68 100644 --- a/client/src/modules/contentmanager.js +++ b/client/src/modules/contentmanager.js @@ -173,6 +173,7 @@ export default class { const configs = { defaultConfig: readConfig.defaultConfig, + schemes: readConfig.configSchemes, userConfig } diff --git a/client/src/modules/plugin.js b/client/src/modules/plugin.js index 3c944897..0a4aa768 100644 --- a/client/src/modules/plugin.js +++ b/client/src/modules/plugin.js @@ -51,6 +51,7 @@ export default class Plugin { get main() { return this.__pluginInternals.main } get defaultConfig() { return this.configs.defaultConfig } get userConfig() { return this.configs.userConfig } + get configSchemes() { return this.configs.schemes } get id() { return this.info.id || this.name.replace(/[^a-zA-Z0-9-]/g, '-').replace(/--/g, '-') } get name() { return this.info.name } get authors() { return this.info.authors } diff --git a/client/src/modules/theme.js b/client/src/modules/theme.js index 34081010..2bfcb5f6 100644 --- a/client/src/modules/theme.js +++ b/client/src/modules/theme.js @@ -51,6 +51,7 @@ export default class Theme { get main() { return this.__themeInternals.main } get defaultConfig() { return this.configs.defaultConfig } get userConfig() { return this.configs.userConfig } + get configSchemes() { return this.configs.schemes } get id() { return this.info.id || this.name.toLowerCase().replace(/[^a-zA-Z0-9-]/g, '-').replace(/\s+/g, '-') } get name() { return this.info.name } get authors() { return this.info.authors } diff --git a/client/src/styles/partials/bdsettings/index.scss b/client/src/styles/partials/bdsettings/index.scss index 9b482385..258a9019 100644 --- a/client/src/styles/partials/bdsettings/index.scss +++ b/client/src/styles/partials/bdsettings/index.scss @@ -3,3 +3,4 @@ @import './plugins.scss'; @import './card.scss'; @import './tooltips.scss'; +@import './settings-schemes.scss'; diff --git a/client/src/styles/partials/bdsettings/settings-schemes.scss b/client/src/styles/partials/bdsettings/settings-schemes.scss new file mode 100644 index 00000000..8f664c21 --- /dev/null +++ b/client/src/styles/partials/bdsettings/settings-schemes.scss @@ -0,0 +1,47 @@ +.bd-settings-schemes { + margin-bottom: 15px; + border-bottom: 1px solid rgba(114, 118, 126, 0.3); + + .bd-settings-schemes-container { + margin-right: -15px; + } +} + +.bd-settings-scheme { + display: inline-block; + width: calc(33.3% - 15px); + margin: 0 15px 15px 0; + cursor: pointer; + + .bd-settings-modal & { + width: calc(50% - 15px); + + .bd-settings-scheme-icon { + height: 120px; + } + } + + .bd-settings-scheme-icon { + box-sizing: border-box; + width: 100%; + height: 120px; + border: 2px solid $coldimwhite; + border-radius: 3px; + transition: border-color 0.2s ease; + margin-bottom: 15px; + background: center / cover no-repeat #2f3136; + } + + .bd-settings-scheme-name { + font-weight: 500; + color: #f6f6f7; + } + + &.bd-active { + cursor: default; + + .bd-settings-scheme-icon { + border-color: $colbdblue; + } + } +} diff --git a/client/src/ui/components/BdSettings.vue b/client/src/ui/components/BdSettings.vue index 986848b6..b3073676 100644 --- a/client/src/ui/components/BdSettings.vue +++ b/client/src/ui/components/BdSettings.vue @@ -33,7 +33,7 @@
- +
diff --git a/client/src/ui/components/bd/SettingsPanel.vue b/client/src/ui/components/bd/SettingsPanel.vue index 2ed3b8f8..ae12ed73 100644 --- a/client/src/ui/components/bd/SettingsPanel.vue +++ b/client/src/ui/components/bd/SettingsPanel.vue @@ -9,39 +9,92 @@ */