Giter Site home page Giter Site logo

cuber's Introduction

Cuber

Cuber is a Rubik's cube simulator written in javascript with a little bit of three.js thrown in for good measure. It uses CSS 3D transforms and has a programmatic API, and has different rendering outputs.

Getting started

Download the minified file, the css and include it in your project.

<script  charset="utf-8" src="js/cuber.min.js"></script>
<link rel="stylesheet" type="text/css" href="styles/cube.css">

Create a new Cube, attach it to your DOM and you're good to go.

var cube = new ERNO.Cube();
document.body.appendChild( cube.domElement );

Commands

Cuber is interactive, but you can also twist slices programmatically. We use a variation of the Singmaster notation which uses a single character and it's case to denote a move. For example cube.twist( 'U' ) rotates the Upper face clockwise. You can also chain multiple moves into a sequence such as cube.twist( 'UDLF' ).

You can also use cube.undo() and cube.redo() to step through the move history. cube.shuffle( 5 ) shuffles the cube 5 times.

Examples

From the desktop
Take a look at the basic example. This demonstrates many of the api settings.

cuber's People

Contributors

tstaylor7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cuber's Issues

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.