Mobile Navigation Pattern

Developer
Size
5,939 Kb
Views
26,312

How do I make an mobile navigation pattern?

What is a mobile navigation pattern? How do you make a mobile navigation pattern? This script and codes were developed by Daniel Gooß on 10 November 2022, Thursday.

Mobile Navigation Pattern Previews

Mobile Navigation Pattern - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Mobile Navigation Pattern</title> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel='stylesheet prefetch' href='https://fonts.googleapis.com/css?family=Roboto:400,700'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="0 0 24 24" class="hidden"> <symbol id="loupe" viewBox="0 0 24 24"> <title>Search</title> <path d="M14 0C8.5 0 4 4.5 4 10c0 2.4 0.8 4.6 2.3 6.3L0 22.6 1.4 24l6.3-6.3C9.4 19.2 11.6 20 14 20c5.5 0 10-4.5 10-10C24 4.5 19.5 0 14 0zM14 18c-4.4 0-8-3.6-8-8 0-4.4 3.6-8 8-8s8 3.6 8 8C22 14.4 18.4 18 14 18z"/> </symbol> <symbol id="burger" viewBox="0 0 24 24"> <title>Menu</title> <rect y="3" width="24" height="2"/> <rect y="19" width="24" height="2"/> <rect y="11" width="24" height="2"/> </symbol> <symbol id="user" viewBox="0 0 24 24"> <title>Profile</title> <path d="M24.09 24H-0.09l0.09-1.08c0.6-7 6.11-8.7 7.79-9.06 0.54-0.11 0.67-0.95 0.7-1.5C7.12 10.43 6.5 7.5 6.5 5.37 6.5 1.91 8.45 0 12 0s5.5 1.91 5.5 5.37c0 2.13-0.62 5.06-1.99 6.99 0.03 0.55 0.16 1.39 0.7 1.5 1.68 0.36 7.2 2.06 7.79 9.06L24.09 24zM2.15 22h19.71c-0.87-4.58-4.47-5.85-6.06-6.19 -0.68-0.14-2.28-0.79-2.29-3.71L13.5 11.75l0.22-0.34c1.05-1.31 1.78-3.79 1.78-6.04C15.5 3.01 14.45 2 12 2S8.5 3.01 8.5 5.37c0 2.25 0.73 4.73 1.78 6.04l0.25 0.32 -0.04 0.4c-0.01 2.9-1.6 3.55-2.29 3.69C6.62 16.15 3.01 17.42 2.15 22z"/> </symbol>
</svg>
<input type="checkbox" name="" id="main-nav-toggle" hidden="true" />
<div class="app-wrapper"> <header class="main-header"> <a href="" class="logo">MobileSite</a> <label for="main-nav-toggle" class="icon main-nav-trigger" title="Menu"> <svg viewBox="0 0 100 100"> <use xlink:href="#burger"/> </svg> </label> <label for="" class="icon search-trigger" title="Search"> <svg viewBox="0 0 100 100"> <use xlink:href="#user"/> </svg> </label> </header> <nav role="navigation" class="main-nav"> <label class="search-container"> <input type="text" class="search" name="search"/> <div class="icon loupe"> <svg viewBox="0 0 100 100"> <use xlink:href="#loupe"/> </svg> </div> </label> <ol> <li> <a href="">Home</a> </li> <li> <input id="UI_nav01" class="UI_state UI_toggleBox" type="radio" hidden="true" name="test"/> <label for="UI_nav01" class="pp_expandBtn" title="Expand">Variables</label> <ol> <li> <a href="" class="showAll">All</a> </li> <li> <a href="">Test</a> </li> <li> <a href="">Fonts</a> </li> <li> <a href="">Spacings</a> </li> </ol> </li> <li> <input id="UI_nav02" class="UI_state UI_toggleBox" type="radio" hidden="true" name="test"/> <label for="UI_nav02" class="pp_expandBtn" title="Expand">Testlink #2</label> <ol> <li> <a href="" class="showAll">All</a> </li> <li> <a href="">Test</a> </li> <li> <a href="">Fonts</a> </li> <li> <a href="">Spacings</a> </li> </ol> </li> <li> <a href="">Testlink #3</a> </li> <li> <a href="">Testlink #4</a> </li> <li> <a href="">Testlink #5</a> </li> <li> <a href="">Testlink #6</a> </li> <li> <a href="">Testlink #7</a> </li> <li> <a href="">Testlink #8</a> </li> <li> <a href="">Testlink #9</a> </li> <li> <a href="">Testlink #10</a> </li> </ol> </nav> <main class="main-content"> <h1>Lorem Ipsum</h1> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nisi officiis velit sint ipsam, impedit id reiciendis fugiat repellat aliquam harum sequi, saepe minus. Numquam natus provident eveniet praesentium saepe dolorum.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nisi officiis velit sint ipsam, impedit id reiciendis fugiat repellat aliquam harum sequi, saepe minus. Numquam natus provident eveniet praesentium saepe dolorum. Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ea excepturi, id animi placeat, sequi omnis laudantium amet, unde sunt ipsa magni dolor, numquam fugit? Ut, cumque alias quo officia optio.</p> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Nisi officiis velit sint ipsam, impedit id reiciendis fugiat repellat aliquam harum sequi, saepe minus. Numquam natus provident eveniet praesentium saepe dolorum.</p> </main>
</div> <script src="js/index.js"></script>
</body>
</html>

Mobile Navigation Pattern - Script Codes CSS Codes

