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