-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
72 lines (64 loc) · 2.7 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Around the Table: Question Presenter</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="css/bootstrap.min.css" >
<!--<link href="css/narrow-jumbotron.css" rel="stylesheet">-->
</head>
<body>
<div class="container">
<br/>
<p><a class="btn btn-lg btn-success" href="#" role="button" onclick="randomQuestion()">Random Question</a></p>
<div class="jumbotron">
<span class="badge badge-dark" id="dark"></span>
<h1 id="question"></h1>
<!--<h1 class="display-4" id="question"></h1>-->
<hr class="my-4">
</div>
<div class="row">
<div class="col-lg-8">
<h4>Around the Table</h4>
<p>This is based on Nick Crocker's "<a href="https://medium.com/things-ive-written/around-the-table-ea8b520683c5">Around the table – 101 ways to kick off the best family dinner table game.</a>"</p>
<p><span class="badge badge-dark">Dark</span> marks questions IMHO to be avoided if you prefer a rather positive experience.</p>
<h4>Resources</h4>
<p>Find here a <a href="tex/aroundthetable.pdf">printable PDF</a> of the questions, the <a href="tex/aroundthetable.tex">LaTeX source</a> for customization, and the <a href="aroundthetable_questions.csv">CSV</a>.</p>
</div>
</div>
<footer class="footer">
<p>Website created with <a href="https://jquery.com/">jQuery</a>, <a href="https://github.com/evanplaice/jquery-csv">jQuery-CSV</a>, and <a href="https://getbootstrap.com/">Bootstrap</a> by <a href="http://www.miede.de">André Miede</a> 2019. <a href="https://github.com/amiede/aroundthetable">Source code is available on GitHub</a>.</p>
</footer>
</div> <!-- /container -->
<script src="js/jquery-3.4.1.min.js"></script>
<script src="js/jquery.csv.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
<script type="text/javascript">
function randomQuestion() {
// array of arrays
$.ajax({
type: "GET",
url: "aroundthetable_questions.csv",
dataType: "text",
success: function(data) {
var options = { separator: ";", delimiter:'"', headers:false }
var result = $.csv.toArrays(data, options );
var len = result.length;
var rand = Math.floor((Math.random() * len));
var question = result[rand][0]
var dark = result[rand][1];
if (dark) {
dark = "DARK";
}
document.getElementById('question').innerHTML = question;
document.getElementById('dark').innerHTML = dark;
//document.getElementById('link').href = link;
;}
});
};
$(document).ready(function() {
randomQuestion();
});
</script>