Code Monkey home page Code Monkey logo

samsara's Introduction

Build Status Gitter Chat

SamsaraJS is a library for building continuous user interfaces. A continuous UI is one where many visual elements are animating in coordinated ways. For example, you may want to fade the opacity of a nav bar while a settings menu is translated by a user's swipe gesture. Or maybe you want to blur and scale a banner image when a user scrolls some content past its limits, and add a springy bounce at the end.

Building these interactions and maintaining performance is hard, and SamsaraJS is here to help. It supports

  • 3D transforms and perspective (all hardware accelerated)
  • natural physics-based transitions like springs and inertia along with tweens
  • user input for mouse and touch along with gestures like pinch, scale, and rotate
  • a stream-based architecture for coordinating animations

SamsaraJS is opinionated about presentation, but has no opinions about content. It moves rectangles around the screen — what you do inside them is up to you. There is no support for routing, server syncing, templating, data-binding, etc. There are many other frameworks for those needs, and Samsara is designed to be friends with them.

Getting Started

Resources
Guide samsaraJS.org/docs
API docs samsaraJS.org/reference_docs
Questions SamsaraJS Google Group

Examples

Example Demo (fullscreen) Description
Logo demodocs The SamsaraJS logo
Cube demodocs 3D spinning cube with animated size
ParallaxCats demodocs Scrollview of cat images that parallax with the scroll
Carousel demodocs A paginated scrollview converted into a slideshow with previous/next buttons
SideMenu demodocs A navigation UI with an exposed side drawer
Safari Tabs demodocs A scrollview imitating the mobile Safari tab viewer

Installation

SamsaraJS requires a small CSS file located at dist/samsara.css or samsara/samsara.css. For all of the installation methods below, you will also need to include this CSS file for SamsaraJS to work properly.

Git

Clone this repo

git clone [email protected]:dmvaldman/samsara.git

You'll find AMD modules in the samsara directory, CommonJS bundles in the dist directory, examples in the examples directory and reference documentation in the docs directory.

NPM

Install the CommonJS build of Samsara with

npm install samsarajs

This will provide a bundled Samsara object. Note there is a case-difference: path keys are capitalized for CommonJS but lowercase for AMD.

var Surface = require('samsara/dom/Surface');   // AMD
var Surface = require('samsarajs').DOM.Surface; // CommonJS

The samsara.css file will also be included in node_modules/samsarajs/dist/samsara.css.

Window Object

Copy dist/samsara.js and include it as a source file. Samsara will then be accessible through window.Samsara. This is particularly useful for sharing on sites like jsFiddle, CodePen, etc.

Yeoman Generator

A generator was made by @richardkopelow. This is an easy way to get started if you're comfortable with yeoman. Follow the installation instructions here.

Talks

Talk JSConf EU 2015 Berlin, Germany

Talk InRhythm Meetup

samsara's People

Contributors

dmvaldman avatar jd-carroll avatar pem-- avatar solomon-gumball avatar stephanbijzitter avatar adamcmiel avatar jandrieu avatar deepfritz avatar michaelobriena avatar wgester avatar ftripier avatar ijzerenhein avatar majorbreakfast avatar rich-harris avatar richardkopelow avatar sabithpocker avatar sing-li avatar talves avatar bguiz avatar extempl avatar

Watchers

Alvar Laigna avatar James Cloos avatar  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.