This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.belowfold = function(el) { | |
var fold = $(window).height() + $(window).scrollTop(); | |
return fold <= $(el).offset().top; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fuckin... | |
I was in my kitchen right | |
checking to see if my T-shirt was dry right | |
and I just burst out laughing | |
cos on the label of my T-shirt | |
it said George | |
cos I got it fae Asda | |
and it was as if | |
every time I leave the kitchen | |
everything in the kitchen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Front end dev chat | |
*/ | |
/* TOOLS */ | |
- dev browser of choice. why? | |
- dev editor of choice. why? | |
- other tools? | |
/* HTML */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// background cover for position:fixed video | |
// aspectRatio = original aspect ratio of video | |
var ww = $(window).width(), | |
wh = $(window).height(), | |
wAR = ww / wh, | |
newW = (wAR < aspectRatio) ? 'auto' : ww, | |
newH = (wAR < aspectRatio) ? wh : 'auto', | |
mT = (wAR < aspectRatio) ? 0 : Math.round((el.height() - wh) / 2) * -1, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the audio file for the loop | |
this.drumloop = new Pizzicato.Sound({ | |
source: 'file', | |
options: { | |
path: '/assets/audio/drum-break-99bpm.wav', | |
loop: true | |
} | |
}); | |
// Create the Low Pass Filter effect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Event Listeners | |
$('.speaker') | |
.on('touchstart mousedown', this.onTouchStart) | |
.on('touchmove mousemove', this.onTouchMove) | |
.on('touchend mouseup', this.onTouchEnd); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Event handlers | |
onTouchStart(e) { | |
e.preventDefault(); | |
this.drumloop.play(); | |
this.isPlaying = true; | |
} | |
onTouchEnd(e) { | |
this.drumloop.stop(); | |
this.isPlaying = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set the low pass filter based on pageY position | |
// freq value will be between 0 and 10,000 | |
setLPF(e) { | |
let freq = 10000 - ((this.getEvent(e).pageY / $(window).height()) * 10000); | |
this.LPF.frequency = freq; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set the stereo panner position based on pageX position | |
// pos value will be between -1 and 1 | |
setPan(e) { | |
let pos = (((this.getEvent(e).pageX / $(window).width())*2)-1); | |
this.panner.pan = pos; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create Analyser | |
this.analyser = Pizzicato.context.createAnalyser(); | |
this.analyser.fftSize = 1024; | |
this.bufferLength = this.analyser.frequencyBinCount; | |
this.dataArray = new Uint8Array(this.bufferLength); | |
this.LPF.connect(this.analyser); |
OlderNewer