diff --git a/assets/main.js b/assets/main.js
new file mode 100644
index 0000000..ca7d724
--- /dev/null
+++ b/assets/main.js
@@ -0,0 +1,143 @@
+/* === ANIMATION TITRE-NAV (toutes les pages) === */
+function animerTitreNav() {
+ document.querySelectorAll('.fenetre-nom').forEach(el => {
+ 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 `${c}`;
+ }).join('');
+ });
+}
+
+/* === /NOW (index.html) === */
+function afficherNow() {
+ const phrasesNow = [
+ "/now : faut que je fasses les courses.",
+ "/now : les arbres vibrent !",
+ "/now : les mains, les jambes, avancent..",
+ "/now : lave toi le visage.",
+ "/now : il pleut, et c'est très bien comme ça.",
+ "/now : pas mal la page d'accueil !",
+ "/now : i love my computer",
+ "/now : demain je serais en cours, j'espère",
+ "/now : je resterais auprès de toi pour toujours",
+ "/now : je serais toi j'irais prendre l'air",
+ "/now : je dois vraiment aller dormir la"
+ ];
+
+ const spanNow = document.querySelector('.now');
+ if (spanNow) {
+ const indexAleatoire = Math.floor(Math.random() * phrasesNow.length);
+ spanNow.textContent = phrasesNow[indexAleatoire];
+ }
+}
+
+/* === GRILLE ALBUMS (reviews/index.html) === */
+function toSlug(titre) {
+ return titre
+ .toLowerCase()
+ .normalize('NFD').replace(/[\u0300-\u036f]/g, '')
+ .replace(/\s+/g, '-')
+ .replace(/[^a-z0-9-]/g, '');
+}
+
+function chargerAlbums() {
+ fetch('data/albums.json')
+ .then(r => r.json())
+ .then(albums => {
+ const grille = document.getElementById('grille');
+
+ albums.forEach(album => {
+ const carte = document.createElement('div');
+ carte.className = 'carte';
+
+ const media = album.cover
+ ? ``
+ : `
aucune dépêche pour l\'instant.
'; + return; + } + + depeches.forEach(d => { + const el = document.createElement('div'); + el.className = 'depeche'; + + const img = d.image + ? `impossible de charger les dépêches.
'; + }); +} + +/* === INIT === */ +document.addEventListener('DOMContentLoaded', () => { + animerTitreNav(); + + if (document.querySelector('.now')) { + afficherNow(); + } + + if (document.getElementById('grille')) { + chargerAlbums(); + } + + if (document.getElementById('feed')) { + chargerDepeches(); + } +}); diff --git a/assets/styles.css b/assets/styles.css new file mode 100644 index 0000000..284d312 --- /dev/null +++ b/assets/styles.css @@ -0,0 +1,347 @@ +/* === BASE === */ +body { + font-family: 'IM Fell English', serif; + font-size: 20px; +} + +/* === ANIMATIONS === */ +@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); } +} + +/* === LAYOUT === */ +.fenetre { + max-width: 600px; + border: 1px solid black; + padding: 0.3rem 1.5rem 0 1.5rem; + padding-bottom: 0; + margin-top: 0px; + position: relative; + display: grid; + grid-template-columns: 1fr auto; + align-items: start; + gap: 1rem; + overflow-wrap: break-word; +} + +.fenetre--large { max-width: 950px; } +.fenetre--medium { max-width: 900px; } +.fenetre--small { max-width: 550px; } + +.fenetre-nom { + margin-bottom: 1px; + margin-left: 2px; +} + +.fenetre-contenu { + padding: 0 1rem 1.5rem 1rem; + min-width: 0; +} + +/* === NAVIGATION === */ +.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; +} + +.retour:hover { + text-decoration: underline; +} + +/* === COMPONENTS === */ +.now { + font-size: 0.75rem; + font-style: italic; + color: #555; + padding-top: 0.6rem; + margin-top: 0.8rem; + line-height: 1.6; + text-align: right; +} + +.index-header { + display: flex; + align-items: baseline; + justify-content: space-between; + max-width: 550px; +} + +.index-header .now { + margin-right: -3rem; +} + +.now-titre { + font-style: normal; + color: #999; + font-size: 0.7rem; + display: block; + margin-bottom: 0.2rem; +} + +.soustitre { + font-size: medium; + font-style: italic; + color: grey; +} + +.thanks { + width: 450px; +} + +/* === REVIEWS: GRILLE === */ +.grille { + display: flex; + flex-wrap: wrap; + gap: 1rem; + margin-top: 1rem; +} + +.carte { + width: 150px; + cursor: pointer; + transition: transform 0.2s ease, opacity 0.25s ease; + position: relative; +} + +.carte img { + width: 150px; + height: 150px; + object-fit: cover; + display: block; + border: 1px solid #111; +} + +.carte .placeholder { + width: 150px; + height: 150px; + background: #eee; + border: 1px solid #111; + display: flex; + align-items: center; + justify-content: center; + font-style: italic; + color: #999; + font-size: 0.8rem; + text-align: center; + padding: 0.5rem; +} + +.carte .nom { + margin-top: 0.3rem; + font-size: 0.8rem; + line-height: 1.3; +} + +.carte .nom .artiste { + font-style: italic; + color: #555; +} + +.grille.hovering .carte { + opacity: 0.15; +} + +.grille.hovering .carte.actif { + opacity: 1; + transform: scale(1.07); + z-index: 10; +} + +.badge-fav { + position: absolute; + top: 4px; + right: 4px; + font-size: 0.7rem; + background: #fff; + border: 1px solid #111; + padding: 1px 4px; + pointer-events: none; +} + +/* === REVIEWS: ALBUM PAGE === */ +.col-cover { + position: sticky; + top: 1rem; + display: flex; + flex-direction: column; + align-items: center; + gap: 0.4rem; + padding-top: 1rem; + padding-bottom: 1.5rem; +} + +.cover { + height: 280px; + width: auto; + display: block; + border: 1px solid #111; + margin-top: 1rem; +} + +.cover-legende { + font-size: 0.75rem; + font-style: italic; + color: #888; + text-align: center; +} + +.meta-ligne { + display: flex; + align-items: baseline; + flex-wrap: wrap; + gap: 0.8rem; + font-size: 0.85rem; + color: #555; + border-bottom: 1px solid #ddd; + padding-bottom: 0.6rem; + margin-bottom: 1.2rem; +} + +.note { + color: #111; + font-size: 1rem; +} + +.genre-tag { + border: 1px solid #bbb; + padding: 1px 5px; + font-style: italic; +} + +.review p { + margin-bottom: 1rem; + line-height: 1.5; +} + +.review p:last-child { + margin-bottom: 0; +} + +.nav-albums { + margin-top: 1.2rem; + padding-top: 0.6rem; + border-top: 1px solid #ddd; + display: flex; + gap: 1.5rem; + font-size: 0.9rem; +} + +.nav-albums a:hover { + border-bottom-style: dashed; +} + +/* === DEPECHES: 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; +} + +/* === PERSO IMAGES === */ +.fenetre img.perso { + height: 400px; + width: auto; + display: block; +} + +.fenetre img.perso--offset { + margin-top: 22px; +} + +/* === RESPONSIVE === */ +@media (max-width: 600px) { + body { + font-size: 17px; + } + + .fenetre { + grid-template-columns: 1fr; + } + + .fenetre img.perso, + .fenetre img.cover, + .thanks { + width: 100%; + height: auto; + } + + .col-cover { + position: static; + padding-top: 0; + } + + .index-header { + flex-direction: column; + gap: 0.3rem; + } + + .now { + text-align: left; + } +} diff --git a/blog/entries/index.html b/blog/entries/index.html index bcdf682..cc2358a 100644 --- a/blog/entries/index.html +++ b/blog/entries/index.html @@ -20,69 +20,14 @@ - - +