From c5442f709d56c6f6c48d674f6811b46113827e95 Mon Sep 17 00:00:00 2001 From: Samuel Elliott Date: Sat, 3 Feb 2018 14:52:58 +0000 Subject: [PATCH 1/2] Add drawers and hairline when scrolling in a modal and organise form SCSS files --- .../src/styles/partials/bdsettings/index.scss | 3 +- .../bdsettings/plugin-settings-modal.scss | 69 +++++++++++++++++++ .../partials/bdsettings/plugincard.scss | 58 ---------------- .../src/styles/partials/generic/drawers.scss | 29 ++++++++ client/src/styles/partials/generic/forms.scss | 42 ++++++++++- client/src/styles/partials/generic/index.scss | 3 +- .../src/styles/partials/generic/modals.scss | 22 ++++-- .../src/styles/partials/generic/switches.scss | 47 ++----------- .../ui/components/bd/PluginSettingsModal.vue | 15 ++-- client/src/ui/components/common/Drawer.vue | 39 +++++++++++ client/src/ui/components/common/Modal.vue | 11 ++- .../ui/components/common/SettingSwitch.vue | 16 +++-- 12 files changed, 230 insertions(+), 124 deletions(-) create mode 100644 client/src/styles/partials/bdsettings/plugin-settings-modal.scss create mode 100644 client/src/styles/partials/generic/drawers.scss create mode 100644 client/src/ui/components/common/Drawer.vue diff --git a/client/src/styles/partials/bdsettings/index.scss b/client/src/styles/partials/bdsettings/index.scss index 66455ea4..247ad836 100644 --- a/client/src/styles/partials/bdsettings/index.scss +++ b/client/src/styles/partials/bdsettings/index.scss @@ -2,4 +2,5 @@ @import './sidebarview.scss'; @import './plugins.scss'; @import './plugincard.scss'; -@import './tooltips.scss'; \ No newline at end of file +@import './tooltips.scss'; +@import './plugin-settings-modal.scss'; diff --git a/client/src/styles/partials/bdsettings/plugin-settings-modal.scss b/client/src/styles/partials/bdsettings/plugin-settings-modal.scss new file mode 100644 index 00000000..ea8e9564 --- /dev/null +++ b/client/src/styles/partials/bdsettings/plugin-settings-modal.scss @@ -0,0 +1,69 @@ +.bd-plugin-settings-modal { + .bd-modal .bd-modal-body { + padding: 0; + } + + .bd-scroller-wrap .bd-scroller { + margin: 0; + padding: 0; + } + + .bd-plugin-settings-body { + margin-bottom: 80px; + padding: 0 15px; + + .bd-setting-switch { + .bd-switch-wrapper { + flex: 0 0 auto; + user-select: none; + position: relative; + width: 40px; + height: 20px; + display: block; + + input { + position: absolute; + opacity: 0; + cursor: pointer; + width: 100%; + height: 100%; + z-index: 1; + } + + .bd-switch { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background: #72767d; + border-radius: 14px; + transition: background .15s ease-in-out,box-shadow .15s ease-in-out,border .15s ease-in-out; + + &:before { + content: ""; + display: block; + width: 14px; + height: 14px; + position: absolute; + top: 3px; + left: 3px; + bottom: 3px; + background: #f6f6f7; + border-radius: 10px; + transition: all .15s ease; + box-shadow: 0 3px 1px 0 rgba(0,0,0,.05), 0 2px 2px 0 rgba(0,0,0,.1), 0 3px 3px 0 rgba(0,0,0,.05); + } + + &.bd-checked { + background: $colbdblue; + + &::before { + transform: translateX(20px); + } + } + } + } + } + } +} diff --git a/client/src/styles/partials/bdsettings/plugincard.scss b/client/src/styles/partials/bdsettings/plugincard.scss index 40f26646..96d93feb 100644 --- a/client/src/styles/partials/bdsettings/plugincard.scss +++ b/client/src/styles/partials/bdsettings/plugincard.scss @@ -110,61 +110,3 @@ } } } - -.bd-plugin-settings-body { - margin-bottom: 80px; - - .bd-setting-switch { - .bd-switch-wrapper { - flex: 0 0 auto; - user-select: none; - position: relative; - width: 40px; - height: 20px; - display: block; - - input { - position: absolute; - opacity: 0; - cursor: pointer; - width: 100%; - height: 100%; - z-index: 1; - } - - .bd-switch { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - background: #72767d; - border-radius: 14px; - transition: background .15s ease-in-out,box-shadow .15s ease-in-out,border .15s ease-in-out; - - &:before { - content: ""; - display: block; - width: 14px; - height: 14px; - position: absolute; - top: 3px; - left: 3px; - bottom: 3px; - background: #f6f6f7; - border-radius: 10px; - transition: all .15s ease; - box-shadow: 0 3px 1px 0 rgba(0,0,0,.05), 0 2px 2px 0 rgba(0,0,0,.1), 0 3px 3px 0 rgba(0,0,0,.05); - } - - &.bd-checked { - background: $colbdblue; - - &::before { - transform: translateX(20px); - } - } - } - } - } -} diff --git a/client/src/styles/partials/generic/drawers.scss b/client/src/styles/partials/generic/drawers.scss new file mode 100644 index 00000000..6ec146de --- /dev/null +++ b/client/src/styles/partials/generic/drawers.scss @@ -0,0 +1,29 @@ +.bd-drawer { + .bd-drawer-open-button { + svg { + transition: transform 0.2s ease; + transform: rotate(0deg); + } + } + + .bd-drawer-contents { + display: none; + } + + &:not(.bd-drawer-open) { + padding-bottom: 5px; + border-bottom: 1px solid rgba(114, 118, 126, 0.3); + } + + &.bd-drawer-open { + .bd-drawer-open-button { + svg { + transform: rotate(45deg); + } + } + + .bd-drawer-contents { + display: block; + } + } +} diff --git a/client/src/styles/partials/generic/forms.scss b/client/src/styles/partials/generic/forms.scss index a5ad77c2..dd610d66 100644 --- a/client/src/styles/partials/generic/forms.scss +++ b/client/src/styles/partials/generic/forms.scss @@ -1,3 +1,39 @@ +.bd-form-header { + margin: 15px 0 10px; + color: rgba(255, 255, 255, 0.15); + font-size: 14px; + font-weight: 700; + line-height: 16px; + text-transform: uppercase; + font-weight: 600; + flex-shrink: 0; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-family: Whitney, Helvetica Neue, Helvetica, Arial, sans-serif; + display: flex; + + .bd-form-header-text { + flex: 1 1 auto; + } + + .bd-form-header-button { + flex: 0 0; + margin-left: 5px; + + svg { + width: 16px; + height: 16px; + cursor: pointer; + fill: #ccc; + + &:hover { + fill: #fff; + } + } + } +} + .bd-form-item h5 { color: #b9bbbe; text-transform: uppercase; @@ -14,7 +50,7 @@ .bd-form-textinput + &, .bd-form-fileinput + &, .bd-setting-switch + & { - margin: 0 0 15px 0; + margin: 15px 0; } } @@ -59,7 +95,8 @@ } .bd-form-textinput, -.bd-form-fileinput { +.bd-form-fileinput, +.bd-setting-switch { .bd-title { display: flex; @@ -79,7 +116,6 @@ font-size: 14px; font-weight: 500; margin-top: 5px; - margin-bottom: 15px; line-height: 20px; border-bottom: 0px solid rgba(114, 118, 126, 0.1); } diff --git a/client/src/styles/partials/generic/index.scss b/client/src/styles/partials/generic/index.scss index 4bbcc2ca..15e03cab 100644 --- a/client/src/styles/partials/generic/index.scss +++ b/client/src/styles/partials/generic/index.scss @@ -4,4 +4,5 @@ @import './buttons.scss'; @import './forms.scss'; @import './material-buttons.scss'; -@import './modals.scss'; \ No newline at end of file +@import './modals.scss'; +@import './drawers.scss'; diff --git a/client/src/styles/partials/generic/modals.scss b/client/src/styles/partials/generic/modals.scss index cca6c5b2..f5dea896 100644 --- a/client/src/styles/partials/generic/modals.scss +++ b/client/src/styles/partials/generic/modals.scss @@ -56,36 +56,50 @@ .bd-modal-header { display: flex; padding: 15px; + flex: 0 0; + -webkit-transition: -webkit-box-shadow .1s ease-out; + transition: -webkit-box-shadow .1s ease-out; + transition: box-shadow .1s ease-out; .bd-modal-headertext { color: #FFF; font-weight: 700; - margin-bottom: 15px; - padding-bottom: 15px; flex-grow: 1; + line-height: 18px; + padding: 1px; } .bd-modal-x { display: flex; width: 20px; height: 20px; - border: 1px solid transparent; border-radius: 3px; cursor: pointer; align-content: center; justify-content: center; align-items: center; + margin-left: -2px -2px -2px 10px; + padding: 2px; .bd-material-design-icon { - fill: #FFF; + fill: #ccc; } &:hover { background: #2d2f34; + + .bd-material-design-icon { + fill: #fff; + } } } } + &.bd-modal-scrolled .bd-modal-header { + -webkit-box-shadow: 0 1px 0 0 rgba(24,25,28,.3), 0 1px 2px 0 rgba(24,25,28,.3); + box-shadow: 0 1px 0 0 rgba(24,25,28,.3), 0 1px 2px 0 rgba(24,25,28,.3); + } + .bd-modal-body { padding: 0 15px; } diff --git a/client/src/styles/partials/generic/switches.scss b/client/src/styles/partials/generic/switches.scss index 7d9d8b05..1a49f0e2 100644 --- a/client/src/styles/partials/generic/switches.scss +++ b/client/src/styles/partials/generic/switches.scss @@ -7,20 +7,6 @@ -webkit-box-align: stretch; align-items: stretch; - .bd-title { - display: flex; - justify-content: flex-start; - -webkit-box-align: stretch; - align-items: stretch; - -webkit-box-direction: normal; - -webkit-box-orient: horizontal; - display: -webkit-box; - display: -ms-flexbox; - display: flex; - flex-direction: row; - box-sizing: border-box; - } - .bd-switch-wrapper { flex: 0 0 auto; user-select: none; @@ -73,36 +59,15 @@ } } - .bd-title h3 { - font-weight: 500; - color: #f6f6f7; - flex: 1; - line-height: 24px; - margin-bottom: 0; - margin-top: 0; + .bd-setting-switch-wrap { + transition: opacity 0.2s ease; } - .bd-hint { - flex: 1 1 auto; - color: #72767d; - font-size: 14px; - font-weight: 500; - margin-bottom: 15px; - line-height: 30px; - border-bottom: 0px solid hsla(218,5%,47%,.1); - } + &.bd-disabled .bd-setting-switch-wrap { + opacity: 0.6; - + .bd-form-divider { - margin: 0 0 10px 0; - } - - &.bd-disabled { - input { - cursor: not-allowed; - } - - .bd-switch::before { - background: #888888; + &, input { + cursor: not-allowed !important; } } } diff --git a/client/src/ui/components/bd/PluginSettingsModal.vue b/client/src/ui/components/bd/PluginSettingsModal.vue index 34e5d5b8..b2a319cd 100644 --- a/client/src/ui/components/bd/PluginSettingsModal.vue +++ b/client/src/ui/components/bd/PluginSettingsModal.vue @@ -9,7 +9,7 @@ */