Permalink
Browse files

Mode chooser, larger item name

  • Loading branch information...
blinry committed Jun 25, 2017
1 parent fa153e9 commit 39410f571dd9c70c149af193699390a717b86bb9
Showing with 24 additions and 3 deletions.
  1. +5 −1 css/style.css
  2. +10 −0 index.html
  3. +9 −2 js/app.js
View
@@ -61,13 +61,17 @@ html, body {
bottom: 45px;
left: 20px;
width: 200px;
height: 80px;
height: 110px;
padding: 10px;
background: white;
box-shadow: 0px 0px 20px rgba(0,0,0, 0.9);
z-index: 1000;
}
select {
width: 200px;
}
#scoreBoard .round {
}
View
@@ -22,6 +22,16 @@
<span class='roundScore'>Last Round Score: <b>0</b></span><br/>
<span class='totalScore'>Total Score: <b>0</b></span><br />
<span><a href="https://github.com/blinry/wikidata-guessr">View project on GitHub</a></span>
<span>
<select id="mode">
<option value="">Start new game...</option>
<option value="">Any item</option>
<option value="?Q7138926">Parliament buildings</option>
<option value="?Q515">Cities</option>
<option value="?Q8502">Mountains</option>
<option value="?Q204832">Roller coasters</option>
</select>
</span>
</div>
<div id='miniMap'></div>
<div id='guessButton' class="btn btn-large btn-danger">Make Your Guess</div>
View
@@ -24,6 +24,13 @@ $(document).ready(function() {
// Init Timer
resetTimer();
var mode = document.getElementById("mode");
mode.onchange = function() {
var value = mode.options[mode.selectedIndex].value;
console.log(value);
document.location.search = value;
}
// Timer
function timer() {
count = count-1;
@@ -176,7 +183,7 @@ $(document).ready(function() {
points = 0;
} else {
$('#roundEnd').html('<p>Your guess was<br/><strong><h1>'+distance+'</strong>km</h1> away from the actual location,<br/><a href="'+window.locID+'">'+window.locName+'</a>,<br/>'+window.locDescription+'.<br/><div id="roundMap"></div><br/> You have scored<br/><h1>'+roundScore+' points</h1> this round!<br/><br/><button class="btn btn-primary closeBtn" type="button">Continue</button></p></p>');
$('#roundEnd').html('<p>Your guess was<br/><strong><h1>'+distance+'</strong>km</h1> away from the actual location,<br/><h2><a href="'+window.locID+'">'+window.locName+'</a>' + (window.locDescription ? ', '+window.locDescription : '' ) + '.</h2><div id="roundMap"></div><br/> You have scored<br/><h1>'+roundScore+' points</h1> this round!<br/><br/><button class="btn btn-primary closeBtn" type="button">Continue</button></p></p>');
$('#roundEnd').fadeIn();
};
@@ -244,7 +251,7 @@ $(document).ready(function() {
if (place.itemDescription) {
window.locDescription = place.itemDescription.value;
} else {
window.locDescription = "(no description available)";
window.locDescription = undefined;
}
});
}

0 comments on commit 39410f5

Please sign in to comment.