-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
117 lines (110 loc) · 3.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<!DOCTYPE html>
<html>
<head>
<title>Lunchinator</title>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<link href="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
<style type="text/css">
.lottery {
text-align: center;
}
.choice {
text-align: center;
font-size: 18px;
font-weight: 600;
}
.title {
text-align: center;
margin-top: 48px;
}
.row {
padding: 20px 0;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<div class="title span12">
<h1>Lunchinator</h1>
</div>
</div>
<div class="row lottery">
<div class="span4"></div>
<div class="span4 ">
<div class="input-append">
<input class="span3 name" type="text" placeholder="I'm hungry ...">
<button class="btn btn-danger stop" type="button">Stop</button>
<button class="btn btn-inverse start" type="button">Start</button>
</div>
</div>
<div class="span4"></div>
</div>
<div class="row">
<div class="span4"></div>
<div class="span4">
<p class="choice"></p>
</div>
<div class="span4"></div>
</div>
<div class="row">
<div class="span4"></div>
<div class="span4">
<!-- <h2 style="text-align: center;">History</h2>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th>Date</th>
<th>Spot</th>
</tr>
</thead>
<tbody></tbody>
</table>
--> </div>
<div class="span4"></div>
</div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/js/bootstrap.min.js"></script>
<script type="text/javascript">
var options = [
'Taco Ocho', "Babe's", 'Mooyah', 'Firehouse', "Rudy's BBQ", 'Great Outdoors', 'Pure Poke',
'Roti Grill', "Luigi's", "Norma's", 'The Egg and I', 'Chipotle', 'Mendocino Farms',
'Freebirds', "Jet's Pizza", "Scotty P's", "Chip's Hamburgers", "Biscuit Bar", "Wingstop", "Spring Creek BBQ",
"Breadwinners", "Torchy's", "Newk's", "Eatzi's", "Fuzzy's", "Black Walnut Cafe", "Chuy's", "Hutchins BBQ"
],
place = 1,
stop = false,
pickedIndex = 0,
pickedName = '',
$choice = $('.choice');
pickSomeone = function() {
$choice.css({opacity: 0});
if (!stop) {
pickedIndex = Math.floor(Math.random() * options.length);
pickedName = options[pickedIndex];
$('.name').val(pickedName);
setTimeout(function() {
pickSomeone();
}, 100);
} else {
// options.splice(pickedIndex, 1);
// console.log(options);
$choice.html($('.name').val());
$choice.animate({opacity: 1});
//insert chosen player into table
// $('.table tbody').append('<tr><td>' + place + '</td><td>' + $('.name').val() + '</td></tr>');
// place++;
}
};
pickSomeone();
$('.stop').click(function(e) {
stop = true;
});
$('.start').click(function(e) {
stop = false;
pickSomeone();
});
</script>
</body>
</html>