-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
56 lines (53 loc) · 1.78 KB
/
index.php
File metadata and controls
56 lines (53 loc) · 1.78 KB
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
<?php
/**
* (c) 2013-2023 Jannis Grimm <jannis@gje.ch>
* MIT License
*/
declare(strict_types=1);
require_once __DIR__ . '/vendor/autoload.php';
require_once __DIR__ . '/src/games.php';
$games = getGames();
?>
<!DOCTYPE html>
<meta charset='utf-8'>
<title>BoardGameShelf</title>
<meta name="viewport" content="width=900">
<link rel="stylesheet" href="src/style.css">
<h1>BoardGameShelf</h1>
<?php foreach ($games as $game) { ?>
<img
height="150"
src="<?= $game['thumbnail'] ?>"
alt="<?= $game['name'] ?>"
title="<?= $game['name'] ?>"
data-name="<?= $game['name'] ?>"
data-rating="<?= $game['rating'] > 0 ? $game['rating'] : 'N/A' ?>"
data-average="<?= number_format($game['average'], 1) ?>"
data-players="<?= $game['players'] ?>"
data-playingtime="<?= $game['playingtime'] ?>"
data-yearpublished="<?= $game['yearpublished'] ?>"
data-objectid="<?= $game['objectid'] ?>"
>
<?php } ?>
<footer style="font-style: italic"><small>Data and images by <a href="http://www.boardgamegeek.com/">BoardGameGeek</a></small></footer>
<div hidden id='infopanel'>
<img height='150' src='src/boardgameshelf.gif' id='infoimage' alt=''>
<div>
<h2 id='infoname'></h2>
<dl>
<dt>My Rating:</dt>
<dd id='inforating'></dd>
<dt>Average:</dt>
<dd id='infoaverage'></dd>
<dt>Players:</dt>
<dd id='infoplayers'></dd>
<dt>Playing Time:</dt>
<dd id='infoplayingtime'></dd>
<dt>Published:</dt>
<dd id='infoyearpublished'></dd>
<dt>Owned Expansions:</dt>
<dd id='infoownedexpansions'></dd>
</dl>
</div>
</div>
<script src="src/script.js"></script>