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

@stuvascript/mobile-menu

v1.0.1

Published

A nifty mobile menu for all your mobile projects!

Downloads

23

Readme

Mobile Menu

A nifty mobile menu for all your mobile projects!

Getting Started

View The Project

Visit the live project. If you're not using a mobile device, open the dev tools with F12 on Windows or Cmd + Opt + I on macOS and change the window size to see the mobile menu in action!

Prerequisites

I'm pretty sure you need Webpack for this to work on your browser.

Installing

Make sure you have npm installed by going to the root directory of your project and typing the following CLI command:

npm init -y

Then install this project using the following CLI command:

npm i @stuvascript/mobile-menu

To Use

JavaScript

You can use the import syntax to call the package. Here is what it would look like:

import mobile-menu from '@stuvascript/mobile-menu';

HTML

In your HTML file, you need:

  1. An element to have the class of "outer-nav-for-mobile-menu". This is what the package looks for to actually work. Semantically this should be a <nav> element but really it can be anything.

  2. That element needs to have <li> children. This is what the package will read and copy to the mobile menu for navigation.

Notes

  • If your element that has the class of "outer-nav-for-mobile-menu" is the child of another element, it's up to you to target that parent element with a media query parameter of "min-width: 450px" and a "position: absolute" to remove it from the document flow when this mobile menu kicks in.

  • Your element that has the class of "outer-nav-for-mobile-menu" CAN'T be styled directly. You need to target that element with your own class name so it doesn't override the mobile menu styles.

Examples

Here is an example of what your HTML could look like:

<nav class="outer-nav-for-mobile-menu class-for-styling">
  <ul>
    <li>Home</li>
    <li>About</li>
    <li>Products</li>
    <li>Contact</li>
    <li>Team</li>
    <li>Funky Monkey</li>
  </ul>
</nav>

You can see there is the correct class name and an extra class name for you to style.

Here's an example of what your CSS could look like if your element that has the class of "outer-nav-for-mobile-menu" has a parent element:

@media (width <= 450px) {

  .wrapper-element {
    position: absolute;
  }

}

This "media query" and "position: absolute" are needed so that the parent element will disappear from the document flow and make the rest of the page look better.

Built With

Vanilla JavaScript and CSS

With assistance from:

  • node.js
  • Webpack
  • Prettier
  • ES Lint

Author

License

This project is licensed under the MIT License - see the MIT License file for details

Acknowledgments

  • Shoutout to The Odin Project for helping me on my coding journey