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