Skip to content

Commit

Permalink
Initial commit for "New Location" feature.
Browse files Browse the repository at this point in the history
  • Loading branch information
UsainBloot committed Oct 10, 2014
1 parent e8880e2 commit 61c5c97
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 13 deletions.
13 changes: 11 additions & 2 deletions css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ div.input-group input {
.one {
opacity: 0;
-webkit-animation: dot 1.3s infinite;
-webkit-animation-delay: 0.0s;
-webkit-animation-delay: 0s;
animation: dot 1.3s infinite;
animation-delay: 0.0s; }
animation-delay: 0s; }

.two {
opacity: 0;
Expand All @@ -194,6 +194,7 @@ div.input-group input {

100% {
opacity: 1; } }

@keyframes dot {
0% {
opacity: 0; }
Expand All @@ -203,6 +204,7 @@ div.input-group input {

100% {
opacity: 1; } }

.panel-map {
position: absolute;
top: 50%;
Expand Down Expand Up @@ -270,3 +272,10 @@ input[type="text"]#search {

button#select-location {
width: 157px; }

button#new-location {
position: absolute;
bottom: 0;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0; }
8 changes: 8 additions & 0 deletions css/global.scss
Original file line number Diff line number Diff line change
Expand Up @@ -355,4 +355,12 @@ input[type="text"]#search {

button#select-location {
width: 157px;
}

button#new-location {
position: absolute;
bottom: 0;
border-top-left-radius: 0;
border-bottom-left-radius: 0;
border-bottom-right-radius: 0;
}
4 changes: 3 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,12 @@ <h2></h2>
<span class="input-group-addon"><span class="glyphicon glyphicon-share"></span> Share link</span>
<input type="text" id="shareLink" class="form-control" value="">
</div>
<button type="submit" id="search" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span> Search</button>
<button type="submit" id="settings-search" class="btn btn-primary"><span class="glyphicon glyphicon-search"></span> Search</button>
</div>
</div>

<button type="button" id="new-location" class="btn btn-primary blur"><span class="glyphicon glyphicon-globe"></span> New Location</button>

<canvas id="confetti-world"></canvas>
<button type="button" id="spin" class="btn btn-success blur"><span class="glyphicon glyphicon-repeat"></span> Spin</button>
<canvas id="wheel" class="blur" width="600" height="600"></canvas>
Expand Down
24 changes: 14 additions & 10 deletions js/geolocation.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
var crd;
var rangeCounter = 0;
var defaultRadius = 300;
var radiusIncremental = 50;
var defaultPlaceType = "restaurant";
var defaultMaxPlaces = 12;
var initialPlaces = 12;
var params = getUrlParams();
var crd, rangeCounter, defaultRadius, radiusIncremental, defaultPlaceType, defaultMaxPlaces, initialPlaces ,params;
reset();

function reset() {
rangeCounter = 0;
defaultRadius = 300;
radiusIncremental = 50;
defaultPlaceType = "restaurant";
defaultMaxPlaces = 12;
initialPlaces = 12;
params = getUrlParams();
}

function getPlacesAjax(latitude, longitude, radius, placeType, maxPlaces) {
restaurants = new Array(maxPlaces);
Expand Down Expand Up @@ -38,7 +42,7 @@ function getPlacesAjax(latitude, longitude, radius, placeType, maxPlaces) {
$('#radius').val(radius);
drawRouletteWheel();
proceed();
$('#search').html('<span class="glyphicon glyphicon-search"></span> Search');
$('#settings-search').html('<span class="glyphicon glyphicon-search"></span> Search');
}
});
}
Expand Down Expand Up @@ -71,7 +75,7 @@ function positionError(err) {
}

function searchUserDefined() {
$('#search').html('<i class="fa fa-refresh fa-spin"></i>');
$('#settings-search').html('<i class="fa fa-refresh fa-spin"></i>');
getPlacesAjax(
$('#latitude').val(),
$('#longitude').val(),
Expand Down
11 changes: 11 additions & 0 deletions js/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ $(document).ready(function() {
$('input#shareLink').click(function() {
$(this).select();
});
$('button#new-location').click(function() {
reset();
params.lat = undefined;
params.long = undefined;
blurBackground();
$('.select-localisation').show();
});
});

function proceed() {
Expand All @@ -55,6 +62,10 @@ function proceed() {
$('.panel-map').hide();
$('.result').hide();

//Clear google maps
$('#search').val('');
$('#select-location').text('Select Location');

//Clear confetti canvas
var confetti = document.getElementById('confetti-world');
confetti.width = confetti.width;
Expand Down

0 comments on commit 61c5c97

Please sign in to comment.