2 <html xmlns="http://www.w3.org/1999/xhtml" lang="en">
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"/>
13 <img class="ouyalogo" src="../ouya-logo.grey.svg" alt="OUYA logo" width="50"/>
15 <section class="text">
16 <h1><?= htmlspecialchars($json->title); ?></h1>
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>
26 <?php if ($appsJson->app->website): ?>
27 <a href="<?= htmlspecialchars($appsJson->app->website) ?>"><?= htmlspecialchars($json->developer->name) ?></a>
29 <?= htmlspecialchars($json->developer->name) ?>
33 <dt>Suggested age</dt>
34 <dd class="contentRating">
35 <?= htmlspecialchars($json->suggestedAge) ?>
38 <dt>Number of players</dt>
40 <?= htmlspecialchars(implode(', ', $json->gamerNumbers)) ?>
43 <dt>Download size</dt>
45 <?= number_format($json->apk->fileSize / 1024 / 1024, 2) ?> MiB
49 <p class="description">
50 <?= nl2br(htmlspecialchars($json->description)) ?>
54 <section class="media">
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'): ?>
62 <source src="<?= htmlspecialchars($tile->url) ?>"/>
69 <section class="buttons">
72 <a href="<?= $apkDownloadUrl ?>">Download .apk</a>
74 Version <?= $json->version->number ?>, published
75 <?= gmdate('Y-m-d', $json->version->publishedAt) ?>
79 <form method="post" action="<?= htmlspecialchars($pushUrl) ?>" id="push" onsubmit="pushToMyOuya();return false;">
80 <button name="push" type="submit" class="push-to-my-ouya">
81 <img src="../push-to-my-ouya.png" width="335" height="63"
90 <?php foreach ($navLinks as $url => $title): ?>
91 <a rel="up" href="<?= htmlspecialchars($url) ?>"><?= htmlspecialchars($title) ?></a>
95 <div style="display: none" class="popup" id="push-success">
96 <a class="close" href="#" onclick="this.parentNode.style.display='none';return false;">⊗</a>
97 <strong><?= htmlspecialchars($json->title); ?></strong>
98 will start downloading to your OUYA within the next few minutes
100 <div style="display: none" class="popup" id="push-error">
101 <a class="close" href="#" onclick="this.parentNode.style.display='none';return false;">⊗</a>
102 <strong>Push error</strong>
106 <script type="text/javascript">
107 function pushToMyOuya() {
108 var form = document.getElementById("push");
109 var req = new XMLHttpRequest();
110 req.addEventListener("load", pushToMyOuyaComplete);
111 req.open("POST", form.action);
114 function pushToMyOuyaComplete() {
115 if (this.status / 100 == 2) {
116 document.getElementById('push-success').style.display = "";
118 var err = document.getElementById('push-error');
119 err.getElementsByTagName("p")[0].textContent = this.responseText;
120 err.style.display = "";