Inspired by the effect on Android when you switch the screen off
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
function toTS(script) { | |
return script.replace(/ =/g, ':any ='); | |
} |
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
function toEs6(script) { | |
return script.replace(/var/g, 'let'); | |
} |
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
// vertex shader | |
attribute float a_eyeOffset; | |
varying float v_eyeOffset; | |
... | |
vec4 mvPosition = modelViewPosition * vec4(position, 1.0); | |
mvPosition.x -= a_eyeOffset; | |
gl_Position = projectionMatrix * mvPosition; | |
gl_Position.x = gl_Position.x * 0.5 + sign(a_eyeOffset) * 0.5 * gl_Position.w; |
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
var raf = require('raf'); | |
var mp = require('mouse-position'); | |
var mpos = mp(window); | |
var undef; | |
var sumDeltaX = 0; | |
var libSumDeltaX = 0; | |
var curPageX; | |
var prevPageX; |
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
var glslifyBundle = require('glslify-bundle') | |
var staticModule = require('static-module') | |
var glslifyDeps = require('glslify-deps') | |
var glslResolve = require('glsl-resolve') | |
var through = require('through2') | |
var nodeResolve = require('resolve') | |
var path = require('path') | |
var fs = require('fs') | |
module.exports = transform |
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
Array.prototype.poop = function() { | |
this.pop(); | |
// return nothing, it's poop | |
} | |
Array.prototype.shit = function() { | |
this.shift(); | |
// return nothing, it's shit | |
} |
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
(function(p, l){ | |
var s = ''; | |
function yolo(i) { | |
return function() { | |
return this.splice(this.length - i - 2); | |
}; | |
} | |
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
// port from GLSL code base on https://github.com/ashima/webgl-noise/blob/master/src/noise2D.glsl | |
//JS SNOISE PORT | |
function snoise2d(x, y) { | |
var C0 = 0.211324865405187; | |
var C1 = -0.577350269189626; | |
var C2 = 1.79284291400159; | |
var OVER_289 = 1 / 289; |
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
(function(){ | |
Modernizr.addTest('customfilter', function () { | |
var prop = 'filter'; | |
var prefixedProp = ['WebkitFilter', 'MozFilter', 'msFilter', 'OFilter', 'filter']; | |
var prefixCSS = ['-webkit-filter', '-moz-filter', '-ms-filter', '-o-filter', 'filter']; | |
var val = 'custom(url(data:text/plain;base64,))'; | |
var computedStyle; | |
for(var i = 0, len = prefixCSS.length; i < len; i++) { |
NewerOlder