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 🙏

© 2025 – Pkg Stats / Ryan Hefner

jquery-flapper

v1.1.6

Published

A split-flap (Solari) display for numbers and words using jQuery

Downloads

71

Readme

For a React version see react-split-flap-effect

Flapper

Project Homepage Live Demo

A jQuery number display

Flapper is a jQuery plugin that replicates the split-flap (or "Solari") displays that used to be common in train stations and airports, and your dad's alarm clock in the 70s.

To use, just attach Flapper to any input on your page. Whenever the input's change event is fired, Flapper will update the display.

For best results, you should load jquery.transform and jquery.numberformatter.

Options

Flapper accepts a hash of options:

var options = {
  width: 6,             // number of digits
  format: null,         // options for jquery.numberformatter, if loaded
  align: 'right',       // aligns values to the left or right of display
  padding: ' ',    // value to use for padding
  chars: null,          // array of characters that Flapper can display
  chars_preset: 'num',  // 'num', 'hexnum', 'alpha' or 'alphanum'
  timing: 250,          // the maximum timing for digit animation
  min_timing: 10,       // the minimum timing for digit animation
  threshhold: 100,      // the point at which Flapper will switch from
                        // simple to detailed animations
  transform: true       // Flapper automatically detects the jquery.transform
                        // plugin. Set this to false if you want to force
                        // transform to off
  on_anim_start: null   // Callback for start of animation
  on_anim_end: null     // Callback for end of animation
}

Generally, the only options you will care about are width and chars_preset. If you want to use a custom set of characters, specify chars instead of chars_preset. Flapper will use the first character in your array as the default glyph, so you'll usually want this to be either   or 0.

Character presets are:

  • num:  , 1-9, 0, dollar sign, decimal point, comma, colon
  • hexnum:  , 1-9, A-F, 0
  • alpha:  , A-Z
  • alphanum: All of alpha and num

The timing params timing, min_timing and threshhold control how fast the glyphs flash by as the display changes. You can set timing to a higher number if you'd like a slower, more obvious transform effect. You can set min_timing higher if you'd like the glyphs to flash by more slowly. You generally don't need to set threshhold.

If you'd like to add commas to numbers, use money symbols, control the number of decimal points, and other fun things, you can load jquery.numberformatter and pass its options in format. You can also set padding to 0 if you'd like to zero-pad numbers, and you're not using jquery.numberformatter.

Theming

You can control Flapper's built-in themes by adding classes to your inputs.

The classes XS, S, M, L, XL and XXL choose Flapper's six size presets. The default is M.

The classes light and dark choose Flapper's two color themes. The default is dark.

If you'd like to change Flapper's look, you can define your own theme in CSS. Just give your inputs a class mytheme and define two extra CSS selectors. Each Flapper digit consists of an outer div with four inner divs. The inner divs are positioned in two layers, a back layer with upper and lower halves, and a front layer with upper and lower halves.

Define .flapper.mytheme .digit to change the outer divs. In the default themes, this controls the border color and the stripe running horizontally through each digit (the background of this div shows through the space between the inner divs.)

Define .flapper.light .digit div to change the inner divs. In the default themes, this controls the background color of the digits.

The different size presets have font sizes and line heights that are specific to the font I've chosen as the default (Roboto Condensed.) If you're using your own font, you'll need to set your own metrics for the size(s). So, for example:

Define .flapper.mytheme to change the font that Flapper uses.

Define .flapper.mytheme.S to set font-size and line-height so that your digits are nicely centered in Flapper's display (in this case, for the small size.)

To change the border radius of Flapper's digits, change .flapper.mytheme.S .digit and .flapper.mytheme.S .digit div.

Flapper's size presets work like this:

.flapper.S sets the height of each digit.

.flapper.S .digit div sets the height (again!) and width of each digit.

.flapper.S .digit div.top clips the top half of each digit.

.flapper.S .digit div.bottom clips the bottom half of each digit, minus one pixel at the top (the horizontal stripe.)

Defining new sizes is a little tricky, but if you look a the src code you'll get the hang of it.