Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ImageOff } from "lucide-react";
import { Chip } from "~/components/chip/chip.component";
import { FloatBar } from "~/components/float-bar/float-bar.component";
import { ItemThumbHalftone } from "~/components/item-thumb/item-thumb.component";
import { ItemThumbBackdrop } from "~/components/item-thumb/item-thumb.component";
import { attachedCharmsValue } from "~/lib/items/charm-value";
import { floatRangeSpan, isOnScale, wearBandFor } from "~/lib/items/float-bar";
import { formatDateTime, formatFloatExact, formatMoney } from "~/utils/format";
Expand Down Expand Up @@ -48,7 +48,7 @@ export function ItemInspectCard({ item, currency, now }: ItemInspectCardProps) {
return (
<div className={classes.root}>
<div className={classes.hero}>
<ItemThumbHalftone rarityColor={item.rarityColor} />
<ItemThumbBackdrop rarityColor={item.rarityColor} />
{item.rarityColor !== null && (
<span
aria-hidden
Expand Down
105 changes: 0 additions & 105 deletions src/components/item-thumb/item-thumb-halftone.svg

This file was deleted.

24 changes: 24 additions & 0 deletions src/components/item-thumb/item-thumb-topo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/components/item-thumb/item-thumb.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import { ITEM_THUMB } from "./item-thumb.config";
import type { ItemThumbProps } from "./item-thumb.types";

/** Shared one-layer mask. Only the paint colour changes between items. */
export function ItemThumbHalftone({ rarityColor }: Pick<ItemThumbProps, "rarityColor">) {
export function ItemThumbBackdrop({ rarityColor }: Pick<ItemThumbProps, "rarityColor">) {
return (
<span
aria-hidden
className={ITEM_THUMB.classes.halftone}
className={ITEM_THUMB.classes.backdrop}
style={{ color: rarityColor ?? undefined }}
/>
);
Expand All @@ -27,7 +27,7 @@ export function ItemThumb({
const loaded = imageUrl !== null && (loadedUrl === imageUrl || isImageLoaded(imageUrl));
return (
<div className={cn(ITEM_THUMB.classes.root, className)} style={{ width: size, height: size }}>
<ItemThumbHalftone rarityColor={rarityColor} />
<ItemThumbBackdrop rarityColor={rarityColor} />
{/* Rarity is item data: a 2px key along the bottom edge, never a wash. */}
{showRarityBar && rarityColor && (
<span
Expand Down
2 changes: 1 addition & 1 deletion src/components/item-thumb/item-thumb.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export const ITEM_THUMB = {
classes: {
root: `relative flex shrink-0 items-center justify-center overflow-hidden rounded-sm border ${ITEM_THUMB_BACKDROP}`,
rarity: "absolute inset-x-0 bottom-0 h-0.5",
halftone: "item-thumb-halftone",
backdrop: "item-thumb-backdrop",
image: "size-full object-contain p-0.5 transition-opacity duration-300",
},
} as const;
8 changes: 4 additions & 4 deletions src/components/item-thumb/item-thumb.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.item-thumb-halftone {
.item-thumb-backdrop {
--thumb-screen-min-size: 72px;
--thumb-dot-opacity: 0.5;
--thumb-neutral: light-dark(#6b6b6b, #818181);
Expand All @@ -11,16 +11,16 @@
background-color: color-mix(in srgb, currentColor var(--thumb-base-tint), var(--card));
}

.item-thumb-halftone::after {
.item-thumb-backdrop::after {
position: absolute;
inset: 0;
content: "";
opacity: var(--thumb-dot-opacity);
background-color: color-mix(in srgb, currentColor var(--thumb-dot-tint), black);
mask: url("./item-thumb-halftone.svg") center / max(var(--thumb-screen-min-size), 100%)
mask: url("./item-thumb-topo.svg") center / max(var(--thumb-screen-min-size), 100%)
max(var(--thumb-screen-min-size), 100%) no-repeat;
}

.item-thumb-halftone ~ img {
.item-thumb-backdrop ~ img {
filter: var(--thumb-art-tone, none);
}
Loading