Skip to content

Commit

Permalink
burst: fix tune/genereate methods 2
Browse files Browse the repository at this point in the history
  • Loading branch information
legomushroom committed Jun 8, 2016
1 parent e3d36d3 commit 29b9d4b
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 84 deletions.
2 changes: 1 addition & 1 deletion bower.json
@@ -1,7 +1,7 @@
{
"name": "mojs",
"description": "motion graphics toolbelt for the web",
"version": "0.258.1",
"version": "0.258.2",
"license": "MIT",
"homepage": "https://github.com/legomushroom/mojs",
"authors": [
Expand Down
34 changes: 2 additions & 32 deletions build/mo.js
Expand Up @@ -1528,7 +1528,7 @@
var module = modules[j],
options = {};
this._addBurstProperties(options, i, j);
// module._tuneNewOptions( options );
module._tuneNewOptions(options);
}
};
/*
Expand Down Expand Up @@ -8561,7 +8561,7 @@
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var mojs = {
revision: '0.258.1', isDebug: true, helpers: _h2.default,
revision: '0.258.2', isDebug: true, helpers: _h2.default,
Shape: _shape2.default, ShapeSwirl: _shapeSwirl2.default, Burst: _burst2.default, stagger: _stagger2.default, Spriter: _spriter2.default, MotionPath: _motionPath2.default,
Tween: _tween2.default, Timeline: _timeline2.default, Tweenable: _tweenable2.default, Thenable: _thenable2.default, Tunable: _tunable2.default, Module: _module2.default,
tweener: _tweener2.default, easing: _easing2.default, shapesMap: _shapesMap2.default
Expand Down Expand Up @@ -8591,36 +8591,6 @@
percentage for radius
*/

var burst = new mojs.Burst({
isIt: 1,
// left: '50%', top: '50%',
radius: { 0: 150 },
swirls: {
duration: 2000,
isForce3d: 1
}
}).then({
radius: 50,
angle: 90,
swirls: {
scale: 1
}
});

document.addEventListener('click', function (e) {

burst.tune({
x: e.pageX,
y: e.pageY,
radius: { 250: 0 },
swirls: {
duration: 1000
}
})
// .generate()
.replay();
});

// istanbul ignore next
if (true) {
!(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_RESULT__ = function () {
Expand Down
8 changes: 4 additions & 4 deletions build/mo.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/burst.babel.js
Expand Up @@ -162,7 +162,7 @@ class Burst extends Tunable {
var module = modules[j],
options = {};
this._addBurstProperties( options, i, j );
// module._tuneNewOptions( options );
module._tuneNewOptions( options );
}
}
/*
Expand Down
35 changes: 1 addition & 34 deletions js/mojs.babel.js
Expand Up @@ -17,7 +17,7 @@ import tweener from './tween/tweener';
import easing from './easing/easing';

var mojs = {
revision: '0.258.1', isDebug: true, helpers: h,
revision: '0.258.2', isDebug: true, helpers: h,
Shape, ShapeSwirl, Burst, stagger, Spriter, MotionPath,
Tween, Timeline, Tweenable, Thenable, Tunable, Module,
tweener, easing, shapesMap
Expand Down Expand Up @@ -47,39 +47,6 @@ window.mojs = mojs;
percentage for radius
*/

const burst = new mojs.Burst({
isIt: 1,
// left: '50%', top: '50%',
radius: { 0: 150 },
swirls: {
duration: 2000,
isForce3d: 1
}
})
.then({
radius: 50,
angle: 90,
swirls: {
scale: 1
}
});

document.addEventListener('click', function (e) {

burst
.tune({
x: e.pageX,
y: e.pageY,
radius: {250: 0},
swirls: {
duration: 1000
}
})
// .generate()
.replay();

});

// istanbul ignore next
if ( (typeof define === "function") && define.amd ) {
define("mojs", [], function () { return mojs; });
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "mo-js",
"description": "motion graphics toolbelt for the web",
"version": "0.258.1",
"version": "0.258.2",
"license": "MIT",
"private": false,
"scripts": {
Expand Down
13 changes: 7 additions & 6 deletions spec/burst.coffee
Expand Up @@ -949,16 +949,17 @@ describe 'Burst ->', ->

modules = b._swirls[0][0]._modules

b._refreshBurstOptions modules, 1
for j in [1...modules.length]
module = modules[j]
spyOn(module, '_tuneNewOptions').and.callThrough()

options = {}

arg0 = module._tuneNewOptions.calls.argsFor(j-1)[0]

b._refreshBurstOptions modules, 1

expect(arg0).toBe b._addBurstProperties {}, 1, j
for j in [1...modules.length]
module = modules[j]
options = {}
b._addBurstProperties options, 1, j
expect(module._tuneNewOptions).toHaveBeenCalledWith options

describe '_tuneSwirls method', ->
it 'should call _refreshBurstOptions with modules and i', ->
Expand Down
13 changes: 8 additions & 5 deletions spec/burst.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 29b9d4b

Please sign in to comment.