2018-11-01 22:01:09 -04:00
|
|
|
<?php
|
2020-08-21 19:25:27 -04:00
|
|
|
use function Aviat\AnimeClient\getLocalImg;
|
2018-11-01 22:01:09 -04:00
|
|
|
use Aviat\AnimeClient\API\Kitsu;
|
|
|
|
?>
|
|
|
|
<main class="details fixed">
|
|
|
|
<section class="flex flex-no-wrap">
|
|
|
|
<div>
|
|
|
|
<?= $helper->picture("images/people/{$data['id']}-original.webp", 'jpg', ['class' => 'cover' ]) ?>
|
|
|
|
</div>
|
|
|
|
<div>
|
2018-11-08 11:36:42 -05:00
|
|
|
<h2 class="toph"><?= $data['name'] ?></h2>
|
2018-11-01 22:01:09 -04:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
2018-11-08 11:36:42 -05:00
|
|
|
<?php if ( ! empty($data['staff'])): ?>
|
2018-11-01 22:01:09 -04:00
|
|
|
<section>
|
|
|
|
<h3>Castings</h3>
|
2020-08-21 19:25:27 -04:00
|
|
|
|
2018-11-01 22:01:09 -04:00
|
|
|
<div class="vertical-tabs">
|
|
|
|
<?php $i = 0 ?>
|
2018-11-08 11:36:42 -05:00
|
|
|
<?php foreach ($data['staff'] as $role => $entries): ?>
|
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>
|
|
|
|
<?php foreach ($entries as $type => $casting): ?>
|
|
|
|
<?php if ($type === 'characters') continue; ?>
|
2020-08-21 19:25:27 -04:00
|
|
|
<?php if (isset($entries['manga'], $entries['anime'])): ?>
|
2018-11-01 22:01:09 -04:00
|
|
|
<h4><?= ucfirst($type) ?></h4>
|
|
|
|
<?php endif ?>
|
2020-08-21 19:25:27 -04:00
|
|
|
<section class="content media-wrap flex flex-wrap flex-justify-start">
|
2018-11-01 22:01:09 -04:00
|
|
|
<?php foreach ($casting as $sid => $series): ?>
|
2020-08-21 19:25:27 -04:00
|
|
|
<?php $mediaType = in_array($type, ['anime', 'manga'], TRUE) ? $type : 'anime'; ?>
|
|
|
|
<?= $component->media(
|
|
|
|
Kitsu::filterTitles($series),
|
|
|
|
$url->generate("{$mediaType}.details", ['id' => $series['slug']]),
|
|
|
|
$helper->picture("images/{$type}/{$sid}.webp")
|
|
|
|
) ?>
|
2018-11-01 22:01:09 -04:00
|
|
|
<?php endforeach; ?>
|
|
|
|
</section>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</div>
|
|
|
|
<?php $i++ ?>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
<?php endif ?>
|
|
|
|
|
2018-11-08 11:36:42 -05:00
|
|
|
<?php if ( ! (empty($data['characters']['main']) || empty($data['characters']['supporting']))): ?>
|
2018-11-01 22:01:09 -04:00
|
|
|
<section>
|
2020-08-21 19:25:27 -04:00
|
|
|
<h3>Voice Acting Roles</h3>
|
|
|
|
<?= $component->tabs('voice-acting-roles', $data['characters'], static function ($characterList) use ($component, $helper, $url) {
|
|
|
|
$voiceRoles = [];
|
|
|
|
foreach ($characterList as $cid => $item):
|
|
|
|
$character = $component->character(
|
|
|
|
$item['character']['canonicalName'],
|
|
|
|
$url->generate('character', ['slug' => $item['character']['slug']]),
|
|
|
|
$helper->picture(getLocalImg($item['character']['image']['original']))
|
|
|
|
);
|
|
|
|
$medias = [];
|
|
|
|
foreach ($item['media'] as $sid => $series)
|
|
|
|
{
|
|
|
|
$medias[] = $component->media(
|
|
|
|
Kitsu::filterTitles($series),
|
|
|
|
$url->generate('anime.details', ['id' => $series['slug']]),
|
|
|
|
$helper->picture("images/anime/{$sid}.webp")
|
|
|
|
);
|
|
|
|
}
|
|
|
|
$media = implode('', array_map('mb_trim', $medias));
|
|
|
|
|
|
|
|
$voiceRoles[] = <<<HTML
|
|
|
|
<tr>
|
|
|
|
<td>{$character}</td>
|
|
|
|
<td>
|
|
|
|
<section class="align-left media-wrap">{$media}</section>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
HTML;
|
|
|
|
endforeach;
|
|
|
|
|
|
|
|
$roles = implode('', array_map('mb_trim', $voiceRoles));
|
|
|
|
|
|
|
|
return <<<HTML
|
|
|
|
<table class="borderless max-table">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Character</th>
|
|
|
|
<th>Series</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>{$roles}</tbody>
|
|
|
|
</table>
|
|
|
|
HTML;
|
|
|
|
|
|
|
|
}) ?>
|
2018-11-01 22:01:09 -04:00
|
|
|
</section>
|
|
|
|
<?php endif ?>
|
|
|
|
</main>
|