From 164010d7fd133dc324a6e5bd40451e17416c6a7d Mon Sep 17 00:00:00 2001 From: Kevin Ngo Date: Thu, 20 Sep 2018 17:40:30 -0700 Subject: [PATCH] gitattributes for auto crlf normalization --- .gitattributes | 30 ++++++++++ .../{logoflickr.js => logoflicker.js} | 58 +++++++++---------- 2 files changed, 59 insertions(+), 29 deletions(-) create mode 100644 .gitattributes rename src/components/{logoflickr.js => logoflicker.js} (85%) diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..3d71b16 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,30 @@ +# FIX CRLF always when developer has not set +# Linux/Mac: git config --global core.autocrlf input +# Windows: git config --global core.autocrlf true +# Auto detect text files and perform LF normalization +* text=auto +* eol=lf + +*.js text +*.html text +*.npmignore text +*.md text +.ackrc text +.gitattributes text +.gitignore text +.jshintrc text +.nojekyll text +.travis.yml text +LICENSE text + +# Avoid creation of unnecessary big commit objects +# For these files we do not want to see text diff for +*.min.* binary minified +*js.map* binary +*.svg binary +*.mtl binary +*.obj binary +*.jpg binary +*.jpeg binary +*.png binary +*.wav binary diff --git a/src/components/logoflickr.js b/src/components/logoflicker.js similarity index 85% rename from src/components/logoflickr.js rename to src/components/logoflicker.js index ffadd5f..9561c57 100644 --- a/src/components/logoflickr.js +++ b/src/components/logoflicker.js @@ -1,29 +1,29 @@ -AFRAME.registerComponent('logoflicker', { - dependencies: ['text'], - schema: { - default: 1000.0, - }, - init: function () { - this.defaultColor = this.el.components['text'].data.color; - this.sparks = document.getElementById('logosparks'); - this.sparkPositions = [ - { position: new THREE.Vector3(0, 0.1, 0) }, - { position: new THREE.Vector3(0.5, 1.2, 0) }, - { position: new THREE.Vector3(0, 1.2, 0) } - ]; - this.setOn(); - }, - setOff: function () { - this.el.setAttribute('text', {color: '#0a0228'}); - this.sparks.emit('flicker', - this.sparkPositions[Math.floor(Math.random() * this.sparkPositions.length)]); - - setTimeout(this.setOn.bind(this), - 50 + Math.floor(Math.random() * 100)); - }, - setOn: function () { - this.el.setAttribute('text', {color: this.defaultColor}); - setTimeout(this.setOff.bind(this), - Math.floor((this.data * 3 / 10) + Math.random() * this.data)); - } -}); +AFRAME.registerComponent('logoflicker', { + dependencies: ['text'], + schema: { + default: 1000.0, + }, + init: function () { + this.defaultColor = this.el.components['text'].data.color; + this.sparks = document.getElementById('logosparks'); + this.sparkPositions = [ + { position: new THREE.Vector3(0, 0.1, 0) }, + { position: new THREE.Vector3(0.5, 1.2, 0) }, + { position: new THREE.Vector3(0, 1.2, 0) } + ]; + this.setOn(); + }, + setOff: function () { + this.el.setAttribute('text', {color: '#0a0228'}); + this.sparks.emit('flicker', + this.sparkPositions[Math.floor(Math.random() * this.sparkPositions.length)]); + + setTimeout(this.setOn.bind(this), + 50 + Math.floor(Math.random() * 100)); + }, + setOn: function () { + this.el.setAttribute('text', {color: this.defaultColor}); + setTimeout(this.setOff.bind(this), + Math.floor((this.data * 3 / 10) + Math.random() * this.data)); + } +});