Skip to content

Commit 2db6464

Browse files
kuco23claude
andcommitted
claude:design: bring out chain background svgs — drop grayscale, per-chain sizing, lvh anchor
Co-Authored-By: Claude <noreply@anthropic.com>
1 parent d0879b6 commit 2db6464

2 files changed

Lines changed: 36 additions & 8 deletions

File tree

src/assets/css/custom.css

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,9 @@
3333
/* CHAIN BACKGROUND ICON (root layout)
3434
*
3535
* The chain logo (FLR/SGB/AVAX) renders in a child .background-image
36-
* element rather than on .background itself, so we can apply a filter
37-
* that desaturates and darkens just the image without affecting content.
38-
* isolation: isolate keeps the negative z-index contained within the
39-
* .background stacking context — without it, z-index: -1 would push the
36+
* element rather than on .background itself, so .background can own the
37+
* stacking context. isolation: isolate keeps the negative z-index
38+
* contained within .background — without it, z-index: -1 would push the
4039
* image behind <body> and disappear.
4140
*/
4241

@@ -47,16 +46,34 @@
4746

4847
.background-image {
4948
position: fixed;
50-
inset: 0;
49+
top: 0;
50+
left: 0;
51+
right: 0;
52+
/* Pin to the largest viewport height (URL-bar-hidden state) so the
53+
centered SVG doesn't shift as mobile browsers show/hide their
54+
chrome during scroll. lvh > 100% on iOS/Android while the bar is
55+
visible — the element overflows slightly off-screen at the bottom,
56+
which is fine since z-index: -1 + pointer-events: none. */
57+
height: 100lvh;
5158
background-size: auto 400px;
5259
background-position: center;
5360
background-repeat: no-repeat;
54-
filter: grayscale(1) brightness(0.35);
55-
opacity: 0.5;
61+
opacity: 0.30;
5662
z-index: -1;
5763
pointer-events: none;
5864
}
5965

66+
/* Per-chain size overrides — each symbol has different padding inside
67+
its viewBox, so we tune render size per protocol so the three read at
68+
a similar visual weight. */
69+
.background-image.bg-songbird {
70+
background-size: auto 600px;
71+
}
72+
73+
.background-image.bg-avalanche {
74+
background-size: auto 520px;
75+
}
76+
6077
/* NOTIFICATION BLOCK */
6178

6279
.notification-block {

src/layout/root.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ function chainToBackgroundImage(chain: Chain): string {
2929
return ''
3030
}
3131

32+
// Per-chain modifier class so each background can tune its own size /
33+
// position — the Songbird symbol has a transparent ring around the bird
34+
// so needs a bigger render size to match Flare/Avalanche visually.
35+
function chainToBackgroundClass(chain: Chain): string {
36+
if (chain == Chain.FLARE) return 'bg-flare'
37+
if (chain == Chain.SONGBIRD) return 'bg-songbird'
38+
if (chain == Chain.AVALANCHE) return 'bg-avalanche'
39+
return ''
40+
}
41+
3242
const NavigationPreloader = () => {
3343
const navigation = useNavigation()
3444
const [show, setShow] = useState(false)
@@ -53,6 +63,7 @@ const RootLayout = () => {
5363
const chain = chainFromRoute(pathname)
5464
const chainId = chainToChainId(chain)
5565
const image = chainToBackgroundImage(chain)
66+
const bgClass = chainToBackgroundClass(chain)
5667

5768
const { setChain, setWallet, wallet } = useGlobalStore(
5869
useShallow(state => ({ setChain: state.setChain, setWallet: state.setWalletAddress, wallet: state.walletProvider }))
@@ -79,7 +90,7 @@ const RootLayout = () => {
7990
<NavigationPreloader />
8091
<Header />
8192
<div className='background'>
82-
{image && <div className='background-image' style={{ backgroundImage: `url("${image}")` }} />}
93+
{image && <div className={`background-image ${bgClass}`} style={{ backgroundImage: `url("${image}")` }} />}
8394
<CookiesProvider>
8495
<Outlet />
8596
{!hideCallToAction && <CallToAction />}

0 commit comments

Comments
 (0)