diff --git a/.gitignore b/.gitignore index 65742f2..b69cfc1 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,4 @@ static/* !static/.keep !static/images !static/sounds +.DS_Store diff --git a/coffee/receiver/state.coffee b/coffee/receiver/state.coffee index ec43440..4f4e90c 100644 --- a/coffee/receiver/state.coffee +++ b/coffee/receiver/state.coffee @@ -14,13 +14,17 @@ class StateHandler setState: (@current) -> class StateDefinition - constructor: ({@handler = window.stateHandler} = {}) -> + constructor: ({@handler = window.stateHandler, @audio} = {}) -> + console.debug 'statedef', arguments... + if @audio? + audio = new Audio("/static/sounds/#{@audio}") + audio.play() onMessage: (message) -> @handler.resetState() class SplashState extends StateDefinition - constructor: ({@handler = window.stateHandler} = {}) -> + constructor: -> @splash = document.createElement('div') @splash.id = 'splash' @splash.innerHTML = '' diff --git a/coffee/receiver/wheel.coffee b/coffee/receiver/wheel.coffee index e239f81..30b58ef 100644 --- a/coffee/receiver/wheel.coffee +++ b/coffee/receiver/wheel.coffee @@ -34,6 +34,7 @@ segConfig = [ winState: YouTubeState stateOptions: content: 'Whenever "Fuhrer" is said in the video, everyone drinks!' + audio: 'fuhrer.m4a' data: videos: 'sfkDxF2kn1I ZrHmcpRAZNs pS8kgSLA500'.split ' ' } @@ -41,6 +42,7 @@ segConfig = [ text: 'Beer Match!' winState: TimeoutState stateOptions: + audio: 'boxing.m4a' data: seconds: 20 } @@ -49,6 +51,7 @@ segConfig = [ winState: YouTubeState stateOptions: content: "Take a shot every fail until you can't!" + audio: 'fail-mail.m4a' data: videos: 'Hcp_2HB5MCE 0ez-XM7eiiI t5oZ7fr3gsE'.split ' ' } @@ -56,12 +59,14 @@ segConfig = [ text: "Drinkin', Alexey Style" winState: DrinkState stateOptions: + audio: 'alexey.m4a' content: 'The Alexey Challenge
Drink one Arak or Vodka shot with a straw!' } { text: 'Drink with Someone' winState: DrinkState stateOptions: + audio: 'yeehaw.mp3' content: -> names = 'amit avihad chen dor eran lior michael tom zeevi'.split(' ') idx = Math.floor(Math.random() * names.length) @@ -71,18 +76,21 @@ segConfig = [ text: 'No Mercy' winState: DrinkState stateOptions: + audio: 'evil-laugh.mp3' content: 'Pick someone from your group to take one shot' } { text: 'The Spicy Round' winState: DrinkState stateOptions: + audio: 'kill.wav' content: 'Pick one:' } { text: 'Solo Round' winState: DrinkState stateOptions: + audio: 'mr-lonely.mp3' content: 'Drink up!' } ] diff --git a/static/sounds/alexey.m4a b/static/sounds/alexey.m4a new file mode 100644 index 0000000..899d7d2 Binary files /dev/null and b/static/sounds/alexey.m4a differ diff --git a/static/sounds/boxing.m4a b/static/sounds/boxing.m4a new file mode 100644 index 0000000..90cfee5 Binary files /dev/null and b/static/sounds/boxing.m4a differ diff --git a/static/sounds/evil-laugh.mp3 b/static/sounds/evil-laugh.mp3 new file mode 100644 index 0000000..418eb18 Binary files /dev/null and b/static/sounds/evil-laugh.mp3 differ diff --git a/static/sounds/fail-mail.m4a b/static/sounds/fail-mail.m4a new file mode 100644 index 0000000..cf9da39 Binary files /dev/null and b/static/sounds/fail-mail.m4a differ diff --git a/static/sounds/fuhrer.m4a b/static/sounds/fuhrer.m4a new file mode 100644 index 0000000..530a144 Binary files /dev/null and b/static/sounds/fuhrer.m4a differ diff --git a/static/sounds/kill.wav b/static/sounds/kill.wav new file mode 100644 index 0000000..7cc3800 Binary files /dev/null and b/static/sounds/kill.wav differ diff --git a/static/sounds/mr-lonely.mp3 b/static/sounds/mr-lonely.mp3 new file mode 100644 index 0000000..0e7a42c Binary files /dev/null and b/static/sounds/mr-lonely.mp3 differ diff --git a/static/sounds/yeehaw.mp3 b/static/sounds/yeehaw.mp3 new file mode 100644 index 0000000..f68859c Binary files /dev/null and b/static/sounds/yeehaw.mp3 differ