0.2.4 • Published 8 years ago

samsarajs v0.2.4

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

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
GuidesamsaraJS.org/docs
API docssamsaraJS.org/reference_docs
QuestionsSamsaraJS Google Group

Examples

ExampleDemo (fullscreen)Description
LogodemodocsThe SamsaraJS logo
Cubedemodocs3D spinning cube with animated size
ParallaxCatsdemodocsScrollview of cat images that parallax with the scroll
CarouseldemodocsA paginated scrollview converted into a slideshow with previous/next buttons
SideMenudemodocsA navigation UI with an exposed side drawer
Safari TabsdemodocsA 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 git@github.com: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.

Talks

Talk JSConf EU 2015 Berlin, Germany

Talk InRhythm Meetup

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.4

9 years ago

0.0.2

9 years ago