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
40,048 changes: 40,048 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"react-scripts": "4.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"start": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts start",
"build": "export SET NODE_OPTIONS=--openssl-legacy-provider && react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
Expand All @@ -28,4 +28,4 @@
"last 1 safari version"
]
}
}
}
40 changes: 8 additions & 32 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,14 @@
.App {
text-align: center;
*{
margin:5px;
}

.App-logo {
height: 40vmin;
pointer-events: none;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
section{
margin-bottom: 70px;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
.tarjetas{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
}
justify-content: space-around ;

.App-link {
color: #61dafb;

}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}

96 changes: 83 additions & 13 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,96 @@
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';
import CreditCard from './CreditCard';





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

<IdCard firstName='Obrien' lastName='Delores' gender='female' height={172} birth={new Date("1988-05-11")}
picture="https://randomuser.me/api/portraits/women/44.jpg"
/>
</header>


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


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

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

</section>

<section>
<div className="tarjetas">
<CreditCard
type="Visa"
number="0123456789018845"
expirationMonth={3}
expirationYear={2021}
bank="BNP"
owner="Maxence Bouret"
bgColor="#11aa99"
color="white" />
<CreditCard
type="Master Card"
number="0123456789010995"
expirationMonth={3}
expirationYear={2021}
bank="N26"
owner="Maxence Bouret"
bgColor="#eeeeee"
color="#222222" />
<CreditCard
type="Visa"
number="0123456789016984"
expirationMonth={12}
expirationYear={2019}
bank="Name of the Bank"
owner="Firstname Lastname"
bgColor="#ddbb55"
color="white" />
</div>

</section>

{/* <section>
<Rating>0</Rating>
<Rating>1.49</Rating>
<Rating>1.5</Rating>
<Rating>3</Rating>
<Rating>4</Rating>
<Rating>5</Rating>

</section> */}

</div>
);



}

export default App;
6 changes: 6 additions & 0 deletions src/BoxColor.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.colorBox{
width: 320px;
margin: 6px auto;
padding: 20px;
border: 1px solid black;
}
15 changes: 15 additions & 0 deletions src/BoxColor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react';
import './BoxColor.css';

const BoxColor = ({r,g,b}) => {

return <div className="colorBox" style={{ backgroundColor:`rgb(${r},${g},${b})` }} />

}


// rgb(567,658,688)

// ${}

export default BoxColor;
4 changes: 4 additions & 0 deletions src/CreditCard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.cardcredit{
width: 350px;
border-radius: 5px;
}
25 changes: 25 additions & 0 deletions src/CreditCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React from 'react';
import './CreditCard.css';

function CreditCard (props){
let styles= {
background:props.bgColor,
color:props.color
}
return (<div className="cardcredit" style={styles}>
<p className="type">{props.type}</p>
<p>{props.number}</p>
<div className="row">
<div className="expiration">
<p>
Expires {props.expirationMonth}/{props.expirationYear}
</p>
<p>{props.bank}</p>
</div>
</div>
<p className="owner">{props.owner}</p>
</div>)
}


export default CreditCard;
Empty file added src/Greetings.css
Empty file.
30 changes: 30 additions & 0 deletions src/Greetings.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react'
import './Greetings.css'

const lenguage= (lang) =>{
if(lang === "de"){
return "Halo"
}else if(lang === "en"){
return "Hello"
}else if(lang === "es"){
return "Hola"
}else if(lang === "fr"){
return "Bonjour"
}
}




const Greetings = (props) => {
return (
<article className="greeting">

<div>
<p>{lenguage(props.lang)} {props.children} </p>
</div>
</article>
)
}

export default Greetings
20 changes: 20 additions & 0 deletions src/IdCard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.card{
width: 97%;
height: 150px;
margin: 6px auto;
padding: 20px;
border: 1px solid black;
text-align: right;
}

.photo{
display: flex;
justify-content: left;
}

.text{
display: flex;
justify-content: right;

}

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


const IdCard = (props) => {
return (
<article className="card">
<div className="photo">
<img src={props.picture} alt={props.name} />
</div>
<div className="text">
<p>firstName: {props.firstName} </p>
<p>lastName: {props.lastName}</p>
<p>gender: {props.gender}</p>
<p>height: {props.height/100}m</p>
<p>birth: {props.birth.toDateString()}</p>
</div>
</article>
)
}

export default IdCard
Empty file added src/Random.css
Empty file.
16 changes: 16 additions & 0 deletions src/Random.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import React from 'react'
import './Random.css'

function Random(props) {
return (
<p>
Random value between {props.min} and {props.max} is = {Math.floor(Math.random() * (props.max - props.min + 1)) + props.min};
</p>
);
}





export default Random
Empty file added src/Rating.js
Empty file.
Loading