Coder Social home page Coder Social logo

js1k-2018's Introduction

Forward-kinematic system with a pencil

Introduction

This is very a simplified forward-kinematic system which is an entry for the js1k-2018 competition. Try it to find out beautiful patterns applying simple rules.

Files

index.html is a shim environment provided by the contest organizers.

human-readable/app.js is a place you might want to take a look to understand what's going on in the application.

src/app.js is what was actually developed having in mind further minification. It was automatically minified into dist/app.js by the Gulp plugin.

Finally, submission/app.js is a result of aggressive minification by means of the Closure Compiler and a couple of further tweaks. That's what was submitted to the competition.

How to

The app starts animation automatically using predefined value from the input. To start observing how your own patterns emerge, you should fill the input field using the following format [arms_lengths]&[arms_rotation_speeds] where:

arms_lengths - is a string containing comma-separated values (in pixels) of the arm lengths. Inability to convert the value to a number defaults to 50 pixels.

arms_rotation_speeds - is a string containing comma-separated values (in degrees) of the arm rotation speeds i.e. a change of the angle per frame. The system will try to maintain 60 fps, so the value of 6 here will give you a full circle in a second. Inability to convert the value to a number defaults to 1 degree.

Each string value is trimmed before converting to a number, so spaces don't matter.

The number of the arms is defined by the number of the arm lengths. So if the number of the rotation speeds is less then that, the missing slots will be filled with default values.

Once the input loses focus - the app starts animating the arms. The last arm has a pencil in its hand. ๐Ÿ˜„ Enjoy!

js1k-2018's People

Watchers

James Cloos avatar Sergey Chernykh avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.