1
0
Fork 0
docsearch/docs/algolia-frontend-components/components/communityHeader/communityHeader.scss
2018-02-07 10:56:52 +01:00

957 lines
18 KiB
SCSS
Executable file

@import "./../../stylesheets/_variables.scss";
@import "./../../stylesheets/_functions.scss";
@import "./../../stylesheets/_mixins.scss";
$nav-height: 56px;
$nav-z-index: 50;
$nav-background: $deep-cove;
$nav-background-medium: mix($nav-background, #fff, 96%);
$nav-background-light: mix($nav-background, #fff, 92%);
.algc-navigation {
top: 0;
left: 0;
width: 100%;
color: #fff;
padding: 0 1em;
z-index: $z-top;
position: fixed;
perspective: 2000px;
transform-style: preserve-3d;
background: $nav-background;
font-size: 1em;
will-change: transform;
@media (max-width: $breakpoint-sm){
padding: 0 .5em;
}
.algc-mainmenu {
position: relative;
}
.algc-navigation__container{
margin: 0 auto;
max-width: $container-max-width;
}
a {
text-decoration: none;
}
}
.algc-navigation__brands {
height: $nav-height;
margin: 0;
padding: 0;
list-style-type: none;
float: left;
font-weight: $light;
display: flex;
align-items:center;
z-index: $z-1;
position: relative;
a {
text-decoration: none;
color: $white;
&:hover {
color: $white;
}
}
&:hover,
&:visited {
color: white;
}
img,svg {
max-width: none;
vertical-align: middle;
}
@media (max-width: $breakpoint-md) {
font-size: .8em;
}
.algc-navigation__li {
float: left;
text-align: center;
min-height: 33px;
display: flex;
align-items: center;
@media (min-width: $breakpoint-md) and (max-width: $breakpoint-lg) {
&:nth-child(2) {
padding-left: 0;
img,svg {
margin-left: 0px;
}
.algc-arrowseparator {
margin-left: 4px;
}
}
}
@media (max-width: $breakpoint-lg) {
&:nth-child(2) {
a { padding-left: 0; }
.algc-arrowseparator { display: none; }
}
}
@media (max-width: $breakpoint-sm) {
&:nth-child(2) {
width: 30px;
overflow: hidden;
}
}
}
a {
position: relative;
display: block;
padding-right: 12px;
@media (max-width: $breakpoint-lg) {
padding: 0 1.2em;
}
@media (max-width: $breakpoint-sm) {
padding: 0 .8em
}
}
.algc-navigation__li--algolia {
a {
padding-left: 0;
}
.algolia-logo {
width: auto;
height: 23px;
}
@media (max-width: $breakpoint-lg) {
display: none;
}
}
.algc-navigation__li--community {
a {
height: 33px;
}
.algolia-community-logo{
width: auto;
height: 30px;
}
}
}
//---------------------------
// Dropdown starts here
//---------------------------
.algc-navigation__dropdown-holder {
position: absolute;
top: $nav-height - 14px;
left: 25px;
max-width: 490px;
width: 100%;
height: 800px;
-webkit-perspective: 500px;
perspective: 500px;
pointer-events: none;
font-size: 1.2em;
@media (max-width: $breakpoint-sm) {
left:0;
max-width: 100%;
}
}
.algc-dropdownroot {
top: 4px;
width: 100%;
position: absolute;
opacity: 0;
transform-origin: 50% -50px;
transition-property: transform, opacity;
transition-duration: .25s;
will-change: transform, opacity;
pointer-events: none;
z-index: $z-top;
transform: rotateX(-15deg) translate(-50%, 0%);
&.notransition {
.algc-dropdownroot__dropdowncontainer,
.algc-dropdownroot__dropdownbg,
.algc-dropdownroot__section,
.algc-dropdownroot__dropdownarrow {
transition: none;
}
}
&.activeDropdown {
opacity: 1;
transform: translate(-50%, 0);
pointer-events: all;
.algc-dropdownroot__dropdownbg {
opacity: 1;
transform: none;
transform-origin: 50% 0;
}
}
.algc-dropdownroot__dropdownbg {
left: 0;
top: 10px;
box-shadow: 0 50px 100px rgba(50, 50, 93, .1), 0 15px 35px rgba(50, 50, 93, .15), 0 5px 15px rgba(0, 0, 0, .1);
border-radius: 4px;
transform-origin: 50% 0;
background-color: #FFF;
transition-property: transform, opacity;
transition-duration: .25s;
position: absolute;
width: 490px;
height: 360px;
will-change: transform, opacity;
}
.algc-dropdownroot__dropdownarrow {
left: 50%;
top: 6px;
background-color: #FFF;
box-shadow: -3px -3px 5px rgba(82, 95, 127, .04);
will-change: transform, opacity;
transition-property: transform, opacity;
transition-duration: .25s;
transform: rotate(45deg) translate(-50%, 0);
position: absolute;
width: 12px;
height: 12px;
border-radius: 2px;
pointer-events: none;
}
.algc-dropdownroot__dropdowncontainer {
margin: 0 auto;
position: relative;
overflow: hidden;
will-change: transform, width, height;
transition-property: transform, width, height;
transition-duration: .25s;
}
@media (max-width: $breakpoint-sm){
transform: translate(0,0) rotateX(-15deg);
&.activeDropdown {
transform: rotateX(0deg) translate(0,0) !important;
}
.algc-dropdownroot__dropdownbg {
width: 100%;
}
.algc-dropdownroot__widelist {
width: 100%;
}
.algc-dropdownroot__content {
width: 100% !important;
}
.algc-dropdownroot__section {
width:100%;
}
.algc-dropdownroot__dropdowncontainer {
width: 100% !important;
max-width: 100%;
transform: translate(0,0) !important;
}
}
}
.algc-dropdownroot__section {
position: absolute;
left: 0;
top: 0;
opacity: 0;
will-change: transform, opacity;
transition-property: transform, opacity;
transition-duration: .25s;
&.active {
opacity: 1;
transform: translateX(0);
z-index: $z-1
}
&.right {
transform: translateX(150px);
}
&.left {
transform: translateX(-150px);
}
.algc-dropdownroot__content {
position: absolute;
top: 10px;
left: 0;
background: #fff;
border-radius: 4px;
overflow: hidden;
}
}
.algc-dropdownroot__widelist {
display: flex;
flex-wrap: wrap;
list-style-type: none;
padding: 0;
width: 450px;
padding: em(10) em(20);
margin: 0;
background-color: $titan-white;
li {
flex: 50%;
border-radius: 3px;
margin: .5em auto;
a {
display: flex;
flex-wrap: wrap;
flex-direction: row;
align-items: center;
color: #333333;
background-color: $titan-white;
border-radius: 4px;
transition: background 160ms ease;
&:hover {
color: darken(#333333, 10%);
background-color: $athens-gray;
}
}
h4 {
text-align: center;
text-align: left;
margin: 0;
font-size: $text-sm;
}
.item-icon {
width: 42px;
height: 42px;
margin: 8px;
border-radius: 4px;
text-align:center;
position: relative;
img,
svg {
max-width: 60%;
transition: transform 0.2s ease 0.15s;
}
}
svg,
img {
position: absolute;
left: 50%;
top:50%;
max-width: 32px;
width: 100%;
height: auto;
transform: translate(-50%,-50%);
}
}
}
.algc-dropdownroot__footer {
text-align: center;
font-size: $text-sm;
transition: filter 0.2s ease, opacity 0.2s ease;
will-change: filter, opacity;
a {
padding: .8em 0;
display: block;
color: $nav-background;
opacity: 0.8;
&:hover {
opacity: 1;
}
}
img,
svg {
vertical-align: middle;
}
}
.algc-dropdownroot__links {
list-style-type: none;
padding: em(10) em(20);
display: flex;
flex-wrap: wrap;
width: 290px;
margin: 0;
li {
box-sizing: border-box;
display: flex;
align-items: center;
flex: 1 0 50%;
padding: em(10) em(10);
p {
margin: 0;
}
img,
svg {
margin-right: 5px;
height: 20px;
width: 20px;
}
}
}
.algc-navigation__menu {
float: right;
height: $nav-height;
line-height: $nav-height;
font-weight: $light;
z-index: $z-2;
.algc-menu__list {
list-style-type: none;
padding: 0;
margin: 0;
width: auto;
float: left;
position: relative;
z-index: $z-1;
a {
text-decoration: none;
color: $white;
}
@media (max-width: $breakpoint-md) {
display: none;
}
&__item {
position: relative;
height: $nav-height;
line-height: $nav-height;
display: inline-block;
float: left;
img,
svg {
height: $text-lg;
width: auto;
}
a {
padding: 0 .5em 0 .5em;
display: flex;
align-items: center;
height: 100%;
}
}
.algc-glyph {
margin-left: 1em;
font-size: .4em;
}
.algc-menu__list__item.algc-menu--hassublist.open {
.algc-menu__sublist {
opacity: 1;
transform: translate(0, 0);
pointer-events: auto;
transition: .25s;
}
}
}
.algc-menu__sublist {
pointer-events: none;
padding: 0;
position: absolute;
right: 0;
top:100%;
background-color: white;
list-style-type: none;
background-color: #FFF;
border-radius: 3px;
box-shadow: 0 1px 4px 0 rgba(31, 59, 93, 0.5);
font-size: 14px;
opacity:0;
transition: .14s;
transform: translate(0, 6px);
will-change: opacity, transform;
text-align: left;
&:before{
content: "";
position: absolute;
right: 16px;
top: -4px;
height: 12px;
width: 12px;
border-radius: 3px;
transform: rotate(45deg);
background-color: #FFF;
}
li:not(:last-child) {
border-bottom: solid 1px #eee;
}
li a {
text-transform: none;
margin: 0;
width: 100%;
border: none;
display: block;
padding: 1em 2em;
clear: both;
font-weight: normal;
line-height: 1.42857;
color: #333333;
white-space: nowrap;
font-size: 1em;
&:hover {
color: darken(#333333, 10%);
background-color: #f9f9f9;
}
}
}
}
.algc-mobilemenu{
display: block;
position: fixed;
top: 0;
right: 0;
width: 100%;
max-width: 200px;
padding: 64px $text-sm 0 $text-sm;
height: 100vh;
background-color: $deep-cove;
text-align: right;
font-weight: $light;
transform: translate(100%, 0);
transition: transform 140ms ease-out,
opacity 140ms 100ms ease-out;
opacity: 0;
will-change: transform;
a {
color: $white;
}
&:before{
width:100%;
height:100vh;
position: absolute;
content: "";
left:0;
top: 0;
box-shadow: 0 0 36px 3px rgba(0, 0, 0, 0.2);
z-index: $z--1;
}
&:after {
width: 100%;
height: 100%;
max-height: 40px;
bottom:0;
left:0;
position: fixed;
content: "";
background-image: -webkit-linear-gradient(bottom, transparent 0%,rgba(5,15,44,1) 100%);
}
&--open {
opacity: 1;
transition: 360ms cubic-bezier(0.19, 1, 0.22, 1);
transform: translate(0, 0);
}
@media (min-width: $breakpoint-md) {
display: none;
}
.algc-mobilemenulist {
list-style-type: none;
padding: 0 0 40px 0;
margin-bottom: 0;
position: absolute;
top:74px;
right:0;
width: 100%;
height: 100%;
overflow: auto;
}
.algc-mobilemenu__item {
line-height: 2.6;
position: relative;
&:after {
bottom: 0;
width:100%;
height: 1px;
position: absolute;
content: "";
display: block;
background: linear-gradient(76deg, rgba(28,199,208,0.01) 0%,rgba(28,199,208,0) 18%, rgba(28,199,208,0.49) 46%,rgba(80,191,221,.7) 93%,rgba(125,185,232,0) 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
}
&:last-child {
&:after {
background-color: trasparent;
}
}
}
a {
padding: 0 $text-xs;
display: flex;
align-items: center;
justify-content: flex-end;
}
img, svg {
height: 1em;
margin-right: .4em;
}
}
// Docsearch input
.algc-menu__search {
width: auto;
padding: 0 12px;
height: $nav-height;
display: inline-block;
float: left;
font-size: $text-sm;
&--holder {
position: relative;
width: 32px;
height: $nav-height;
}
.algc-search__input {
button {
appearance: none;
border: none;
background: transparent;
position: absolute;
z-index: $z-1;
top: 50%;
bottom: 0;
margin: 0;
outline: none;
display: none;
width: 1.6em;
height: 1.6em;
transition: transform 0.28s ease;
transform: translate(0,-50%);
cursor: pointer;
transform: translate(0,-50%);
img,
svg {
top: 0;
bottom: 0;
left: 0;
right: 0;
width: 100%;
height: auto;
max-width: 16px;
max-height: $nav-height;
vertical-align: middle;
position: absolute;
margin: auto;
pointer-events: all;
transition: opacity 0.28s ease 0.15s;
@media (max-width: $breakpoint-sm) {
margin-top: 2px;
}
use {
fill: #fff
}
}
&#search {
z-index: $z-2;
display: block;
}
&#cancel {
z-index: $z-1;
display: block;
pointer-events: none;
opacity: 0;
right: -.35em;
transition: 40ms ease;
transform: translate(0, -40%) scale(.7);
img,
svg {
width: 12px;
top: 50%;
transform: translate(0,-50%);
}
}
}
// DOCSEARCH RELATED
input[type=search] {
padding: 0;
margin: 0 0 0 2.4em;
appearance: none;
background: transparent;
width: 32px;
max-height: 32px;
border: 1px solid transparent;
position: relative;
left: 0;
z-index: $z-1;
cursor: pointer;
transition: background 0.28s ease, transform 0.28s ease, width 0.28s ease;
padding: 8px;
outline: none;
font-weight: $light;
border-radius: 3px;
padding-left: 1.8em;
color: #fff;
line-height: 1.3em;
padding-right: 1.4em;
}
}
&--holder.open {
// DOCSEARCH RELATED
input[type="search"] {
background-color: rgba(white, 0.2);
width: 300px;
transform: translate(-300px);
outline: none;
cursor: auto;
#searchbox {
background-color: inherit !important;
}
@media (max-width: $breakpoint-xl){
transform: translate(-180px);
width: 180px;
}
@media (max-width: $breakpoint-md) and (orientation: landscape) {
transform: translate(-240px);
width: 240px;
}
@media (max-width: $breakpoint-sm) {
transform: translate(-140px);
width: 140px;
}
@media (max-width: 370px) {
transform: translate(-110px);
width: 110px;
}
@include placeholder {
color: rgba(#ffffff, 0.3);
}
}
button#search {
transform: translate(calc(-300px + 4em), -50%);
@media (max-width: 1180px){
transform: translate(calc(-180px + 4em), -50%);
}
@media (max-width: $breakpoint-md) and (orientation: landscape) {
transform: translate(calc(-240px + 4em), -50%);
}
@media (max-width: $breakpoint-sm) {
transform: translate(calc(-140px + 4em), -50%);
}
@media (max-width: 370px) {
transform: translate(calc(-110px + 4em), -50%)
}
}
button#cancel {
transition: 300ms 300ms ease;
pointer-events: auto;
opacity: 1;
}
}
}
.algolia-autocomplete {
position: inherit !important;
display: initial !important;
input#searchbox,
input[type="search"] {
vertical-align: middle !important;
-webkit-appearance: none;
appearance: none;
font-size: 16px;
@media (min-width: $breakpoint-sm) {
margin-top: -2px;
}
}
.ds-dropdown-menu {
top: $nav-height - 10px !important;
left: -438px !important;
right: inherit !important;
line-height: 26px !important;
font-size: $text-lg;
@media (max-width: $breakpoint-sm) {
margin-top: 0;
top: $nav-height !important;
left:0 !important;
right:0 !important;
width: 100% !important;
position:fixed !important;
min-width: 0 !important;
border-radius: 0;
&:before {
display: none;
}
[class^=ds-dataset-] {
border-radius: 0;
border-left: 0;
border-right: 0;
border-top: 0;
}
.algolia-docsearch-suggestion--subcategory-column {
white-space: nowrap;
text-overflow: ellipsis;
padding-right: 14px;
overflow: hidden;
}
}
}
}
.algc-openmobile {
height: 40px;
width: 40px;
vertical-align: middle;
position: relative;
z-index: $z-1;
cursor: pointer;
z-index: $z-3;
background-color: $deep-cove;
border: none;
&:focus {
outline: none;
}
@media (min-width: $breakpoint-md) {
display: none;
}
span {
height: 2px;
width: 62%;
top:50%;
left: 50%;
transform: translate(-50%, -50%);
transition: 140ms ease-out;
background-color: rgba($white, .88);
position: absolute;
&:before,
&:after {
content: "";
width: 100%;
height: 2px;
background-color: inherit;
position: absolute;
transition: 130ms ease-out;
transform: translate(-50%,-50%);
}
&:before {
transform-origin: left center;
margin-top: -4px;
}
&:after{
transform-origin: left center;
margin-top: 6px;
}
}
&--open {
span {
transition: 130ms ease-out;
transform: translate(-70%,-50%);
&:before,
&:after{
transition: 130ms ease-out;
transform: translate(-20%,-50%);
}
}
}
}
.algc-arrowseparator {
height: 33px;
margin-right: 16px;
}