@@ -8,9 +8,7 @@ import {minMax} from "../utils/number";
88import { useTheme } from "../theme/theme" ;
99import { injectIntl } from "gatsby-plugin-intl" ;
1010
11- const Nav = styled . nav `
12- background : linear-gradient (to top, rgba (255 , 255 , 255 , 1 ) 20% , rgba (255 , 255 , 255 , 0.9 ));
13- color : black;
11+ const Nav = styled . nav < { sticky ?: boolean } > `
1412 position: sticky;
1513 width: 100%;
1614 top: 0;
@@ -20,6 +18,14 @@ const Nav = styled.nav`
2018 align-content: center;
2119 align-items: center;
2220 overflow: hidden;
21+ background: linear-gradient(to top, rgba(255, 255, 255, 0.8) 20%, rgba(255, 255, 255, 0.5));
22+ color: black;
23+ ${ ( { sticky} ) =>
24+ sticky &&
25+ css `
26+ box-shadow : 0 1px 0 0 rgba (0 , 0 , 0 , 0.01 ), 0 0 10px 0 rgba (0 , 0 , 0 , 0.03 );
27+ backdrop-filter : saturate (400% ) blur (10px );
28+ ` } ;
2329` ;
2430
2531const Stretch = styled . div < { justify ?: string } > `
@@ -109,7 +115,7 @@ export const MobileNavigation: React.FC<WithClassName & WithIntl> = ({className,
109115 style = { {
110116 fontSize : "2em"
111117 } } >
112- < KellerkindLogo />
118+ < Logo />
113119 </ HomeLink >
114120 < Stretch >
115121 < Link to = { `/${ intl . locale } /products` } > { intl . messages . products } </ Link >
@@ -128,15 +134,19 @@ export const MainNavigation: React.FC<WithClassName & WithIntl> = ({className, i
128134 const scrollY = useScrollY ( ) ;
129135 const minSizeDiff = header . height - header . minHeight ;
130136 const offset = header . height - minMax ( 0 , minSizeDiff , scrollY ) ;
137+ const sizeDiff = header . height - offset ;
131138 const scale = offset / header . height ;
139+ const sticky = offset === header . minHeight ;
140+ const rotation = ( sizeDiff / minSizeDiff ) * 180 + 180 ;
132141 return (
133142 < Stage className = { className } >
134143 < Header >
135144 < Nav
136145 role = "navigation"
137146 style = { {
138147 height : offset
139- } } >
148+ } }
149+ sticky = { sticky } >
140150 < Stretch justify = "flex-end" >
141151 < Link to = { `/${ intl . locale } /services` } > { intl . messages . services } </ Link >
142152 < Link to = { `/${ intl . locale } /location` } > { intl . messages . location } </ Link >
@@ -145,9 +155,9 @@ export const MainNavigation: React.FC<WithClassName & WithIntl> = ({className, i
145155 to = "/"
146156 style = { {
147157 fontSize : logo . size ,
148- transform : `scale3d(${ scale } , ${ scale } , 1)`
158+ transform : `scale3d(${ scale } , ${ scale } , 1) rotate3d(0,0,1, ${ rotation } deg) `
149159 } } >
150- < KellerkindLogo />
160+ < Logo />
151161 </ HomeLink >
152162 < Stretch >
153163 < Link to = { `/${ intl . locale } /products` } > { intl . messages . products } </ Link >
0 commit comments