forked from EmulatorJS/EmulatorJS
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.html
38 lines (34 loc) · 1.32 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="main.css">
<title>Test Stuff</title>
</head>
<body>
<script type="text/javascript" src="games.json"></script>
<script>
/**const games = [
{title: "Mario Kart 64 (USA)", filetype: "z64"},
{title: "Star Fox 64 (USA) (Rev 1)", filetype: "z64"}
]**/
const games = fetch("games.json")
//const games = json.games
for(i=0; i<games.length; i++){
var icon = "https://thumbnails.libretro.com/Nintendo%20-%20Nintendo%2064/Named_Boxarts/" + games[i].title + ".png"
var link = "player.html?game=" + games[i].title //+ "&id =" + i// + "&type=" + games[i].filetype
var game = document.createElement("a")
game.setAttribute("href", link)
//game.setAttribute("innerHtml", games[i].title)
game.className = "a"
var cover = document.createElement("img")
cover.setAttribute("src", icon)
cover.className = "img"
game.appendChild(cover)
document.body.appendChild(game)
}
</script>
</body>
</html>