body { position: relative; max-width: 100%; color: #333; font-size: 16px; font-family: 'Roboto', sans-serif;
}
* { box-sizing: border-box;
}
.hidden { display: none; height: 0;
}
.app-wrapper { position: relative; width: 100%; overflow-x: hidden;
}
.main-header,
.main-nav,
.main-content { -webkit-transition: -webkit-transform 0.5s ease-in-out; transition: -webkit-transform 0.5s ease-in-out; transition: transform 0.5s ease-in-out; transition: transform 0.5s ease-in-out, -webkit-transform 0.5s ease-in-out;
}
#main-nav-toggle:checked ~ .app-wrapper { /*overflow: hidden; height: 100vh;*/
}
#main-nav-toggle:checked ~ .app-wrapper .main-nav { -webkit-transform: translateX(100%); transform: translateX(100%);
}
#main-nav-toggle:checked ~ .app-wrapper .main-content,
#main-nav-toggle:checked ~ .app-wrapper .main-header { -webkit-transform: translateX(80%); transform: translateX(80%); -webkit-transform: translateX(85vw); transform: translateX(85vw);
}
.main-header { z-index: 2; position: fixed; top: 0; left: 0; width: 100%;
}
.main-nav { position: fixed; overflow-y: scroll; -webkit-overflow-scrolling: touch; top: 0; right: 100%; height: 100vh; width: 80%; width: 85vw; padding: 0 0 70px 0;
}
.main-header { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; -webkit-box-align: center; -ms-flex-align: center; align-items: center; height: 60px; padding: 14px 5vw; background-color: #fff; background-color: #3079d0; color: #fff; border-bottom: 1px solid #ddd; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.main-header .logo { -webkit-box-flex: 1; -ms-flex-positive: 1; flex-grow: 1; -webkit-box-ordinal-group: 1; -ms-flex-order: 0; order: 0; margin: 0 20px; color: inherit; font-size: 1.25em; text-align: center; text-decoration: none;
}
.icon { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; -webkit-box-align: center; -ms-flex-align: center; align-items: center; width: 24px; font-size: 0; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.icon svg { display: block; width: 100%; max-height: 100%; fill: currentColor;
}
.icon svg use { fill: inherit;
}
.main-nav-trigger { -webkit-box-ordinal-group: 0; -ms-flex-order: -1; order: -1;
}
.search-container { display: -webkit-box; display: -ms-flexbox; display: flex; -webkit-box-orient: horizontal; -webkit-box-direction: normal; -ms-flex-direction: row; flex-direction: row; -webkit-box-align: stretch; -ms-flex-align: stretch; align-items: stretch; -webkit-box-flex: 0; -ms-flex: none; flex: none; height: 60px; padding: 12px 5vw; background-color: #fff; border-bottom: 1px solid #ddd; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}
.search-container .search { display: block; width: 100%; padding: 5px 10px; background-color: transparent; border: 0; border-radius: 0; color: #ddd; -webkit-transition: all ease 0.3s; transition: all ease 0.3s;
}
.search-container .search:focus { outline: 0; color: #333;
}
.search-container .search:focus + .loupe { color: inherit;
}
.search-container .loupe { -webkit-box-ordinal-group: 0; -ms-flex-order: -1; order: -1; color: #ddd; -webkit-transition: all ease 0.3s; transition: all ease 0.3s;
}
.main-nav { background-color: #efefef; border-right: 1px solid #ddd;
}
.main-nav ol { list-style: none; padding: 0; margin: 0; counter-reset: menuItem;
}
.main-nav ol .UI_state ~ ol { display: none;
}
.main-nav ol .UI_state:checked ~ ol { display: block;
}
.main-nav ol .UI_state:checked ~ label::after { -webkit-transform: translate(0%, -60%) rotate(45deg); transform: translate(0%, -60%) rotate(45deg);
}
.main-nav a:not(.showAll)::before,
.main-nav li label::before { content: counters(menuItem, '.') ' '; counter-increment: menuItem;
}
.main-nav li { display: block;
}
.main-nav li > li { background-color: #fff;
}
.main-nav li a,
.main-nav li label { display: block; padding: 15px 5vw; border-bottom: 1px solid #ddd; color: inherit; text-decoration: none;
}
.main-nav > ol { position: relative; background-color: #efefef;
}
.main-nav > ol > li.active { background-color: #fff;
}
.main-nav > ol > li > label { position: relative; padding-left: 5vw;
}
.main-nav > ol > li li { background-color: #fff;
}
.main-nav > ol > li li a { padding-left: 10vw; -webkit-transition: box-shadow 0.3s ease; transition: box-shadow 0.3s ease;
}
.main-nav > ol > li li a.active,
.main-nav > ol > li li a:hover { z-index: 1; position: relative; box-shadow: 0 0 5px rgba(0, 0, 0, 0.15); color: #333;
}
.main-nav > ol > li li li a { padding-left: 15vw;
}
.main-nav > ol > li li li li a { padding-left: 20vw;
}
.main-nav li label { -webkit-transition: all 0.1s ease; transition: all 0.1s ease;
}
.main-nav li label::after { content: ''; position: absolute; display: inline-block; width: 10px; top: 50%; right: 10px; padding-top: 10px; border: solid #333; border-width: 0 2px 2px 0; vertical-align: middle; -webkit-transition: inherit; transition: inherit; -webkit-transform: translate(0%, -60%) rotate(-45deg); transform: translate(0%, -60%) rotate(-45deg);
}
.main-content { padding: 65px 5vw 5vw;
}

Mobile Navigation Pattern - Script Codes JS Codes

// Yeah folks, really no JS!
Mobile Navigation Pattern - Script Codes
Mobile Navigation Pattern - Script Codes
Home Page Home
Developer Daniel Gooß
Username daniel_gooss
Uploaded November 10, 2022
Rating 3
Size 5,939 Kb
Views 26,312
Do you need developer help for Mobile Navigation Pattern?

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!

Daniel Gooß (daniel_gooss) Script Codes
Create amazing web content 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!