-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
107 lines (106 loc) · 4.48 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
<!DOCTYPE html>
<html>
<head>
<meta charset='utf-8'>
<meta http-equiv='content-type' content='text/html;charset=UTF-8' />
<title>GameDB</title>
<meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1'>
<script src='static/script/cms.min.js' type='text/javascript'></script>
<script src='static/script/typeahead.min.js' type='text/javascript'></script>
<link type='text/css' href='static/css/cms.css' rel='stylesheet' />
<style>
.twitter-typeahead {
display: block !important;
}
.tt-input {
width: 100%;
display: block;
}
.tt-dropdown-menu, .tt-menu {
width: 100%;
background-color: #fff;
padding: 10px;
}
</style>
</head>
<body>
<a href="https://github.com/jasonsperske/game-db"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
<div class='navbar' role='navigation'>
<div class='container'>
<div class='navbar-header'>
<button type='button' class='navbar-toggle' data-toggle='collapse' data-target='.navbar-collapse'>
<span class='sr-only'>Menu</span>
<i class="fa fa-bars" aria-hidden="true"></i>
</button>
<span class='navbar-brand thin'>GameDB</span>
</div>
</div>
</div>
<div id='main' class='container'>
<div class="jumbotron">
<h1>GameDB</h1>
<p>An Open Source database of videogames</p>
</div>
<h2>Example Search</h2>
<div id="GameSearch">
<input class="typeahead form-control input-lg" type="text" placeholder="North American Games">
<script type="text/javascript">
var load = function(name, url) {
var list = [];
$.ajax({
url: url,
dataType: 'json',
async: false,
success: function(data) {
Object.keys(data.games).forEach(function(guid) {
list.push($.extend({guid: guid, src: url}, data.games[guid]))
});
}
});
return { name: name,
display: 'name',
templates: {
header: '<h3 class="platform-name">'+name+'</h3>'
},
source: new Bloodhound({
identify: function(o) { return o.guid; },
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'),
queryTokenizer: Bloodhound.tokenizers.whitespace,
local: list
})
};
};
$('#GameSearch .typeahead').typeahead({
highlight: true
},
load('NES', 'content/platforms/Nintendo/NES/us/index.json'),
load('SNES', 'content/platforms/Nintendo/SNES/us/index.json'),
load('Genesis', 'content/platforms/SEGA/Genesis/us/index.json'),
load('TG16', 'content/platforms/NEC/TG16/us/index.json')).on('typeahead:selected', function(e, item) {
console.log(item);
});
</script>
</div>
<h2>Resources</h2>
<p>
<ul>
<li><a href='content/platforms/index.json'>A List of all Platforms</a></li>
<li>
North American Systems
<ul>
<li><a href='content/platforms/Nintendo/NES/us/index.json'>NES</a></li>
<li><a href='content/platforms/Nintendo/SNES/us/index.json'>SNES</a></li>
<li><a href='content/platforms/SEGA/Genesis/us/index.json'>Genesis</a></li>
<li><a href='content/platforms/NEC/TG16/us/index.json'>TurboGrafx-16</a></li>
</ul>
</li>
</ul>
</p>
</div>
<div id='footer'>
<div class='container'>
<p class='text-muted'><small>Created with ♡ by <a href='http://jason.sperske.com/'>Jason Sperske</a></p>
</div>
</div>
</body>
</html>