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

conway-loader

v0.1.3

Published

A package to spice up your loaders using Conway's Game of Life

Downloads

19

Readme

Conway Loader

This is a project that helps you spice up your loaders using the famous Game of Life. It is built as a tribute to John Horton Conway. You can use it in your app, or just play around with it for exploring Game of Life.

How to Use

Install it using NPM

npm install conway-loader

Build Loaders using our Conway Loader Builder

Access it here: https://ArpanKIIT2017.github.io/conway-loader-builder

Use it

// Import it depending on you build environemnt

import './styles/general.scss';
import conwayLoader from 'conway-loader';

// Or

const conwayLoader = require('conway-loader');

// Should Work the following way

window.loader = conwayLoader.createLoader({
    rootNode: document.getElementById("root"),
    size: 50,
    animationDelay: 500,
    randomColor: true,
    initialBoard: conwayLoader.presets.blink(),
    loopPattern: false, // If your pattern is oscillatory by default
 });
 
 window.loader.render();
 window.loader.start();

Following are the Presets (Raise PR to add more)

  • beauty
  • blink
  • blinkyFace
  • quadpole
  • styleSpin

These presets are basically starting states of the GoL algorithm. These are specifically chosen because of their oscillatory behaviour (turing machine never halts), looks good for loader purposes.

You can have precise control over the resolution by using the height, width, cellSizeR, cellSizeC paramaters. If you provide a initialBoard (presets are matrices passed to this) then you don't need to specify cellSizeR and cellSizeC, it will be autocalculated. Please note that making high resolution loaders may result in high CPU load as the Game of Life computation is CPU-intensive in the order of O(n^m), where n is the number of rows and m is the number of columns in the grid.

How to stop / suspend the loader

window.loader.stop();

How to Contribute

Any positive modifications including performance fixes are welcome. This project will be much more interesting if presets are contributed for the well known Conway Seeds.