Do you wish to register an account?
API client for Kitsu.io, with optional Anime collection, and optional Anilist syncing.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

75 lines
2.1KB

  1. <?php
  2. use function Aviat\AnimeClient\getLocalImg;
  3. use Aviat\AnimeClient\API\Kitsu;
  4. ?>
  5. <main class="details fixed">
  6. <section class="flex flex-no-wrap">
  7. <div>
  8. <picture class="cover">
  9. <source
  10. srcset="<?= $urlGenerator->assetUrl("images/people/{$data['id']}-original.webp") ?>"
  11. type="image/webp"
  12. >
  13. <source
  14. srcset="<?= $urlGenerator->assetUrl("images/people/{$data['id']}-original.jpg") ?>"
  15. type="image/jpeg"
  16. >
  17. <img src="<?= $urlGenerator->assetUrl("images/people/{$data['id']}-original.jpg") ?>" alt="" />
  18. </picture>
  19. </div>
  20. <div>
  21. <h2><?= $data['attributes']['name'] ?></h2>
  22. </div>
  23. </section>
  24. <section>
  25. <?php if ($castCount > 0): ?>
  26. <h3>Castings</h3>
  27. <?php foreach ($castings as $role => $entries): ?>
  28. <h4><?= $role ?></h4>
  29. <?php foreach ($entries as $type => $casting): ?>
  30. <?php if ( ! empty($entries['manga'])): ?>
  31. <h5><?= ucfirst($type) ?></h5>
  32. <?php endif ?>
  33. <section class="align_left media-wrap">
  34. <?php foreach ($casting as $sid => $series): ?>
  35. <article class="media">
  36. <?php
  37. $link = $url->generate('anime.details', ['id' => $series['attributes']['slug']]);
  38. $titles = Kitsu::filterTitles($series['attributes']);
  39. ?>
  40. <a href="<?= $link ?>">
  41. <picture>
  42. <source
  43. srcset="<?= $urlGenerator->assetUrl("images/{$type}/{$sid}.webp") ?>"
  44. type="image/webp"
  45. />
  46. <source
  47. srcset="<?= $urlGenerator->assetUrl("images/{$type}/{$sid}.jpg") ?>"
  48. type="image/jpeg"
  49. />
  50. <img
  51. src="<?= $urlGenerator->assetUrl("images/{$type}/{$sid}.jpg") ?>"
  52. width="220" alt=""
  53. />
  54. </picture>
  55. </a>
  56. <div class="name">
  57. <a href="<?= $link ?>">
  58. <?= array_shift($titles) ?>
  59. <?php foreach ($titles as $title): ?>
  60. <br />
  61. <small><?= $title ?></small>
  62. <?php endforeach ?>
  63. </a>
  64. </div>
  65. </article>
  66. <?php endforeach; ?>
  67. </section>
  68. <br />
  69. <?php endforeach ?>
  70. <?php endforeach ?>
  71. <?php endif ?>
  72. </section>
  73. </main>