Claude m'a aidé tout au long du projet, mais la ca atteint des sommets. En meme temps, je suis en retard de fou !! Heuresuement quil explique mega bien sinon je ne comprendrais rien... et encore, je comprends deja assez peu les lignes que je rentre moi meme. trop de balises tuent les balises......

This commit is contained in:
camille
2026-03-29 12:54:47 +02:00
parent b26f3080f9
commit 7aa8912276
6 changed files with 516 additions and 13 deletions
+20 -5
View File
@@ -1,29 +1,44 @@
import { component, unmount } from 'riot'
import App from './components/app.riot'
import PageDetail from './components/page-detail.riot'
import Comparateur from './components/comparateur.riot'
import 'chart.css'
import './style.css'
import EstimationChances from './components/estimation-chances.riot'
const app = document.getElementById('app')
let currentComponent = null
function navigate()
function navigate()
{
const hash = window.location.hash
if (currentComponent)
if (currentComponent)
{
unmount(app, true)
}
if (hash.startsWith('#/formation/'))
if (hash.startsWith('#/formation/'))
{
const id = hash.replace('#/formation/', '')
currentComponent = component(PageDetail)(app, { id })
}
else
}
else if (hash === '#/comparateur')
{
currentComponent = component(Comparateur)(app)
}
else if (hash === '#/estimation')
{
currentComponent = component(EstimationChances)(app)
}
else
{
currentComponent = component(App)(app)
}
}
window.addEventListener('hashchange', navigate)