Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PABAMBO committed May 14, 2024
1 parent 18d5a15 commit 20e5944
Show file tree
Hide file tree
Showing 7 changed files with 201 additions and 59 deletions.
147 changes: 147 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
{
"name": "api-app",
"homepage": "https://PABAMBO.github.io/api-app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^5.17.0",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"gh-pages": "^6.1.1",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-scripts": "5.0.1",
Expand All @@ -15,7 +17,9 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"predeploy": "npm run build",
"deploy": "gh-pages -d build"
},
"eslintConfig": {
"extends": [
Expand Down
53 changes: 27 additions & 26 deletions src/App.css
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;
}

41 changes: 22 additions & 19 deletions src/App.js
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;
8 changes: 0 additions & 8 deletions src/App.test.js

This file was deleted.

4 changes: 0 additions & 4 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,3 @@ body {
-moz-osx-font-smoothing: grayscale;
}

code {
font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',
monospace;
}
1 change: 0 additions & 1 deletion src/logo.svg

This file was deleted.

0 comments on commit 20e5944

Please sign in to comment.