Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/diversify/janu
Browse files Browse the repository at this point in the history
# By Juntima Nawilaijaroen (2) and others
# Via scanniza (2) and Mattias Arrelid (1)
* 'master' of https://github.com/diversify/janu:
  Better description is better.
  combo icon
  resource for winning screen
  blur-animation
  pulsing score

Conflicts:
	app/partials/game.html
  • Loading branch information
hejelin committed Nov 23, 2014
2 parents a57b2ee + 6e41714 commit 8c56bba
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 8 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
# Diversify your music taste

This is a game that will help you broaden your taste in music.

# How to get started

- Clone the repo
- Start an HTTP server in the root of the repository. Some people like ``python -m SimpleHTTPServer``
- Visit the server in your web browser of choice
```bash
git clone $THIS_REPO
python -m SimpleHTTPServer
# Visit the page served by the web server above
```
16 changes: 14 additions & 2 deletions app/controllers/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,28 @@ app.controller('januController', ['$scope','$http','$interval', function ($scope

// this is the first song the user guesses
firstSong = fetchNewSong();
$('#album-cover').addClass('no-blur');
playSong(firstSong);

$scope.gameInSession = true;

// start the timer
$interval(function(){
timeLeft = getTimeLeft();
if(timeLeft<16)
if(timeLeft<16){
$scope.timeLeft = timeLeft;
if(timeLeft==15){
$('#album-cover').addClass('animate-blur');
}
if(timeLeft==14){
$('#album-cover').addClass('no-blur');
}
}
else
$scope.timeLeft = 15;
if (timeLeft <= 0) {
$('#album-cover').removeClass('animate-blur');
$('#album-cover').removeClass('no-blur');
checkAnswer();
}
}, 1000);
Expand Down Expand Up @@ -158,9 +168,11 @@ app.controller('januController', ['$scope','$http','$interval', function ($scope
//clear the selection
$scope.currentAnswer = null;

newSong = fetchNewSong();
newSong = fetchNewSong();
playSong(newSong);
$scope.markerSet = false;
$scope.score.round = 0;

}

function answerSuccess() {
Expand Down
5 changes: 2 additions & 3 deletions app/partials/game.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@


<div id="game-header"><h2><a href="/"><img src="content/image/logo.png" alt="logo" id="logo" /> <h2>Saturn</h2></a></div>
<!-- <input type="button" value = "Add Song" ng&#45;click="addSong()"> -->
<div class="rings-in-back"></div>
<div class="rings-in-front"></div>

Expand All @@ -12,7 +11,7 @@ <h2>{{currentSong.year}}</h2>
</div>

<div id="game-content" ng-init="init()">
<img src="content/image/audiowave-gif.gif" id="album-cover" alt="album cover" />
<img ng-src="{{currentSong.image_url !== null && currentSong.image_url || 'content/image/audiowave-gif.gif'}}" id="album-cover" alt="album cover" class="animate-blur"/>
<div ng-if="gameInSession" class="question-and-timer">
<h2 id="timer"><strong>{{timeLeft}}</strong></h2>
<h2 id="question">Which timespan?</h2>
Expand All @@ -32,5 +31,5 @@ <h2 id="question">Which timespan?</h2>
<div id="endpoint">NOW</div>
</div>

<div id="game-footer"><h2 id="score">SCORE <em>{{score.total}}</em></h2><h2 id="round">CORRECT GUESSES {{timelineSongs.length}} / 10</h2></div>
<div id="game-footer"><h2 id="score">SCORE <em>{{score.total}}</em><em class="emergency">{{score.round!=0 && ' +' + score.round || ''}}</em></h2><h2 id="round">CORRECT GUESSES {{timelineSongs.length}} / 10</h2></div>

Binary file added content/image/combo-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/image/congratulation.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/image/correct-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added content/image/wrong-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions content/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,19 @@ label {
border-radius: 50%;
position: relative;
-webkit-filter: blur(10px);
-moz-filter: blur(10px);
filter: blur(10px);
z-index: 4;
}
.no-blur{
-webkit-filter: blur(0px)!important;
-moz-filter: blur(0px)!important;
filter: blur(0px)!important;
}
.animate-blur{
-webkit-transition:17s -webkit-filter linear!important;
transition:-webkit-filter 17s linear!important;
}

.rings-in-back {
padding: 15px;
Expand Down Expand Up @@ -374,3 +384,21 @@ button {
.wrong {
border-color: #da3e2f !important;
}
.emergency
{
-webkit-animation: cc 1s ease-in 1s infinite alternate;
animation: cc 1s ease-in 1s infinite alternate;
color: #eee;
}

@-webkit-keyframes cc
{
0% { color: #eee;}
100% { color: #c66 ;}
}

@keyframes cc
{
0% { color: #eee;}
100% { color: #c66;}
}

0 comments on commit 8c56bba

Please sign in to comment.