parent
370b9abe96
commit
1451661b52
@ -0,0 +1,68 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>03-rotating-nav</title>
|
||||||
|
|
||||||
|
<link rel="stylesheet" href="style.css">
|
||||||
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css"
|
||||||
|
integrity="sha512-1PKOgIY59xJ8Co8+NE6FZ+LOAZKjy+KY8iq0G4B3CyeY6wYHN3yt9PW0XpSriVlkMXe40PTKnXrLnZ9+fkDaog=="
|
||||||
|
crossorigin="anonymous" />
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<nav>
|
||||||
|
<div class="hamburger-btn-wrapper">
|
||||||
|
<i class="fas fa-bars" id="open" onclick="openMenu()"></i>
|
||||||
|
<i class="fas fa-times" id="close" onclick="closeMenu()"></i>
|
||||||
|
</div>
|
||||||
|
<div class="hamburger-menu">
|
||||||
|
<ul>
|
||||||
|
<li>Home</li>
|
||||||
|
<li>About</li>
|
||||||
|
<li>Contact</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
|
||||||
|
<div class="wrapper">
|
||||||
|
<div class="container">
|
||||||
|
<h1>Amazing Article</h1>
|
||||||
|
<small><i>Florin Pop</i></small>
|
||||||
|
|
||||||
|
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Accusantium quia in ratione dolores cupiditate,
|
||||||
|
maxime aliquid
|
||||||
|
impedit dolorem nam dolor omnis atque fuga labore modi veritatis porro laborum minus, illo, maiores
|
||||||
|
recusandae cumque
|
||||||
|
ipsa quos. Tenetur, consequuntur mollitia labore pariatur sunt quia harum aut. Eum maxime dolorem
|
||||||
|
provident natus
|
||||||
|
veritatis molestiae cumque quod voluptates ab non, tempore cupiditate? Voluptatem, molestias culpa.
|
||||||
|
Corrupti, laudantium
|
||||||
|
iure aliquam rerum sint nam quas dolor dignissimos in error placeat quae temporibus minus optio eum
|
||||||
|
soluta cupiditate!
|
||||||
|
Cupiditate saepe voluptates laudantium. Ducimus consequuntur perferendis consequatur nobis
|
||||||
|
exercitationem molestias
|
||||||
|
fugiat commodi omnis. Asperiores quia tenetur nemo ipsa.</p>
|
||||||
|
|
||||||
|
<h2>My Dog</h2>
|
||||||
|
|
||||||
|
<img src="https://images.unsplash.com/photo-1507146426996-ef05306b995a?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=2100&q=80"
|
||||||
|
alt="">
|
||||||
|
|
||||||
|
<p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Accusantium quia in ratione dolores cupiditate,
|
||||||
|
maxime aliquid
|
||||||
|
impedit dolorem nam dolor omnis atque fuga labore modi veritatis porro laborum minus, illo, maiores
|
||||||
|
recusandae cumque
|
||||||
|
ipsa quos. Tenetur, consequuntur mollitia labore pariatur sunt quia harum aut. Eum maxime dolorem
|
||||||
|
provident natus
|
||||||
|
veritatis molestiae cumque quod voluptates ab non, tempore cupiditate?</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<script src="script.js"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
@ -0,0 +1,15 @@
|
|||||||
|
const body = document.getElementsByTagName("body")[0];
|
||||||
|
const openBars = document.getElementById("open");
|
||||||
|
const closeBars = document.getElementById("close");
|
||||||
|
|
||||||
|
function openMenu() {
|
||||||
|
body.classList.add("active");
|
||||||
|
openBars.classList.add("open-active");
|
||||||
|
closeBars.classList.add("close-active");
|
||||||
|
}
|
||||||
|
|
||||||
|
function closeMenu() {
|
||||||
|
body.classList.remove("active");
|
||||||
|
openBars.classList.remove("open-active");
|
||||||
|
closeBars.classList.remove("close-active");
|
||||||
|
}
|
@ -0,0 +1,89 @@
|
|||||||
|
* {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
body {
|
||||||
|
background-color: #444;
|
||||||
|
position: relative;
|
||||||
|
overflow-x: hidden;
|
||||||
|
transition: rotate 0.3s linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
.active {
|
||||||
|
transform: rotate(-15deg);
|
||||||
|
transform-origin: top left;
|
||||||
|
}
|
||||||
|
@keyframes rotate {
|
||||||
|
0% {
|
||||||
|
transform: rotate(0deg);
|
||||||
|
transform-origin: top left;
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
transform: rotate(-15deg);
|
||||||
|
transform-origin: top left;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.wrapper {
|
||||||
|
width: 100%;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 150px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
margin: auto;
|
||||||
|
font-family: Arial, Helvetica, sans-serif;
|
||||||
|
width: 60%;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
height: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
p,
|
||||||
|
img {
|
||||||
|
margin: 20px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
nav {
|
||||||
|
position: absolute;
|
||||||
|
width: 200px;
|
||||||
|
height: 200vh;
|
||||||
|
color: #fff;
|
||||||
|
font-weight: 500;
|
||||||
|
right: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hamburger-btn-wrapper {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 100%;
|
||||||
|
background-color: #000;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
border-radius: 50%;
|
||||||
|
font-size: 24px;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fas {
|
||||||
|
position: absolute;
|
||||||
|
top: 70%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.fa-bars {
|
||||||
|
left: 70%;
|
||||||
|
}
|
||||||
|
.fa-times {
|
||||||
|
left: 30%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.open-active {
|
||||||
|
transform: translate(0%, -150%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.close-active {
|
||||||
|
transform: translate(100%, -50%) rotate(15deg);
|
||||||
|
}
|
Loading…
Reference in new issue