From bff6057e0c1ebfd51d7b166ff074ddcb4557109d Mon Sep 17 00:00:00 2001 From: Samuel Elliott Date: Thu, 1 Mar 2018 00:05:29 +0000 Subject: [PATCH 1/2] Add an animation when closing the settings menu content panel --- client/src/modules/thememanager.js | 3 +- .../styles/partials/bdsettings/button.scss | 6 +++- .../partials/bdsettings/sidebarview.scss | 31 ++++++++++++---- .../src/styles/partials/sidebarview/main.scss | 7 +--- .../styles/partials/sidebarview/sidebar.scss | 3 +- client/src/ui/components/BdSettings.vue | 36 ++++++++++++------- .../src/ui/components/BdSettingsWrapper.vue | 17 +++++++-- 7 files changed, 74 insertions(+), 29 deletions(-) diff --git a/client/src/modules/thememanager.js b/client/src/modules/thememanager.js index 599ba83b..33955207 100644 --- a/client/src/modules/thememanager.js +++ b/client/src/modules/thememanager.js @@ -152,7 +152,8 @@ export default class ThemeManager extends ContentManager { } if (type === 'dropdown' || type === 'radio') { - return [name, setting.options.find(opt => opt.id === value).value]; + const option = setting.options.find(opt => opt.id === value); + return [name, option ? option.value : value]; } if (typeof value === 'boolean' || typeof value === 'number') { diff --git a/client/src/styles/partials/bdsettings/button.scss b/client/src/styles/partials/bdsettings/button.scss index df81d933..5cb54504 100644 --- a/client/src/styles/partials/bdsettings/button.scss +++ b/client/src/styles/partials/bdsettings/button.scss @@ -49,7 +49,6 @@ background: transparent; opacity: 1; box-shadow: none; - z-index: 3001; .bd-settings-button-btn { background-image: $logoBigBw; @@ -62,6 +61,11 @@ cursor: default; } } + + &.bd-active, + &.bd-animating { + z-index: 3001; + } } @keyframes bd-settings-button-pulse { diff --git a/client/src/styles/partials/bdsettings/sidebarview.scss b/client/src/styles/partials/bdsettings/sidebarview.scss index 05512f8c..0e7f175c 100644 --- a/client/src/styles/partials/bdsettings/sidebarview.scss +++ b/client/src/styles/partials/bdsettings/sidebarview.scss @@ -119,14 +119,33 @@ .platform-linux & { top: 0; } -} -.bd-settings .bd-sidebar-view.bd-stop .bd-content-region { - z-index: 3003; -} + .bd-sidebar-view.bd-stop .bd-content-region { + z-index: 3003; + } -.bd-backdrop { - z-index: 3003; + .bd-sidebar-view.active { + .bd-content-region { + transition: transform 0.4s ease-in-out, opacity 0.2s ease; + transform: none; + opacity: 1; + } + } + + &:not(.active) .bd-sidebar-view.active, + &.bd-settings-out .bd-sidebar-view.active { + .bd-content-region { + transform: translate(-600px, 0%); + opacity: 0; + width: 590px; + } + } + + &:not(.active) .bd-sidebar-view.active { + .bd-content-region { + transform: translate(-600px, 100%); + } + } } .bd-sidebar .bd-settings-button { diff --git a/client/src/styles/partials/sidebarview/main.scss b/client/src/styles/partials/sidebarview/main.scss index 59ddec14..15e0a437 100644 --- a/client/src/styles/partials/sidebarview/main.scss +++ b/client/src/styles/partials/sidebarview/main.scss @@ -31,6 +31,7 @@ background: #36393e; box-shadow: 0 0 4px #202225; backface-visibility: hidden; + transition: transform 0.6s ease; } &.bd-stop { @@ -38,10 +39,4 @@ transform: none; } } - - &.active { - .bd-content-region { - animation: bd-slidein .6s; - } - } } diff --git a/client/src/styles/partials/sidebarview/sidebar.scss b/client/src/styles/partials/sidebarview/sidebar.scss index c61c149a..6d1ee455 100644 --- a/client/src/styles/partials/sidebarview/sidebar.scss +++ b/client/src/styles/partials/sidebarview/sidebar.scss @@ -41,10 +41,11 @@ &:hover, &.active { background: $colbdblue; + color: #fff; } &.active { - color: #fff; + cursor: default; } } } diff --git a/client/src/ui/components/BdSettings.vue b/client/src/ui/components/BdSettings.vue index 11a1d5fb..a342b1f4 100644 --- a/client/src/ui/components/BdSettings.vue +++ b/client/src/ui/components/BdSettings.vue @@ -9,8 +9,8 @@ */