aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/HeaderBar/index.tsx
blob: c3d46fcc63b22000b827b5b6a4c2f96ddd4fea76 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
/** @jsx jsx */
import { css, jsx } from "@emotion/core";
import SVG from "react-inlinesvg";

import header1 from "./header_1.svg";
import header2 from "./header_2.svg";

interface HeaderBarProps {
  title?: string
}

const headerImageStyles = css`
z-index: -1;
top: 0;
position: absolute;
width: 100%;
transition: height 1s;

@media (max-width: 770px) {
  height: 140px;
}
`;

function HeaderBar({ title }: HeaderBarProps) {
  if (!title) {
    title = "Python Discord Forms";
  };
  
  return <div>
    <div>
      <SVG src={header1} css={headerImageStyles}/>
      <SVG src={header2} css={headerImageStyles}/>
    </div>
    <h1 css={css`
      font-size: 4vw;
      margin: 0;
      margin-top: 30px;
      margin-left: 30px;
      margin-bottom: 200px;
      transition-property: font-size, margin-bottom;
      transition-duration: 1s;
      font-family: "Uni Sans", "Hind", "Arial", sans-serif;

      @media (max-width: 1000px) {
        margin-top: 15px;
        font-size: 8vw;
      }

      @media (max-width: 770px) {
        margin-top: 15px;
        font-size: 6vw;
        margin-bottom: 100px;
      }
      @media (max-width: 450px) {
        text-align: center;
        margin-left: 0;
      }
    `}>
      {title}
    </h1>
  </div>
}

export default HeaderBar;