Skip to content

Commit 975c394

Browse files
committed
feat: adjust logos and header effect
1 parent 99f62aa commit 975c394

4 files changed

Lines changed: 36 additions & 12 deletions

File tree

src/components/footer.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import ReactMarkdown from "react-markdown";
88
import {toPhone} from "../utils/number";
99
import {DE} from "./flags/de";
1010
import {US} from "./flags/us";
11-
import {KellerkindLogo} from "./logo";
11+
import {KellerkindLogo, PngLogo} from "./logo";
1212
import Kellerkind from "./kellerkind";
1313

1414
const Nav = styled.nav`
@@ -184,14 +184,16 @@ const Footer: React.FC<WithIntl> = ({intl}) => {
184184
<h3>
185185
{intl.messages.address} & {intl.messages.more}
186186
</h3>
187+
<Kellerkind />
188+
<ReactMarkdown
189+
source={location.address.childMarkdownRemark.rawMarkdownBody}
190+
/>
187191
<div>
188192
<a href={`tel:${toPhone(location.telephone)}`}>
189193
{location.telephone}
190194
</a>
191195
</div>
192-
<ReactMarkdown
193-
source={location.address.childMarkdownRemark.rawMarkdownBody}
194-
/>
196+
<Spacing size="xs" />
195197
<div>
196198
<Social
197199
href="https://www.facebook.com/Fatih-Sahanoglucom-234829333300330"
@@ -215,7 +217,7 @@ const Footer: React.FC<WithIntl> = ({intl}) => {
215217
<h3>
216218
<Language intl={intl} />
217219
</h3>
218-
<KellerkindLogo style={{fontSize: "10em"}} />
220+
<PngLogo style={{fontSize: "7em"}} />
219221
</Column>
220222
</Row>
221223
</Grid>

src/components/logo.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,18 @@ export const Logo = props => (
1414
<path fill="currentColor" d={tree} />
1515
</Svg>
1616
);
17+
export const PngLogoWrapper = styled.div`
18+
width: 1em;
19+
img {
20+
width: 100%;
21+
}
22+
`;
23+
export const PngLogo = props => (
24+
<PngLogoWrapper {...props}>
25+
<img src="/images/logo_light.png" alt="logo" />
26+
</PngLogoWrapper>
27+
);
28+
1729
export const LogoWrapper = styled.div`
1830
position: relative;
1931
display: inline-flex;

src/components/navigation.tsx

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import {minMax} from "../utils/number";
88
import {useTheme} from "../theme/theme";
99
import {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

2531
const 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>

static/images/logo_light.png

43.6 KB
Loading

0 commit comments

Comments
 (0)