Browse Source

More webp images, fix login

tags/v4.1.0
Timothy Warren 1 year ago
parent
commit
f1a54d8782
6 changed files with 41 additions and 14 deletions
  1. +1
    -4
      app/views/manga/details.php
  2. +15
    -3
      app/views/me.php
  3. +11
    -2
      public/js/scripts-authed.min.js
  4. +1
    -1
      public/js/scripts-authed.min.js.map
  5. +11
    -2
      public/js/src/template-helpers.js
  6. +2
    -2
      src/API/Kitsu/Auth.php

+ 1
- 4
app/views/manga/details.php View File

@@ -11,7 +11,7 @@
<table>
<tr>
<td>Manga Type</td>
<td><?= $data['manga_type'] ?></td>
<td><?= ucfirst($data['manga_type']) ?></td>
</tr>
<tr>
<td>Volume Count</td>
@@ -56,9 +56,6 @@
<source srcset="<?= $urlGenerator->assetUrl("images/characters/{$id}.jpg") ?>" type="image/jpeg">
<img src="<?= $urlGenerator->assetUrl("images/characters/{$id}.jpg") ?>" alt="" />
</picture>
<?php /*<?= $helper->img($urlGenerator->assetUrl('images/characters', "{$id}.jpg"), [
'width' => '225'
]) ?> */ ?>
</a>
</article>
<?php endif ?>

+ 15
- 3
app/views/me.php View File

@@ -76,7 +76,11 @@
<?php $link = $url->generate('character', ['slug' => $char['slug']]) ?>
<div class="name"><?= $helper->a($link, $char['name']); ?></div>
<a href="<?= $link ?>">
<?= $helper->img($urlGenerator->assetUrl('images/characters', "{$char['id']}.jpg")) ?>
<picture>
<source srcset="<?= $urlGenerator->assetUrl("images/characters/{$char['id']}.webp") ?>" type="image/webp">
<source srcset="<?= $urlGenerator->assetUrl("images/characters/{$char['id']}.jpg") ?>" type="image/jpeg">
<img src="<?= $urlGenerator->assetUrl("images/characters/{$char['id']}.jpg") ?>" alt="" />
</picture>
</a>
</article>
<?php endif ?>
@@ -93,7 +97,11 @@
$titles = Kitsu::filterTitles($anime);
?>
<a href="<?= $link ?>">
<img src="<?= $urlGenerator->assetUrl('images/anime', "{$anime['id']}.jpg") ?>" width="220" alt="" />
<picture width="220">
<source srcset="<?= $urlGenerator->assetUrl("images/anime/{$anime['id']}.webp") ?>" type="image/webp">
<source srcset="<?= $urlGenerator->assetUrl("images/anime/{$anime['id']}.jpg") ?>" type="image/jpeg">
<img src="<?= $urlGenerator->assetUrl("images/anime/{$anime['id']}.jpg") ?>" width="220" alt="" />
</picture>
</a>
<div class="name">
<a href="<?= $link ?>">
@@ -117,7 +125,11 @@
$titles = Kitsu::filterTitles($manga);
?>
<a href="<?= $link ?>">
<img src="<?= $urlGenerator->assetUrl('images/manga', "{$manga['id']}.jpg") ?>" width="220" alt="" />
<picture width="220">
<source srcset="<?= $urlGenerator->assetUrl("images/manga/{$manga['id']}.webp") ?>" type="image/webp">
<source srcset="<?= $urlGenerator->assetUrl("images/manga/{$manga['id']}.jpg") ?>" type="image/jpeg">
<img src="<?= $urlGenerator->assetUrl("images/manga/{$manga['id']}.jpg") ?>" width="220" alt="" />
</picture>
</a>
<div class="name">
<a href="<?= $link ?>">

+ 11
- 2
public/js/scripts-authed.min.js View File

@@ -387,7 +387,12 @@
<input type="radio" class="mal-check" id="mal_${item.slug}" name="mal_id" value="${x.mal_id}" />
<input type="radio" class="big-check" id="${item.slug}" name="id" value="${x.id}" />
<label for="${item.slug}">
<img src="/public/images/anime/${x.id}.jpg" alt="" width="220" />
<picture width="220">
<source srcset="/public/images/anime/${x.id}.webp" type="image/webp" />
<source srcset="/public/images/anime/${x.id}.jpg" type="image/jpeg" />
<img src="/public/images/anime/${x.id}.jpg" alt="" width="220" />
</picture>
<span class="name">
${item.canonicalTitle}<br />
<small>${titles}</small>
@@ -423,7 +428,11 @@
<input type="radio" id="mal_${item.slug}" name="mal_id" value="${x.mal_id}" />
<input type="radio" class="big-check" id="${item.slug}" name="id" value="${x.id}" />
<label for="${item.slug}">
<img src="/public/images/manga/${x.id}.jpg" alt="" width="220" />
<picture width="220">
<source srcset="/public/images/manga/${x.id}.webp" type="image/webp" />
<source srcset="/public/images/manga/${x.id}.jpg" type="image/jpeg" />
<img src="/public/images/manga/${x.id}.jpg" alt="" width="220" />
</picture>
<span class="name">
${item.canonicalTitle}<br />
<small>${titles}</small>

+ 1
- 1
public/js/scripts-authed.min.js.map
File diff suppressed because it is too large
View File


+ 11
- 2
public/js/src/template-helpers.js View File

@@ -22,7 +22,12 @@ export function renderAnimeSearchResults (data) {
<input type="radio" class="mal-check" id="mal_${item.slug}" name="mal_id" value="${x.mal_id}" />
<input type="radio" class="big-check" id="${item.slug}" name="id" value="${x.id}" />
<label for="${item.slug}">
<img src="/public/images/anime/${x.id}.jpg" alt="" width="220" />
<picture width="220">
<source srcset="/public/images/anime/${x.id}.webp" type="image/webp" />
<source srcset="/public/images/anime/${x.id}.jpg" type="image/jpeg" />
<img src="/public/images/anime/${x.id}.jpg" alt="" width="220" />
</picture>
<span class="name">
${item.canonicalTitle}<br />
<small>${titles}</small>
@@ -58,7 +63,11 @@ export function renderMangaSearchResults (data) {
<input type="radio" id="mal_${item.slug}" name="mal_id" value="${x.mal_id}" />
<input type="radio" class="big-check" id="${item.slug}" name="id" value="${x.id}" />
<label for="${item.slug}">
<img src="/public/images/manga/${x.id}.jpg" alt="" width="220" />
<picture width="220">
<source srcset="/public/images/manga/${x.id}.webp" type="image/webp" />
<source srcset="/public/images/manga/${x.id}.jpg" type="image/jpeg" />
<img src="/public/images/manga/${x.id}.jpg" alt="" width="220" />
</picture>
<span class="name">
${item.canonicalTitle}<br />
<small>${titles}</small>

+ 2
- 2
src/API/Kitsu/Auth.php View File

@@ -175,7 +175,7 @@ final class Auth {
$isExpired = time() >= $this->segment->get('auth_token_expires', 0);

// Attempt to re-authenticate with refresh token
if ($isExpired && $refreshToken)
/* if ($isExpired && $refreshToken)
{
if ($this->reAuthenticate($refreshToken))
{
@@ -183,7 +183,7 @@ final class Auth {
}

return FALSE;
}
} */

return $token;
}

Loading…
Cancel
Save