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

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
color: #61dafb;
}

@keyframes App-logo-spin {
/* @keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
} */
123 changes: 107 additions & 16 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,116 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import IdCard from './Components/IdCard/IdCard';
import './Components/IdCard/IdCard.css'
import Greetings from './Components/Greetings/Greetings'
import './Components/Greetings/Greetings.css'
import Random from './Components/Random/Random'
import './Components/Random/Random.css'
import BoxColor from './Components/BoxColor/BoxColor'
import './Components/BoxColor/BoxColor.css'
import CreditCard from './Components/CreditCard/CreditCard'
import './Components/CreditCard/CreditCard.css'
import Rating from './Components/Rating/Rating'
import './Components/Rating/Rating.css'
import DriverCard from './Components/DriverCard/DriverCard'
import './Components/DriverCard/DriverCard.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 className="IdCard">
<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"
/>
</div>

<div className="box-greetings">
<Greetings lang="es">Ludwig</Greetings>
<Greetings lang="fr">François</Greetings>
</div>

<Random />

<BoxColor r={300} g={33} b={22} />
<BoxColor r={132} g={255} b={0} />

<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="Santander Rio"
owner="Manue Pascual"
bgColor="#ddbb55"
color="white" />

<Rating>0</Rating>
<Rating>1.49</Rating>
<Rating>1.5</Rating>
<Rating>3.9</Rating>
<Rating>2.5</Rating>
<Rating>4.7</Rating>

<DriverCard
name="Travis Kalanick"
rating={4.2}
img="https://si.wsj.net/public/resources/images/BN-TY647_37gql_OR_20170621052140.jpg?width=620&height=428"
car={{
model: "Toyota Corolla Altis",
licensePlate: "CO42DE"
}} />
<DriverCard
name="Dara Khosrowshahi"
rating={4.9}
img="https://ubernewsroomapi.10upcdn.com/wp-content/uploads/2017/09/Dara_ELT_Newsroom_1000px.jpg"
car={{
model: "Audi A3",
licensePlate: "BE33ER"
}} />





</>



);
}

Expand Down
Empty file.
20 changes: 20 additions & 0 deletions src/Components/BoxColor/BoxColor.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react'
import "./BoxColor.css"


const BoxColor = (props) => {

function rgbToHex(r, g, b) {
return "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
}

return(
<div style={{backgroundColor: `rgb(${props.r},${props.g},${props.b})`}} className="background-color-box">
<p>rgb({props.r}, {props.g}, {props.b})</p>
<p>{rgbToHex(props.r, props.g, props.b)} </p>
</div>
)

}

export default BoxColor
23 changes: 23 additions & 0 deletions src/Components/CreditCard/CreditCard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

.CreditCard {
margin: 10px;
padding: 20px;
width: 300px;
border-radius: 10px;
display: inline-block;
}


.CreditCard img {
height: 20px;
}

.CreditCard .number {
font-size: 1.9em;
text-align: center;
margin: 20px 0;
}

.CreditCard .bank {
margin-left: 20px;
}
54 changes: 54 additions & 0 deletions src/Components/CreditCard/CreditCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import React from 'react'
import "./CreditCard.css"
import visa from './visa.png'
import master from './master-card.svg'

// import portrait4 from './images/img4.jpeg'


const CreditCard = (props) => {

let cardType
props.type === 'Visa' ? cardType = visa: cardType = master

const password = (number) => number.slice(12)

return (

<div className="CreditCard" style={{backgroundColor:props.bgColor, color:props.color}}>
<img src={cardType} alt="---" />
<p className="">•••• •••• ••••{password(props.number)} </p>
<p className="">Expires: {props.expirationMonth}/{props.expirationYear} {props.bank}</p>
<p className="">{props.owner}</p>




</div>
)
}




// function CreditCard(props) {



// return (
// <div className="" style={{backgroundColor:props.bgColor, color:props.color}}>


// {/* <strong className="">type: {props.type}</strong> */}
// <p className="">number: {props.number} </p>
// <p className="">expirationMonth: {props.expirationMonth} </p>
// <p className="">expirationYear: {props.expirationYear} </p>
// <p className="">bank: {props.bank} </p>
// <p className="">owner: {props.owner} </p>


// </div>
// );
// }

export default CreditCard
File renamed without changes
File renamed without changes
27 changes: 27 additions & 0 deletions src/Components/DriverCard/DriverCard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

.DriverCard {
background-color: #425cbb;
border-radius: 10px;
color: white;
padding: 15px;
display: flex;
justify-content: center;
align-items: center;
margin: 10px;
}

.DriverCard > * {
margin: 5px;
}

.DriverCard img {
height: 100px;
width: 100px;
object-fit: cover;
border-radius: 100px;
}

.DriverCard .right > * {
margin: 0;
}

19 changes: 19 additions & 0 deletions src/Components/DriverCard/DriverCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import React from 'react';
import './DriverCard.css'
import Rating from '../Rating/Rating'


function DriverCard(props) {
return (
<div className="DriverCard">
<p className="">{props.name}</p>
<Rating>{props.rating}</Rating>
<img src={props.img} className="" alt="---" />
<p className="">{props.car.model} </p>
<p className="">{props.car.licensePlate} </p>

</div>
);
}

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

function Greetings(props) {
let greeting = ''

if(props.lang === 'fr'){
greeting = 'Bonjour';
}
if(props.lang ==='en'){
greeting = 'Hello';
}

if(props.lang ==='de'){
greeting = 'Bonjour';
}

if(props.lang ==='es'){
greeting = 'Hola';
}

return (
<div className="box">
<h2>{greeting} {" "} {props.children}</h2>
</div>
)
}

export default Greetings;
13 changes: 13 additions & 0 deletions src/Components/IdCard/IdCard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.box {
border: 1px solid black;
padding: 5px;
margin: 10px 0;
}

.IdCard {
display: flex;
}

.IdCard img {
margin-right: 5px;
}
21 changes: 21 additions & 0 deletions src/Components/IdCard/IdCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import './IdCard.css'
const IdCard = (props) => {

const date = `${props.birth}`.slice(0,15);

return (
<div className="box IdCard">
<div className="">
<img src={props.picture} className="" alt="card-id" />
<p> <strong className="">lastName: </strong> {props.lastName} </p>
<p><strong className=""> firstName: </strong> {props.firstName} </p>
<p><strong className=""> gender: </strong> {props.gender} </p>
<p><strong className=""> height: </strong> {props.height} </p>
<p> <strong className=""> birth: </strong> {date} </p>
</div>
</div>
);
}

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

const firstNum = Math.floor(Math.random() * 6) + 1
const secondNum = Math.floor(Math.random() * 100) + 1

function Random(props) {
return (
<>
<div className="box IdCard">
<p className="IdCard">Random Value between 1 and 6 : {firstNum}</p>
</div>
<div className="box IdCard">
<p className="IdCard">Random Value between 1 and 6 : {secondNum}</p>
</div>
</>
);
}

export default Random;
3 changes: 3 additions & 0 deletions src/Components/Rating/Rating.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.Rating {
font-size: 2rem;
}
Loading