$(window).bind('load', function () {
const raf = function (entry) {
window.requestAnimationFrame(entry);
const random = function (min, max) {
return Math.floor(Math.random() * (max - min) + min);
this.container = $('#container');
this.images.imagesLoaded(function () {
$(window).resize(function initial() {
TweenMax.set(app.container, {
cursorEvents: function (e) {
var cContainer = $('#c-container'),
c = document.getElementById('c'),
c2Container = $('#c2-container'),
c2 = document.getElementById('c2'),
c2x = c2.getContext('2d'),
c.width = $('#c').outerWidth();
c.height = $('#c').outerHeight();
c2.width = $('#c2').outerWidth();
c2.height = $('#c2').outerHeight();
cx.fillStyle = 'rgba(0,0,0,1)';
cx.fillRect(0, 0, c.width, c.height);
c2x.fillStyle = 'rgba(0,0,0,1)';
c2x.fillRect(0, 0, c2.width, c2.height);
function particleFactory(thisCanvas, thisContext, thisParticleName, thisCanvasFunction) {
thisParticleName = function () {
this.rIncrement = this.r * -0.01;
this.x = thisCanvas.width / 2;
this.y = thisCanvas.height / 2;
this.originTriggered = false;
this.vy = random(-10, 10);
this.opacityIncrement = 0.05;
this.opacityReversing = false;
this.framerateCounter = this.framerate;
particles[particleIndex] = this;
this.maxLife = random(0, 100);
this.hue = random(30, 60);
this.light = random(50, 100);
this.color = `hsla(${this.hue},100%,${this.light}%,${this.opacity})`;
this.durationTotal = this.duration + this.opacityLimit * 10;
this.durationCounter = 0;
thisParticleName.prototype.draw = function () {
if ((!this.originTriggered) && (app.mouseX != null)) {
this.originTriggered = true;
this.color = `hsla(${this.hue},100%,${this.light}%,${this.opacity})`;
thisContext.fillStyle = this.color;
thisContext.arc(this.x, this.y, this.r, 0, 2 * Math.PI);
this.r += this.rIncrement;
if (this.y > thisCanvas.height - this.rStart) {
this.y = thisCanvas.height - this.rStart;
delete particles[this.id];
thisCanvasFunction = function () {
thisContext.globalCompositeOperation = 'source-over';
thisContext.fillStyle = 'rgba(0,0,0,1)';
thisContext.fillRect(0, 0, thisCanvas.width, thisCanvas.height);
for (var i = 0; i < particleNum; i++) {
thisContext.globalCompositeOperation = 'lighter';
for (var i in particles) {
setInterval(thisCanvasFunction, 15);
$(window).resize(function initial() {
window.addEventListener('mousemove', app.cursorEvents, false);
c.width = $('#c').outerWidth();
c.height = $('#c').outerHeight();
c2.width = $('#c2').outerWidth();
c2.height = $('#c2').outerHeight();
particleFactory(c, cx, Particle, canvas);
particleFactory(c2, c2x, Particle2, canvas2);
TweenMax.set(c2Container, {
transformOrigin: 'center bottom',