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

modalsquared

v1.1.3

Published

ModalSquared.js is a super small less than a 1kb library for showing and hiding modals.

Downloads

5

Readme

ModalSquared.js

HitCount

Easy, Fast and simple modals.

ModalSquared.js is a super small library for showing and hiding modals. It was specificly designed to show and hide bootstrap modals so i didnt have to use jquery and bootstrap's javascript but you can use it for anything. It's also less than 1kb!

Setup

1. Run npm install modalsquared

2. Add <script src="node_modules/modalsquared/ModalSquared.js"></script> and <link href="node_modules/modalsquared/ModalSquared.css" rel="stylesheet" type="text/css"> to the head tag.

3. That's it you can now use ModalSquared

Documentation

Note: every modal has to have the modal class!

Note: You must put the content of your page in a div with the class of content. Do not put modals inside the content div.

Example

<!DOCTYPE html>
<html lang="en">
<head>
    <script src="node_modules/modalsquared/ModalSquared.js"></script>
    <link href="node_modules/modalsquared/ModalSquared.css" rel="stylesheet" type="text/css">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="content">
        <button onclick="ShowModal('myModal')" >open modal</button>
        <h1>Content goes here</h1>
        <h2>Hello, World!</h2>
    </div>
    <div id="myModal" class="modal"><h1>My modal 1</h1><button data-modal-close >&times</button></div>
</body>
</html>

ModalShow

ModalShow shows a modal. it takes the id of the modal you want to show.

ModalHide

ModalHide hides a modal. it takes the id of the modal you want to hide. Or use data-modal-hide on the button that you want to close the modal. data-modal-hide does not take any values.

Changelog

v1.1.1

  • added blur effect
  • you now have to put the content of your page in a div with the class of .content
  • updated README