HummingBirdAnimeClient/app/views/anime/details.php

177 lines
5.1 KiB
PHP
Raw Normal View History

2018-11-01 22:01:09 -04:00
<?php use function Aviat\AnimeClient\getLocalImg; ?>
2017-03-31 13:37:53 -04:00
<main class="details fixed">
<section class="flex">
<aside class="info">
<?= $helper->picture("images/anime/{$data['id']}-original.webp") ?>
2018-11-01 22:01:09 -04:00
<br />
2018-11-01 22:01:09 -04:00
<table class="media-details">
<tr>
<td class="align-right">Airing Status</td>
<td><?= $data['status'] ?></td>
</tr>
<tr>
<td>Show Type</td>
<td><?= $data['show_type'] ?></td>
</tr>
<tr>
<td>Episode Count</td>
<td><?= $data['episode_count'] ?? '-' ?></td>
</tr>
<?php if ( ! empty($data['episode_length'])): ?>
2018-11-01 22:01:09 -04:00
<tr>
<td>Episode Length</td>
<td><?= $data['episode_length'] ?> minutes</td>
2018-11-01 22:01:09 -04:00
</tr>
<?php endif ?>
<?php if ( ! empty($data['age_rating'])): ?>
2018-11-01 22:01:09 -04:00
<tr>
<td>Age Rating</td>
<td><abbr title="<?= $data['age_rating_guide'] ?>"><?= $data['age_rating'] ?></abbr>
2018-11-01 22:01:09 -04:00
</td>
</tr>
2017-01-12 15:41:20 -05:00
<?php endif ?>
<tr>
<td>Genres</td>
<td>
<?= implode(', ', $data['genres']) ?>
</td>
</tr>
</table>
<br />
</aside>
<article class="text">
<h2 class="toph"><a rel="external" href="<?= $data['url'] ?>"><?= $data['title'] ?></a></h2>
<?php foreach ($data['titles'] as $title): ?>
2018-11-01 22:01:09 -04:00
<h3><?= $title ?></h3>
<?php endforeach ?>
<br />
<p class="description"><?= nl2br($data['synopsis']) ?></p>
<?php if (count($data['streaming_links']) > 0): ?>
2018-11-01 22:01:09 -04:00
<hr />
<h4>Streaming on:</h4>
2018-11-05 11:22:35 -05:00
<table class="full-width invisible streaming-links">
2018-11-01 22:01:09 -04:00
<thead>
2017-01-13 16:49:46 -05:00
<tr>
<th class="align-left">Service</th>
2017-01-13 16:49:46 -05:00
<th>Subtitles</th>
<th>Dubs</th>
</tr>
2018-11-01 22:01:09 -04:00
</thead>
<tbody>
<?php foreach ($data['streaming_links'] as $link): ?>
2018-11-01 22:01:09 -04:00
<tr>
<td class="align-left">
2018-11-01 22:01:09 -04:00
<?php if ($link['meta']['link'] !== FALSE): ?>
<a
href="<?= $link['link'] ?>"
title="Stream '<?= $data['title'] ?>' on <?= $link['meta']['name'] ?>"
2018-11-01 22:01:09 -04:00
>
2018-11-05 09:56:38 -05:00
<?= $helper->picture("images/{$link['meta']['image']}", 'svg', [
'class' => 'streaming-logo',
'width' => 50,
'height' => 50,
'alt' => "{$link['meta']['name']} logo",
]); ?>
2018-11-01 22:01:09 -04:00
&nbsp;&nbsp;<?= $link['meta']['name'] ?>
</a>
<?php else: ?>
2018-11-05 09:56:38 -05:00
<?= $helper->picture("images/{$link['meta']['image']}", 'svg', [
'class' => 'streaming-logo',
'width' => 50,
'height' => 50,
'alt' => "{$link['meta']['name']} logo",
]); ?>
2018-11-01 22:01:09 -04:00
&nbsp;&nbsp;<?= $link['meta']['name'] ?>
<?php endif ?>
</td>
<td><?= implode(', ', $link['subs']) ?></td>
<td><?= implode(', ', $link['dubs']) ?></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
2017-01-13 16:49:46 -05:00
<?php endif ?>
<?php if ( ! empty($data['trailer_id'])): ?>
2018-11-05 09:56:38 -05:00
<div class="responsive-iframe">
<h4>Trailer</h4>
2018-11-01 22:01:09 -04:00
<iframe
2018-11-05 09:56:38 -05:00
width="560"
height="315"
src="https://www.youtube.com/embed/<?= $data['trailer_id'] ?>"
2018-11-05 09:56:38 -05:00
frameborder="0"
allow="autoplay; encrypted-media"
allowfullscreen
2018-11-01 22:01:09 -04:00
></iframe>
2018-11-05 09:56:38 -05:00
</div>
<?php endif ?>
</article>
</section>
<?php if (count($data['characters']) > 0): ?>
2018-11-01 22:01:09 -04:00
<section>
<h2>Characters</h2>
<div class="tabs">
<?php $i = 0 ?>
<?php foreach ($data['characters'] as $role => $list): ?>
2018-11-01 22:01:09 -04:00
<input
type="radio" name="character-types"
id="character-types-<?= $i ?>" <?= ($i === 0) ? 'checked' : '' ?> />
<label for="character-types-<?= $i ?>"><?= ucfirst($role) ?></label>
<section class="content media-wrap flex flex-wrap flex-justify-start">
<?php foreach ($list as $id => $char): ?>
<?php if ( ! empty($char['image']['original'])): ?>
<article class="<?= $role === 'supporting' ? 'small-' : '' ?>character">
2018-11-01 22:01:09 -04:00
<?php $link = $url->generate('character', ['slug' => $char['slug']]) ?>
<div class="name">
<?= $helper->a($link, $char['name']); ?>
</div>
<a href="<?= $link ?>">
<?= $helper->picture("images/characters/{$id}.webp") ?>
</a>
</article>
<?php endif ?>
<?php endforeach ?>
</section>
<?php $i++; ?>
<?php endforeach ?>
</div>
2017-03-20 13:14:01 -04:00
</section>
<?php endif ?>
<?php if (count($data['staff']) > 0): ?>
2018-11-01 22:01:09 -04:00
<section>
<h2>Staff</h2>
2018-11-01 22:01:09 -04:00
<div class="vertical-tabs">
<?php $i = 0; ?>
<?php foreach ($data['staff'] as $role => $people): ?>
2018-11-01 22:01:09 -04:00
<div class="tab">
<input type="radio" name="staff-roles" id="staff-role<?= $i ?>" <?= $i === 0 ? 'checked' : '' ?> />
<label for="staff-role<?= $i ?>"><?= $role ?></label>
<section class='content media-wrap flex flex-wrap flex-justify-start'>
<?php foreach ($people as $pid => $person): ?>
<article class='character small-person'>
2018-11-01 22:01:09 -04:00
<?php $link = $url->generate('person', ['id' => $person['id']]) ?>
<div class="name">
<a href="<?= $link ?>">
<?= $person['name'] ?>
</a>
</div>
<a href="<?= $link ?>">
<?= $helper->picture(getLocalImg($person['image']['original'] ?? NULL)) ?>
</a>
</article>
<?php endforeach ?>
</section>
</div>
2018-11-01 22:01:09 -04:00
<?php $i++; ?>
<?php endforeach ?>
</div>
</section>
<?php endif ?>
2016-02-01 09:49:18 -05:00
</main>