organisation css
This commit is contained in:
parent
a0fa93a62e
commit
96812f75df
18 changed files with 260 additions and 16 deletions
65
template.html
Normal file
65
template.html
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Botascopia</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/assets/style.css">
|
||||
<link rel="stylesheet" type="text/css" href="/assets/fonts/borna/stylesheet.css">
|
||||
<link rel="stylesheet" type="text/css" href="/assets/fonts/nunita/stylesheet.css">
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<include src="/components/site-header.html"></include>
|
||||
|
||||
<main id="main_species-list">
|
||||
|
||||
|
||||
|
||||
|
||||
</main>
|
||||
|
||||
|
||||
|
||||
<include src="/components/site-footer.html"></include>
|
||||
|
||||
|
||||
|
||||
<!-- SCRIPT À SUPPRIMER UNE FOIS LE SITE INTEGRÉ (include des composants)-->
|
||||
<script>
|
||||
function processIncludes() {
|
||||
const includes = document.querySelectorAll('include[src]');
|
||||
|
||||
if (includes.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
const promises = Array.from(includes).map(el => {
|
||||
const src = el.getAttribute('src');
|
||||
return fetch(src)
|
||||
.then(r => {
|
||||
if (!r.ok) throw new Error(`Erreur ${r.status}: ${src}`);
|
||||
return r.text();
|
||||
})
|
||||
.then(html => {
|
||||
el.outerHTML = html;
|
||||
})
|
||||
.catch(err => {
|
||||
console.error('Erreur de chargement:', err);
|
||||
});
|
||||
});
|
||||
|
||||
Promise.all(promises).then(() => {
|
||||
processIncludes();
|
||||
});
|
||||
}
|
||||
|
||||
document.addEventListener('DOMContentLoaded', processIncludes);
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue