Mobile navigation using GSAP

Developer
Size
3,145 Kb
Views
44,528

How do I make an mobile navigation using gsap?

Mock up of a mobile nav that used some gsap and kind of a hacky material design. What is a mobile navigation using gsap? How do you make a mobile navigation using gsap? This script and codes were developed by Chris Maki on 12 August 2022, Friday.

Mobile navigation using GSAP Previews

Mobile navigation using GSAP - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Mobile navigation using GSAP</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="container"> <header></header>
<div class="box-container"> <div class="box amber"></div> <div class="box teal"></div> <div class="box purple"></div> <div class="box amber"></div> </div> <section class="btn"> <?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="hei-loader" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="-16 5.5 115.3 141.5" style="enable-background:new -16 5.5 115.3 141.5;" xml:space="preserve">
<style type="text/css">	.st0{fill:#FFFFFF;}	.st1{fill:none;stroke:#fff;stroke-width:4;stroke-miterlimit:10;}	.st2{fill:none;stroke:#fff;stroke-width:4;stroke-miterlimit:10;}
</style>
<g id="bulb_1_">
<path id="bulb-body-fill" class="bulb-body-fill" d="M79.7,67.8c0-18.4-16.9-33.2-37.7-33.2S4.3,49.4,4.3,67.8c0,7.3,2.7,14,7.1,19.4 c0.5,0.7,15.5,21.9,16.7,30.8c1.3,9.1,1.3,11.5,1.3,11.5h25.2c0,0,0-2.4,1.3-11.5c1.3-8.9,16.2-30,16.7-30.8 C77.1,81.8,79.7,75.1,79.7,67.8"/>	<path id="bulb-body" class="st1" d="M79.4,67.8c0-18.4-16.9-33.2-37.7-33.2S4,49.4,4,67.8c0,7.3,2.7,14,7.1,19.4	c0.5,0.7,15.5,21.9,16.7,30.8c1.3,9.1,1.3,11.5,1.3,11.5h25.2c0,0,0-2.4,1.3-11.5c1.3-8.9,16.2-30,16.7-30.8	C76.8,81.8,79.4,75.1,79.4,67.8"/>	<g>	<line id="one" class="st2" x1="-15.3" y1="36.8" x2="-4.8" y2="47.4"/>	<line id="two" class="st2" x1="-3.4" y1="16.6" x2="8.1" y2="32.7"/>	<line id="three" class="st2" x1="21" y1="13.2" x2="24.5" y2="26.8"/>	<line id="four" class="st2" x1="41.4" y1="5.5" x2="42.3" y2="24.9"/>	<line id="five" class="st2" x1="61.9" y1="14.2" x2="57.8" y2="27.9"/>	<line id="six" class="st2" x1="88.2" y1="19.4" x2="74.5" y2="34"/>	<line id="seven" class="st2" x1="98.7" y1="40" x2="86.2" y2="48.8"/>	</g>	<line id="middle-screw" class="st1" x1="25.9" y1="138.5" x2="58" y2="138.5"/>	<line id="bottom-screw" class="st2" x1="25.9" y1="146" x2="58" y2="146"/>
</g>
</svg> </section>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://cdnjs.cloudflare.com/ajax/libs/gsap/1.16.1/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Mobile navigation using GSAP - Script Codes CSS Codes

.container { height: 580px; width: 320px;
/* width: 580px; height: 320px;*/ border: 1px solid gray; margin: 3rem auto; overflow: hidden; position: relative;
}
header { background-color: #000 ; height: 45px;
}
.box { border: 1px solid #ccc; width: 100%; height: 35px; display: block; margin: .625rem ; opacity: 1; position: relative; /* left: 50%; */ display: none; /* visibility: hidden; */
}
.box-container { position: absolute; bottom: 60px; right: 10%; width: 40%;
}
.btn { width: 60px; height: 60px; border-radius: 50%; background-color: #8BC1C1; position: absolute; right:5px; cursor: pointer; top: 85%
}
#hei-loader { width: 35px; height: auto; margin: 8px 0 0 12px;
}
.purple { background-color: #9c27b0;
}
.teal { background-color: #009688; animation-delay: .3s;
}
.amber { background-color: #ffc107; animation-delay: 0s;
}
.bulb-body-fill { fill: none;
}
@keyframes fade { 0% { opacity: 0 } 100% { opacity: 1 }
}

Mobile navigation using GSAP - Script Codes JS Codes

function open() {
var button = $('.btn');
var box = $('.box');
var fill = $('.bulb-body-fill');
var flag = false;
button.on('click', function(){ if(flag){ fill.css({ fill: "none" }); // TweenMax.staggerTo(box, 0.2, {right:"-100%", ease:Back.easeOut}, .2); TweenMax.staggerTo(box, 0.5, {y:5, ease:Power1.easeIn}, 0.1);
box.fadeOut(400); flag = false; } else{ //TweenMax.staggerTo(box, 0.2, {right:"-150", ease:Back.easeOut}, .2); fill.css({ fill: "#ffffff" }); TweenMax.staggerTo(box, .5, { y:-40, ease:Power1.easeOut}, 0.1); box.fadeIn(500); flag = true; } });
}
open();
Mobile navigation using GSAP - Script Codes
Mobile navigation using GSAP - Script Codes
Home Page Home
Developer Chris Maki
Username chrisMaki
Uploaded August 12, 2022
Rating 3
Size 3,145 Kb
Views 44,528
Do you need developer help for Mobile navigation using GSAP?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Chris Maki (chrisMaki) Script Codes
Create amazing love letters with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!