Version 2.0
This JS web app is to help me (and my team) to decide where to head off for lunch by randomly choosing one of the regular venues.
The list of venue is retrieved using Firebase API
Venues can be disabled by toggling the item.
###Prequisites Install NPM (if you do not have one)
Install Gem and Compass
Install dependencies
npm install
Execute Grunt
grunt watch
Instantiate JS
var lunchTime = new LunchTime();
You may overwrite settings by parsing:
var settings = {
allowAudio : true,
randomise : true,
defaultLocation : "newlocation",
timer : {
interval: 200
}
},
lunchTime = new LunchTime(settings);
Attributes | Object attribtues | Values | Default |
---|---|---|---|
defaultLocation | - | Default location to load the venues | mulgrave |
listContainer | idName | lunch list container ID | lunchList |
listContainer | classNormal | List item class | item |
listContainer | classSelected | Selected list item class | selected |
listContainer | classDisabled | Disabled list item class | disabled |
timer | interval | Delay between each random (miliseconds) | 150 |
timer | increment | Increment for each threshold (miliseconds) | 250 |
timer | threshold | Delay before increment (miliseconds in an array) | [3000,3000,3000] |
allowAudio | - | Plays audio | false |
srcAudio | selection | File source for selection audio | "audio/beep.mp3" |
srcAudio | selected | File source for selected audio | "audio/tadaa.mp3" |
randomise | - | Randomise lunch list | false |
The JSON string should be just a simple list
{
"location1":{
"item1" : " Cafe A",
"item2" : " Cafe B",
"item3" : " Cafe C"
},
"location2":{
"item1" : " Cafe X",
"item2" : " Cafe Y",
"item3" : " Cafe Z"
}
}
- Automate Firebase installation instead of manual script insertion
- Fix Safari and iOS audio play
- Ogg audio support
v2.0 (3rd August 2016) - Massive fail. Upgraded Firebase API 2.0 to 3.0