Skip to content

Instantly share code, notes, and snippets.

Created March 6, 2018 10:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/338575c695c0077049c30b407764b612 to your computer and use it in GitHub Desktop.
Save anonymous/338575c695c0077049c30b407764b612 to your computer and use it in GitHub Desktop.
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