mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-03-21 18:04:39 -05:00
Tier list maker preset colors
This commit is contained in:
parent
b681a562be
commit
4df6149605
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
/>
|
||||
<input
|
||||
type="color"
|
||||
value={tier.color}
|
||||
onChange={(e) => handleChangeTierColor(tier.id, e.target.value)}
|
||||
className="plain"
|
||||
/>
|
||||
<div className={styles.colorPickerContainer}>
|
||||
<div className={styles.presetColorsGrid}>
|
||||
{PRESET_COLORS.map((color) => (
|
||||
<button
|
||||
key={color}
|
||||
type="button"
|
||||
className={clsx(styles.colorButton, {
|
||||
[styles.colorButtonSelected]: tier.color === color,
|
||||
})}
|
||||
style={{ backgroundColor: color }}
|
||||
onClick={() => handleChangeTierColor(tier.id, color)}
|
||||
aria-label={`Select color ${color}`}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<label className={styles.customColorLabel}>
|
||||
<span className="text-xs">{t("tier-list-maker:custom")}</span>
|
||||
<input
|
||||
type="color"
|
||||
value={tier.color}
|
||||
onChange={(e) =>
|
||||
handleChangeTierColor(tier.id, e.target.value)
|
||||
}
|
||||
className="plain"
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div className="stack horizontal justify-end">
|
||||
<SendouButton
|
||||
|
|
|
|||
|
|
@ -13,6 +13,19 @@ export const TIER_NAME_FONT_SIZE_BREAKPOINTS = [
|
|||
|
||||
export const TIER_NAME_FONT_SIZE_MIN = "var(--fonts-xxs)";
|
||||
|
||||
export const PRESET_COLORS = [
|
||||
"#ff4655",
|
||||
"#ff8c42",
|
||||
"#ffd23f",
|
||||
"#bfe84d",
|
||||
"#5dbb63",
|
||||
"#8b0000",
|
||||
"#90ee90",
|
||||
"#4169e1",
|
||||
"#9b59b6",
|
||||
"#20b2aa",
|
||||
];
|
||||
|
||||
export const DEFAULT_TIERS: TierListMakerTier[] = [
|
||||
{ id: "tier-x", name: "X", color: "#ff4655" },
|
||||
{ id: "tier-s", name: "S", color: "#ff8c42" },
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "Allow duplicates",
|
||||
"showTierHeaders": "Show tier headers",
|
||||
"titlePlaceholder": "Click to add title...",
|
||||
"by": "Made by"
|
||||
"by": "Made by",
|
||||
"custom": "Custom"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,5 +15,6 @@
|
|||
"allowDuplicates": "",
|
||||
"showTierHeaders": "",
|
||||
"titlePlaceholder": "",
|
||||
"by": ""
|
||||
"by": "",
|
||||
"custom": ""
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user