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 🙏

© 2026 – Pkg Stats / Ryan Hefner

vanilla-croakpopup

v1.0.32

Published

simple JavaScript popup

Readme

Croak Popup(JavaScript popup)💻

Features:

  • keyboard control ("ArrowLeft"/"ArrowRight", "A"/"D", "Escape") 💡
  • custom buttons control (left/right) 💡
  • slide click control 💡
  • swipe control (mobile, desktop(experimental)) 💡🔬

Let's get started

  1. Install croak:
npm i vanilla-croakpopup
  1. Add CSS and JS:
<link rel="stylesheet" href="/node_modules/vanilla-croakpopup/css/croak.min.css">

<script type="module" src="/node_modules/vanilla-croakpopup/js/croak.min.js"></script>
<script type="module" src="/js/yourscript.js"></script>
  1. Add croak container:
<div data-croak-container>

</div>
  1. Add control buttons(optional):
<div data-croak-container>
  <button class="stories-prev"></button>
  <button class="stories-next"></button>
</div>
  1. Add data-el attribute to specify img elements:
<img src="yourpath/yourimage.jpg" data-el>
  1. Add data-video-el, data-src attributes to specify video elements:
<div
  data-video-el
  data-src-webm="yourpath/yourvideo.webm"
  data-src-mp4="yourpath/yourvideo.mp4"
  data-src-mob-mp4="yourpath/yourvideo.mp4"
  data-src-mob-webm="yourpath/yourvideo.webm"
  >

  <img src="yourpath/yourimage.jpg">
</div>
  1. Add data-video-el, data-src attributes to your img to specify video elements:
<img
  src="yourpath/yourimage.jpg"

  data-video-el
  data-src-webm="yourpath/yourvideo.webm"
  data-src-mp4="yourpath/yourvideo.mp4"
  data-src-mob-mp4="yourpath/yourvideo.mp4"
  data-src-mob-webm="yourpath/yourvideo.webm"
>
  1. Your basic HTML for images only:
<div data-croak-container>
  <button class="stories-prev"></button>
  <button class="stories-next"></button>

  <img src="yourpath/yourimage1.png" data-el>
  <img src="yourpath/yourimage2.png" data-el>
  <img src="yourpath/yourimage3.png" data-el>
</div>
  1. Your basic HTML for images + video:
<div data-croak-container>
  <button class="stories-prev"></button>
  <button class="stories-next"></button>

  <img src="yourpath/yourimage1.png" data-el>
  <div
    data-video-el
    data-src-webm="yourpath/yourvideo1.webm"
    data-src-mp4="yourpath/yourvideo1.mp4"
    data-src-mob-mp4="yourpath/yourvideo1.mp4"
    data-src-mob-webm="yourpath/yourvideo1.webm"
    >

    <img src="yourpath/yourimage1.jpg">
  </div>

  <img src="yourpath/yourimage2.png" data-el>
  <div
    data-video-el
    data-src-webm="yourpath/yourvideo2.webm"
    data-src-mp4="yourpath/yourvideo2.mp4"
    data-src-mob-mp4="yourpath/yourvideo2.mp4"
    data-src-mob-webm="yourpath/yourvideo2.webm"
    >

    <img src="yourpath/yourimage2.jpg">
  </div>
</div>
  1. Create basic popup essence:
import { croakSlider } from "../node_modules/vanilla-croakpopup/js/croak.min.js"

let frog = new croakSlider({
  DOMElement: "div[data-croak-container]",
  gap: 50,
  scale: .75,
  opacity: 0.95,
  deskStories: true, //optional
  deskSwipe: true, // experimental, works when clickGallery is false
  deskSwipeFocus: true, // experimental, works when clickGallery is false
  //mobileVideo: true, //optional
  keyboard: true, //optional
  buttons: true, //optional
  clickGallery: false, //optional
});
  1. use
  • gap
  • scale
  • opacity in order to set gap between slides, scale of slides and opacity of the background respectively

You have done it🥰

Showcase:

| Live example | Sandbox example | Features | |-------------------------------------|---------------------------------------------|-------------------------------------------| | https://croakpopup-desktop.vercel.app/ | https://codepen.io/Vlad_Vasinev/pen/ZYEWwqL | desktop, no buttons, keyboard| | https://croak-popup-v1.vercel.app/ | https://codepen.io/Vlad_Vasinev/pen/dPyQZdL | desktop-swipe, no buttons, no keyboard| | | https://codepen.io/Vlad_Vasinev/pen/zxYbzmz | click-gallery, keyboard, buttons| | | https://codepen.io/Vlad_Vasinev/pen/ByaKboN | mobile, keyboard| | | https://codepen.io/Vlad_Vasinev/pen/RNwKKGM | desktop, desktop-swipe| | https://croak-popup-v1.vercel.app/multipleCroak.html | | desktop-swipe, multiple-popup|

Tutorial:

  • https://youtu.be/BCNzKoOepxY?si=U0RJ62vWuF2lzJKu