Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
f6195f1
footer
JeeTeee Nov 14, 2022
1a164de
maj
Ramzer Nov 14, 2022
54fd96f
Merge branch 'Dev' of https://github.com/razorbak10/Team.C.M into Dev
Ramzer Nov 14, 2022
531b595
router
Ramzer Nov 14, 2022
8aa529a
corrections 2 errors
JeeTeee Nov 14, 2022
3771fea
Test component
Mathilde89 Nov 14, 2022
1381f5d
Merge branch 'Dev' of github.com:razorbak10/Team.C.M into Dev
Mathilde89 Nov 14, 2022
a9a7df4
Merge pull request #1 from razorbak10/Dev
razorbak10 Nov 14, 2022
ea8e97d
footer et imports logo partenaires
JeeTeee Nov 14, 2022
5de33e1
footer + import logos
JeeTeee Nov 14, 2022
6309a9c
Update index.js
JeeTeee Nov 14, 2022
1ef3586
images
JeeTeee Nov 14, 2022
e21ad41
images
JeeTeee Nov 14, 2022
bbc6f25
images footer ok
JeeTeee Nov 15, 2022
c70c502
header
JeeTeee Nov 15, 2022
54baae6
API transport
Mathilde89 Nov 15, 2022
34c5167
API tri
ThanhVietHuynh Nov 15, 2022
765a01b
Merge branch 'Dev' of github.com:razorbak10/Team.C.M into Dev
ThanhVietHuynh Nov 15, 2022
fdde6e8
header ok + refonte footer
JeeTeee Nov 15, 2022
5bb4618
fichier triselectif.json
ThanhVietHuynh Nov 15, 2022
564a046
Merge branch 'Dev' of github.com:razorbak10/Team.C.M into Dev
ThanhVietHuynh Nov 15, 2022
6ce8273
card
razorbak10 Nov 15, 2022
edadfa1
card
razorbak10 Nov 15, 2022
8552206
css
razorbak10 Nov 15, 2022
6677a62
map stations
Mathilde89 Nov 15, 2022
97f594d
Merge branch 'Dev' of github.com:razorbak10/Team.C.M into Dev
Mathilde89 Nov 15, 2022
2c7fb57
Merge branch 'main' into Dev
razorbak10 Nov 15, 2022
d4bff9c
front cards
JeeTeee Nov 15, 2022
0c18a57
conflits resolus
JeeTeee Nov 15, 2022
df36c75
MAJ MapRtm
Mathilde89 Nov 15, 2022
45ca6c9
MAJ
Mathilde89 Nov 15, 2022
99e6d4f
Merge branch 'Dev' of github.com:razorbak10/Team.C.M into Dev
Mathilde89 Nov 15, 2022
880d752
front cards final
JeeTeee Nov 15, 2022
c1062b6
Calcul Km
razorbak10 Nov 15, 2022
71009d3
ajout map card transport
JeeTeee Nov 15, 2022
be012bd
merge
JeeTeee Nov 15, 2022
ad78a81
MAJ Map
Mathilde89 Nov 15, 2022
aba3355
Merge branch 'Dev' of github.com:razorbak10/Team.C.M into Dev
Mathilde89 Nov 15, 2022
7f107b9
lerging
JeeTeee Nov 15, 2022
653136e
maj bio
Ramzer Nov 15, 2022
347629b
Merge branch 'Dev' of https://github.com/razorbak10/Team.C.M into Dev
Ramzer Nov 15, 2022
06d802d
Merge branch 'Dev' of https://github.com/razorbak10/Team.C.M into Dev
Ramzer Nov 15, 2022
7ce7f76
Maj reccup données coord
Mathilde89 Nov 15, 2022
f2873c8
Merge branch 'Dev' of github.com:razorbak10/Team.C.M into Dev
Mathilde89 Nov 15, 2022
1c824c2
front map bio
JeeTeee Nov 15, 2022
e8b4ef1
merge again
JeeTeee Nov 15, 2022
8eda26b
Fix réduction CO2
Mathilde89 Nov 16, 2022
18a05b7
Merge branch 'Dev' of github.com:razorbak10/Team.C.M into Dev
Mathilde89 Nov 16, 2022
16387eb
Input
Mathilde89 Nov 16, 2022
99c83ca
markers map
JeeTeee Nov 16, 2022
273756d
merging
JeeTeee Nov 16, 2022
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
19,380 changes: 19,203 additions & 177 deletions front/package-lock.json

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion front/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"bootstrap": "^5.2.2",
"bootstrap-cards": "^1.16.0",
"mapbox-gl": "^2.11.0",
"react": "^18.2.0",
"react-bootstrap": "^2.6.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"react-map-gl": "^7.0.19",
"react-router-dom": "^5.1.2",
"react-scripts": "^5.0.1",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand All @@ -34,5 +40,9 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"css-loader": "^6.7.2",
"style-loader": "^3.3.1"
}
}
7 changes: 7 additions & 0 deletions front/public/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

