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
class PasswordRevealer extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
shown: false | |
}; | |
this.toggleShown = this.toggleShown.bind(this); | |
} | |
toggleShown() { |
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
let winsize; | |
const calcWinsize = () => winsize = {width: window.innerWidth, height: window.innerHeight}; | |
calcWinsize(); | |
window.addEventListener('resize', calcWinsize); | |
const getMousePos = (ev) => { | |
let posx = 0; | |
let posy = 0; | |
if (!ev) ev = window.event; | |
if (ev.pageX || ev.pageY) { |
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
const imgs = [...document.querySelectorAll('.content__img')]; | |
const imgsTotal = imgs.length; | |
let imgTranslations = [...new Array(imgsTotal)].map(() => ({x: 0, y: 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
const randomHexColorCode = () => { | |
let n = (Math.random() * 0xfffff * 1000000).toString(16); | |
return '#' + n.slice(0, 6); | |
}; |
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 BufferLoader(context, urlList, callback) { | |
this.context = context; | |
this.urlList = urlList; | |
this.onload = callback; | |
this.bufferList = new Array(); | |
this.loadCount = 0; | |
} | |
BufferLoader.prototype.loadBuffer = function(url, index) { | |
var request = new XMLHttpRequest(); |
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
"browserify": { | |
"transform": [["babelify", { "presets": ["es2015", "stage-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 React, { Component } from 'react' | |
import cx from 'classnames' | |
import PropTypes from 'prop-types' | |
import Instagram from '../../../static/images/instagram.svg' | |
import Story from '../../../static/images/story.svg' | |
import Facebook from '../../../static/images/facebook.svg' | |
import Twitter from '../../../static/images/twitter.svg' | |
import Snapchat from '../../../static/images/snapchat.svg' | |
import Youtube from '../../../static/images/youtube.svg' | |
import Blog from '../../../static/images/blog.svg' |
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
let renderer, camera, controls, scene, | |
width = window.innerWidth, | |
height = window.innerHeight; | |
init(); | |
animate(); | |
render(); | |
function init() { | |
// RENDERER |
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
document.getElementsByTagName('button')[0].onclick = function () { | |
scrollTo(document.body, 0, 1250); | |
} | |
function scrollTo(element, to, duration) { | |
var start = element.scrollTop, | |
change = to - start, | |
currentTime = 0, | |
increment = 20; | |
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() { | |
var mouseTimer = null, cursorVisible = true; | |
function disappearCursor() { | |
mouseTimer = null; | |
document.body.style.cursor = "none"; | |
cursorVisible = false; | |
} | |
document.onmousemove = function() { |