Skip to content

Instantly share code, notes, and snippets.

@tjkhara
Created May 4, 2021 07:09
Show Gist options
  • Save tjkhara/43a052e98298277cac76c88480fa2561 to your computer and use it in GitHub Desktop.
Save tjkhara/43a052e98298277cac76c88480fa2561 to your computer and use it in GitHub Desktop.
End of video 49
.navigation {
&__checkbox {
display: none;
}
&__button {
background-color: $color-white;
// This is also a circle slightly bigger than the background circle
// To cover it properly
height: 7rem;
width: 7rem;
position: fixed;
top: 6rem;
right: 6rem;
border-radius: 50%;
z-index: 2000;
}
// This is the green colored circle
&__background {
height: 6rem;
width: 6rem;
border-radius: 50%;
position: fixed;
top: 6.5rem;
right: 6.5rem;
background-image: radial-gradient(
$color-primary-light,
$color-primary-dark
);
// When we scroll this circle gets hidden behind
// to fix that we have the z-index below
z-index: 1000;
// This is to grow the circle
transform: scale(80);
}
// This is a huge element that covers the entire viewport
// so that we can center the links over this horizontally and vertically
&__nav {
height: 100vh;
width: 100%;
position: fixed;
top: 0;
right: 0;
z-index: 1500;
}
// This is the ul
// We will center this vertically and horizontally in the middle of the nav element
&__list {
// Center horizontal and vertical
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
// List style
list-style: none;
text-align: center;
}
&__item {
margin: 1rem;
}
&__link {
&:link,
&:visited {
display: inline-block;
font-size: 3rem;
padding: 1rem 2rem;
font-weight: 300;
color: $color-white;
text-decoration: none;
text-transform: uppercase;
background-image: linear-gradient(
120deg,
transparent 0%,
transparent 50%,
$color-white 50%
);
background-size: 225%;
transition: all 0.4s;
}
&:hover,
&:active {
background-position: 100%;
color: $color-primary;
transform: translateX(1rem);
}
& span {
margin-right: 1.5rem;
display: inline-block;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment