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

glitchbitch

v0.0.1

Published

glitchbitch is the javascript plugin for animated effects of images, based on WebAssembly (emscripten) technology.

Downloads

15

Readme

GlitchBitch

"GlitchBitch" is the javascript plugin for animated effects of images, based on WebAssembly (emscripten) technology.

glitchbitch

Why WebAssembly?

Because its fast! Imagine: you need to manipulate image with dimension 500px 400px.. Its 200 000 pixels and 800 000 bytes as total (because each pixel stores 4 RGBA bytes). You will need to re-render all this bytes into a canvas at every small time segment - its so difficult job for javascript in browser. This is a job for low-level language (we chose C), and now WebAssembly allows to do this!

WebAssembly browser supporting

Canvas fallback for older browsers is coming soon, in the upcoming versions of glitchbitch!

|IE|Edge|Firefox|Chrome|Safari|Opera|iOS Safari|Opera Mini|Android Browser|Chrome for Android| |---|---|---|---|---|---|---|---|---|---| |-|16|52|57|11|44|11|-|56|61|

Usage

Install the package from npm repo:

npm install glitchbitch

or

yarn add glitchbitch

Maximal example below (see html example here):

GlitchBitch
  .create({
    image: '../test/mock-data/image.jpg',
    selector: '.test',
  })
  .then(timeline => {
    timeline
      .settings({
        loopsCount: 3, // count of loops
        effectDuration: 150, // in milliseconds
      })
      .effects([ // effects are carried out in this order
        'greenChannel',
        ['redChannel', 'repeatVertical'],
        'blueChannel',
        'moveHorizontal',
        'opacity',
      ])
      .values([ // ..and effects values in same order
        [0, 0],
        [[50, 10], [4]],
        [45, 200],
        [75],
        [100],
      ])
      .start(i => { // your callback here that runs after each loop ending
        if (i === 3) {
          document.querySelector('.test').innerHTML = 'effects loop is done!';
        }
      });

Parameters

.settings()

Its not required pipe, may be omitted

|Parameter|Default value|Description| |---|---|---| |effectDuration|100|Each effect duration in milliseconds| |loopsCount|Infinity|Effects are looping to this number of times|

.effects()

|Effect name|Parameter|Default value|Description| |---|---|---|---| |redChannel|[greenContrast, blueContrast]|[0, 0]|Set only red channel by default| |greenChannel|[redContrast, blueContrast]|[0, 0]|Set only green channel by default| |blueChannel|[redContrast, greenContrast]|[0, 0]|Set only blue channel by default| |opacity|[alphaValue]|[0]|Set opacity of image, value must be between 0 - 255| |moveHorizontal|[range]|[0]|Shifts image by X axis by percentage (0 - 100)| |repeatVertical|[count]|[0]|Repeat image by Y axis|

.values()

Its not required pipe, may be omitted

Contributing

GlitchBitch is an open source project, waiting for your participation! See CONTRIBUTING.md for details.