chore(ui): drop grid-texture hover fade
Remove the hover-only brightening of the tactical dossier grid texture so it keeps a constant opacity across EmploymentCard, CampaignCard, and the operations surfaces (OperationSections, StrategicSummary, tokens).
This commit is contained in:
parent
665992a7ea
commit
4b9d231ba5
6 changed files with 72 additions and 53 deletions
|
|
@ -458,7 +458,7 @@ The recipe (each piece is separable; use subsets, do not feel obliged to use all
|
|||
4. **Military status language**: squared pill (`rounded-sm`) or plain colored text, uppercase relabels (e.g. Concept → Planning, In Progress → Active Deployment, Completed → Concluded). The status color renders as **text** (`text-blue-400` / `text-emerald-400` / `text-muted-foreground`); do not duplicate status in two places on one card.
|
||||
5. **Readout footer**: a permanent (not hover-only) single-line bar (`border-t border-white/15 bg-black/60 py-1.5 backdrop-blur-sm`), cells `flex-1` separated by hairline `border-r border-white/15`, each cell a `font-mono text-xs tabular-nums text-white/80` value plus a 9px uppercase `text-white/50` label (e.g. `3 MSNS`, `4h 0m DURATION`). No owner/DIR cell unless the user wants it.
|
||||
6. **Darkened cover imagery**: image at `opacity-15` (hover 25) under a heavy gradient (`from-black/85 via-black/60 to-black/25`) so text stays readable.
|
||||
7. **Faint grid texture**: 1px white grid lines, 28px cells, `opacity-[0.04]` (hover 0.07), `motion-reduce` honored.
|
||||
7. **Faint grid texture**: 1px white grid lines, 28px cells, `opacity-[0.04]`. Constant opacity: it does NOT brighten on hover (only borders/brackets/imagery highlight).
|
||||
8. **One-shot glitch hover** (only with explicit user opt-in; it is extra motion): every layer fires instantly at 0% then decays; steps-based chaos only in the first ~15-20% of the animation; title/soft text restore to readable within ~25-35%; chromatic aberration via paired cyan/rose `text-shadow`; title shards are duplicated absolutely-positioned `aria-hidden` spans clipped by slanted `clip-path` polygons (cyan `#22d3ee`, rose `#f43f5e`, white); image tears use two ghost `<img>` copies clipped to horizontal bands so pieces shift but nothing ever disappears (never animate `opacity: inherit` on an image, it flashes to full brightness). Image band decay may run longer (2s) than text (1s). Everything is one-shot (no `infinite`) and fully disabled under `prefers-reduced-motion`.
|
||||
|
||||
Where it fits: large feature/hero cards, section headers, showcase surfaces. Where it does not: dense data UI, tables, forms, dialogs, buttons, or anything shadcn-styled (the shadcn rule above still governs those). Consistency rule: within one page, secondary surfaces stay conventional so the tactical surface stands out.
|
||||
|
|
|
|||
|
|
@ -1,10 +1,11 @@
|
|||
"use client";
|
||||
|
||||
import { BadgeCheckIcon } from "lucide-react";
|
||||
import { Building2Icon } from "lucide-react";
|
||||
import type { CurrencyConfig } from "@/lib/banking/format";
|
||||
import { CurrencyAmount } from "@/components/frontend/banking/CurrencyAmount";
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { StrategicSummary } from "@/components/frontend/operations";
|
||||
import { HireStaffDialog } from "@/components/frontend/baseManagement/HireStaffDialog";
|
||||
import { cn } from "@/lib/utils";
|
||||
import type { LaborClassificationOption, StructureStaffingOption } from "@/lib/base";
|
||||
|
||||
interface EmploymentCardProps {
|
||||
|
|
@ -24,6 +25,28 @@ interface EmploymentCardProps {
|
|||
readonly currencyConfig: CurrencyConfig;
|
||||
}
|
||||
|
||||
/** Squared tactical chip colors per staffing position type. */
|
||||
const POSITION_TYPE_STYLES: Record<string, string> = {
|
||||
labor: "border-amber-500/40 bg-amber-500/20 text-amber-400",
|
||||
administrative: "border-blue-500/40 bg-blue-500/20 text-blue-400",
|
||||
technical: "border-violet-500/40 bg-violet-500/20 text-violet-400",
|
||||
other: "border-white/25 bg-white/10 text-white/70",
|
||||
};
|
||||
|
||||
function PositionTypeChip({ type }: { type: string }) {
|
||||
const style = POSITION_TYPE_STYLES[type] ?? POSITION_TYPE_STYLES.other;
|
||||
return (
|
||||
<span
|
||||
className={cn(
|
||||
"inline-flex items-center border px-1.5 py-px font-mono text-[9px] uppercase leading-none tracking-widest",
|
||||
style,
|
||||
)}
|
||||
>
|
||||
{type}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
export function EmploymentCard({
|
||||
employment,
|
||||
structures,
|
||||
|
|
@ -36,50 +59,46 @@ export function EmploymentCard({
|
|||
currencyConfig,
|
||||
}: EmploymentCardProps) {
|
||||
return (
|
||||
<Card>
|
||||
<CardHeader className="gap-2">
|
||||
<CardTitle className="flex items-center gap-2">
|
||||
<BadgeCheckIcon className="size-4 text-muted-foreground" />
|
||||
Employment
|
||||
</CardTitle>
|
||||
<CardDescription>Current base assignment and compensation.</CardDescription>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
{employment ? (
|
||||
<div className="flex flex-col gap-2">
|
||||
<p className="font-medium">{employment.positionTitle}</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{employment.positionType} · {employment.structureName}
|
||||
</p>
|
||||
<p className="font-mono text-sm tabular-nums">
|
||||
<CurrencyAmount value={employment.salary} currency={currencyConfig} />/tick
|
||||
</p>
|
||||
<StrategicSummary classificationLeft="Employment" classificationRight="Base Assignment">
|
||||
{employment ? (
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex flex-wrap items-center gap-2">
|
||||
<p className="font-medium text-white/90">{employment.positionTitle}</p>
|
||||
<PositionTypeChip type={employment.positionType} />
|
||||
</div>
|
||||
) : canManage && hiringEnabled ? (
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
<p className="text-sm text-muted-foreground">Not currently employed.</p>
|
||||
<HireStaffDialog
|
||||
structures={structures}
|
||||
npcs={[{ id: npcId, name: npcName ?? `NPC #${npcId}` }]}
|
||||
fixedNpcId={npcId}
|
||||
canManage={canManage}
|
||||
classifications={classifications}
|
||||
hiringEnabled={hiringEnabled}
|
||||
hiringDisabledMessage={hiringDisabledMessage}
|
||||
currencyConfig={currencyConfig}
|
||||
/>
|
||||
<div className="flex items-center gap-2 text-sm text-white/60">
|
||||
<Building2Icon className="size-3.5 shrink-0 text-white/40" />
|
||||
<span className="truncate">{employment.structureName}</span>
|
||||
</div>
|
||||
) : canManage ? (
|
||||
<div className="flex flex-col gap-2">
|
||||
<p className="text-sm text-muted-foreground">Not currently employed.</p>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
{hiringDisabledMessage || "Staff hiring is currently disabled."}
|
||||
</p>
|
||||
<div className="flex items-center gap-1.5 font-mono text-sm tabular-nums text-white/90">
|
||||
<CurrencyAmount value={employment.salary} currency={currencyConfig} />
|
||||
<span>/tick</span>
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-sm text-muted-foreground">Not currently employed.</p>
|
||||
)}
|
||||
</CardContent>
|
||||
</Card>
|
||||
</div>
|
||||
) : canManage && hiringEnabled ? (
|
||||
<div className="flex flex-wrap items-center justify-between gap-3">
|
||||
<p className="text-sm text-white/60">Not currently employed.</p>
|
||||
<HireStaffDialog
|
||||
structures={structures}
|
||||
npcs={[{ id: npcId, name: npcName ?? `NPC #${npcId}` }]}
|
||||
fixedNpcId={npcId}
|
||||
canManage={canManage}
|
||||
classifications={classifications}
|
||||
hiringEnabled={hiringEnabled}
|
||||
hiringDisabledMessage={hiringDisabledMessage}
|
||||
currencyConfig={currencyConfig}
|
||||
/>
|
||||
</div>
|
||||
) : canManage ? (
|
||||
<div className="flex flex-col gap-2">
|
||||
<p className="text-sm text-white/60">Not currently employed.</p>
|
||||
<p className="text-sm text-white/50">
|
||||
{hiringDisabledMessage || "Staff hiring is currently disabled."}
|
||||
</p>
|
||||
</div>
|
||||
) : (
|
||||
<p className="text-sm text-white/60">Not currently employed.</p>
|
||||
)}
|
||||
</StrategicSummary>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ export function CampaignCard({ campaign, size = "lg" }: CampaignCardProps) {
|
|||
{!isSmall && (
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute inset-0 z-[5] opacity-[0.04] transition-opacity duration-500 group-hover:opacity-[0.07] motion-reduce:transition-none"
|
||||
className="pointer-events-none absolute inset-0 z-[5] opacity-[0.04]"
|
||||
style={{
|
||||
backgroundImage:
|
||||
"linear-gradient(to right, white 1px, transparent 1px), linear-gradient(to bottom, white 1px, transparent 1px)",
|
||||
|
|
@ -166,7 +166,7 @@ export function CampaignCard({ campaign, size = "lg" }: CampaignCardProps) {
|
|||
{!isSmall && (
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="absolute inset-x-0 top-0 z-20 flex items-center justify-between border-b border-white/15 bg-black/50 px-3 py-1.5 backdrop-blur-sm"
|
||||
className="absolute inset-x-0 top-0 z-20 flex items-center justify-between border-b border-white/15 bg-black/50 px-5 py-1.5 backdrop-blur-sm"
|
||||
>
|
||||
<span className="font-mono text-[9px] uppercase tracking-widest text-white/60">
|
||||
Official // Unit Command
|
||||
|
|
|
|||
|
|
@ -21,14 +21,14 @@ function CardShell({
|
|||
<section className="group relative overflow-hidden rounded-none border border-border/70 bg-card" data-slot="operation-card">
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute inset-0 z-[5] opacity-[0.04] transition-opacity duration-500 group-hover:opacity-[0.07] motion-reduce:transition-none"
|
||||
className="pointer-events-none absolute inset-0 z-[5] opacity-[0.04]"
|
||||
style={DOSSIER.gridTexture}
|
||||
/>
|
||||
<CornerBrackets />
|
||||
<header className={`${DOSSIER.strip} relative z-10`}>
|
||||
<h2 className={DOSSIER.stripLabel}>{title}</h2>
|
||||
</header>
|
||||
<div className="relative z-10 p-3">{children}</div>
|
||||
<div className="relative z-10 px-5 py-3">{children}</div>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,13 +39,13 @@ export function StrategicSummary({
|
|||
>
|
||||
<div
|
||||
aria-hidden="true"
|
||||
className="pointer-events-none absolute inset-0 z-[5] opacity-[0.04] transition-opacity duration-500 group-hover:opacity-[0.07] motion-reduce:transition-none"
|
||||
className="pointer-events-none absolute inset-0 z-[5] opacity-[0.04]"
|
||||
style={DOSSIER.gridTexture}
|
||||
/>
|
||||
<CornerBrackets />
|
||||
<div className="relative z-10 flex flex-col">
|
||||
<ClassificationStrip left={classificationLeft} right={classificationRight} />
|
||||
<div className="px-4 py-4">{children}</div>
|
||||
<div className="px-5 py-4">{children}</div>
|
||||
{readoutCells ? <LedgerRow cells={readoutCells} /> : null}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ export function statusToneFor(status: string): StatusTone {
|
|||
|
||||
/** Shared dossier surface classes (classification strip, readouts, chips). */
|
||||
export const DOSSIER = {
|
||||
strip: "border-b border-white/15 bg-black/50 px-3 py-1.5 backdrop-blur-sm",
|
||||
strip: "border-b border-white/15 bg-black/50 px-5 py-1.5 backdrop-blur-sm",
|
||||
stripLabel: "font-mono text-[9px] uppercase tracking-widest text-white/60",
|
||||
readout: "border-t border-white/15 bg-black/60 py-1.5 backdrop-blur-sm",
|
||||
readout: "border-t border-white/15 bg-black/60 px-5 py-1.5 backdrop-blur-sm",
|
||||
readoutValue: "font-mono text-xs tabular-nums text-white/80",
|
||||
readoutLabel: "text-[9px] uppercase tracking-wider text-white/50",
|
||||
chip: "border border-white/25 bg-black/40 px-1.5 py-0.5 font-mono text-[9px] uppercase tracking-widest text-white/70",
|
||||
|
|
|
|||
Loading…
Reference in a new issue