Skip to content
View TremulaJS-Boilerplate.markdown

TremulaJS Boilerplate

TremulaJS is a client-side javascript UI component providing Bézier-based content-stream interactions with momentum & physics effects for mouse, scroll and and touch UIs.

This Pen allows you to experiment using different config file settings.

A Pen by Garris on CodePen.

License.

View package.json
{
"name": "spaServer",
"description": "express app that serves index.html",
"version": "0.0.1",
"private": true,
"dependencies": {
"express": "3.x",
"underscore": "~1.6.0"
}
}
View server.js
var express = require('express')
,app = express()
,_ = require('underscore')
,util = require('util')
,os = require('os');
var rootDir = __dirname + '/app'
,port = 3000;
View rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller
// fixes from Paul Irish and Tino Zijdel
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
for(var x = 0; x < vendors.length && !window.requestAnimationFrame; ++x) {
View example.html
Choose a ticket class: <select id="tickets"></select>
<p id="ticketOutput"></p>
<script id="ticketTemplate" type="text/x-jquery-tmpl">
{{if chosenTicket}}
You have chosen <b>${ chosenTicket().name }</b>
($${ chosenTicket().price })
<button data-bind="click: resetTicket">Clear</button>
{{/if}}
Something went wrong with that request. Please try again.