
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
cloak.animate
Advanced tools
Cloak.js is a collection of modules for building modern web applications. Each module is designed to work with the others, but are decoupled to allow you pick and choose which ones you need. Want views but don't need to deal with models or a complex router? You can do that! First, make sure you have cloak.core
which contains some basic utilities for each module. Then, install the modules you want.
$ npm install --save cloak.core
$ npm install --save cloak.view
Then, in your JavaScript, just start using the components. Cloak is designed to work in a CommonJS environment, so any tools that do so will work (like common.js or browserify).
var View = require('cloak.view');
var MyView = module.exports = View.extend({
template: 'views/myview/myview.hbs',
draw: function() {
this.elem.innerHTML = this.render();
}
});
View
classModel
and Collection
classes for handling dataRouter
class for all you app routing needsController
class for transitioning displaying viewsXMLHttpRequest
; Also provides an interface to define XHR methods on the Model
and Controller
classesModel
and Collection
classescloak.view
for easier handling of forms$ npm install --save cloak.core cloak.animate
var View = require('cloak.view');
var ViewAnimation = require('cloak.animate').ViewAnimation;
//
// The ViewAnimation mixin adds the `animate` method, as well as some shortcut
// methods for common animations like `fadeIn`. These all effect the View::elem
// property.
//
var FancyView = module.exports = View.extend(ViewAnimation, {
//...
fadeInOut: function() {
return this.fadeOut()
.then(this.animate.wait(500))
.then(this.fadeIn.bind(this));
},
customAnimation: function() {
return this.animate(
{ opacity: 0.5, background: '#fff' },
{ duration: 1500 }
);
}
});
var Controller = require('cloak.controller');
var ControllerAnimation = require('cloak.animate').ControllerAnimation;
//
// Like above, the ControllerAnimation mixin adds all of the same methods,
// except that the controller version target the Controller::scope property
// as the element to animate.
//
var FancyController = module.exports = Controller.extend(ControllerAnimation, {
//...
fadeInOut: function() {
return this.fadeOut()
.then(this.animate.wait(500))
.then(this.fadeIn.bind(this));
},
customAnimation: function() {
return this.animate(
{ opacity: 0.5, background: '#fff' },
{ duration: 1500 }
);
}
});
var animate = require('cloak.animate').animate;
//
// You can also use the base `animate` method to animate any element in the
// same basic fashion
//
var para = document.querySelector('p');
animate(para, { color: '#a00' }, { duration: 200 })
.then(animate.wait(500))
.then(function() {
return animate(para, { color: '#000' }, { duration: 200 });
});
FAQs
The Cloak.js module for animating views and controllers (using Velocity)
The npm package cloak.animate receives a total of 2 weekly downloads. As such, cloak.animate popularity was classified as not popular.
We found that cloak.animate demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.