Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15,830 changes: 15,830 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^17.0.0",
"react-dom": "^17.0.0",
"react": "^16.3.2",
"react-dom": "^16.3.2",
"react-scripts": "4.0.0"
},
"scripts": {
Expand Down
42 changes: 4 additions & 38 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,4 @@
.App {
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;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
*{
margin: 0px;
padding: 0px;
}
41 changes: 23 additions & 18 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import IdCard from './IdCard';
import Greetings from './Greetings';
import Random from './Random';
import BoxColor from './BoxColor';

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>
<IdCard
lastName='Doe' firstName='John' gender='male' height={178} birth={new Date("1992-07-14")} picture="https://randomuser.me/api/portraits/men/44.jpg" />
<IdCard
lastName='Delores' firstName='Obrien' gender='female' height={172} birth={new Date("1988-05-11")} picture="https://randomuser.me/api/portraits/women/44.jpg" />

<Greetings lang="de">Ludwig</Greetings>
<Greetings lang="fr">François</Greetings>

<Random min={1} max={6} />
<Random min={1} max={100} />

{/* <BoxColor r={255} g={0} b={0} />
<BoxColor r={128} g={255} b={0} /> */}


</div>
);
}

)
}
export default App;
11 changes: 11 additions & 0 deletions src/BoxColor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// import React from 'react'



// const Boxcolor = {
// backgroundColor: '{props.r}, {props.g}, {props.b}',
// }



// export default BoxColor
6 changes: 6 additions & 0 deletions src/Greetings.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.Greetings {
display: flex;
flex-direction: row;
border: 1px black solid;

}
28 changes: 28 additions & 0 deletions src/Greetings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import "./Greetings.css"


const Greetings = (props) => {
let greetings
switch (props.lang) {
case "de":
greetings = "Hallo"
break
case "en":
greetings = "Hi"
break
case "es":
greetings = "Hola"
break
case "fr":
greetings = "Bonjour"
break
}
return (
<div class="Greetings">
<p>{greetings}</p>
<p>{props.children}</p>
</div>
)
}
export default Greetings;
10 changes: 10 additions & 0 deletions src/IdCard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.IdCard {
display: flex;
flex-direction: row;
border: 1px black solid;
margin-top: 10px;
margin-left: 10px;
padding-top: 10px;
padding-left: 10px;

}
24 changes: 24 additions & 0 deletions src/IdCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import React from 'react'
import './IdCard.css'


const IdCard = (props) => {

return (
<article className="IdCard">
<div>
<img src={props.picture} alt={props.name} />
</div>
<div>
<p><strong>First name:</strong> {props.firstName}</p>
<p><strong>Last name:</strong> {props.lastName}</p>
<p><strong>Gender:</strong> {props.gender}</p>
<p><strong>Height:</strong> {props.height}</p>
<p><strong>Birth:</strong> {props.birth.toDateString('')}</p>
</div>

</article>
)
}

export default IdCard
6 changes: 6 additions & 0 deletions src/Random.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.Random {
display: flex;
flex-direction: row;
border: 1px black solid;

}
15 changes: 15 additions & 0 deletions src/Random.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import "./Random.css"


const Random = (props) => {

return (
<div className="Random">
{Math.floor(Math.random() * (props.max - props.min)) + props.min}

</div>)
}


export default Random;