Skip to content

Commit

Permalink
add burst mockup
Browse files Browse the repository at this point in the history
  • Loading branch information
legomushroom committed Jan 14, 2015
1 parent 212be59 commit ac91e89
Show file tree
Hide file tree
Showing 12 changed files with 346 additions and 72 deletions.
88 changes: 88 additions & 0 deletions dist/burst.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@

/* istanbul ignore next */
var Burst, Transit, bitsMap, burst,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

bitsMap = require('./bitsMap');

Transit = require('./transit');

Burst = (function(_super) {
__extends(Burst, _super);

function Burst() {
return Burst.__super__.constructor.apply(this, arguments);
}

Burst.prototype.defaults = {
burstPoints: 5,
burstRadius: {
50: 75
},
burstDegree: 360,
strokeWidth: 2,
strokeOpacity: 1,
strokeDasharray: '',
strokeDashoffset: '',
stroke: '#ff00ff',
fill: 'transparent',
fillOpacity: 'transparent',
strokeLinecap: '',
points: 3,
x: 0,
y: 0,
shiftX: 0,
shiftY: 0,
opacity: 1,
radius: 50,
angle: 0,
size: null,
sizeGap: 0,
onInit: null,
onStart: null,
onComplete: null,
onCompleteChain: null,
onUpdate: null,
duration: 500,
delay: 0,
repeat: 1,
yoyo: false,
easing: 'Linear.None'
};

Burst.prototype.render = function() {
return Burst.__super__.render.apply(this, arguments);
};

return Burst;

})(Transit);

burst = new Burst;


/* istanbul ignore next */

if ((typeof define === "function") && define.amd) {
define("Burst", [], function() {
return Burst;
});
}

if ((typeof module === "object") && (typeof module.exports === "object")) {
module.exports = Burst;
}


/* istanbul ignore next */

if (typeof window !== "undefined" && window !== null) {
if (window.mojs == null) {
window.mojs = {};
}
}

