-
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
Showing
7 changed files
with
201 additions
and
59 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,39 @@ | ||
.App { | ||
body { | ||
text-align: center; | ||
} | ||
|
||
.App-logo { | ||
height: 40vmin; | ||
pointer-events: none; | ||
} | ||
|
||
@media (prefers-reduced-motion: no-preference) { | ||
.App-logo { | ||
animation: App-logo-spin infinite 20s linear; | ||
} | ||
} | ||
|
||
.App-header { | ||
background-color: #282c34; | ||
background-color: #54033f; | ||
min-height: 100vh; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
font-size: calc(10px + 2vmin); | ||
color: white; | ||
font-family: papyrus; | ||
color: darkgrey; | ||
} | ||
|
||
.App-link { | ||
color: #61dafb; | ||
h1 { | ||
margin-top: 0px; | ||
} | ||
|
||
@keyframes App-logo-spin { | ||
from { | ||
transform: rotate(0deg); | ||
} | ||
to { | ||
transform: rotate(360deg); | ||
} | ||
button { | ||
width: 11rem; | ||
height: 6rem; | ||
font-size: 30px; | ||
font-family: papyrus; | ||
font-weight: bold; | ||
background-color: grey; | ||
border-radius: 10px; | ||
} | ||
|
||
|
||
|
||
.randomFact { | ||
text-align: center; | ||
margin:25px; | ||
padding: 10px 10px; | ||
border-style: dotted; | ||
border-color: black; | ||
border-radius: 10px; | ||
font-size: 2rem; | ||
} | ||
|
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,25 +1,28 @@ | ||
import logo from './logo.svg'; | ||
import React, { useState } from 'react'; | ||
import './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> | ||
const App = () => { | ||
const [facts, setFacts] = useState([]); | ||
|
||
const getFact = () => { | ||
fetch('http://numbersapi.com/random/year?json') | ||
.then((res) => res.json()) | ||
.then((data) => setFacts(data)); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<h1>Click the following button for a random fact about a random year! | ||
<br /> | ||
Who knows? You might learn something interesting... | ||
</h1> | ||
<button onClick={getFact}>Click Me!!!</button> | ||
<div className='randomFact' key='text'> | ||
Your random fact is that: {facts.text} | ||
</div> | ||
<footer>API requested from numbersapi.com ^_^</footer> | ||
</div> | ||
); | ||
} | ||
}; | ||
|
||
export default App; |
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
This file was deleted.
Oops, something went wrong.