summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-12-11 01:11:23 +0500
committerilotterytea <iltsu@alright.party>2025-12-11 01:11:23 +0500
commitc79bb71e7694d4674c28a7e1192dd644e41fbfdb (patch)
tree857e40e34ecb6a79f32945c2b571ab44e4c64ab1
parente8b0b4769d013862a54c273931ac4456c486e9ab (diff)
fix: use lazy loading for emotes
-rw-r--r--lib/emote.php4
-rw-r--r--system/emotes/index.php4
-rw-r--r--users.php6
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/emote.php b/lib/emote.php
index 14f6088..4ad71c4 100644
--- a/lib/emote.php
+++ b/lib/emote.php
@@ -268,7 +268,7 @@ function html_display_emotes(array $emotes, int $scale = 3)
// icon
echo '<div class="flex justify-center items-center grow emote-icon">';
$scale = $emote_wall ? "3" : ((string) $scale);
- echo "<img src='/static/userdata/emotes/{$e->id}/{$scale}x.webp' alt='{$e->code}' />";
+ echo "<img src='/static/userdata/emotes/{$e->id}/{$scale}x.webp' alt='{$e->code}' loading='lazy' />";
echo '</div>';
// info
@@ -299,7 +299,7 @@ function html_display_emoteset(array $emotesets)
echo '<div class="small-gap row">';
foreach ($es->emotes as $e) {
- echo "<img src='/static/userdata/emotes/{$e->id}/1x.webp' alt='{$e->code}' title='{$e->code}' height='16' />";
+ echo "<img src='/static/userdata/emotes/{$e->id}/1x.webp' alt='{$e->code}' title='{$e->code}' height='16' loading='lazy' />";
}
echo '</div></a>';
diff --git a/system/emotes/index.php b/system/emotes/index.php
index d2ac1f8..866eb0e 100644
--- a/system/emotes/index.php
+++ b/system/emotes/index.php
@@ -82,7 +82,7 @@ if (isset($_GET["id"])) {
<?php
foreach ($emote_results as $row) {
echo '<a href="/system/emotes?id=' . $row["id"] . '">';
- echo '<img src="/static/userdata/emotes/' . $row["id"] . '/1x.webp">';
+ echo '<img src="/static/userdata/emotes/' . $row["id"] . '/1x.webp" loading="lazy">';
echo '<b>' . $row["code"] . '</b>';
echo '<span style="font-size:10px;"> by ';
@@ -126,7 +126,7 @@ if (isset($_GET["id"])) {
for ($size = 1; $size < 4; $size++) {
echo '<div class="column items-center small-gap">';
- echo '<img src="/static/userdata/emotes/';
+ echo '<img loading="lazy" src="/static/userdata/emotes/';
echo $emote["id"];
echo "/{$size}x.webp\"";
echo 'title="' . $emote["code"] . '" />';
diff --git a/users.php b/users.php
index 359056a..2375aa1 100644
--- a/users.php
+++ b/users.php
@@ -488,7 +488,7 @@ if ($is_json) {
if ($e_stmt->rowCount() == 1) {
echo '/emotes?id=' . $payload["emote"]["id"] . '">';
- echo '<img src="/static/userdata/emotes/' . $payload["emote"]["id"] . '/1x.webp" height="16" /> ';
+ echo '<img src="/static/userdata/emotes/' . $payload["emote"]["id"] . '/1x.webp" height="16" loading="lazy" /> ';
} else {
echo '">';
}
@@ -499,7 +499,7 @@ if ($is_json) {
if ($e_stmt->rowCount() == 1) {
echo '/emotes?id=' . $payload["emote"]["id"] . '">';
- echo '<img src="/static/userdata/emotes/' . $payload["emote"]["id"] . '/1x.webp" height="16" /> ';
+ echo '<img src="/static/userdata/emotes/' . $payload["emote"]["id"] . '/1x.webp" height="16" loading="lazy" /> ';
} else {
echo '">';
}
@@ -528,7 +528,7 @@ if ($is_json) {
if ($e_stmt->rowCount() == 1) {
echo '/emotes?id=' . $payload["emote"]["id"] . '">';
- echo '<img src="/static/userdata/emotes/' . $payload["emote"]["id"] . '/1x.webp" height="16" /> ';
+ echo '<img src="/static/userdata/emotes/' . $payload["emote"]["id"] . '/1x.webp" height="16" loading="lazy" /> ';
} else {
echo '">';
}