-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from Astarosa/dev
Dev
- Loading branch information
Showing
33 changed files
with
571 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"type": "node", | ||
"request": "launch", | ||
"name": "Launch Program", | ||
"skipFiles": [ | ||
"<node_internals>/**" | ||
], | ||
"program": "${file}" | ||
} | ||
] | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,52 @@ | ||
import React from 'react'; | ||
import './Styles/App.css'; | ||
import Home from './Pages/Home'; | ||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
<Home /> | ||
</div> | ||
); | ||
import Header from './Components/Header'; | ||
import axios from 'axios'; | ||
import PeriodsList from './Components/PeriodsList'; | ||
|
||
class App extends React.Component { | ||
constructor (props) { | ||
super(props); | ||
this.state = { | ||
backgroundImageUrl: '', | ||
isLoaded:false | ||
}; | ||
} | ||
|
||
getBackGroundImage = async () => { | ||
const backgroundIndex = Math.round(Math.random() * 714); | ||
const ids = await axios.get('https://collectionapi.metmuseum.org/public/collection/v1/search?q=a&departmentIds=9') | ||
.then(res => res.data) | ||
.then(data => data.objectIDs); | ||
|
||
const url = await axios.get(`https://collectionapi.metmuseum.org/public/collection/v1/objects/${ids[backgroundIndex]}`) | ||
.then(result => result.data) | ||
.then(data => data.primaryImageSmall); | ||
this.setState({ backgroundImageUrl: url, isLoaded: true }); | ||
} | ||
|
||
componentDidMount () { | ||
this.timerID = setInterval(() => { | ||
this.getBackGroundImage(); | ||
}, 4000); | ||
this.getBackGroundImage(); | ||
} | ||
|
||
componentWillUnmount () { | ||
clearInterval(this.timerID); | ||
} | ||
|
||
render () { | ||
return ( | ||
<div className='App'> | ||
<Header isLoaded={this.state.isLoaded} backgroundImageUrl={this.state.backgroundImageUrl} /> | ||
<h2 className='intro'>Au fil des époques, l'art s'est exprimé de différentes manières. S'il est difficile l'appréhender, rien n'est laissé au hasard. Pour voyager au sein du MetMuseum et découvrir l'art à différentes époques depuis votre canapé, suivez le guide !</h2> | ||
<PeriodsList /> | ||
<h2 className='intro'>"L'histoire des artistes ne peut être racontée qu'une fois que sont devenues claires, après un certain laps de temps, l'influence que leur oeuvre a exercé sur d'autres et les contributions qu'ils ont faites à l'histoire de l'art en tant que telle"</h2> | ||
<h3 className='author-quote'>Ernst Gombrich</h3> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default App; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
import '../Styles/Header.css'; | ||
|
||
const Header = (props) => { | ||
return ( | ||
<header className={props.isLoaded ? 'banner-background' : 'banner-background wait'} style={{ backgroundImage: `linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)), url(${props.backgroundImageUrl})` }}> | ||
<h1>EVAD'ART</h1> | ||
<h2>- Comprendre l'art au fil des époques -</h2> | ||
</header> | ||
); | ||
}; | ||
|
||
export default Header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import React from 'react'; | ||
import '../Styles/Period.css'; | ||
import GetPeriodObjects from '../Requests/GetPeriodObjects'; | ||
|
||
// Ici class Period qui donne le squelette d'une periode affichée, avec les props title, date (remplacer le contneu du h3) plus le contenu | ||
|
||
class Period extends React.Component { | ||
constructor (props) { | ||
super(props); | ||
this.state = { | ||
open: false, | ||
isLoaded: false, | ||
periodObjects: [] | ||
}; | ||
} | ||
|
||
handleOpen = async () => { | ||
const open = !this.state.open; | ||
this.setState({ open }); | ||
const periodObjects = await GetPeriodObjects(this.props.request, this.props.id); | ||
console.log(periodObjects); | ||
this.setState({ periodObjects, isLoaded: true }); | ||
} | ||
|
||
render () { | ||
return ( | ||
<div className='period-bloc-container'> | ||
<div className={this.state.open ? 'period-bloc-banner opened' : 'period-bloc-banner closed'} style={{ backgroundImage: `linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.4)), url(${this.props.url})` }}> | ||
<h2>{this.props.title}</h2> | ||
<h3>{this.props.date}</h3> | ||
<button onClick={this.handleOpen} className='open-content-container'> | ||
<span className={this.state.open ? 'close-content' : 'open-content'} /> | ||
</button> | ||
</div> | ||
<div className={this.state.open ? 'period-bloc-content opened' : 'period-bloc-content closed'}> | ||
<p className='period-content'>{this.props.content.text}</p> | ||
<img className='period-illustration' src={this.props.content.illustration} alt={this.props.description} /> | ||
<p className='period-description'>{this.props.content.description}</p> | ||
<div className='discover-object-container'> | ||
<h4>Explorer des oeuvres de cette période</h4> | ||
{this.state.isLoaded === false ? <div className='loading' /> | ||
: this.state.periodObjects.slice(0, 3).map(object => ( | ||
<div className='object-container' key={object.objectURL}> | ||
<a href={object.objectURL} target='_blank' rel='noopener noreferrer'><div className='object-image-container' style={{ backgroundImage: `url(${object.primaryImageSmall})` }} /></a> | ||
<h5>{object.title}</h5> | ||
<h6>{object.artistDisplayName !== '' ? object.artistDisplayName : 'artiste inconnu'}</h6> | ||
</div> | ||
))} | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default Period; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import Period from './Period'; | ||
import periods from '../Requests/periods'; | ||
|
||
class PeriodsList extends React.Component { | ||
render () { | ||
return ( | ||
<div className='all-period-bloc-container'> | ||
<div className='time-arrow' /> | ||
{periods.map(period => ( | ||
<Period key={period.id} title={period.title} date={period.date} content={period.content} url={period.url} request={period.request} id={period.id} /> | ||
))} | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default PeriodsList; |
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import axios from 'axios'; | ||
|
||
const modernArtObjects = [488098, 488142, 485536, 490210]; | ||
|
||
const GetPeriodObjects = async (q, deptId) => { | ||
if (deptId === 9) { | ||
const objectList = await Promise.all(modernArtObjects.map(objectId => { | ||
return axios.get(`https://collectionapi.metmuseum.org/public/collection/v1/objects/${objectId}`) | ||
.then(result => result.data); | ||
})); | ||
return objectList; | ||
} else { | ||
const objectIds = await axios.get(`https://collectionapi.metmuseum.org/public/collection/v1/search?q=${q}&departmentId=${deptId}`) | ||
.then(res => res.data) | ||
.then(data => data.objectIDs); | ||
const objectList = await Promise.all(objectIds.map(objectId => { | ||
return axios.get(`https://collectionapi.metmuseum.org/public/collection/v1/objects/${objectId}`) | ||
.then(result => result.data); | ||
})); | ||
return objectList; | ||
} | ||
}; | ||
|
||
export default GetPeriodObjects; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import artEgyptien from '../Images/art-egyptien.jpg'; | ||
import artGrecRomain from '../Images/art-antique.jpg'; | ||
import artMedieval from '../Images/art-medieval.jpg'; | ||
import artModerne from '../Images/art-moderne.jpg'; | ||
import artMedievalIllustrationUne from '../Images/art-medieval-illustration-1.jpg'; | ||
import artModerneIllustrationUne from '../Images/art-moderne-illustration-1.jpg'; | ||
|
||
// Ici mettre un tableau en dur des periodes (periods) qu'on veut afficher, avec des objets {key=id:, title:, date:, content: } | ||
// Puis le composant PeriodList sous forme de fonction qui map periods, et qui pour chaque period , passe le composant | ||
// Period , en lui passant une key unique (l'id de la période,), le title la date, et le contenu. | ||
|
||
const periods = [ | ||
{ | ||
id: 10, | ||
request: 'egypt', | ||
title: 'Art Egyptien', | ||
date: '3150 av. .J-C. - 150 av. .J-C.', | ||
content: | ||
{ | ||
text: "L'art Egyptien n'est pas \"primitif\" au sens des peintures rupestres. Si les bas-reliefs sont une représentation tronquée de la nature, c'est une volonté des Egyptiens. En effet, leur but n'est pas de faire une représentation exacte de la réalité, il est bien plus important d'en faire une représentation complète: la tête se voit mieux de profil, le torse de face, les bras et les jambes de profil, etc. Pour la première fois, on peut parler de \"style\".", | ||
illustration: 'https://ekladata.com/3B7IUx3anXzGBOPMKFSpyuvXltE.jpg', | ||
description: 'Le style Egyptien' | ||
}, | ||
url: artEgyptien | ||
}, | ||
{ | ||
id: 13, | ||
request: 'sculpture', | ||
title: 'Art Grec et Romain', | ||
date: 'VIIème siècle av. .J-C. - Ier siècle ap. .J-C.', | ||
content: | ||
{ | ||
text: "L'art Grec apporte une grande nouveauté : le but n'est plus d'imiter avec la plus grande fidélité possible le style des anciens mais, pour chaque sculpteur, de décider par lui même comment il va représenter le corps, chacun reprenant les grands succès des autres : comment réussir un torse, réaliser que la statue est plus vivante si le pied est légèrement soulevé, remarquer qu'un léger sourire rend sympa. L'idée générale est : \"n'imitez pas, innovez\". On invente le raccourci.", | ||
illustration: 'https://idata.over-blog.com/4/08/12/30/raccourci/Euthymides---detail2.JPG', | ||
description: "L'invention du raccourci : un pied de profil et l'autre de face" | ||
}, | ||
url: artGrecRomain | ||
}, | ||
{ | ||
id: 17, | ||
request: 'medieval', | ||
title: 'Art Médiéval', | ||
date: 'Vème siècle ap. .J-C. - XIIIème siècle ap. .J-C.', | ||
content: | ||
{ | ||
text: "Avec le christianisme, la question de la place des images dans la religion se pose de manière renouvelée. Si pour tous les premiers chrétiens, il ne doit pas y avoir de représentation dans les églises, le Pape Grégoire le Grand, au IVème siècle, inverse la tendance. D'après lui, les images peuvent avoir un rôle d'enseignement pour les fidèles ne sachant pas lire. Le but n'est donc plus de représenter la réalité mais d'aller à l'essentiel pour plus de clarté et, ainsi, mieux éduquer.", | ||
illustration: artMedievalIllustrationUne, | ||
description: 'Peu importe les proportions, le message doit être le plus clair possible' | ||
}, | ||
url: artMedieval | ||
}, | ||
{ | ||
id: 9, | ||
request: 'abstract', | ||
title: 'Art Moderne', | ||
date: 'XXème siècle ap. .J-C.', | ||
content: | ||
{ | ||
text: "Faut il impérativement représenter une toile reconnaissable pour pouvoir exprimer ses sentiments.Le cap est franchit par le peintre russe Wassily Kandisky , pionnier de l'art abstrait connu également sous le nom d'art décoratif. Picasso lui emboîtera le pas en s'inspirant du fauvisme issu de l'impressionnisme de Monnet , comme peut l'illustrer son oeuvre intitulée violon et raisin.", | ||
illustration: artModerneIllustrationUne, | ||
description: 'Violon et raisins, Pablo Picasso, 1912' | ||
}, | ||
url: artModerne | ||
} | ||
]; | ||
|
||
export default periods; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Oops, something went wrong.