npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

fullburger

v0.0.61

Published

[example fullburger menu](https://vahanhovanisyan.github.io/burger/#).

Downloads

36

Readme

FullBurger

example fullburger menu.

A simple and lightweight JavaScript library for burger menu

Peculiarities

  • No dependencies. The library is written in pure JavaScript and does not require any other libraries to work.
  • Simplicity and functionality. You can easily and quickly connect and use a library that implements important functionality for the burger menu
  • Availability. The burger menu meets all accessibility rules.
  • Customization with CSS. You can easily change the appearance, layout using CSS.

example of use in react js

useEffect(() => {
    new Fullburger('.fullburger', {});
  }, []);

and be sure to remove :

  <React.StrictMode>

How to work with the library in type common.js

Connect style.css and index.js from the dist folder to the page

Place the following JS code to connect the FullBurger:

const fullBurger = new Fullburger('.fullburger');

How to work with the library in type module

  1. Download the latest version of the library the page
npm i fullburger
  1. ways to connect the library in type module
import Fullburger from 'fullburger';
import 'fullburger/style';
  1. Place the following markup in your HTML document:
<header class="fullburger">
  <div class="fullburger-container">
    <a class="fullburger-logo" href="#">
      Logo
    </a> 
    <nav class="fullburger-nav">
      <ul class="fullburger-list">
          <li class="fullburger-item">
              <a href="#" class="fullburger-link">home</a>
          </li>
          <li class="fullburger-item">
            <a href="#" class="fullburger-link">about</a>
          </li>
          <li class="fullburger-item">
              <a href="#" class="fullburger-link">contact</a>
          </li>
      </ul>
    </nav>
    <button class="fullburger-button">
        <span></span>
        <span></span>
        <span></span>
    </button>
  </div>
</header>
  1. if you want to use dropdown Place the following markup in your HTML document:
<header class="fullburger">
  <div class="fullburger-container">
    <a class="logo" href="#">
        Logo
    </a> 
    <nav class="fullburger-nav">
      <ul class="fullburger-list">
        <li class="fullburger-item dropdown">
          <a href="#" class="fullburger-link">home</a>
          <button class="dropdown-button"></button>
          <ul class="fullburger-sub-list dropdown-list">
              <li class="fullburger-sub-item">subitem</li>
              <li class="fullburger-sub-item dropdown">
                  <a href="#" class="fullburger-link">contact</a>
                  <button class="dropdown-button"></button>
                  <ul class="fullburger-sub-list dropdown-list">
                      <li class="fullburger-sub-item">subitem</li>
                      <li class="fullburger-sub-item dropdown">
                          <a href="#" class="fullburger-link">contact</a>
                          <button class="dropdown-button"></button>
                          <ul class="fullburger-sub-list dropdown-list ">
                              <li class="fullburger-sub-item">subitem</li>
                              <li class="fullburger-sub-item">
                                  <a href="#" class="fullburger-link">contact</a>
                              </li>
                              <li class="fullburger-sub-item">subitem</li>
                              <li class="fullburger-sub-item">subitem</li>
                          </ul>
                      </li>
                      <li class="fullburger-sub-item">subitem</li>
                      <li class="fullburger-sub-item">subitem</li>
                  </ul>
              </li>
              <li class="fullburger-sub-item">subitem</li>
              <li class="fullburger-sub-item dropdown">
                  <a href="#" class="fullburger-link">contact</a>
                  <button class="dropdown-button"></button>
                  <ul class="fullburger-sub-list dropdown-list ">
                      <li class="fullburger-sub-item">subitem</li>
                      <li class="fullburger-sub-item">
                          <a href="#" class="fullburger-link">contact</a>
                      </li>
                      <li class="fullburger-sub-item">subitem</li>
                      <li class="fullburger-sub-item">subitem</li>
                  </ul>
              </li>
          </ul>
        </li>
        <li class="fullburger-item">
          <a href="#" class="fullburger-link">about</a>
        </li>
        <li class="fullburger-item dropdown">
          <a href="#" class="fullburger-link">contact</a>
          <button class="dropdown-button"></button>
          <ul class="fullburger-sub-list dropdown-list">
              <li class="fullburger-sub-item">subitem</li>
              <li class="fullburger-sub-item">subitem</li>
              <li class="fullburger-sub-item">subitem</li>
              <li class="fullburger-sub-item">subitem</li>
          </ul>
        </li>
        <li class="fullburger-item">
          <a href="#" class="fullburger-link">blog</a>
        </li>
        <li class="fullburger-item">
          <a href="#" class="fullburger-link">price</a>
        </li>
        <li class="fullburger-item">
          <a href="#" class="fullburger-link">sign in</a>
        </li>
      </ul>
    </nav>
    <button class="fullburger-button">
      <span></span>
      <span></span>
      <span></span>
    </button>
  </div>
</header>

you can change the background-color of the header by accessing this css variable --header-color, for example you can write this variable in css

:root{
--header-color:#fff;
}

Place the following JS code to connect the FullBurger:

const fullBurger = new Fullburger('.fullburger');

The library supports nine parameters:

  1. params whichSide: top or left or right or bottom - The WhichSide parameter affects which side the menu is displayed on
Default

const fullBurger = new Fullburger('.fullburger', {
  ...
  whichSide: {
    top: true
  },
  ...
});
  1. params position: top or left or right or bottom - The position parameter affects which side there will be a menu item. This is clearly visible when the menu width or height is less than 100%.
Default

const fullBurger = new Fullburger('.fullburger', {
  ...
  position: {
    top: true
  },
  ...
});
  1. params offsetSize: maxWidth || maxHeight - The offsetSize parameter affects the width and height of the menu. By the way, you can select any unit of measurement.
Default 

const fullBurger = new Fullburger('.fullburger', {
  ...
  offsetSize: {
    maxHeight: '100vh',
    maxWidth: '100vw',
  },
  ...
});
  1. params fixed: scrolling or defaultValue - The fixed parameter affects the fixed state of the menu, using the "scrolling" property you can select from what distance the menu will be fixed. Both are disabled by default.
const fullBurger = new Fullburger('.fullburger', {
  ...
  fixed: {
      scrolling: 500,
      // defaultValue: true
  },
  ...
});
  1. params dropdown: click || hover - The dropdown parameter affects the operation of the dropdown, the "click" property is needed so that the dropdown only opens when clicked without hovering, the "hover" property is so that the dropdown occurs with a hover effect, these two properties can be enabled together, even I recommend doing so a dropdown worked on all devices. Both are disabled by default.
const fullBurger = new Fullburger('.fullburger', {
  ...
  dropdown: {
      click: true,
      hover: true
  }
  ...
});
  1. params breakpoint: ... - Setting a breakpoint affects the distance at which the hamburger button appears and disappears. Default media query (min-width: 768px).
const fullBurger = new Fullburger('.fullburger', {
  ...
  breakpoint: 768,
  ...
});
  1. params overlay: true or false - overlay affects whether an overlay will be present, Default overlay :false.
const fullBurger = new Fullburger('.fullburger', {
  ...
  overlay: true,
  ...
});
  1. params speed: 1000 - The speed setting affects how long it takes for menus to appear or disappear. Default speed: 900
const fullBurger = new Fullburger('.fullburger', {
  ...
  speed: 1000,
  ...
});
  1. params marker: true - adds the active class to the clicked link in the menu.Default marker: false
const fullBurger = new Fullburger('.fullburger', {
  ...
  marker: true,
  ...
});