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

subtle-slideshow

v1.0.0

Published

A jQuery slideshow plugin (haha yes another one) with a subtle Ken Burns effect using CSS3 animations. It has no controls or anything fancy like that, just some tasteful animation and transition effects, which you can customize. The slides can contain any

Downloads

5

Readme

subtle-slideshow.js

A jQuery slideshow plugin (haha yes another one) with a subtle Ken Burns effect using CSS3 animations. It has no controls or anything fancy like that, just some tasteful animation and transition effects, which you can customize. The slides can contain anything you want (images, videos, etc.), but images are best supported. On this demo page you can see an example of what it can look like.

Installation

First download jquery.subtle-slideshow.js and subtle-slideshow.css and include them in the <head> of your page. Don't forget to include jQuery first.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="jquery.subtle-slideshow.js"></script>
<link rel="stylesheet" href="subtle-slideshow.css">

Then put your slides anywhere within the body element. There is a minimum of two slides needed for the slideshow to work (duh!). The slides are made up of (example below):

  1. The #slides div element, which contains all your slides. Put this where you want your slideshow. The element itself will be hidden, the plugin will use it to draw the slides from. (The id #slides is necessary unless you want to update subtle-slideshow.css manually to match the custom id.)
  2. Inside the #slides element there are the individual .slide elements. These can be <a> or <div>, doesn't really matter, as long as it can contain other elements and is compatible with position: absolute;. The slides will be cycled through during the slideshow. (Again, the .slides classname is necessary unless you want to change subtle-slideshow.css manually.)
  3. Each slide has a <span> element which can be animated to move left, right, up, down or zoom in or out. The easiest way to make an image slideshow is to give these span elements an image-background. This background image will be sized and positioned proportionally to fill the entire slidehow. To animate the <span> element you have to give it the .animate class. Along with this you have to define the animation type by giving it one of the following classnames:
    • .left: move left.
    • .right: move right.
    • .up: move up.
    • .down: move down.
    • .in: zoom in.
    • .out: zoom out.
  4. You can use a div with a .static-content class for putting content in the slide that isn't animated, like titles or what have you.
<div id="slides">
  <a class="slide" href="#link01">
    <span class="animate right" style="background-image: url(your-image-01.jpg)"></span>
    <div class="static-content"><h1>Revolve Waterbottle</h1></div>
  </a>
  <a class="slide" href="#link02">
    <span class="animate in" style="background-image: url(your-image-02.jpg)"></span>
    <div class="static-content"><h1>Lunchbox</h1></div>
  </a>
  <a class="slide" href="#link03">
    <span class="animate down" style="background-image: url(your-image-03.jpg)"></span>
    <div class="static-content"><h1>Salad Shaker</h1></div>
  </a>
</div>

To initialize subtle-slideshow.js you need to call .slideshow() on the the #slides div. Put this right below #slides, or call on $(document).ready().

<script>
  // These are te default settings.
  $('#slides').slideshow({
    randomize: true,            // Randomize the play order of the slides.
    slideDuration: 6000,        // Duration of each induvidual slide.
    fadeDuration: 1000,         // Duration of the fading transition. Should be shorter than slideDuration.
    animate: true,              // Turn css animations on or off.
    pauseOnTabBlur: true,       // Pause the slideshow when the tab is out of focus. This prevents glitches with setTimeout().
    enableLog: false,           // Enable log messages to the console. Useful for debugging.
    slideElementClass: 'slide', // This is also defined in the CSS!
    slideshowId: 'slideshow'    // This is also defined in the CSS!
  });
</script>

Subtle-slideshow.js will generate a div#slideshow right above #slides. This will be the slideshow that the user sees on the page. You can style this element to your needs with CSS. The default styling looks like this:

#slideshow {
  position: fixed; /* 'relative' or 'absolute' will also work. */
  overflow: hidden;  /* Necessary. Otherwise you would see the slides sticking out the sides while being animated. */
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
}

MIT License