<!DOCTYPE html>
<html lang="en">
<head>
Expand All @@ -10,11 +11,17 @@
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<script src='https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.js'></script>
<link href='https://api.mapbox.com/mapbox-gl-js/v2.9.1/mapbox-gl.css' rel='stylesheet' />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Expand Down
45 changes: 28 additions & 17 deletions front/src/App.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
import logo from './logo.svg';
import './App.css';
import { BrowserRouter as Router, Route, Switch} from 'react-router-dom';

import './assets/App.css';
import Bio from './components/Bio';
import Footer from './components/Footer';
import Header from './components/Header';
import MapRtm from './components/MapRtm';
import Tri from './components/Tri';
import Card from './components/Card';

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

<Switch>
<Route exact path="/bio" component={Bio}></Route>
<Route exact path="/footer" component={Footer}></Route>
<Route exact path="/header" component={Header}></Route>
<Route exact path="/MapRtm" component={MapRtm}></Route>
<Route exact path="/tri" component={Tri}></Route>
<Route exact path="/card" component={Card}></Route>




</Switch>
</Router>
);
}

export default App;


8 changes: 0 additions & 8 deletions front/src/App.test.js

This file was deleted.

File renamed without changes.
42 changes: 42 additions & 0 deletions front/src/assets/Header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.my-navbar {
height: 80px;
width: 100%;
background-color: #00A651;
display: flex;
justify-content: space-around;
align-items: center;
font-family: 'Poppins', sans-serif;
}

.navbar-container {
display: flex;
flex: 1 1;
flex-wrap: wrap;
justify-content: space-between;
align-items: center;
padding: 30px;
}

a > img {
max-width: 280px;
}

ul {
list-style: none;
display: flex;
}

ul > li {
padding: 15px;
}

li > a {
text-decoration: none;
color: white;
}

li > a:hover {
font-weight: 600;
border-bottom: white solid 2px;
color: white;
}
3 changes: 3 additions & 0 deletions front/src/assets/MapBio.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.map-container {
height: 400px;
}
32 changes: 32 additions & 0 deletions front/src/assets/footer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.footer {
display: flex;
flex: 1;
flex-direction: row;
flex-wrap: wrap;
border: 1px solid #707070;
padding-bottom: 40px;
justify-content: center;
align-items: center;
}

.footer a {
flex-basis: 30%;
text-align: center;
padding: 10px;
}

.footer img {
height: 70px;
object-fit: contain;
}

.smaller {
height: 40px !important;
}

@media (max-width: 600px) {
.grid {
width: 100%;
flex-direction: column;
}
}
Binary file added front/src/assets/images/AWS.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front/src/assets/images/code4marseille.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front/src/assets/images/conso.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front/src/assets/images/departement13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front/src/assets/images/geoloc-marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front/src/assets/images/inco.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front/src/assets/images/logo_jo4marseille.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front/src/assets/images/marina-marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front/src/assets/images/metro-marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front/src/assets/images/provencetourisme.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front/src/assets/images/tram-marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front/src/assets/images/velodrome-marker.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added front/src/assets/images/voyage_prive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions front/src/components/Bio.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
import React, {useState, useEffect, useReducer} from 'react'
import MapBio from './MapBio';
import './bio.css'


function Bio() {

const [data, setData] = useState({});
const [fin, setFin] = useState([]);
const [lng, setLng] = useState(5.385010);
const [lat, setLat] = useState(43.267833);
const [zoom, setZoom] = useState(13);




useEffect(() => {

const requestOptions = {
method: 'GET',
};
fetch('https://opendata.agencebio.org/api/gouv/operateurs/?activite=Restauration&lat=43.296482&lng=5.36978&nb=50&filtrerRestaurants=1', requestOptions)
.then(response => response.json())
.then((response) => {
console.log(response);
setData(response)
let final = []
response.items.map((data) => {
final.push({
"type" : "Restaurant",
"nom" : data.denominationcourante,
"latitude" : data.adressesOperateurs[0].lat,
"longitude":data.adressesOperateurs[0].long,
"adresse": data.adressesOperateurs[0].ville + " , " + data.adressesOperateurs[0].codePostal
}
)
})
setFin(final)
console.log(final)

}).catch(function(error) {
console.log('Il y a eu un problème avec l\'opération fetch: ' + error.message);
});

}, [])

const findLoc = (lon, lat, zoom, event) => {
event.preventDefault()
setLng(lon)
setLat(lat)
setZoom(zoom)
console.log(lon, lat, zoom)
}

return (

<div> <h1 style={{fontFamily: "'Poppins', sans-serif"}}>Restaurants BIO :</h1>

<div className='row'>

<div className='col-6 border'> <div className='listbox'>
{fin.map((data) => {
return (<div> <div className="card" >
<div className="card-body">
<h5 className="card-title">{data.nom}</h5>
<h6 className="card-title">{data.adresse}</h6>
<button className="btn btn-dark" onClick={(e) => findLoc(data.longitude,data.latitude, 14,e)} >Find Location</button>
</div>
</div></div>)
})}</div>
</div>
<div className='col-6' id='staticMap'><MapBio lon={lng} lat ={lat} zoom ={zoom}/></div>

</div>



</div>
)
}

