diff --git a/parcoursup-app/index.html b/parcoursup-app/index.html index 63c5c35..b3fc109 100644 --- a/parcoursup-app/index.html +++ b/parcoursup-app/index.html @@ -6,11 +6,7 @@ Parcoursup but coded by an idiot -

Explorateur de formations

- - -
- +
\ No newline at end of file diff --git a/parcoursup-app/src/components/app.riot b/parcoursup-app/src/components/app.riot new file mode 100644 index 0000000..b6e30ba --- /dev/null +++ b/parcoursup-app/src/components/app.riot @@ -0,0 +1,41 @@ + +

Explorateur de formations

+ + + + + +
Chargement...
+ +
+ +
+ + +
\ No newline at end of file diff --git a/parcoursup-app/src/components/carte-formations.riot b/parcoursup-app/src/components/carte-formations.riot new file mode 100644 index 0000000..d6533f9 --- /dev/null +++ b/parcoursup-app/src/components/carte-formations.riot @@ -0,0 +1,34 @@ + +
+ + +
\ No newline at end of file diff --git a/parcoursup-app/src/main.js b/parcoursup-app/src/main.js index 8dc24d4..e920851 100644 --- a/parcoursup-app/src/main.js +++ b/parcoursup-app/src/main.js @@ -1,27 +1,4 @@ -import * as riot from 'riot' -import LigneResultat from './components/ligne-resultat.riot' -import { recupereFormations } from './api/parcoursup.js' +import { component } from 'riot' +import App from './components/app.riot' - -riot.register('ligne-resultat', LigneResultat) - -const bouton = document.getElementById("entrerRequete") -const champRecherche = document.getElementById("requete") -const divResultats = document.getElementById("affichageResultats") - -bouton.addEventListener("click", async () => { - const motCle = champRecherche.value - divResultats.innerHTML = "Chargement..." - - const formations = await recupereFormations(motCle) - - divResultats.innerHTML = "" - - formations.forEach(f => { - const listeFormations = riot.mount( - document.createElement('ligne-resultat'), - { formation: f } - ) - divResultats.appendChild(listeFormations[0].root) - }) -}) \ No newline at end of file +component(App)(document.getElementById('app')) \ No newline at end of file