high contrast buttons

This commit is contained in:
tresabhi committed 2026-12-03 23:51:31 -06:00
1 parent 3cacf50398
commit 3b915e7ac8
11 files changed
+43 -28

No files matched your search

@@ -60,7 +60,7 @@ styles += "}";
--shadow-aggressive: var(--space-1) var(--space-1) var(--space-4) --shadow-aggressive: var(--space-1) var(--space-1) var(--space-4)
var(--black-a11); var(--black-a11);
--shadow-subtle: 0 var(--space-1) var(--space-3) var(--black-a5); --shadow-subtle: 0 var(--space-1) var(--space-3) var(--black-a5);
--shadow-icon: 0 0 var(--space-1) var(--black-a11); --shadow-icon: 0 0 var(--space-1) var(--black-a8);
--shadow-none: 0 0 0 transparent; --shadow-none: 0 0 0 transparent;
&.light { &.light {
@@ -100,6 +100,11 @@
&[data-high-contrast="true"] { &[data-high-contrast="true"] {
color: var(--accent-1); color: var(--accent-1);
background-color: var(--accent-12); background-color: var(--accent-12);
svg,
img {
filter: drop-shadow(var(--shadow-icon));
}
} }
} }
@@ -78,7 +78,8 @@ function AugmentButton({ node, isSelected, onToggle }: AugmentButtonProps) {
<IconButton <IconButton
radius="1" radius="1"
size="major" size="major"
variant={isSelected ? "surface" : "soft"} variant={isSelected ? "solid" : "soft"}
highContrast={isSelected}
color={isSelected ? (isCommon ? undefined : "amber") : "gray"} color={isSelected ? (isCommon ? undefined : "amber") : "gray"}
className={shared.node} className={shared.node}
data-notable={!isCommon} data-notable={!isCommon}
@@ -108,7 +109,8 @@ function GroupButton({ group, isSelected, onToggle }: GroupButtonProps) {
<IconButton <IconButton
radius="1" radius="1"
size="major" size="major"
variant={isSelected ? "surface" : "soft"} variant={isSelected ? "solid" : "soft"}
highContrast={isSelected}
color={isSelected ? "amber" : "gray"} color={isSelected ? "amber" : "gray"}
className={shared.node} className={shared.node}
data-notable data-notable
@@ -20,6 +20,8 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
font-size: var(--font-size-minor);
.entry { .entry {
display: flex; display: flex;
gap: var(--space-2); gap: var(--space-2);
@@ -10,7 +10,6 @@ import { Button } from "../Button";
import { IconButton } from "../IconButton"; import { IconButton } from "../IconButton";
import { LazyImage } from "../LazyImage"; import { LazyImage } from "../LazyImage";
import { LoadoutSection } from "../LoadoutSection"; import { LoadoutSection } from "../LoadoutSection";
import { Text } from "../Text";
import { Tooltip } from "../Tooltip"; import { Tooltip } from "../Tooltip";
import styles from "./index.module.css"; import styles from "./index.module.css";
@@ -19,6 +18,10 @@ const [consumables, scripts] = await Promise.all([
api.scripts(), api.scripts(),
]); ]);
const sortedConsumables = Object.values(consumables.consumables).sort(
(a, b) => b.category - a.category,
);
interface ContentProps { interface ContentProps {
tank: TankDefinition; tank: TankDefinition;
gun: GunDefinition; gun: GunDefinition;
@@ -33,7 +36,7 @@ function Content({ tank, gun, selected, onToggle }: ContentProps) {
return ( return (
<div className={styles.consumables}> <div className={styles.consumables}>
{Object.values(consumables.consumables).map((consumable) => { {sortedConsumables.map((consumable) => {
if ( if (
consumable.game_mode_exclusive || consumable.game_mode_exclusive ||
!isCompatible(consumable.include, consumable.exclude) !isCompatible(consumable.include, consumable.exclude)
@@ -52,7 +55,8 @@ function Content({ tank, gun, selected, onToggle }: ContentProps) {
<Tooltip tooltip={name}> <Tooltip tooltip={name}>
<Button <Button
radius="1" radius="1"
variant={isSelected ? "surface" : "soft"} variant={isSelected ? "solid" : "soft"}
highContrast={isSelected}
color={isSelected ? undefined : "gray"} color={isSelected ? undefined : "gray"}
className={styles.consumable} className={styles.consumable}
disabled={disabled} disabled={disabled}
@@ -63,25 +67,21 @@ function Content({ tank, gun, selected, onToggle }: ContentProps) {
/> />
<div className={styles.info}> <div className={styles.info}>
{duration > 0 && ( {duration > 0 && (
<Text lowContrast size="minor"> <div className={styles.entry}>
<div className={styles.entry}> <ClockIcon />
<ClockIcon /> {literals(strings.units.s, {
{literals(strings.units.s, { value: duration,
value: duration, })}
})} </div>
</div>
</Text>
)} )}
{cooldown > 0 && ( {cooldown > 0 && (
<Text lowContrast size="minor"> <div className={styles.entry}>
<div className={styles.entry}> <ResetIcon />
<ResetIcon /> {literals(strings.units.s, {
{literals(strings.units.s, { value: cooldown,
value: cooldown, })}
})} </div>
</div>
</Text>
)} )}
</div> </div>
</Button> </Button>
@@ -66,7 +66,8 @@ function Slot({ slot, slotIndex, selected, onToggle }: SlotProps) {
<IconButton <IconButton
size="major" size="major"
color={isSelected ? undefined : "gray"} color={isSelected ? undefined : "gray"}
variant={isSelected ? "surface" : "soft"} variant={isSelected ? "solid" : "soft"}
highContrast={isSelected}
radius="1" radius="1"
parentListChild="horizontal" parentListChild="horizontal"
onClick={() => onToggle(slotIndex, optionIndex)} onClick={() => onToggle(slotIndex, optionIndex)}
@@ -213,7 +213,8 @@ function ModuleNode({
<IconButton <IconButton
radius="1" radius="1"
size="major" size="major"
variant={isSelected ? "surface" : "soft"} variant={isSelected ? "solid" : "soft"}
highContrast={isSelected}
color={isSelected ? (isTop ? "amber" : undefined) : "gray"} color={isSelected ? (isTop ? "amber" : undefined) : "gray"}
className={shared.node} className={shared.node}
data-major={unlock.type === ModuleType.MODULE_TYPE_VEHICLE} data-major={unlock.type === ModuleType.MODULE_TYPE_VEHICLE}
@@ -51,7 +51,8 @@ function Content({
<IconButton <IconButton
size="major" size="major"
radius="1" radius="1"
variant={isSelected ? "surface" : "soft"} variant={isSelected ? "solid" : "soft"}
highContrast={isSelected}
color={isSelected ? undefined : "gray"} color={isSelected ? undefined : "gray"}
disabled={disabled} disabled={disabled}
onClick={() => onToggle(provision.id)} onClick={() => onToggle(provision.id)}
@@ -31,7 +31,8 @@ export function LoadoutShells({ gun, selected, onSelect }: LoadoutShellsProps) {
size="major" size="major"
radius="1" radius="1"
color={isSelected ? undefined : "gray"} color={isSelected ? undefined : "gray"}
variant={isSelected ? "surface" : "soft"} variant={isSelected ? "solid" : "soft"}
highContrast={isSelected}
parentListChild="horizontal" parentListChild="horizontal"
onClick={() => onSelect(candidate.id)} onClick={() => onSelect(candidate.id)}
> >
@@ -41,7 +41,8 @@ function Content({ selected, onChange }: ContentProps) {
? undefined ? undefined
: "amber" : "amber"
} }
variant={level === 0 ? "soft" : "surface"} variant={level === 0 ? "soft" : "solid"}
highContrast={level !== 0}
onClick={(event) => { onClick={(event) => {
if (event.shiftKey) { if (event.shiftKey) {
onChange(skill, level === 0 ? MAX_SKILL_LEVEL : 0); onChange(skill, level === 0 ? MAX_SKILL_LEVEL : 0);
@@ -46,7 +46,8 @@ export function LoadoutStatus({
radius="1" radius="1"
className={styles.state} className={styles.state}
color={status[key] ? "amber" : "gray"} color={status[key] ? "amber" : "gray"}
variant={status[key] ? "surface" : "soft"} variant={status[key] ? "solid" : "soft"}
highContrast={status[key]}
onClick={() => onToggle(key)} onClick={() => onToggle(key)}
> >
<LazyImage src={`/media/status/${key}.png`} /> <LazyImage src={`/media/status/${key}.png`} />