if (typeof window !== "undefined" && window !== null) {
window.mojs.Burst = Burst;
}
147 changes: 107 additions & 40 deletions dist/mojs.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ if (typeof window !== "undefined" && window !== null) {
window.mojs.Bit = Bit;
}

},{"./h":5}],2:[function(require,module,exports){
},{"./h":6}],2:[function(require,module,exports){
var Bit, BitsMap, Circle, Cross, Line, Polygon, Rect, h;

Bit = require('./bit');
Expand Down Expand Up @@ -214,7 +214,97 @@ if (typeof window !== "undefined" && window !== null) {
window.mojs.bitsMap = new BitsMap;
}

},{"./bit":1,"./circle":3,"./cross":4,"./h":5,"./line":6,"./polygon":8,"./rect":9}],3:[function(require,module,exports){
},{"./bit":1,"./circle":4,"./cross":5,"./h":6,"./line":7,"./polygon":9,"./rect":10}],3:[function(require,module,exports){

/* istanbul ignore next */
var Burst, Transit, bitsMap, burst,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

bitsMap = require('./bitsMap');

Transit = require('./transit');

Burst = (function(_super) {
__extends(Burst, _super);

function Burst() {
return Burst.__super__.constructor.apply(this, arguments);
}

Burst.prototype.defaults = {
burstPoints: 5,
burstRadius: {
50: 75
},
burstDegree: 360,
strokeWidth: 2,
strokeOpacity: 1,
strokeDasharray: '',
strokeDashoffset: '',
stroke: '#ff00ff',
fill: 'transparent',
fillOpacity: 'transparent',
strokeLinecap: '',
points: 3,
x: 0,
y: 0,
shiftX: 0,
shiftY: 0,
opacity: 1,
radius: 50,
angle: 0,
size: null,
sizeGap: 0,
onInit: null,
onStart: null,
onComplete: null,
onCompleteChain: null,
onUpdate: null,
duration: 500,
delay: 0,
repeat: 1,
yoyo: false,
easing: 'Linear.None'
};

Burst.prototype.render = function() {
return Burst.__super__.render.apply(this, arguments);
};

return Burst;

})(Transit);

burst = new Burst;


/* istanbul ignore next */

if ((typeof define === "function") && define.amd) {
define("Burst", [], function() {
return Burst;
});
}

if ((typeof module === "object") && (typeof module.exports === "object")) {
module.exports = Burst;
}


/* istanbul ignore next */

if (typeof window !== "undefined" && window !== null) {
if (window.mojs == null) {
window.mojs = {};
}
}

if (typeof window !== "undefined" && window !== null) {
window.mojs.Burst = Burst;
}

},{"./bitsMap":2,"./transit":11}],4:[function(require,module,exports){

/* istanbul ignore next */
var Bit, Circle,
Expand Down Expand Up @@ -272,7 +362,7 @@ if (typeof window !== "undefined" && window !== null) {
window.mojs.Circle = Circle;
}

},{"./bit":1}],4:[function(require,module,exports){
},{"./bit":1}],5:[function(require,module,exports){

/* istanbul ignore next */
var Bit, Cross,
Expand Down Expand Up @@ -335,7 +425,7 @@ if (typeof window !== "undefined" && window !== null) {
window.mojs.Cross = Cross;
}

},{"./bit":1}],5:[function(require,module,exports){
},{"./bit":1}],6:[function(require,module,exports){
var Helpers, TWEEN;

TWEEN = require('./vendor/tween');
Expand Down Expand Up @@ -674,7 +764,7 @@ if (typeof window !== "undefined" && window !== null) {
window.mojs.helpers = new Helpers;
}

},{"./vendor/tween":11}],6:[function(require,module,exports){
},{"./vendor/tween":12}],7:[function(require,module,exports){

/* istanbul ignore next */
var Bit, Line,
Expand Down Expand Up @@ -730,41 +820,18 @@ if (typeof window !== "undefined" && window !== null) {
window.mojs.Line = Line;
}

},{"./bit":1}],7:[function(require,module,exports){
var Transit, rect;
},{"./bit":1}],8:[function(require,module,exports){
var Burst, Transit, burst;

Transit = require('./transit');

rect = new Transit({
type: 'polygon',
stroke: {
"deeppink": "orange"
},
x: 200,
y: 100,
radius: {
75: 5
},
points: 6,
strokeWidth: 10,
duration: 2000,
isDrawLess: true,
strokeLinecap: {
'round': 'butt'
},
isRunLess: true,
onComplete: function() {}
});

document.body.addEventListener('click', function(e) {
return rect.run({
x: e.x,
y: e.y,
isDrawLess: false
});
});
Burst = require('./burst');

burst = new Burst;

console.log(burst.defaults);

},{"./transit":10}],8:[function(require,module,exports){
},{"./burst":3,"./transit":11}],9:[function(require,module,exports){

/* istanbul ignore next */
var Bit, Polygon, h,
Expand Down Expand Up @@ -844,7 +911,7 @@ if (typeof window !== "undefined" && window !== null) {
window.mojs.Polygon = Polygon;
}

},{"./bit":1,"./h":5}],9:[function(require,module,exports){
},{"./bit":1,"./h":6}],10:[function(require,module,exports){

/* istanbul ignore next */
var Bit, Rect,
Expand Down Expand Up @@ -906,7 +973,7 @@ if (typeof window !== "undefined" && window !== null) {
window.mojs.Rect = Rect;
}

},{"./bit":1}],10:[function(require,module,exports){
},{"./bit":1}],11:[function(require,module,exports){

/* istanbul ignore next */
var TWEEN, Transit, bitsMap, h,
Expand Down Expand Up @@ -1350,7 +1417,7 @@ if (typeof window !== "undefined" && window !== null) {
window.mojs.Transit = Transit;
}

},{"./bitsMap":2,"./h":5,"./vendor/tween":11}],11:[function(require,module,exports){
},{"./bitsMap":2,"./h":6,"./vendor/tween":12}],12:[function(require,module,exports){
/* istanbul ignore next */
;(function(undefined){

Expand Down Expand Up @@ -2153,4 +2220,4 @@ if (typeof window !== "undefined" && window !== null) {
})()


},{}]},{},[7])
},{}]},{},[8])
2 changes: 1 addition & 1 deletion dist/mojs.min.js

Large diffs are not rendered by default.

60 changes: 60 additions & 0 deletions js/burst.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# ignore coffescript sudo code
### istanbul ignore next ###

bitsMap = require './bitsMap'
Transit = require './transit'

class Burst extends Transit
defaults:
# burst props
burstPoints: 5
burstRadius: { 50: 75 }
burstDegree: 360
# presentation props
strokeWidth: 2
strokeOpacity: 1
strokeDasharray: ''
strokeDashoffset: ''
stroke: '#ff00ff'
fill: 'transparent'
fillOpacity: 'transparent'
strokeLinecap: ''
points: 3
# position props/el props
x: 0
y: 0
shiftX: 0
shiftY: 0
opacity: 1
# size props
radius: 50
angle: 0
size: null
sizeGap: 0
# callbacks
onInit: null
onStart: null
onComplete: null
onCompleteChain: null
onUpdate: null
# tween props
duration: 500
delay: 0
repeat: 1
yoyo: false
easing: 'Linear.None'

render:->
super

burst = new Burst

### istanbul ignore next ###
if (typeof define is "function") and define.amd
define "Burst", [], -> Burst
if (typeof module is "object") and (typeof module.exports is "object")
module.exports = Burst
### istanbul ignore next ###
window?.mojs ?= {}
window?.mojs.Burst = Burst

Loading

0 comments on commit ac91e89

Please sign in to comment.