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
'use strict'; | |
/* | |
This function will resize a letter until it fits the specified height | |
options: | |
- height: the height to fit | |
- precision: how much pixels +/- | |
- size: the start font size | |
- increment: the step of each iteration |
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
// Point position on a line | |
// (see also https://github.com/ayamflow/point-in-line) | |
pointInLine: function(p1, p2, t) | |
return { | |
p1.x + t * (p2.x - p1.x) | |
p1.y + t * (p2.y - p1.y) | |
}; | |
} | |
clamp: function(value, min, max) { |
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
// http://stackoverflow.com/a/13351534 | |
var vFOV = this.camera.fov * Math.PI / 180;; | |
var h = 2 * Math.tan( vFOV / 2 ) * this.camera.position.z; | |
var aspect = width / height; | |
var w = h * aspect; |
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
$(window).on('devicemotion', this._onOrientation); | |
_onOrientation: function(event) { | |
var x = 0.25 * ((size.width * 0.5) - (event.originalEvent.accelerationIncludingGravity.y * size.width)); | |
var y = 0.25 * ((size.height * 0.5) - (event.originalEvent.accelerationIncludingGravity.x * size.height)); | |
} |
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 loop(val, min, max){ | |
if (val < min) return ((val + 1) % max) + (max - 1); | |
return val % max; | |
} |
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 screenToWorldAtZ(positionX, positionY, z){ | |
var vector = new THREE.Vector3(); | |
var dX, dY, dZ; | |
if(this.curObject && this.curObject.parent ){ | |
dX = this.curObject.parent.position.x; | |
dY = this.curObject.parent.position.y; | |
dZ = this.curObject.parent.position.z; | |
}else{ | |
dX = 0; dY = 0, dZ = 0; |
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
import THREE from 'three'; | |
export default class MeshLine { | |
constructor() { | |
this.attributes = {}; | |
this.positions = []; | |
this.geometry = new THREE.BufferGeometry(); | |
this.widthCallback = null; | |
} |
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
.sidebar_newsletter_sign_up, | |
.sidebar_subscribe, | |
.sign-up-form-single, | |
.signup-form--header, | |
.signup-with-checkboxes, | |
.skinny-sign-up, | |
.slidedown-newsletter, | |
.small-newsletter, | |
.social-link-mail, | |
.social_newsletter_box, |
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
// Bars will always show when clicking close to the top/botton of the device | |
html, body { | |
width: 100%; | |
height: 100%; | |
overflow: hidden; | |
} | |
body { | |
height: 101%; |
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
// http://stackoverflow.com/a/6714140 | |
transform="matrix(sx, 0, 0, sy, cx - sx * cx, cy - sy * cy)" |