GithubHelp home page GithubHelp logo

javohirdev / hamburger-menu Goto Github PK

View Code? Open in Web Editor NEW

This project forked from abarna-codespot/hamburger-menu

0.0 0.0 0.0 3 KB

A basic Hamburger Menu Animation using HTML, CSS and Javascript

HTML 34.19% JavaScript 10.08% CSS 55.73%

hamburger-menu's Introduction

Hamburger Menu

A basic Hamburger Menu Animation using HTML, CSS and Javascript title-pic1

This repository contains code for creating a basic hamburger Menu Animation with few quick & easy steps.

The Approach Followed:

For converting the basic 3 lines to cross.

  • Create a separate div section for 3 lines.
  • Use "Change" class to animate them to cross sign.
  • Use Toggle JS function to toggle between 3 lines and cross sign.
  • Bring all the lines to a single line using transform.
  • Then, rotate the first line and third line, 45deg, anti-clockwise & clock-wise respectively.
  • Make the middle line disappear by setting opacity to 0.

For the background

  • Create a div container below the menu created previously.
  • Use "change-bg" class to animate this and mention the toggle functionality in javascript as well.
  • Initially give the dimensions to this div as 0.
  • Under "change-bg" give this the desired width & height.
  • Mention both the menu & the background as position: absolute. This will place them on top of each other.
  • Use z-index to mention the order.
  • Finally, move the circle a little to left & top to get a curved desired background.

hamburger-menu's People

Contributors

abarna-codespot avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.