diff --git a/css/style.css b/css/style.css index d8b09b4..4205280 100644 --- a/css/style.css +++ b/css/style.css @@ -266,6 +266,62 @@ header h1 { } } +.cd-close-panel { + position: fixed; + top: 5px; + right: -100%; + display: block; + height: 40px; + width: 40px; + overflow: hidden; + text-indent: 100%; + white-space: nowrap; + z-index: 2; + /* Force Hardware Acceleration in WebKit */ + -webkit-transform: translateZ(0); + -moz-transform: translateZ(0); + -ms-transform: translateZ(0); + -o-transform: translateZ(0); + transform: translateZ(0); + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-transition: right 0.4s; + -moz-transition: right 0.4s; + transition: right 0.4s; +} +.cd-close-panel::before, .cd-close-panel::after { + /* close icon in CSS */ + position: absolute; + top: 16px; + left: 12px; + display: inline-block; + height: 3px; + width: 18px; + background: #6c7d8e; +} +.cd-close-panel::before { + -webkit-transform: rotate(45deg); + -moz-transform: rotate(45deg); + -ms-transform: rotate(45deg); + -o-transform: rotate(45deg); + transform: rotate(45deg); +} +.cd-close-panel::after { + -webkit-transform: rotate(-45deg); + -moz-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + -o-transform: rotate(-45deg); + transform: rotate(-45deg); +} +.cd-close-panel.move-left { + right: 2%; +} +@media only screen and (min-width: 768px) { + .cd-close-panel { + display: none; + } +} + .cd-faq-group { /* hide group not selected */ display: none; diff --git a/index.html b/index.html index 2d28fad..abbb026 100644 --- a/index.html +++ b/index.html @@ -233,6 +233,7 @@

FAQ Template

+ Close diff --git a/scss/style.scss b/scss/style.scss index 1399274..9611a9b 100644 --- a/scss/style.scss +++ b/scss/style.scss @@ -259,6 +259,51 @@ header { } } +.cd-close-panel { + position: fixed; + top: 5px; + right: -100%; + display: block; + height: 40px; + width: 40px; + overflow: hidden; + text-indent: 100%; + white-space: nowrap; + z-index: 2; + /* Force Hardware Acceleration in WebKit */ + @include transform(translateZ(0)); + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + @include transition(right .4s); + + &::before, &::after { + /* close icon in CSS */ + position: absolute; + top: 16px; + left: 12px; + display: inline-block; + height: 3px; + width: 18px; + background: $color-4; + } + + &::before { + @include transform(rotate(45deg)); + } + + &::after { + @include transform(rotate(-45deg)); + } + + &.move-left { + right: 2%; + } + + @include MQ(M) { + display: none; + } +} + .cd-faq-group { /* hide group not selected */ display: none;