First commit
This commit is contained in:
10
frontend/app/utils/cardBack.ts
Normal file
10
frontend/app/utils/cardBack.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
/** Plain backs offered in the menu; the first is the default when nothing is stored. */
|
||||
export const CARD_BACK_COLORS = ['#26304a', '#1f3a2e', '#4a1f24', '#33244f', '#4a3520', '#14161c']
|
||||
|
||||
/** CSS variables for a stored back: `data:` values are images, anything else a plain colour. */
|
||||
export function cardBackVars(back: string | null | undefined): Record<string, string> | undefined {
|
||||
if (!back) return undefined
|
||||
return back.startsWith('data:')
|
||||
? { '--card-back-image': `url("${back}")` }
|
||||
: { '--card-back-color': back }
|
||||
}
|
||||
Reference in New Issue
Block a user