36a1d09e870422ce3ccdd871282298b1b27f105f
[stouyapi.git] / data / templates / game.tpl.php
1 <!DOCTYPE html>
2 <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3  <head>
4   <meta charset="utf-8"/>
5   <title><?= htmlspecialchars($json->title); ?> - OUYA game</title>
6   <meta name="generator" content="stouyapi"/>
7   <meta name="author" content="<?= htmlspecialchars($json->developer->name) ?>"/>
8   <link rel="stylesheet" type="text/css" href="../ouya-game.css"/>
9   <link rel="icon" href="../favicon.ico"/>
10  </head>
11  <body class="game">
12   <header>
13    <img class="ouyalogo" src="../ouya-logo.grey.svg" alt="OUYA logo" width="50"/>
14   </header>
15   <section class="text">
16    <h1><?= htmlspecialchars($json->title); ?></h1>
17    <dl class="meta">
18     <dt>Rating</dt>
19     <dd class="rating">
20      <span class="average average-<?= round($json->rating->average) ?>" title="<?= $json->rating->average ?>"><?= $json->rating->average ?></span>
21      <span class="count">(<?= $json->rating->count ?>)</span>
22     </dd>
23
24     <dt>Developer</dt>
25     <dd class="company">
26      <?php if ($appsJson->app->website): ?>
27       <a href="<?= htmlspecialchars($appsJson->app->website) ?>"><?= htmlspecialchars($json->developer->name) ?></a>
28      <?php else: ?>
29       <?= htmlspecialchars($json->developer->name) ?>
30      <?php endif ?>
31     </dd>
32
33     <dt>Suggested age</dt>
34     <dd class="contentRating">
35      <?= htmlspecialchars($json->suggestedAge) ?>
36     </dd>
37
38     <dt>Number of players</dt>
39     <dd class="players">
40      <?= htmlspecialchars(implode(', ', $json->gamerNumbers)) ?>
41     </dd>
42
43     <dt>Download size</dt>
44     <dd class="size">
45      <?= number_format($json->apk->fileSize / 1024 / 1024, 2) ?> MiB
46     </dd>
47    </dl>
48
49    <p class="description">
50     <?= nl2br(htmlspecialchars($json->description)) ?>
51    </p>
52   </section>
53
54   <section class="media">
55    <h2>Screenshots</h2>
56    <div class="content">
57     <?php foreach ($json->mediaTiles as $tile): ?>
58      <?php if ($tile->type == 'image'): ?>
59       <img src="<?= htmlspecialchars($tile->urls->thumbnail) ?>" alt="Screenshot of <?= htmlspecialchars($json->title); ?>"/>
60      <?php elseif ($tile->type == 'video'): ?>
61       <video controls="">
62        <source src="<?= htmlspecialchars($tile->url) ?>"/>
63       </video>
64      <?php endif ?>
65     <?php endforeach ?>
66    </div>
67   </section>
68
69   <section class="buttons">
70    <h2>Links</h2>
71    <div>
72     <a href="<?= $apkDownloadUrl ?>">Download .apk</a>
73     <p>
74      Version <?= $json->version->number ?>, published
75      <?= gmdate('Y-m-d', $json->version->publishedAt) ?>
76     </p>
77    </div>
78   </section>
79
80   <nav>
81    <?php foreach ($navLinks as $url => $title): ?>
82     <a rel="up" href="<?= htmlspecialchars($url) ?>"><?= htmlspecialchars($title) ?></a>
83    <?php endforeach ?>
84   </nav>
85  </body>
86 </html>