From f7ddd0145cc64f73e5d77bc94513c7f56349f017 Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Mon, 12 Mar 2018 19:50:56 +0100 Subject: [PATCH] [webpack.header][scss.header] created default version management (only template) for header --- webpack/scss/constants.scss | 2 +- webpack/scss/header.scss | 115 +++++++++++++++++++++++++++++++++++- webpack/vue/header.vue | 23 ++++++-- 3 files changed, 134 insertions(+), 6 deletions(-) diff --git a/webpack/scss/constants.scss b/webpack/scss/constants.scss index 089657b..b49db6f 100644 --- a/webpack/scss/constants.scss +++ b/webpack/scss/constants.scss @@ -32,7 +32,7 @@ $menu-width: #{$menu-item-width + 1em}; // Header $header-bg: #fff; -$header-height: 3em; +$header-height: 4em; $c404-bubble-width: 40vh; \ No newline at end of file diff --git a/webpack/scss/header.scss b/webpack/scss/header.scss index 892e2f0..f3e8e62 100644 --- a/webpack/scss/header.scss +++ b/webpack/scss/header.scss @@ -14,8 +14,121 @@ // flex properties flex-direction: row; - justify-content: space-around; + justify-content: space-between; align-items: center; z-index: 150; + + + /* (1) Version management */ + & > div.versions{ + + /* (1.1) Version status */ + & > div.current{ + display: block; + position: relative; + + margin-left: 1em; + + padding: .5em 1em; + + padding-left: 2em; + + border: 1px solid #ddd; + border-radius: 3px; + box-shadow: 0 2px 2px #fff; + + transition: box-shadow .2s ease-in-out; + + cursor: pointer; + + // hover animation + &:hover{ box-shadow: 0 2px 2px darken(#fff,10%); } + + // color state + &:before{ + content: ''; + + display: block; + position: absolute; + top: calc( 50% - .7em/2 ); + left: calc( 1em/2 + .7em/2 ); + width: .7em; + height: .7em; + + border-radius: 50%; + + background-color: $form-invalid-color; + } + + &[data-id='0']:before{ + background-color: $form-valid-color; + } + + + } + + /* (1.2) Version dialog (to switch to another) */ + & > div.version-dialog{ + display: block; + position: absolute; + top: #{$header-height + .5em}; + left: 1em; + + // padding: 1em .5em; + + border: 1px solid #ddd; + border-radius: 3px; + + background-color: #fff; + + box-shadow: 0 2px 2px #ddd; + + overflow: hidden; + + + /* (1.2.1) version items */ + & > span{ + display: block; + position: relative; + + padding: .5em 1em; + padding-left: 2em; + + background-color: #fff; + + transition: background-color .2s ease-in-out; + + cursor: pointer; + + // hover animation + &:hover{ background-color: darken(#fff, 5%); } + + // color state + &:before{ + content: ''; + + display: block; + position: absolute; + top: calc( 50% - .7em/2 ); + left: calc( 1em/2 + .7em/2 ); + width: .7em; + height: .7em; + + border-radius: 50%; + + background-color: $form-invalid-color; + } + + &[data-id='0']:before{ + background-color: $form-valid-color; + } + + } + } + + } + + + } \ No newline at end of file diff --git a/webpack/vue/header.vue b/webpack/vue/header.vue index df96e0d..192affc 100644 --- a/webpack/vue/header.vue +++ b/webpack/vue/header.vue @@ -2,10 +2,17 @@