summaryrefslogtreecommitdiff
path: root/bundle.js
diff options
context:
space:
mode:
Diffstat (limited to 'bundle.js')
-rw-r--r--bundle.js21
1 files changed, 11 insertions, 10 deletions
diff --git a/bundle.js b/bundle.js
index ccd988c..c8b176a 100644
--- a/bundle.js
+++ b/bundle.js
@@ -22718,7 +22718,7 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
var compressor = new _tone2.default.Compressor(-30, 3).toMaster();
-var GRAIN_TIME = 1 / 20;
+var GRAIN_TIME = 1 / 2;
var SAMPLE_RATE = 44100;
var GRAIN_SIZE = GRAIN_TIME * SAMPLE_RATE;
@@ -22755,17 +22755,18 @@ player.connect(compressor);
var intensity = 0,
inertialIntensity = 0,
- inertia = 16;
+ inertia = 5;
function tick(time) {
if (!offsets.length) return;
// let offsetIndex = clamp( Math.floor(mouse.y * offsets.length + Math.cos(time/20)), 0, offsets.length-1 )
inertialIntensity = Math.max(intensity, (intensity + inertialIntensity * (inertia - 1)) / inertia);
console.log(inertialIntensity);
- var offsetIndex = Math.floor(inertialIntensity * offsets.length + Math.cos(time));
+ var offsetIntensity = 0.98 * inertialIntensity;
+ var offsetIndex = Math.floor(offsetIntensity * offsets.length + Math.cos(time));
var offset = Math.max((offsets[offsetIndex] || 0) * GRAIN_TIME + 0.25 * Math.sin(time * 17 / 7), 0);
// console.log(offset, offsets[offsetIndex] * GRAIN_TIME, ( 0.25 * Math.cos(time*13/7)))
- player.start('applause', time, offset, GRAIN_TIME * 4);
+ player.start('applause', time, offset, GRAIN_TIME * 4, 0, inertialIntensity);
}
var mouse = { x: 0, y: 0 };
@@ -22790,8 +22791,8 @@ function move(e) {
if (drawing) {
intensity = Math.min(0.999, intensity + v * 0.1);
inertialIntensity = Math.min(0.999, intensity);
- if (intensity == 0.999) intensity -= Math.random() * 0.01;
- if (inertialIntensity == 0.999) inertialIntensity -= Math.random() * 0.01;
+ if (intensity == 0.999) intensity -= Math.random() * 0.45;
+ if (inertialIntensity == 0.999) inertialIntensity -= Math.random() * 0.35;
var gray = Math.floor((0, _util.clamp)(1 - 10 * v, 0, 1) * 255);
ctx.fillStyle = 'rgb(' + [gray, gray, gray] + ')';
ctx.beginPath();
@@ -22806,8 +22807,8 @@ function up(e) {
intensity = 0;
}
setInterval(function () {
- inertialIntensity += 0.1;
-}, 2000);
+ inertialIntensity += 0.001;
+}, 5000);
if (_util.browser.isMobile) {
document.body.addEventListener('touchstart', (0, _util.firstTouch)(down));
@@ -22822,8 +22823,8 @@ if (_util.browser.isMobile) {
function animate() {
requestAnimationFrame(animate);
ctx.save();
- ctx.fillStyle = 'rgba(255,255,255,0.11)';
- ctx.globalAlpha = 0.1;
+ ctx.fillStyle = 'rgba(255,255,255,' + (1 - (intensity || 0.01)) + ')';
+ ctx.globalAlpha = 0.001;
ctx.fillRect(0, 0, window.innerWidth, window.innerHeight);
ctx.restore();
}