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

Large diffs are not rendered by default.

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);
}
}
* {
padding: 0%;
margin: 0%;
}
116 changes: 100 additions & 16 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,109 @@
import React from 'react';
import logo from './logo.svg';
import './App.css';
import IdCard from './Components/IdCard/IdCard'
import Greetings from './Components/Greetings/Greetings'
import Random from './Components/Random/Random'
import BoxColor from './Components/BoxColor/BoxColor';
import CreditCard from './Components/CreditCard/CreditCard';
import Rating from './Components/Rating/Rating';
import DriverCard from './Components/DriverCard/DriverCard';
import LikeButton from './Components/LikeButton/LikeButton';
import ClickablePicture from './Components/ClickablePicture/ClickablePicture';
import img from './img/persons/maxence.png'
import img2 from './img/persons/maxence-glasses.png'

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


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


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


<div>
<BoxColor r={76} g={0} b={255}></BoxColor>
<BoxColor r={0} g={255} b={192}></BoxColor>
</div>


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


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


<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"
}} />

{/* <div>
<ClickablePicture img={img} img2={img2}></ClickablePicture>
</div> */}

</>
);
}

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



const BoxColor = (props) => {

const style = `rgb(${props.r}, ${props.g}, ${props.b})`

function RGBToHex(r,g,b) {
r = r.toString(16);
g = g.toString(16);
b = b.toString(16);

if (r.length == 1)
r = "0" + r;
if (g.length == 1)
g = "0" + g;
if (b.length == 1)
b = "0" + b;

return "#" + r + g + b;
}


const hexColor = RGBToHex(props.r, props.g, props.b)

return (
<div style={{backgroundColor: style}}>
<p>rgb({props.r},{props.g},{props.b})</p>
<p>{hexColor}</p>
</div>
)

}


export default BoxColor
Empty file.
35 changes: 35 additions & 0 deletions src/Components/ClickablePicture/ClickablePicture.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/* import React from 'react'
import './ClickablePicture.css'


class ClickablePicture extends React.Component {
constructor(props) {
super(props);
this.img = props.img;
this.img2 = props.img2;
this.state = {
clicked: false
}

this.handleClick = this.handleClick.bind(this);

this.handleClick()
this.setState(prevState => ({
clicked: !prevState.clicked
}))

this.render()
return (
<button onClick= {this.handleClick}>
<img src={this.state.clicked ? this.img : this.img2} alt={this.img}></img>
</button>
)




}
}


export default ClickablePicture */
Empty file.
36 changes: 36 additions & 0 deletions src/Components/CreditCard/CreditCard.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react'
import './CreditCard.css'



const CreditCard = (props) => {


const cardType = (type) => {
switch (type){
case "Visa":
return "Visa"

case "Master Card":
return "Master Card"

default:
return
}
}

return (
<div style={{backgroundColor: props.bgColor, color: props.color}}>
<h5>{cardType(props.type)}</h5>
<p>{props.number}</p>
<p>{props.expirationMonth}</p>
<p>{props.expirationYear}</p>
<p>{props.bank}</p>
<p>{props.owner}</p>
</div>
)

}


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



const DriverCard = (props) => {

return (
<div>
<div>
<img src={props.img}></img>
</div>
<div>
<div>
<h2>{props.name}</h2>
</div>
<div>
<Rating children={props.rating}></Rating>
</div>
<div>
<p>{props.car.model}</p>
<p>{props.car.licensePlate}</p>
</div>
</div>
</div>
)

}


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



const Greetings = (props) => {

const greeting = (lang) => {
switch (lang){
case "de":
return "Hallo"
break;

case "en":
return "Hello"
break;

case "es":
return "Hola"
break;

case "fr":
return "Bonjour"
break;

default:
return
break;
}
}



return (
<div>
<p>{greeting(props.lang)} {props.children}</p>
</div>
)

}

export default Greetings
Loading