Skip to content

igarok88/-burgerMenu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Responsive Burger Menu πŸ”

A lightweight, responsive navigation menu built with HTML, CSS, and Vanilla JavaScript. It features a smooth hamburger animation and handles body scroll locking to prevent layout shifts.

πŸ”— View Live Demo on GitHub Pages

πŸ“‹ Description

This project demonstrates a classic mobile navigation pattern. On desktop screens, it displays a standard horizontal menu. On mobile screens (under 767px), it switches to a "Burger" icon that toggles a full-screen navigation overlay.

✨ Features

  • Responsive Design: Automatically adapts layout based on screen width using CSS Media Queries.
  • Animated Icon: The burger icon smoothly transforms into a cross ("X") using CSS transitions.
  • Scroll Locking: When the menu is open, the background scrolling is disabled (overflow: hidden).
  • Layout Shift Prevention: The JavaScript dynamically calculates the browser's scrollbar width and adds equivalent padding to the body when locking the scroll. This prevents the page content from "jumping" to the right when the scrollbar disappears.

πŸ›  Tech Stack

  • HTML5
  • CSS3 (Flexbox, Positioning, Transitions)
  • JavaScript (ES6+)
    • DOM Manipulation
    • Event Listeners
    • Dynamic style calculation

πŸš€ How to Run

  1. Clone the repository:
    git clone [https://github.com/YOUR_USERNAME/REPO_NAME.git](https://github.com/YOUR_USERNAME/REPO_NAME.git)
  2. Open index.html in your browser.

πŸ“‚ Project Structure

  • index.html β€” Main layout structure.
  • style.css β€” Styles for the header, navigation, and animations.
  • main.js β€” Logic for the burger menu toggle and scrollbar width calculation.

Created for educational purposes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors