mirror of
https://github.com/morten-olsen/morten-olsen.github.io.git
synced 2026-02-08 01:46:28 +01:00
103 lines
2.0 KiB
Plaintext
103 lines
2.0 KiB
Plaintext
import React from 'react';
|
|
import styled from 'styled-components';
|
|
import { Profile } from '../../data/profile';
|
|
import { HeroBackground } from './background';
|
|
|
|
type Props = {
|
|
profile: Profile;
|
|
}
|
|
|
|
const Wrapper = styled.div`
|
|
position: relative;
|
|
min-height: 900px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 30px;
|
|
`;
|
|
|
|
const Avatar = styled.div<{src: string}>`
|
|
background-image: url('${({ src }) => src}');
|
|
max-width: 400px;
|
|
width: 100%;
|
|
border-radius: 50%;
|
|
background-size: cover;
|
|
border: solid 10px #fff;
|
|
box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
|
|
transform: scaleX(-1);
|
|
`;
|
|
|
|
const AvatarSpacer = styled.div`
|
|
padding-bottom: 100%;
|
|
`;
|
|
|
|
const Name = styled.h1`
|
|
font-size: 4rem;
|
|
line-height: 4rem;
|
|
font-weight: 400;
|
|
color: #fff;
|
|
margin: 0;
|
|
text-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
|
|
text-align: center;
|
|
`;
|
|
|
|
const Tagline = styled.h2`
|
|
font-size: 2rem;
|
|
font-weight: 100;
|
|
color: #fff;
|
|
margin: 0;
|
|
text-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
|
|
text-align: center;
|
|
`;
|
|
|
|
const Social = styled.div`
|
|
margin-top: 40px;
|
|
display: flex;
|
|
flex-wrap: wrap;
|
|
align-items: center;
|
|
justify-content: center;
|
|
`;
|
|
|
|
const SocialItem = styled.a`
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: 20px;
|
|
color: #000;
|
|
`;
|
|
|
|
const SocialText = styled.div`
|
|
margin-left: 20px;
|
|
`;
|
|
|
|
const SocialLogo = styled.div<{ src: string }>`
|
|
background-image: url('${({ src }) => src}');
|
|
width: 50px;
|
|
height: 50px;
|
|
background-size: cover;
|
|
`
|
|
|
|
const Hero: React.FC<Props> = ({ profile }) => (
|
|
<Wrapper>
|
|
<Avatar src={profile.avatar}>
|
|
<AvatarSpacer />
|
|
</Avatar>
|
|
<Name>
|
|
{profile.name}
|
|
</Name>
|
|
<Tagline>{profile.tagline}</Tagline>
|
|
<Social>
|
|
{profile.social.map((social) => (
|
|
<SocialItem href={social.link} target="_blank">
|
|
<SocialLogo src={social.logo} />
|
|
<SocialText>{social.name}</SocialText>
|
|
</SocialItem>
|
|
))}
|
|
</Social>
|
|
<HeroBackground />
|
|
</Wrapper>
|
|
);
|
|
|
|
export { Hero };
|