Git Product home page Git Product logo

yashchavanweb / dynamic_navbar Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 116 KB

Experience a sleek and interactive website with a dynamic navbar. As you scroll, witness captivating color changes, engaging hovering effects, and seamless transitions. Our sticky navbar ensures easy navigation, providing a user-friendly and visually appealing journey.

Home Page: https://yashchavanweb.github.io/PRODIGY_WD_01/

HTML 56.21% JavaScript 8.47% CSS 35.32%
navbar navigationmenu website

dynamic_navbar's Introduction

Task :

Create an interactive navigation menu that changes color or style when scrolled or when hovering over a menu item. The navigation menu should have a fixed position and be visible on all pages. Use HTML to structure the menu, CSS to style it, and JavaScript to add interactivity, such as changing the background color or font color of the menu when it is scrolled or when a menu item is hovered over.

Website Link : https://yashchavanweb.github.io/Dynamic_Navbar/

Demo :

Prodigy.video.1.mp4

Learnings from the Project:

Header:

  1. Utilized display: flex to easily apply properties such as justify-content and position for better alignment and positioning.
  2. Employed flex in the navigation section to align items on a single line, particularly useful for block elements arranged vertically.
  3. Integrated transitions to facilitate smooth visual changes within the interface.

Image Alignment:

  1. Wrapped the image in a div and utilized text-align to center-align it, enhancing visual aesthetics.

Footer:

  1. Positioned the footer at the bottom with bottom: 0, ensuring it aligns at the page's bottom irrespective of its content.
  2. Chose position: relative to avoid using absolute, preventing it from being relative to an image and ensuring it aligns at the page bottom.

JavaScript Usage:

  1. Employed JavaScript to dynamically change the header's color by creating a new class, navbar-scrolled, not initially declared in HTML.
  2. Strategically ordered the CSS rules, beginning with the new class, followed by other elements like .navbar li a, allowing easy modification of their properties.

Dropdown Menu:

  1. Implemented a dropdown menu within the "Services" list using ul, li, and a elements, assigning a class to the ul.
  2. Initially set display: none and position: absolute for the dropdown, ensuring it stays hidden and appears below its ancestor, "Services."
  3. On hover, changed display to block to reveal the dropdown beneath, preventing it from appearing beside "Services" by avoiding the use of flex.
  4. Extended the dropdown functionality to the scrolling properties, ensuring consistent behavior even with class changes.

dynamic_navbar's People

Contributors

yashchavanweb avatar

Stargazers

 avatar

Watchers

 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.