1
0
mirror of https://github.com/ipdb/website.git synced 2024-12-30 16:47:45 +01:00

menu tweaks

This commit is contained in:
Matthias Kretschmann 2017-08-24 15:48:46 +02:00
parent aa364b6cd7
commit 437b9a99a6
Signed by: m
GPG Key ID: 606EEEF3C479A91F
4 changed files with 96 additions and 22 deletions

View File

@ -39,12 +39,12 @@
max-width: 55em; max-width: 55em;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
padding-left: ($spacer / 2); padding-left: $spacer;
padding-right: ($spacer / 2); padding-right: $spacer;
@media ($screen-sm) { @media ($screen-sm) {
padding-left: $spacer; padding-left: $spacer * 2;
padding-right: $spacer; padding-right: $spacer * 2;
} }
} }

View File

@ -1,6 +1,7 @@
.hero { .hero {
background: $brand-03; background: $brand-03;
padding: $spacer * 2; padding-top: $spacer * 2;
padding-bottom: $spacer * 2;
min-height: 100vh; min-height: 100vh;
&, &,
@ -18,14 +19,28 @@
} }
.menu__link { .menu__link {
color: #fff; color: rgba(#fff, .8);
&:after { &:after {
background: #fff; background: rgba(#fff, .8);
}
&:hover,
&:focus,
&.active {
color: #fff;
&:after {
background: #fff;
}
.logo {
fill: #fff;
}
} }
} }
.logo { .logo {
fill: #fff; fill: rgba(#fff, .95);
} }
} }

View File

@ -3,22 +3,31 @@
padding-top: $spacer; padding-top: $spacer;
} }
.menu__items {
max-width: 100%;
}
.menu__link { .menu__link {
display: inline-block; display: inline-block;
padding: $spacer; padding: $spacer;
text-decoration: none; text-decoration: none;
font-size: $font-size-base; font-size: $font-size-base;
font-weight: $font-weight-bold; font-weight: $font-weight-bold;
color: $link-color; color: $brand-04;
position: relative; position: relative;
&,
&:after {
transition: .25s ease-out;
}
// link line // link line
&:after { &:after {
content: ''; content: '';
position: absolute; position: absolute;
height: 2px; height: 2px;
width: 30px; width: 30px;
background: $link-color; background: $brand-04;
display: block; display: block;
left: 50%; left: 50%;
margin-left: -15px; margin-left: -15px;
@ -26,14 +35,18 @@
// hidden by default // hidden by default
transform: scale(0); transform: scale(0);
transform-origin: center; transform-origin: center;
transition: transform .2s ease-out;
} }
&:hover, &:hover,
&:focus, &:focus,
&.active { &.active {
color: $brand-03;
// show link line // show link line
&:after { transform: scale(1); } &:after {
transform: scale(1);
background: $brand-03;
}
} }
} }
@ -43,10 +56,22 @@
height: 100%; height: 100%;
display: flex; display: flex;
align-items: center; align-items: center;
transition: .25s ease-out;
&:after { &:after {
display: none; display: none;
} }
.logo {
transition: .25s ease-out;
}
&:hover,
&:focus {
.logo {
fill: $brand-03;
}
}
} }
.menu--main { .menu--main {
@ -54,7 +79,13 @@
.row { .row {
display: flex; display: flex;
justify-content: space-between; flex-wrap: wrap;
justify-content: center;
@media ($screen-sm) {
justify-content: space-between;
flex-wrap: nowrap;
}
} }
.menu__link { .menu__link {
@ -73,3 +104,26 @@
padding-top: $spacer * 2; padding-top: $spacer * 2;
padding-bottom: $spacer * 2; padding-bottom: $spacer * 2;
} }
.menu-overflow {
// yummy scrolling
white-space: nowrap;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
margin-left: -$spacer;
margin-right: -$spacer;
padding-left: $spacer;
padding-right: $spacer;
text-align: center;
&::-webkit-scrollbar { display: none; }
@media ($screen-md) {
margin: 0;
padding: 0;
white-space: normal;
overflow: visible;
text-align: right;
}
}

View File

@ -8,17 +8,22 @@
<div class="menu__items"> <div class="menu__items">
{% for link in site.data.menus.main %} <div class="menu-overflow">
{% assign active = nil %}
{% if page.url contains link.url %}
{% assign active = 'active' %}
{% endif %}
<a class="menu__link {{ active }}" href="{{ link.url }}">{{ link.title }}</a> {% for link in site.data.menus.main %}
{% endfor %} {% assign active = nil %}
{% if page.url contains link.url %}
{% assign active = 'active' %}
{% endif %}
<a class="menu__link {{ active }}" href="{{ link.url }}">{{ link.title }}</a>
{% endfor %}
<a class="menu__link button button--small button--primary" href="/foundation/">Signup</a>
<a class="menu__link button button--small" href="/foundation/">Login</a>
</div>
<a class="menu__link button button--small button--primary" href="/foundation/">Signup</a>
<a class="menu__link button button--small" href="/foundation/">Login</a>
</div> </div>
</div> </div>
</nav> </nav>