Created
March 6, 2018 10:38
-
-
Save anonymous/338575c695c0077049c30b407764b612 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import styled, { keyframes } from 'styled-components' | |
import logo from './logo.svg' | |
const AppWrapper = styled.div` | |
text-align: center; | |
` | |
const rotate360 = keyframes` | |
from { | |
transform: rotate(0deg); | |
} | |
to { | |
transform: rotate(360deg); | |
} | |
` | |
const AppLogo = styled.img` | |
animation: ${rotate360} infinite 120s linear; | |
height: 80px; | |
&:hover { | |
animation: ${rotate360} infinite 1.5s linear; | |
} | |
` | |
const AppHeader = styled.div` | |
background-color: #222; | |
height: 12rem; | |
padding: 1rem; | |
color: white; | |
` | |
const AppTitle = styled.h1` | |
font-weight: 900; | |
` | |
const AppIntro = styled.p` | |
font-size: large; | |
code { | |
font-size: 1.3rem; | |
} | |
` | |
const EmojiWrapper = styled.span.attrs({ | |
role: 'img' | |
})`` | |
class App extends Component { | |
render() { | |
return ( | |
<AppWrapper> | |
<AppHeader> | |
<AppLogo src={logo} alt="logo" /> | |
<AppTitle>Welcome to React</AppTitle> | |
</AppHeader> | |
<AppIntro> | |
Bootstrapped with <code>create-react-app</code>. | |
</AppIntro> | |
<AppIntro> | |
Components styled with <code>styled-components</code>{' '} | |
<EmojiWrapper aria-label="nail polish" /> | |
</AppIntro> | |
</AppWrapper> | |
) | |
} | |
} | |
export default App |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment