|
| 1 | +import React from 'react' |
| 2 | +import { media } from '../../../assets/styles/mixin' |
| 3 | +import { Paragraph } from '../../../assets/styles/typo' |
| 4 | +import styled, { useTheme, keyframes } from 'styled-components' |
| 5 | +import { useTranslation } from 'react-i18next' |
| 6 | + |
| 7 | +const MainTheme = styled.div` |
| 8 | + height: calc(100vh - 100px); |
| 9 | +` |
| 10 | + |
| 11 | +const Window = styled.div` |
| 12 | + position: absolute; |
| 13 | + left: 20%; |
| 14 | + right: 20%; |
| 15 | + top: 50%; |
| 16 | + transform: translateY(-50%); |
| 17 | + border: 2px solid ${(props) => props.theme.colors.white}; |
| 18 | + padding: 2rem 4rem; |
| 19 | + ${media.mobile(` |
| 20 | + left: 10%; |
| 21 | + right: 10%; |
| 22 | + `)} |
| 23 | +
|
| 24 | + &:after { |
| 25 | + content: ' '; |
| 26 | + position: absolute; |
| 27 | + left: 0; |
| 28 | + right: 0; |
| 29 | + top: 0; |
| 30 | + border-bottom: 2px solid ${(props) => props.theme.colors.white}; |
| 31 | + height: 3rem; |
| 32 | + } |
| 33 | +` |
| 34 | + |
| 35 | +const WindowButton = styled.div` |
| 36 | + position: absolute; |
| 37 | + right: 0; |
| 38 | + top: 0; |
| 39 | + width: 3rem; |
| 40 | + height: 3rem; |
| 41 | + border-left: 2px solid ${(props) => props.theme.colors.white}; |
| 42 | + &:before, |
| 43 | + &:after { |
| 44 | + position: absolute; |
| 45 | + left: 50%; |
| 46 | + top: 0; |
| 47 | + content: ' '; |
| 48 | + height: 40px; |
| 49 | + width: 2px; |
| 50 | + background-color: ${(props) => props.theme.colors.white}; |
| 51 | + } |
| 52 | + &:before { |
| 53 | + transform: rotate(45deg); |
| 54 | + } |
| 55 | + &:after { |
| 56 | + transform: rotate(-45deg); |
| 57 | + } |
| 58 | +` |
| 59 | + |
| 60 | +const typing = keyframes` |
| 61 | + 0% { |
| 62 | + width: 0; |
| 63 | + } |
| 64 | + 100% { |
| 65 | + width: 100%; |
| 66 | + } |
| 67 | +` |
| 68 | + |
| 69 | +const TitleContainer = styled.div` |
| 70 | + margin-top: 4rem; |
| 71 | + overflow: hidden; |
| 72 | +` |
| 73 | + |
| 74 | +const Title = styled.div` |
| 75 | + font-size: 5rem; |
| 76 | + line-height: 1.1; |
| 77 | + display: inline-block; |
| 78 | + color: ${(props) => props.color || props.theme.colors.white}; |
| 79 | + white-space: nowrap; |
| 80 | + animation: ${typing} 5s linear; |
| 81 | + animation-fill-mode: both; |
| 82 | + &:nth-child(2) { |
| 83 | + animation-delay: 2s; |
| 84 | + } |
| 85 | + &:nth-child(3) { |
| 86 | + animation-delay: 4s; |
| 87 | + } |
| 88 | +` |
| 89 | + |
| 90 | +const MainText = styled.div` |
| 91 | + font-size: 1.7rem; |
| 92 | + font-weight: normal; |
| 93 | + margin-top: 2rem; |
| 94 | + margin-left: 12rem; |
| 95 | + ${media.mobile(` |
| 96 | + margin-top: 3rem; |
| 97 | + margin-left: 6rem; |
| 98 | + `)} |
| 99 | +` |
| 100 | + |
| 101 | +const MainIdentity = () => { |
| 102 | + const { t } = useTranslation() |
| 103 | + const theme = useTheme() |
| 104 | + |
| 105 | + return ( |
| 106 | + <MainTheme> |
| 107 | + <Window> |
| 108 | + <WindowButton /> |
| 109 | + <TitleContainer> |
| 110 | + <div> |
| 111 | + <Title color={theme.colors.violet0}> |
| 112 | + {t(`label:pycon`)} |
| 113 | + </Title> |
| 114 | + </div> |
| 115 | + <div> |
| 116 | + <Title color={theme.colors.violet1}> |
| 117 | + {t(`label:korea`)} |
| 118 | + </Title> |
| 119 | + </div> |
| 120 | + <div> |
| 121 | + <Title color={theme.colors.yellow0}> |
| 122 | + {t(`label:thisYear`)} |
| 123 | + </Title> |
| 124 | + </div> |
| 125 | + </TitleContainer> |
| 126 | + <MainText>{t(`label:pyconkrDate`)}</MainText> |
| 127 | + </Window> |
| 128 | + </MainTheme> |
| 129 | + ) |
| 130 | +} |
| 131 | + |
| 132 | +export default MainIdentity |
0 commit comments