finished updating nav menu
This commit is contained in:
@@ -1,28 +1,43 @@
|
||||
#menu {
|
||||
color: white;
|
||||
transform: scale( 0 );
|
||||
transform-origin: top right;
|
||||
transition: all 1s;
|
||||
transition: width 0.8s, height 1s, border-bottom-left-radius 0.7s;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
height: 0;
|
||||
width: 0;
|
||||
cursor: default;
|
||||
background-color: rgb(18, 12, 59);
|
||||
}
|
||||
|
||||
#menu.open {
|
||||
transform: scale( 1 );
|
||||
border-bottom-left-radius: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#menu.open {
|
||||
transition: width 1s, height 0.8s, border-bottom-left-radius 1.1s;
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
border-bottom-left-radius: 0;
|
||||
}
|
||||
|
||||
.menu-container {
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
opacity: 0;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.menu-container.shown {
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
opacity: 1;
|
||||
transition: all 1s cubic-bezier(1, 0, 0, 1);
|
||||
}
|
||||
|
||||
.bottom-note {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.menu-main {
|
||||
@@ -30,13 +45,67 @@
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
flex-wrap: wrap;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.menu-category {
|
||||
padding: 1vw;
|
||||
transition: all 1s;
|
||||
transition-delay: 0.5s;
|
||||
}
|
||||
|
||||
/* TODO: Make multiple steps for this
|
||||
TODO: Optimise for mobile devices (scale vertically) */
|
||||
|
||||
.menu-cateogry-active {
|
||||
padding-right: 20vw;
|
||||
transition-delay: 0s;
|
||||
}
|
||||
|
||||
.category-list {
|
||||
background-color: rgb(18, 12, 59);
|
||||
transition: all 0.5s;
|
||||
transform: scaleY( 0 );
|
||||
position: absolute;
|
||||
transform-origin: top;
|
||||
transition-delay: 0s;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
padding-bottom: 5%;
|
||||
}
|
||||
|
||||
.category-list-active {
|
||||
transform: scaleY( 1 );
|
||||
transition-delay: 0.5s;
|
||||
}
|
||||
|
||||
/*
|
||||
Menu sub items
|
||||
*/
|
||||
.category-item {
|
||||
padding: 0.5%;
|
||||
text-decoration: none;
|
||||
color: white;
|
||||
background-color: rgba( 0, 0, 0 ,0 );
|
||||
width: 100%;
|
||||
transition: all 1s;
|
||||
}
|
||||
|
||||
.category-item:hover {
|
||||
width: 100%;
|
||||
padding: 1vh 1vw;
|
||||
background-color: rgb(0, 125, 156);
|
||||
}
|
||||
|
||||
@media only screen and ( min-width: 999px ) {
|
||||
.menu-main {
|
||||
flex-direction: row;
|
||||
}
|
||||
|
||||
.menu-category {
|
||||
padding: 2vw;
|
||||
transition: all 1s;
|
||||
transition-delay: 0.5s;
|
||||
}
|
||||
|
||||
/* TODO: Make multiple steps for this
|
||||
@@ -47,19 +116,32 @@
|
||||
transition-delay: 0s;
|
||||
}
|
||||
|
||||
.category-list {
|
||||
transition: all 0.5s;
|
||||
transform: scaleY( 0 );
|
||||
position: absolute;
|
||||
transform-origin: top;
|
||||
transition-delay: 0s;
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: flex-start;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.menu-category:hover .category-list {
|
||||
transform: scaleY( 1 );
|
||||
transition-delay: 0.5s;
|
||||
}
|
||||
|
||||
/*
|
||||
Menu sub items
|
||||
*/
|
||||
|
||||
.category-item:hover {
|
||||
width: 100%;
|
||||
padding: 1vh 1vw;
|
||||
background-color: rgb(0, 125, 156);
|
||||
}
|
||||
|
||||
.bottom-note {
|
||||
font-family: monospace;
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
bottom: 5%;
|
||||
left: 0;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
font-size: 75%;
|
||||
transition: all 1s;
|
||||
}
|
||||
}
|
||||
@@ -12,21 +12,25 @@
|
||||
<body>
|
||||
<div class="nav-container">
|
||||
<div class="nav-toggle-container">
|
||||
<div class="nav-toggle-positioner">
|
||||
<div class="nav-toggle active" onclick="menu()">
|
||||
<div class="nav-toggle-positioner" onclick="menu()">
|
||||
<div class="nav-toggle">
|
||||
<span class="line" id="line1"></span>
|
||||
<span class="line" id="line2"></span>
|
||||
<span class="line" id="line3"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="menu" class="open">
|
||||
<div id="menu">
|
||||
<div class="menu-container">
|
||||
<h2>Menu</h2>
|
||||
<h2><a href="/" style="text-decoration: none; color: white;">Home</a></h2>
|
||||
<div class="menu-main">
|
||||
<div class="menu-category">
|
||||
<div class="bottom-note">
|
||||
<p>Welcome to janishutz.com</p>
|
||||
</div>
|
||||
|
||||
<div class="menu-category" onclick="dropdown( 'projects-page' )" id="projects-page-parent">
|
||||
<h3>Projects</h3>
|
||||
<div class="category-list">
|
||||
<div class="category-list" id="projects-page">
|
||||
<a href="/projects/storagemanager" class="category-item">StorageManager</a>
|
||||
<a href="/projects/smuL" class="category-item">SimpleMediaUpscalerLite</a>
|
||||
<a href="/projects/libreevent" class="category-item">libreǝvent</a>
|
||||
@@ -36,25 +40,25 @@
|
||||
<a href="/projects/impress" class="category-item">impress.js</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-category">
|
||||
<div class="menu-category" onclick="dropdown( 'about' )" id="about-parent">
|
||||
<h3>About</h3>
|
||||
<div class="category-list">
|
||||
<div class="category-list" id="about">
|
||||
<a href="/privacypolicy" class="category-item">Privacy Policy</a>
|
||||
<a href="/about" class="category-item">About janishutz.com</a>
|
||||
<a href="/about/aboutme" class="category-item">About me</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-category">
|
||||
<div class="menu-category" onclick="dropdown( 'services' )" id="services-parent">
|
||||
<h3>Services</h3>
|
||||
<div class="category-list">
|
||||
<div class="category-list" id="services">
|
||||
<a href="/services" class="category-item">Overview</a>
|
||||
<a href="/services/websites" class="category-item">Custom Websites</a>
|
||||
<a href="/services/pcbuilding" class="category-item">PC Building</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="menu-category">
|
||||
<div class="menu-category" onclick="dropdown( 'support' )" id="support-parent">
|
||||
<h3>Support</h3>
|
||||
<div class="category-list">
|
||||
<div class="category-list" id="support">
|
||||
<a href="/support" class="category-item">Support hub</a>
|
||||
<a href="/support/faq" class="category-item">FAQ</a>
|
||||
<a href="/support/contact" class="category-item">Contact</a>
|
||||
@@ -65,10 +69,18 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function dropdown ( id ) {
|
||||
if ( window.innerWidth < 999 ) {
|
||||
$( '#' + id + '-parent' ).toggleClass( 'menu-cateogry-active' );
|
||||
$( '#' + id ).toggleClass( 'category-list-active' );
|
||||
}
|
||||
}
|
||||
|
||||
function menu () {
|
||||
$( '.menu-container' ).fadeToggle( 1000 );
|
||||
$( '#menu' ).toggleClass( 'open' );
|
||||
$( '.nav-toggle' ).toggleClass( 'active' );
|
||||
$( '.menu-container' ).toggleClass( 'shown' );
|
||||
// $( '.menu-container' ).fadeToggle( 300 );
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user