From 84b4c1d67f7ef1a74e052d20e3852fb4b9b904e1 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Mon, 17 Nov 2025 18:40:22 +0200 Subject: [PATCH] Download tier list as img (#2638) Co-authored-by: hfcRed --- app/components/Image.tsx | 26 ++++++ .../components/DraggableItem.tsx | 5 +- .../components/TierListItemImage.tsx | 40 +++++++-- .../components/TierRow.module.css | 6 +- .../tier-list-maker/components/TierRow.tsx | 20 +++-- .../contexts/TierListContext.tsx | 12 ++- .../tier-list-maker/hooks/useTierListState.ts | 12 +-- .../routes/tier-list-maker.module.css | 56 +++++++++++++ .../routes/tier-list-maker.tsx | 84 ++++++++++++++++--- locales/da/tier-list-maker.json | 4 +- locales/de/tier-list-maker.json | 4 +- locales/en/tier-list-maker.json | 4 +- locales/es-ES/tier-list-maker.json | 4 +- locales/es-US/tier-list-maker.json | 4 +- locales/fr-CA/tier-list-maker.json | 4 +- locales/fr-EU/tier-list-maker.json | 4 +- locales/he/tier-list-maker.json | 4 +- locales/it/tier-list-maker.json | 4 +- locales/ja/tier-list-maker.json | 4 +- locales/ko/tier-list-maker.json | 4 +- locales/nl/tier-list-maker.json | 4 +- locales/pl/tier-list-maker.json | 4 +- locales/pt-BR/tier-list-maker.json | 4 +- locales/ru/tier-list-maker.json | 4 +- locales/zh/tier-list-maker.json | 4 +- package-lock.json | 7 ++ package.json | 1 + 27 files changed, 274 insertions(+), 59 deletions(-) diff --git a/app/components/Image.tsx b/app/components/Image.tsx index 4398ed1e7..aea53e143 100644 --- a/app/components/Image.tsx +++ b/app/components/Image.tsx @@ -34,6 +34,7 @@ interface ImageProps { testId?: string; onClick?: () => void; loading?: "lazy"; + forcePng?: boolean; } export function Image({ @@ -50,7 +51,32 @@ export function Image({ containerStyle, onClick, loading, + forcePng, }: ImageProps) { + if (forcePng) { + return ( + // biome-ignore lint/a11y/noStaticElementInteractions: Biome v2 migration +
+ {alt} +
+ ); + } + return ( // biome-ignore lint/a11y/noStaticElementInteractions: Biome v2 migration
- +
); diff --git a/app/features/tier-list-maker/components/TierListItemImage.tsx b/app/features/tier-list-maker/components/TierListItemImage.tsx index a02785d8e..f19034b89 100644 --- a/app/features/tier-list-maker/components/TierListItemImage.tsx +++ b/app/features/tier-list-maker/components/TierListItemImage.tsx @@ -11,38 +11,58 @@ import styles from "./TierListItemImage.module.css"; interface TierListItemImageProps { item: TierListItem; + forcePng?: boolean; } -export function TierListItemImage({ item }: TierListItemImageProps) { +export function TierListItemImage({ item, forcePng }: TierListItemImageProps) { switch (item.type) { case "main-weapon": return (
- +
); case "sub-weapon": return (
- +
); case "special-weapon": return (
- +
); case "stage": return (
- +
); case "mode": return (
- +
); case "stage-mode": { @@ -51,12 +71,18 @@ export function TierListItemImage({ item }: TierListItemImageProps) { return (
- +
diff --git a/app/features/tier-list-maker/components/TierRow.module.css b/app/features/tier-list-maker/components/TierRow.module.css index 55086f1f5..c33dfdb2a 100644 --- a/app/features/tier-list-maker/components/TierRow.module.css +++ b/app/features/tier-list-maker/components/TierRow.module.css @@ -46,7 +46,7 @@ flex-wrap: wrap; gap: var(--s-1-5); padding: var(--s-2); - background: var(--bg-lighter); + background: var(--bg-lighter-solid); border: 2px dashed transparent; border-radius: var(--rounded-sm) 0 0 var(--rounded-sm); align-content: flex-start; @@ -58,10 +58,6 @@ background: var(--bg-lightest); } -.targetZoneFullRadius { - border-radius: var(--rounded-sm); -} - .emptyMessage { width: 100%; height: 100%; diff --git a/app/features/tier-list-maker/components/TierRow.tsx b/app/features/tier-list-maker/components/TierRow.tsx index 87f476749..3b0d144a6 100644 --- a/app/features/tier-list-maker/components/TierRow.tsx +++ b/app/features/tier-list-maker/components/TierRow.tsx @@ -31,7 +31,7 @@ export function TierRow({ tier }: TierRowProps) { handleMoveTierUp, handleMoveTierDown, showTierHeaders, - showArrowControls, + screenshotMode, } = useTierListState(); const items = getItemsInTier(tier.id); @@ -95,28 +95,34 @@ export function TierRow({ tier }: TierRowProps) {
- {items.length === 0 ? ( + {items.length === 0 && !screenshotMode ? (
{t("tier-list-maker:dropItems")}
- ) : ( + ) : items.length > 0 ? ( {items.map((item) => ( - + ))} - )} + ) : null}
- {showArrowControls ? ( + {!screenshotMode ? (