Giter Site home page Giter Site logo

carlosfrontend / dropdownme Goto Github PK

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

A lightweight and simple dropdown generator

Home Page: https://carlosfrontend.github.io/dropdown-menu-odin-project/

HTML 18.95% JavaScript 48.23% CSS 32.82%
animated-dropdown animated-menu css dropdown dropdown-menu dropdownme html javascript npm simple-dropdown webpack5 dropdown-menu-generator

dropdownme's Introduction

@carlosfrontend/dropdownme

Dynamic User Interface Interactions

JavaScript Course The Odin Project

This package was developed as an exercise for The Odin Project. It's pretty lightweight and allows you to add as many animated dropdown menus as you need.

HTML

  1. The first thing you need is to copy and paste this codeblock container into your body tags:

    index.html

    <body>
      <nav id="navbar">
        <!-- Dropdonws will goes here  -->
      </nav>
    </body>
  2. Each block with the .parentContainer class is a dropdown menu. You can add by copying and pasting as many as you need at you navbar container:

    index.html

    <nav id="navbar">
      <!-- Start of the first dropdown -->
    
      <div class="parentContainer">
        <div class="parentItem">Home</div>
        <div class="itemsContainer">
          <div class="dummy-item"></div>
          <div class="item">One</div>
          <div class="item">Two</div>
          <div class="item">Three</div>
        </div>
      </div>
    
      <!-- End of the first dropdown -->
    
      <!-- Start of the second dropdown -->
    
      <div class="parentContainer">
        <div class="parentItem">Services</div>
        <div class="itemsContainer">
          <div class="dummy-item"></div>
          <div class="item">One</div>
          <div class="item">Two</div>
          <div class="item">Three</div>
          <div class="item">Four</div>
        </div>
      </div>
    
      <!-- End of the second dropdown -->
    </nav>

Advice

  1. The only requirement is not to change the name of the nav id and the name classes. You can replace the rest of the text with whatever you want. You can even add more tags with the html tag if you need more elements:

    <div class="item">New Item</div>

Javascipt

  1. Install it as a dependency in your project with this terminal command:

    npm i @carlosfrontend/dropdownme
  2. Make sure you import it into your project's javascipt file and call the function to animate the dropdown:

    index.js

    import dropDownMe from "@carlosfrontend/dropdownme";
    dropDownMe();

Link:

โœ… Assigments ๐Ÿ“˜

โœ… Live Preview ๐Ÿ’ป

Feel free to change the styles as you like.

Happy Coding!! โ˜• ๐Ÿš€

dropdownme's People

Contributors

carlosfrontend avatar

Stargazers

Henry Lin 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.