181 lines
5 KiB
HTML
181 lines
5 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>dépêches — eweng.space</title>
|
|
<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><text y='.9em' font-size='90'>☆</text></svg>">
|
|
<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=IM+Fell+English:ital@0;1&display=swap" rel="stylesheet">
|
|
<style>
|
|
body {
|
|
font-family: 'IM Fell English', serif;
|
|
font-size: 20px;
|
|
}
|
|
|
|
@keyframes colorshift {
|
|
0% { color: hsl(0, 60%, 70%); }
|
|
25% { color: hsl(90, 60%, 70%); }
|
|
50% { color: hsl(180, 60%, 70%); }
|
|
75% { color: hsl(270, 60%, 70%); }
|
|
100% { color: hsl(360, 60%, 70%); }
|
|
}
|
|
|
|
@keyframes levite {
|
|
0% { transform: translateY(0px); }
|
|
50% { transform: translateY(-5px); }
|
|
100% { transform: translateY(0px); }
|
|
}
|
|
|
|
.fenetre {
|
|
max-width: 600px;
|
|
border: 1px solid black;
|
|
padding: 0.3rem 1.5rem 0 1.5rem;
|
|
padding-bottom: 0;
|
|
margin-top: 0px;
|
|
position: relative;
|
|
overflow-wrap: break-word;
|
|
}
|
|
.fenetre-nom {
|
|
margin-bottom: 1px;
|
|
margin-left: 2px;
|
|
}
|
|
.fenetre-contenu {
|
|
padding: 0 1rem 1.5rem 1rem;
|
|
min-width: 0;
|
|
}
|
|
|
|
.retour {
|
|
font-family: 'IM Fell English', serif;
|
|
font-size: 20px;
|
|
color: inherit;
|
|
display: inline-block;
|
|
margin-bottom: 1px;
|
|
margin-right: 0.4rem;
|
|
text-decoration: none;
|
|
}
|
|
|
|
/* ── feed ── */
|
|
.feed {
|
|
margin-top: 1.2rem;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 0;
|
|
}
|
|
|
|
.depeche {
|
|
border-top: 1px solid #ddd;
|
|
padding: 1rem 0;
|
|
}
|
|
.depeche:last-child {
|
|
border-bottom: 1px solid #ddd;
|
|
}
|
|
|
|
.depeche-date {
|
|
font-size: 0.75rem;
|
|
font-style: italic;
|
|
color: #999;
|
|
margin-bottom: 0.4rem;
|
|
}
|
|
|
|
.depeche-texte {
|
|
line-height: 1.6;
|
|
color: #111;
|
|
}
|
|
|
|
.depeche-image {
|
|
margin-top: 0.8rem;
|
|
max-height: 400px;
|
|
max-width: 100%;
|
|
width: auto;
|
|
border: 1px solid #ddd;
|
|
display: block;
|
|
}
|
|
|
|
.chargement {
|
|
font-style: italic;
|
|
color: #aaa;
|
|
padding: 1rem 0;
|
|
}
|
|
|
|
.rss-link {
|
|
position: absolute;
|
|
top: 0.5rem;
|
|
right: 0.5rem;
|
|
font-size: 1rem;
|
|
font-style: italic;
|
|
color: #aaa;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.rss-link:hover { color: #111; }
|
|
|
|
@media (max-width: 600px) {
|
|
body { font-size: 17px; }
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div>
|
|
<a href="index.html" class="retour">←</a><span class="fenetre-nom" id="titre-nav">eweng.space ☆</span>
|
|
</div>
|
|
|
|
<div class="fenetre">
|
|
<a href="/rss/depeches.xml" class="rss-link">rss</a>
|
|
<div class="fenetre-contenu">
|
|
<h1>dépêches</h1>
|
|
|
|
<div class="feed" id="feed">
|
|
<p class="chargement">chargement…</p>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
fetch('/api/depeches')
|
|
.then(r => r.json())
|
|
.then(depeches => {
|
|
const feed = document.getElementById('feed');
|
|
feed.innerHTML = '';
|
|
|
|
if (depeches.length === 0) {
|
|
feed.innerHTML = '<p class="chargement">aucune dépêche pour l\'instant.</p>';
|
|
return;
|
|
}
|
|
|
|
depeches.forEach(d => {
|
|
const el = document.createElement('div');
|
|
el.className = 'depeche';
|
|
|
|
const img = d.image
|
|
? `<img src="${d.image}" class="depeche-image" alt="">`
|
|
: '';
|
|
|
|
el.innerHTML = `
|
|
<div class="depeche-date">ewen - ${d.date}</div>
|
|
<div class="depeche-texte">${d.texte}</div>
|
|
${img}
|
|
`;
|
|
|
|
feed.appendChild(el);
|
|
});
|
|
})
|
|
.catch(() => {
|
|
document.getElementById('feed').innerHTML =
|
|
'<p class="chargement">impossible de charger les dépêches.</p>';
|
|
});
|
|
|
|
const el = document.getElementById('titre-nav');
|
|
el.innerHTML = el.textContent.split('').map((c, i) => {
|
|
if (c === ' ') return ' ';
|
|
const delayColor = (i * 0.3).toFixed(1);
|
|
const delayLevite = (Math.random() * 4).toFixed(2);
|
|
const duree = (3 + Math.random() * 3).toFixed(2);
|
|
return `<span style="display:inline-block;animation:colorshift 12s ease-in-out infinite,levite ${duree}s ease-in-out infinite;animation-delay:-${delayColor}s,-${delayLevite}s">${c}</span>`;
|
|
}).join('');
|
|
</script>
|
|
</body>
|
|
</html>
|