Skip to content
Permalink
Browse files

Edits to iOS9 style

  • Loading branch information
kopiro committed Oct 26, 2018
1 parent e37c143 commit 8294f0ef6c745edb78e702dc59db395ba2b599e1
Showing with 35 additions and 30 deletions.
  1. +15 −14 dist/siriwave.js
  2. +1 −1 dist/siriwave.min.js
  3. BIN ios9.gcx
  4. +19 −15 src/ios9curve.js
@@ -117,15 +117,15 @@
this.ctrl = opt.ctrl;
this.definition = opt.definition;
this.GRAPH_X = 6;
this.AMPLITUDE_FACTOR = 0.5;
this.AMPLITUDE_FACTOR = 1.5;
this.SPEED_FACTOR = 1;
this.DEAD_PX = 2;
this.ATT_FACTOR = 4;
this.DESPAWN_FACTOR = 0.02;
this.NOOFCURVES_RANGES = [5, 10];
this.NOOFCURVES_RANGES = [3, 5];
this.AMPLITUDE_RANGES = [0.6, 1];
this.OFFSET_RANGES = [-this.GRAPH_X / 4, this.GRAPH_X / 4];
this.WIDTH_RANGES = [0.5, 1];
this.OFFSET_RANGES = [0.8, 1];
this.WIDTH_RANGES = [0.4, 1];
this.SPEED_RANGES = [1, 1];
this.DESPAWN_TIMEOUT_RANGES = [500, 2000]; // The padding (left and right) to use when drawing waves

@@ -178,7 +178,7 @@
}, {
key: "_sin",
value: function _sin(x, phase) {
return Math.sin(x - phase);
return Math.sin(0.5 * x - phase);
}
}, {
key: "_grad",
@@ -192,7 +192,7 @@
var y = 0;

for (var ci = 0; ci < this.noOfCurves; ci++) {
var t = this.offsets[ci];
var t = -this.GRAPH_X / 1 + ci / this.noOfCurves * 2 * this.GRAPH_X * this.offsets[ci];
var k = 1 / this.widths[ci];
var x = i * k - t;
y += Math.abs(this.amplitudes[ci] * this._sin(x, this.phases[ci]) * this._globalAttFn(x));
@@ -204,7 +204,7 @@
}, {
key: "_ypos",
value: function _ypos(i) {
return this.AMPLITUDE_FACTOR * this.ctrl.heightMax * this.ctrl.amplitude * this._yRelativePos(i);
return this.AMPLITUDE_FACTOR * this.ctrl.heightMax * this.ctrl.amplitude * this._yRelativePos(i) * this._globalAttFn(i);
}
}, {
key: "_xpos",
@@ -227,10 +227,11 @@
key: "draw",
value: function draw() {
var ctx = this.ctrl.ctx;
ctx.globalAlpha = 0.75;
ctx.globalAlpha = 0.7;
ctx.globalCompositeOperation = 'lighter';

if (this.definition.supportLine) {
// Draw the support line
return this._drawSupportLine(ctx);
}

@@ -251,25 +252,25 @@

for (var _i = 0; _i < _arr.length; _i++) {
var sign = _arr[_i];
ctx.beginPath(); // Cycle the graph from -X to +X every PX_DEPTH and draw the line
ctx.beginPath();

for (var i = -this.GRAPH_X; i <= this.GRAPH_X; i += this.ctrl.opt.pixelDepth) {
var x = this._xpos(i);

var y = sign * this._ypos(i);
var y = this._ypos(i);

ctx.lineTo(x, this.ctrl.heightMax - sign * y);
maxY = Math.max(maxY, y);
ctx.lineTo(x, this.ctrl.heightMax + y);
}

ctx.lineTo(0, this.ctrl.heightMax);
ctx.closePath();
ctx.fillStyle = 'rgba(' + this.definition.color + ', 1)';
ctx.strokeStyle = 'rgba(' + this.definition.color + ', 1)';
ctx.fill();
}

if (maxY < this.DEAD_PX && this.prevMaxY > maxY) {
console.log('respawn');

this._respawn();
}

@@ -339,7 +340,7 @@

}).call(commonjsGlobal);


//# sourceMappingURL=performance-now.js.map
});

var root = typeof window === 'undefined' ? commonjsGlobal : window

0 comments on commit 8294f0e

Please sign in to comment.
You can’t perform that action at this time.