File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import { type FC , useEffect , useState } from 'react' ;
22import styles from './index.module.scss' ;
3- import './global.scss' ;
43
54const useTopArrived = ( ) => {
65 const [ scrollY , setScrollY ] = useState ( 0 ) ;
@@ -45,10 +44,18 @@ export const BackgroundImage: FC<BackgroundProps> = ({
4544 } , [ topArrived , navBarTopArrived ] ) ;
4645
4746 return (
48- < img
49- className = { styles . background }
50- src = "https://assets.rspack.rs/rspack/assets/landingpage-background-compressed.png"
51- alt = "background"
52- />
47+ < >
48+ { /* For transparent navbar, overrides css only in homepage, and unmounted in other pages */ }
49+ < style >
50+ {
51+ ':root {--rp-c-bg: #0b0c0e;}:root:not(.dark) {--rp-c-bg: #fff;}.rspress-nav {transition: background 0.4s;}body:not(.notTopArrived) .rspress-nav {background: transparent !important;}'
52+ }
53+ </ style >
54+ < img
55+ className = { styles . background }
56+ src = "https://assets.rspack.rs/rspack/assets/landingpage-background-compressed.png"
57+ alt = "background"
58+ />
59+ </ >
5360 ) ;
5461} ;
You can’t perform that action at this time.
0 commit comments