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

Large diffs are not rendered by default.

Binary file added src/.ClickablePicture.js.swp
Binary file not shown.
Binary file added src/.index.js.swp
Binary file not shown.
40 changes: 5 additions & 35 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,8 @@
.App {
text-align: center;
* {
margin: 5px;
padding: 0;
}

.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;
.each-card {
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);
}
}
}
140 changes: 126 additions & 14 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,138 @@
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';
import Rating from './Rating';
import DriverCard from './DriverCard';
import LikeButton from './LikeButton';
import ClickablePicture from './ClickablePicture';

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>

<h2>IdCard</h2>

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

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

<h2>Grettings</h2>

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

<h2>Random</h2>

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

<h2>BoxColor</h2>

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

<h2>Credit Card</h2>

<div className="each-card">

<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>

<h2>Rating</h2>

<Rating>0</Rating>
<Rating>1.49</Rating>
<Rating>1.5</Rating>
<Rating>3</Rating>
<Rating>4</Rating>
<Rating>5</Rating>

<h2>DriverCard</h2>

<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"
}} />
<h2>Like Button</h2>

<LikeButton />
<LikeButton />

<h2>Clickable Picture</h2>

<ClickablePicture
img='/img/persons/maxence.png'
imgClicked='/img/persons/maxence-glasses.png'
/>


</div>
);
}




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


.box {
border: 1px solid black;
padding: 40px;
margin: 10px;
width: 95%;
text-align: center;

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


const Random = (props) => {

return (

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

)
}

export default Random
27 changes: 27 additions & 0 deletions src/ClickablePicture.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import React, { Component } from "react";


class ClickablePicture extends Component {
state = {
firstPicture: "./img/persons/maxence.png",
SecondPicture: "./img/persons/maxence-glasses.png"

};

clickPicture = () => {
this.setState({
firstPicture: "./img/persons/maxence-glasses.png"
});
}

render() {
return <img src={this.state.firstPicture} onClick={this.clickPicture} alt="random"/>

}
}
export default ClickablePicture





14 changes: 14 additions & 0 deletions src/CreditCard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
.creditCard {
width: 25%;
height: 25%;
padding: 30px;
border-radius: 10px ;
margin: 20px;

}

img {
width: 80px;


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

const typeCard = (type) => {
switch (type){
case 'Visa':
return "../img/visa.png"

case 'Master Card':
return "../img/master-card.svg"

default:
return "../img/master-card.svg"
}
}

const hideNumber = (string) => {
return string.substr(-4);
}

const CreditCard = (props) => {

return (


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

<img src={typeCard(props.type)} alt="credit-card" />
<p>•••• •••• •••• {hideNumber(props.number)}</p>
<p>Expires {props.expirationMonth}/{props.expirationYear} {props.bank}</p>

<p>{props.owner}</p>

</div>




)
}

export default CreditCard
24 changes: 24 additions & 0 deletions src/DriverCard.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
.driver-card {
background-color: #425cbb;
border-radius: 10px;
color: #fff;
padding: 20px;
display: -webkit-flex;
display: flex;
-webkit-justify-content: center;
justify-content: center;
-webkit-align-items: center;
align-items: center;
margin: 10px;
}

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

.info {
font-size: 20px;
}
28 changes: 28 additions & 0 deletions src/DriverCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from 'react';
import './DriverCard.css'
import './DriverCard.css'
import Rating from './Rating';


const DriverCard = (props) => {

return (

<article className="driver-card">


<img src={props.img} alt="profile"/>


<div className="info">
<p>{props.name}</p>
<Rating>{props.rating}</Rating>
<p> {props.car.model} - {props.car.licensePlate}</p>

</div>

</article>
)
}

export default DriverCard
7 changes: 7 additions & 0 deletions src/Greetings.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.welcome {
border: 3px solid black;
margin: 10px;
padding: 10px;


}
Loading