export default Bio
64 changes: 64 additions & 0 deletions front/src/components/Card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
import React from 'react';

import Card from 'react-bootstrap/Card';
import Map from './MapRtm';
import MapBio from './Bio';


function FinalCard() {
return (
<div className='my-containt'>
<Card style={{backgroundColor: '#fff', marginBottom: '80px', height: '700px', border: "solid #0282C8 12px" , borderRadius: "100px 0px", boxShadow: "0 3px 10px #000000a6", overflow: 'hidden'}}
className="text-center">

<Card.Header style={{backgroundImage: 'url("https://i.ibb.co/H71FK9S/conso.png")',
backgroundColor: '#0282C8',
height: '150px',
backgroundPosition: 'center',
backgroundSize: 'cover',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'}}>

<h2 style={{color: '#fff', fontSize: '60px', textShadow: "2px 2px 7px rgba(0,0,0,0.6)"}}>Consommation Responsable</h2>
</Card.Header>

<Card.Body style={{backgroundColor: '#f3f3f3d8', borderRadius: "0px 0px 20px 0px", display: 'flex', flexDirection: 'column', alignItems: 'center'}}>

<Card.Title style={{fontFamily: "'Poppins', sans-serif", fontSize: '24px'}}> Réduire votre émission de co2 </Card.Title>

<MapBio/>

</Card.Body>
</Card>

<Card style={{backgroundColor: '#fff', marginBottom: '80px', height: '700px', border: "solid #00A651 12px" , borderRadius: "100px 0px", boxShadow: "0 3px 10px #000000a6", overflow: 'hidden'}}
className="text-center">

<Card.Header style={{backgroundImage: 'url("https://i.postimg.cc/nL96n3zm/transport.png")',
backgroundColor: '#00A651',
height: '150px',
backgroundPosition: 'center',
backgroundSize: 'cover',
display: 'flex',
alignItems: 'center',
justifyContent: 'center'}}>

<h2 style={{color: '#fff', fontSize: '60px', textShadow: "2px 2px 7px rgba(0,0,0,0.6)"}}>Mobilité Durable</h2>
</Card.Header>

<Card.Body style={{backgroundColor: '#f3f3f3d8', borderRadius: "0px 0px 20px 0px", display: 'flex', flexDirection: 'column', alignItems: 'center'}}>

<Card.Title style={{fontFamily: "'Poppins', sans-serif", fontSize: '24px'}}> Réduire votre émission de co2 </Card.Title>

<Map/>

</Card.Body>
</Card>
</div>
);
}

export default FinalCard;


36 changes: 36 additions & 0 deletions front/src/components/Footer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React from 'react';
import '../assets/footer.css';
import Aws from "../assets/images/AWS.png";
import Departement13 from "../assets/images/departement13.png";
import Code4marseille from "../assets/images/code4marseille.png";
import Inco from "../assets/images/inco.png";
import Provencetourisme from "../assets/images/provencetourisme.png";
import Voyage_prive from "../assets/images/voyage_prive.png";

function Footer() {
return (
<footer class="footer">

<a href="https://www.departement13.fr/" target="_blank">
<img src={Departement13} alt="d13" />
</a>
<a href="https://www.voyage-prive.com/" target="_blank">
<img src={Voyage_prive} alt="voyage privé" />
</a>
<a href="https://aws.amazon.com/fr/?nc2=h_lg" target="_blank">
<img src={Aws} alt="aws" />
</a>
<a href="https://www.myprovence.fr/" target="_blank">
<img class="smaller" src={Provencetourisme} alt="my provence" />
</a>
<a href="https://inco-group.co/" target="_blank">
<img class="smaller" src={Inco} alt="inco" />
</a>
<a href="https://code4marseille.fr/" target="_blank">
<img src={Code4marseille} alt="code4marseille" />
</a>
</footer>
)
}

export default Footer
Loading