-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6309a7f
commit 4f385e3
Showing
12 changed files
with
172 additions
and
233 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,112 @@ | ||
.App { | ||
text-align: center; | ||
#root, html , body { | ||
margin: 0; | ||
padding: 0; | ||
height: 100vh; | ||
box-sizing: border-box; | ||
font-family: 'Spartan', sans-serif; | ||
} | ||
|
||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
.app { | ||
height: 100%; | ||
background: linear-gradient(rgba(0, 0 , 0, 0.3 ),rgba(0, 0 , 0, 0.3 )), url('./images/bg.jpg'); | ||
background-size: cover; | ||
background-position: center; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
text-align: center; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
.card { | ||
background-color: whitesmoke; | ||
width: 40%; | ||
height: 20%; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
flex-direction: column; | ||
border-radius: 25px; | ||
padding: 2%; | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
min-height: 100vh; | ||
.heading{ | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
height: 580px; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
@media only screen and (max-width: 600px) { | ||
.card { | ||
width: 80%; | ||
height: 30%; | ||
} | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
.button { | ||
position: relative; | ||
outline: none; | ||
text-decoration: none; | ||
border-radius: 50px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
cursor: pointer; | ||
text-transform: uppercase; | ||
height: 200px; | ||
width: 210px; | ||
opacity: 1; | ||
background-color: #ffffff; | ||
border: 1px solid rgba(22, 76, 167, 0.6); | ||
} | ||
|
||
.button span { | ||
color: #164ca7; | ||
font-size: 12px; | ||
font-weight: 500; | ||
letter-spacing: 0.7px; | ||
} | ||
|
||
.button:hover { | ||
animation: rotate 0.7s ease-in-out both; | ||
} | ||
|
||
.button:hover span { | ||
animation: storm 0.7s ease-in-out both; | ||
animation-delay: 0.06s; | ||
} | ||
|
||
@keyframes rotate { | ||
0% { | ||
transform: rotate(0deg) translate3d(0, 0, 0); | ||
} | ||
25% { | ||
transform: rotate(3deg) translate3d(0, 0, 0); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
50% { | ||
transform: rotate(-3deg) translate3d(0, 0, 0); | ||
} | ||
75% { | ||
transform: rotate(1deg) translate3d(0, 0, 0); | ||
} | ||
100% { | ||
transform: rotate(0deg) translate3d(0, 0, 0); | ||
} | ||
} | ||
|
||
@keyframes storm { | ||
0% { | ||
transform: translate3d(0, 0, 0) translateZ(0); | ||
} | ||
25% { | ||
transform: translate3d(4px, 0, 0) translateZ(0); | ||
} | ||
50% { | ||
transform: translate3d(-3px, 0, 0) translateZ(0); | ||
} | ||
75% { | ||
transform: translate3d(2px, 0, 0) translateZ(0); | ||
} | ||
100% { | ||
transform: translate3d(0, 0, 0) translateZ(0); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,43 @@ | ||
import React from 'react'; | ||
import logo from './logo.svg'; | ||
import './App.css'; | ||
import React, { Component } from 'react' | ||
import Axios from 'axios' | ||
import '../src/App.css' | ||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<img src={logo} className="App-logo" alt="logo" /> | ||
<p> | ||
Edit <code>src/App.js</code> and save to reload. | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
</header> | ||
</div> | ||
); | ||
class App extends Component { | ||
|
||
state = { | ||
advice: '' | ||
}; | ||
componentDidMount() { | ||
this.FetchAdvice() | ||
} | ||
|
||
FetchAdvice = () => { | ||
Axios.get('https://api.adviceslip.com/advice') | ||
.then((response) => { | ||
|
||
const { advice } = response.data.slip; | ||
this.setState({advice}); | ||
|
||
}) | ||
.catch((error) => { | ||
console.log(error); | ||
|
||
}) | ||
} | ||
|
||
render() { | ||
const {advice} = this.state | ||
return ( | ||
<div className="app"> | ||
<div className="card"> | ||
<h1 className="heading">{advice}</h1> | ||
<button className="button" onClick={this.FetchAdvice}> | ||
<span>GIVE ME ADVICE</span> | ||
</button> | ||
</div> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default App; | ||
export default App |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,7 @@ | ||
import React from 'react'; | ||
import ReactDOM from 'react-dom'; | ||
import './index.css'; | ||
import App from './App'; | ||
import * as serviceWorker from './serviceWorker'; | ||
|
||
ReactDOM.render( | ||
<React.StrictMode> | ||
<App /> | ||
</React.StrictMode>, | ||
document.getElementById('root') | ||
); | ||
ReactDOM.render(<App />,document.getElementById('root')); | ||
|
||
|
||
// If you want your app to work offline and load faster, you can change | ||
// unregister() to register() below. Note this comes with some pitfalls. | ||
// Learn more about service workers: https://bit.ly/CRA-PWA | ||
serviceWorker.unregister(); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.