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

mojs-player

v0.43.16

Published

Player controls for mojs playback

Downloads

48

Readme

mojs-player

Player controls for mojs. Intended to help you to craft mojs animation sequences. To be clear, this player is not needed to play mojs animations. It is just a debug tool that gives you the ability to:

  • control your sequences with GUI while working on them
  • it saves the current progress of your animation thus you don't loose the focus
  • it gives you bounds to constrain focus point of your animation
  • it gives you the control over the speed of animation
  • it gives you the ability to seek animations freely
  • it saves player's state and settings thus they not get lost when page reloaded

Installation

The MojsPlayer depends on mojs >= 0.225.2 so make sure you link it first.

CDN:

<script src="//cdn.jsdelivr.net/mojs-player/latest/mojs-player.min.js"></script>

NPM:

[sudo] npm install mojs-player

Bower:

bower install mojs-player

Import MojsPlayer constructor to your code (depends on your environment) :

const MojsPlayer = require('mojs-player').default;
// or
import MojsPlayer from 'mojs-player';

If you installed it with script link - you should have MojsPlayer global.

Usage

Construct MojsPlayer and pass your main Tween/Timeline as the add option:

// const mainTimeline = new mojs.Timeline({});
// .. some code regarding timeline ..
const mojsPlayer = new MojsPlayer({ add: mainTimeline });

The add option is the only required option to launch. Player's controls should appear at the bottom of the page.

You can also set other player initial state:

// ..
const mojsPlayer = new MojsPlayer({
  add:      mainTimeline,
  // options
  className:    '',         // class name to add to main HTMLElement
  isSaveState:  true,       // determines if should preserve state on page reload
  isPlaying:    false,      // playback state
  progress:     0,          // initial progress
  isRepeat:     false,      // determines if it should repeat after completion
  isBounds:     false,      // determines if it should have bounds
  leftBound:    0,          // left bound position  [0...1]
  rightBound:   1,          // right bound position [0...1]
  isSpeed:      false,      // determines if speed control should be open
  speed:        1,          // `speed` value
  isHidden:     false,      // determines if the player should be hidden
  precision:    0.1,        // step size for player handle - for instance, after page reload - player should restore timeline progress - the whole timeline will be updated incrementally with the `precision` step size until the progress will be met.
  name:         'mojs-player' // name for the player - mainly used for localstorage identifier, use to distuguish between multiple local players
});

Shortcuts

  • alt + p - toggle play/pause playback state
  • alt + - - decrease progress by 1/100
  • alt + + - increase progress by 1/100
  • shift + alt + - - decrease progress by 1/10
  • shift + alt + + - increase progress by 1/10
  • alt + s - stop playback
  • alt + r - toggle repeat state
  • alt + b - toggle bounds state
  • alt + h - toggle show/hide player state
  • alt + q - reset speed to 1x
  • alt + 2 - decrease speed by 1/50
  • alt + 3 - increase speed by 1/50
  • shift + alt + 2 - decrease speed by 1/10
  • shift + alt + 3 - increase speed by 1/10

Development

Install webpack globally:

[sudo] npm install webpack -g

Install dependencies with npm:

[sudo] npm install

Run webpack:

webpack

Please make sure you are on the dev branch before making changes.

License

(The MIT License)

Copyright (c) Oleg Solomka @LegoMushroom [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.