aboutsummaryrefslogtreecommitdiff
path: root/lume/src/_components
diff options
context:
space:
mode:
authorXe Iaso <me@xeiaso.net>2025-01-11 15:08:12 -0500
committerXe Iaso <me@xeiaso.net>2025-01-11 15:08:12 -0500
commit6da7705fab090fc6944f694e7b48be61b2e48172 (patch)
tree57cfc6fe216a6d1f787e322e35afc5f5c3347518 /lume/src/_components
parent055e1c4e272e13aa36c65879d2d589d26f52f2d6 (diff)
downloadxesite-6da7705fab090fc6944f694e7b48be61b2e48172.tar.xz
xesite-6da7705fab090fc6944f694e7b48be61b2e48172.zip
migrate over to the new stickers endpoint
Signed-off-by: Xe Iaso <me@xeiaso.net>
Diffstat (limited to 'lume/src/_components')
-rw-r--r--lume/src/_components/XeblogConv.tsx3
-rw-r--r--lume/src/_components/XeblogSticker.tsx31
2 files changed, 16 insertions, 18 deletions
diff --git a/lume/src/_components/XeblogConv.tsx b/lume/src/_components/XeblogConv.tsx
index 66d5e10..3377735 100644
--- a/lume/src/_components/XeblogConv.tsx
+++ b/lume/src/_components/XeblogConv.tsx
@@ -15,7 +15,6 @@ const ConvSnippet = ({
}: XeblogConvProps) => {
const nameLower = name.toLowerCase();
name = name.replace(" ", "_");
- const size = standalone ? 256 : 128;
return (
<>
@@ -25,7 +24,7 @@ const ConvSnippet = ({
style={`max-height:${standalone ? "6" : "4"}rem`}
alt={`${name} is ${mood}`}
loading="lazy"
- src={`https://cdn.xeiaso.net/sticker/${nameLower}/${mood}/${size}`}
+ src={`https://stickers.xeiaso.net/sticker/${nameLower}/${mood}`}
/>
</div>
<div className="convsnippet min-w-0 self-center">
diff --git a/lume/src/_components/XeblogSticker.tsx b/lume/src/_components/XeblogSticker.tsx
index 713cad2..8a4a747 100644
--- a/lume/src/_components/XeblogSticker.tsx
+++ b/lume/src/_components/XeblogSticker.tsx
@@ -1,29 +1,28 @@
export interface XeblogStickerProps {
name: string;
mood: string;
+ maxHeight?: string | null;
}
-export default function XeblogSticker({ name, mood }: XeblogStickerProps) {
+export default function XeblogSticker({
+ name,
+ mood,
+ maxHeight = null,
+}: XeblogStickerProps) {
const nameLower = name.toLowerCase();
name = name.replace(" ", "_");
+ if (maxHeight === null) {
+ maxHeight = "12rem";
+ }
return (
<>
- <picture>
- <source
- type="image/avif"
- srcset={`https://cdn.xeiaso.net/file/christine-static/stickers/${nameLower}/${mood}.avif`}
- />
- <source
- type="image/webp"
- srcset={`https://cdn.xeiaso.net/file/christine-static/stickers/${nameLower}/${mood}.webp`}
- />
- <img
- alt={`${name} is ${mood}`}
- loading="lazy"
- src={`https://cdn.xeiaso.net/file/christine-static/stickers/${nameLower}/${mood}.png`}
- />
- </picture>
+ <img
+ style={`max-height:${maxHeight}`}
+ alt={`${name} is ${mood}`}
+ loading="lazy"
+ src={`https://stickers.xeiaso.net/sticker/${nameLower}/${mood}`}
+ />
</>
);
}