Project 3 - Customized Rotating Navigation

 About:

In this Blog, We will be designing Customized Navigation.  I am implementing this using simple Html, CSS and JavaScript , we are not using any frameworks.

for this, I took my Blog name and Blog description, and also I took image of StoneHenge. You guys can use your own data, colors, styles and content you want.

You can find the source code for this below and I have attached the video of the output for reference.

index.html - 

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <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" />
    <link rel="stylesheet" href="style.css" />
    <title>Customized Rotating Navigation</title>
  </head>
  <body>
    <div class="container">
      <div class="circle-container">
        <div class="circle">
          <button id="close">
            <i class="fas fa-times"></i>
          </button>
          <button id="open">
            <i class="fas fa-bars"></i>
          </button>
        </div>
      </div>

      <div class="content">
        <h1>Mini Projects using HTML, CSS and JavaScript for Beginners and intermediate</h1>
        <p>In this Blog, we mainly focus on developing projects purely based on HTML, CSS and 
        JavaScript. We are not using any frameworks. These projects enhance your CSS and JavaScript 
        skills and is also useful for real time projects. Basic knowledge on HTML, CSS and JavaScript 
        is enough for these projects to learn. We will be learning step by step through projects.</p>
        <h3>StoneHenge</h3>
        <img src="./Assets/StoneHenge.jpg" alt="">  
      </div>
    </div>

    <nav>
      <ul>
        <li><i class="fas fa-home"></i> Home</li>
        <li><i class="fas fa-user-alt"></i> About</li>
        <li><i class="fas fa-envelope"></i> Contact</li>
      </ul>
    </nav>
    <script src="script.js"></script>
  </body>
</html>

style.css -
@import url('https://fonts.googleapis.com/css?family=Lato&display=swap');

* {
  box-sizingborder-box;
}

body {
  font-family'Lato'sans-serif;
  background-color#333;
  color#222;
  overflow-xhidden;
  margin0;
}

.container {
  background-color#fafafa;
  transform-origintop left;
  transition: transform 0.5s linear;
  width100vw;
  min-height100vh;
  padding50px;
}

.container.show-nav {
  transform: rotate(-20deg);
}

.circle-container {
  positionfixed;
  top-100px;
  left-100px;
}

.circle {
  background-color#1e279c;
  height200px;
  width200px;
  border-radius50%;
  positionrelative;
  transition: transform 0.5s linear;
}

.container.show-nav .circle {
  transform: rotate(-70deg);
}

.circle button {
  cursorpointer;
  positionabsolute;
  top50%;
  left50%;
  height100px;
  backgroundtransparent;
  border0;
  font-size26px;
  color#fff;
}

.circle button:focus {
  outlinenone;
}

.circle button#open {
  left60%;
}

.circle button#close {
  top60%;
  transform: rotate(90deg);
  transform-origintop left;
}

.container.show-nav + nav li {
  transform: translateX(0);
  transition-delay0.3s;
}

nav {
  positionfixed;
  bottom40px;
  left0;
  z-index100;
}

nav ul {
  list-style-typenone;
  padding-left30px;
}

nav ul li {
  text-transformuppercase;
  color#fff;
  margin40px 0;
  transform: translateX(-100%);
  transition: transform 0.4s ease-in;
}

nav ul li i {
  font-size20px;
  margin-right10px;
}

nav ul li + li {
  margin-left15px;
  transform: translateX(-150%);
}

nav ul li + li + li {
  margin-left30px;
  transform: translateX(-200%);
}

.content img {
  width:1000px;
  height:1000px;
}

.content {
  max-width1000px;
  margin50px auto;
}

.content h1 {
  margin0;
}

.content small {
  color#555;
  font-styleitalic;
}

.content p {
  color#333;
  line-height1.5;
}

script.js -
const open = document.getElementById('open')
const close = document.getElementById('close')
const container = document.querySelector('.container')

open.addEventListener('click', () => container.classList.add('show-nav'))

close.addEventListener('click', () => container.classList.remove('show-nav'))

OUTPUT-






Comments

Popular posts from this blog

Project 2 - Progress Steps

Project 5 - Customized Scroll Animation