Simple drawer menu

Developer
Size
5,625 Kb
Views
14,168

How do I make an simple drawer menu?

A simple drawer menu suitable for responsive and mobile applications.. What is a simple drawer menu? How do you make a simple drawer menu? This script and codes were developed by Nick Nikolov on 17 October 2022, Monday.

Simple drawer menu Previews

Simple drawer menu - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Simple drawer menu</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ body { font-family: 'Roboto', Arial, sans-serif; background: #f3f3f3; font-size: 14px; font-weight: 300; line-height: 150%; overflow-x: hidden;
}
h1,
h2,
h3,
h4,
h5 { font-family: 'Roboto Condensed', Arial, sans-serif; font-weight: 400;
}
section.container { max-width: 600px; transform-origin: 100% 0%; width: 100%; box-sizing: border-box; padding: 0 30px; padding-bottom: 80px; transition: all 0.1s ease-in-out; margin: 0 auto;
}
nav.nav { transition: all 0.1s ease-in-out; display: block; z-index: 1000; background: #223; color: #fff; width: 200px; position: fixed; top: 0; left: -200px; bottom: 0;
}
nav.nav .overlay { display: none; position: fixed; top: 0; left: 0; bottom: 0; width: 100%; z-index: -1; background: rgba(0, 0, 0, 0.2);
}
nav.nav .btn-toggle { transition: all 0.1s ease-in-out; position: absolute; right: calc(-80%); border: none; display: block; background: inherit; bottom: 20px; padding: 0 20px; margin: 0; height: 50px; line-height: 50px; border-radius: 100px; color: #fff; outline: none; box-shadow: rgba(0, 0, 0, 0.5) 0 2px 4px -2px;
}
nav.nav .btn-toggle:before { font-family: 'FontAwesome'; content: '\f0c9'; display: inline-block;
}
nav.nav .btn-toggle:after { content: 'Menu'; display: inline-block; margin-left: 10px;
}
nav.nav .profile { padding: 30px; border-bottom: 1px solid rgba(0, 0, 0, 0.7);
}
nav.nav .profile img { height: 40px; width: 40px; border-radius: 80px; float: left; margin-right: 30px;
}
nav.nav .profile img + div { overflow: hidden;
}
nav.nav .profile > div { padding-top: 7px;
}
nav.nav .profile > div h2,
nav.nav .profile > div p { margin: 0; padding: 0;
}
nav.nav .profile > div h2 { font-size: 1.2em;
}
nav.nav .profile > div p { color: #99a; font-size: 0.8em;
}
nav.nav .menu { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid rgba(0, 0, 0, 0.7);
}
nav.nav .menu > li { margin: 0; padding: 0;
}
nav.nav .menu > li > a { padding: 15px 30px; display: block; color: inherit; text-decoration: none; color: #99a;
}
nav.nav .menu > li.active a { border-right: 4px solid #fff; color: #fff;
}
nav.nav .search { border-bottom: 1px solid rgba(0, 0, 0, 0.7);
}
nav.nav .search input { display: block; box-sizing: border-box; width: 100%; padding: 30px; border: none; background: transparent;
}
.block { margin: 30px 0; background: #fff; box-shadow: rgba(0, 0, 0, 0.3) 0 2px 4px -2px;
}
.block > .content { padding: 30px;
}
.block > .content h2 a { color: inherit; text-decoration: none;
}
.block .image { height: 50vmin; max-height: 240px; background-size: cover; background-position: center center;
}
body.drawer-open { background: #ddd;
}
body.drawer-open nav.nav { box-shadow: rgba(0, 0, 0, 0.3) 2px 0 4px; left: 0;
}
body.drawer-open nav.nav .overlay { display: block;
}
body.drawer-open nav.nav + section.container { opacity: 0.2;
}
body.drawer-open nav.nav .btn-toggle { right: 20px; background: #fff; color: #000;
}
body.drawer-open nav.nav .btn-toggle:before { content: '\f00d';
}
body.drawer-open nav.nav .btn-toggle:after { content: 'Close';
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.2/normalize.min.css" />
<link href='https://fonts.googleapis.com/css?family=Roboto+Condensed:400,300' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Roboto:400,300' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
<nav class="nav"> <button class="btn-toggle" onclick="$(this).parents('body').toggleClass('drawer-open')"></button> <div class="profile"> <img src="http://lorempixel.com/200/200/people" /> <div> <h2>James Bond</h2> <p>Master Chef</p> </div> </div> <ul class="menu"> <li class="active"><a href="#"><i class="fa fa-home"></i> Home</a></li> <li><a href="#"><i class="fa fa-book"></i> Catalog</a></li> <li><a href="#"><i class="fa fa-tasks"></i> Tasks</a></li> <li><a href="#"><i class="fa fa-calculator"></i> Calculator</a></li> </ul> <div class="overlay"></div>
</nav>
<section class="container"> <div class="block"> <div class="image" style="background-image:url('http://lorempixel.com/800/400/food/')"></div> <div class="content"> <h2><a href="#">How all this mistaken idea of denouncing pleasure and praising pain?</a></h2> <p> But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure? </p> </div> </div> <div class="block"> <div class="image" style="background-image:url('http://lorempixel.com/800/400/food/2')"></div> <div class="content"> <h2><a href="#">How all this mistaken idea of denouncing pleasure and praising pain?</a></h2> <p> But I must explain to you how all this mistaken idea of denouncing pleasure and praising pain was born and I will give you a complete account of the system, and expound the actual teachings of the great explorer of the truth, the master-builder of human happiness. No one rejects, dislikes, or avoids pleasure itself, because it is pleasure, but because those who do not know how to pursue pleasure rationally encounter consequences that are extremely painful. Nor again is there anyone who loves or pursues or desires to obtain pain of itself, because it is pain, but because occasionally circumstances occur in which toil and pain can procure him some great pleasure. To take a trivial example, which of us ever undertakes laborious physical exercise, except to obtain some advantage from it? But who has any right to find fault with a man who chooses to enjoy a pleasure that has no annoying consequences, or one who avoids a pain that produces no resultant pleasure? </p> </div> </div>
</section> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
</body>
</html>

Simple drawer menu - Script Codes CSS Codes

body { font-family: 'Roboto', Arial, sans-serif; background: #f3f3f3; font-size: 14px; font-weight: 300; line-height: 150%; overflow-x: hidden;
}
h1,
h2,
h3,
h4,
h5 { font-family: 'Roboto Condensed', Arial, sans-serif; font-weight: 400;
}
section.container { max-width: 600px; transform-origin: 100% 0%; width: 100%; box-sizing: border-box; padding: 0 30px; padding-bottom: 80px; transition: all 0.1s ease-in-out; margin: 0 auto;
}
nav.nav { transition: all 0.1s ease-in-out; display: block; z-index: 1000; background: #223; color: #fff; width: 200px; position: fixed; top: 0; left: -200px; bottom: 0;
}
nav.nav .overlay { display: none; position: fixed; top: 0; left: 0; bottom: 0; width: 100%; z-index: -1; background: rgba(0, 0, 0, 0.2);
}
nav.nav .btn-toggle { transition: all 0.1s ease-in-out; position: absolute; right: calc(-80%); border: none; display: block; background: inherit; bottom: 20px; padding: 0 20px; margin: 0; height: 50px; line-height: 50px; border-radius: 100px; color: #fff; outline: none; box-shadow: rgba(0, 0, 0, 0.5) 0 2px 4px -2px;
}
nav.nav .btn-toggle:before { font-family: 'FontAwesome'; content: '\f0c9'; display: inline-block;
}
nav.nav .btn-toggle:after { content: 'Menu'; display: inline-block; margin-left: 10px;
}
nav.nav .profile { padding: 30px; border-bottom: 1px solid rgba(0, 0, 0, 0.7);
}
nav.nav .profile img { height: 40px; width: 40px; border-radius: 80px; float: left; margin-right: 30px;
}
nav.nav .profile img + div { overflow: hidden;
}
nav.nav .profile > div { padding-top: 7px;
}
nav.nav .profile > div h2,
nav.nav .profile > div p { margin: 0; padding: 0;
}
nav.nav .profile > div h2 { font-size: 1.2em;
}
nav.nav .profile > div p { color: #99a; font-size: 0.8em;
}
nav.nav .menu { margin: 0; padding: 0; list-style: none; border-bottom: 1px solid rgba(0, 0, 0, 0.7);
}
nav.nav .menu > li { margin: 0; padding: 0;
}
nav.nav .menu > li > a { padding: 15px 30px; display: block; color: inherit; text-decoration: none; color: #99a;
}
nav.nav .menu > li.active a { border-right: 4px solid #fff; color: #fff;
}
nav.nav .search { border-bottom: 1px solid rgba(0, 0, 0, 0.7);
}
nav.nav .search input { display: block; box-sizing: border-box; width: 100%; padding: 30px; border: none; background: transparent;
}
.block { margin: 30px 0; background: #fff; box-shadow: rgba(0, 0, 0, 0.3) 0 2px 4px -2px;
}
.block > .content { padding: 30px;
}
.block > .content h2 a { color: inherit; text-decoration: none;
}
.block .image { height: 50vmin; max-height: 240px; background-size: cover; background-position: center center;
}
body.drawer-open { background: #ddd;
}
body.drawer-open nav.nav { box-shadow: rgba(0, 0, 0, 0.3) 2px 0 4px; left: 0;
}
body.drawer-open nav.nav .overlay { display: block;
}
body.drawer-open nav.nav + section.container { opacity: 0.2;
}
body.drawer-open nav.nav .btn-toggle { right: 20px; background: #fff; color: #000;
}
body.drawer-open nav.nav .btn-toggle:before { content: '\f00d';
}
body.drawer-open nav.nav .btn-toggle:after { content: 'Close';
}
Simple drawer menu - Script Codes
Simple drawer menu - Script Codes
Home Page Home
Developer Nick Nikolov
Username necks
Uploaded October 17, 2022
Rating 3
Size 5,625 Kb
Views 14,168
Do you need developer help for Simple drawer menu?

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!

Nick Nikolov (necks) Script Codes
Create amazing captions 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!