From 4df614960580bf618cf75611b833463ef0dad7b2 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 29 Nov 2025 15:37:50 +0200 Subject: [PATCH] Tier list maker preset colors --- .../components/TierRow.module.css | 40 +++++++++++++++++++ .../tier-list-maker/components/TierRow.tsx | 34 +++++++++++++--- .../tier-list-maker-constants.ts | 13 ++++++ locales/da/tier-list-maker.json | 3 +- locales/de/tier-list-maker.json | 3 +- locales/en/tier-list-maker.json | 3 +- locales/es-ES/tier-list-maker.json | 3 +- locales/es-US/tier-list-maker.json | 3 +- locales/fr-CA/tier-list-maker.json | 3 +- locales/fr-EU/tier-list-maker.json | 3 +- locales/he/tier-list-maker.json | 3 +- locales/it/tier-list-maker.json | 3 +- locales/ja/tier-list-maker.json | 3 +- locales/ko/tier-list-maker.json | 3 +- locales/nl/tier-list-maker.json | 3 +- locales/pl/tier-list-maker.json | 3 +- locales/pt-BR/tier-list-maker.json | 3 +- locales/ru/tier-list-maker.json | 3 +- locales/zh/tier-list-maker.json | 3 +- 19 files changed, 113 insertions(+), 22 deletions(-) diff --git a/app/features/tier-list-maker/components/TierRow.module.css b/app/features/tier-list-maker/components/TierRow.module.css index c166d3907..3ad05ef20 100644 --- a/app/features/tier-list-maker/components/TierRow.module.css +++ b/app/features/tier-list-maker/components/TierRow.module.css @@ -120,3 +120,43 @@ stroke-width: 3; color: var(--text); } + +.colorPickerContainer { + display: flex; + flex-direction: column; + gap: var(--s-3); + align-items: center; +} + +.presetColorsGrid { + display: grid; + grid-template-columns: repeat(5, 1fr); + gap: var(--s-2); +} + +.colorButton { + width: 32px; + height: 32px; + border-radius: 50%; + border: 2px solid transparent; + cursor: pointer; + transition: all 0.2s; + padding: 0; +} + +.colorButton:hover { + transform: scale(1.1); + border-color: var(--text-lighter); +} + +.colorButtonSelected { + border-color: var(--text); + box-shadow: 0 0 0 2px var(--bg); +} + +.customColorLabel { + display: flex; + align-items: center; + gap: var(--s-2); + cursor: pointer; +} diff --git a/app/features/tier-list-maker/components/TierRow.tsx b/app/features/tier-list-maker/components/TierRow.tsx index e58fb4b96..80fc3f811 100644 --- a/app/features/tier-list-maker/components/TierRow.tsx +++ b/app/features/tier-list-maker/components/TierRow.tsx @@ -14,6 +14,7 @@ import { ChevronUpIcon } from "~/components/icons/ChevronUp"; import { TrashIcon } from "~/components/icons/Trash"; import { useTierListState } from "../contexts/TierListContext"; import { + PRESET_COLORS, TIER_NAME_FONT_SIZE_BREAKPOINTS, TIER_NAME_FONT_SIZE_MIN, TIER_NAME_MAX_LENGTH, @@ -107,12 +108,33 @@ export function TierRow({ tier }: TierRowProps) { className={styles.nameInput} maxLength={TIER_NAME_MAX_LENGTH} /> - handleChangeTierColor(tier.id, e.target.value)} - className="plain" - /> +
+
+ {PRESET_COLORS.map((color) => ( +
+ +