How to use the ractive.transitions function in ractive

To help you get started, we’ve selected a few ractive examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zenflow / ractive-isomorphic / lib / RactiveExpress.js View on Github external
self.on('complete', function(){
				_.assign(Ractive.transitions, transitions);
			});
			// attach 'route-link' event for handling internal link clicks
github zenflow / ractive-isomorphic / lib / RactiveExpress.js View on Github external
require('./plugins/events');
require('./plugins/transitions');
var _ = require('lodash');
var on_client = require('on-client');
var Ractive = require('ractive');
var ObsRouter = require('obs-router');
var Waitr = require('waitr');
var wrap = require('./wrap');
var scrollTo = require('./scrollTo');
var Page = require('./Page');

// back-up & disable transitions
var transitions = {};
_.assign(transitions, Ractive.transitions);
var fake_transition = function(t){t.complete();};
for (var key in Ractive.transitions){
	Ractive.transitions[key] = fake_transition;
}

var initialOptions = {
	_: _,
	on_client: on_client,
	data: {
		_: _,
		on_client: on_client,
		'status-code': 200,
		title: 'ractive-express app'
	},
	onroute: function(params, is_init){/*noop*/},
	onconfig: function(){
github zenflow / ractive-isomorphic / sandbox / shared / Site / index.js View on Github external
var ractive_transitions_slide = require('ractive-transitions-slide');
var Ractive = require('ractive');
var fs = require('fs');
var path = require('path');
var ri = require('../../../lib');
var documentTemplate = process.browser ? null : fs.readFileSync(path.join(__dirname, 'document.html'), 'utf8');
var bodyTemplate = fs.readFileSync(path.join(__dirname, 'body.html'), 'utf8');
var pages = require('./pages');
var partials = require('./partials');

Ractive.DEBUG = false;
Ractive.transitions.slide = ractive_transitions_slide;

var Site = ri.Site.extend({
	debug: 1,
	//useDataScript: false,
	//baseUrl: '/yay/',
	documentTemplate: documentTemplate,
	bodyTemplate: bodyTemplate,
	pages: pages,
	partials: partials,
	data: {
		loading_opacity: 0
	},
	onroute: function(route){
		var self = this;
		self.set('title', route.name + ' / ractive-isomorphic sandbox');
	},