Giter Site home page Giter Site logo

simon's Introduction

alt tag

simon

Tech

AngularJS + watching, Array_Equals.js, $timeouts and $intervals, PlainJS(Audio)

Tested with:

Karma, PhantomJS, Istanbul, Mocha, Chai, Sinon

Niceties

CSS Overlays, Lights and Glows Array deep comparison

Details

CSS

  • ng-class to smooth darken background when power is on. (Using opacity on black) (Orig. used in TOS Mapdex)
 <div id="darkness" class="disappear" data-ng-class="{'disappear': !power, 'appear': power}"></div>
  • using box-shadow to tint a div which already has a background image.
 input.color = "0px 340px rgba(255, 0, 80, 0.3) inset"
 SEE BELOW for "input.color"
  • Circular glow button, iPhone-style switch
  • TM symbol and happy/frowny faces.

JS

  • Use ng-style with JSON & ng-repeat for generating and animating Xylophone bars:
   $scope.set_styling = function (input) {
       if (input.playing) {
           return { "height": input.length, "box-shadow": input.color }
       }
       else{
       return { "height": input.length }
       };
  • using a box-shadow on an overlayed div to give glow effect. (Used on "Pip Holder" elements that align pips)
   $scope.backlight = function (input) {
       if (input.playing) {
           return { "box-shadow": input.light }
       }
       else{
       return {  }
       };
  • Sequence:
Up Number -> Play Demo -> Listen (allow user input) -> ":)" -> Up Number -> Play Demo....
                                                L ---> ":(" -> Play Demo -> Listen Again...
  • Block User Action with a
    that only disappears during Listen Phase.
   <div id="click-block" data-ng-if="!listening"></div>
  • ng-mousedown, mouseup, mouseenter: (Used in Guide-showing, hold down for long glow aesthetic)
data-ng-mouseenter="ShowGuide(bar)" data-ng-mousedown="Play(bar)" data-ng-mouseleave="UnPlay(bar);ShowGuide(bar)" data-ng-mouseup="UnPlay(bar)"
TODO

would like to find a way to find and cancel all pending timeouts. maybe use a array of timeouts and assign each timeout to that array?

Also find a way to preload sounds so they don't lag the first time they're played Preloading sounds does not solve this problem, but this is how you do it.

    var sounds = [];//preload sounds
    for (var k=0;k<$scope.instrum.xyphone.length;k++){sounds.push(new Audio($scope.instrum.xyphone[k].tune))};//preload sounds
    // and then play them off of sounds array

simon's People

Contributors

vtange avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.