Scan to open on your phone
Point a camera at the QR code - it opens this exact paste, no app needed.
https://codepastes.com/zzgsn05a8ga7kz4ssans-titrePlain Text
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Le Musée des citations</title>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
font-family: Georgia, "Times New Roman", serif;
background: #eee5d5;
color: #30251d;
}
header {
text-align: center;
padding: 55px 20px 40px;
background: #30251d;
color: #f7e8c9;
border-bottom: 8px solid #b58b50;
}
header h1 {
font-size: clamp(32px, 6vw, 58px);
margin: 0 0 12px;
letter-spacing: 2px;
}
header p {
font-style: italic;
font-size: 18px;
}
main {
max-width: 1150px;
margin: auto;
padding: 30px 20px;
}
.formulaire {
background: #fffaf0;
padding: 24px;
border: 1px solid #c6a875;
border-radius: 8px;
margin-bottom: 35px;
box-shadow: 0 5px 15px #0000000d;
}
.formulaire h2 {
margin-top: 0;
}
input, textarea, button {
width: 100%;
padding: 12px;
margin: 7px 0;
font: inherit;
border-radius: 4px;
}
input, textarea {
border: 1px solid #cbbda7;
background: white;
color: #30251d;
}
textarea {
min-height: 90px;
resize: vertical;
}
button {
border: none;
background: #76502f;
color: white;
cursor: pointer;
transition: 0.2s;
}
button:hover {
background: #4b3421;
}
.galerie {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
gap: 30px;
}
.cadre {
padding: 12px;
background: linear-gradient(135deg, #d7b77e, #f4dfae, #9c7039);
box-shadow: 0 8px 18px #39251630;
transition: transform 0.25s;
}
.cadre:hover {
transform: translateY(-5px);
}
.toile {
background: #fffaf0;
min-height: 235px;
padding: 25px 20px;
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
border: 1px solid #d7c6a6;
}
.guillemet {
font-size: 48px;
color: #b58b50;
line-height: 1;
}
.citation {
font-size: 20px;
line-height: 1.5;
overflow-wrap: anywhere;
}
.auteur {
margin-top: 18px;
font-size: 15px;
font-style: italic;
color: #795a37;
}
.actions {
display: flex;
gap: 8px;
margin-top: 10px;
}
.actions button {
font-family: Arial, sans-serif;
font-size: 13px;
margin: 0;
}
.actions .supprimer {
background: #8d3930;
}
footer {
text-align: center;
padding: 30px 15px;
color: #765d43;
font-style: italic;
}
</style>
</head>
<body>
<header>
<h1>Le Musée des citations</h1>
<p>« Les mots sont des œuvres d'art. »</p>
<p>Une galerie de pensées, d'émotions et d'inspiration.</p>
</header>
<main>
<section class="formulaire">
<h2>Ajouter une œuvre à la collection</h2>
<form id="formCitation">
<textarea id="texte" placeholder="Écris ta citation ici..." required></textarea>
<input id="auteur" placeholder="Auteur de la citation" required>
<button type="submit">+ Ajouter au musée</button>
</form>
</section>
<h2>La collection permanente</h2>
<div class="galerie" id="galerie"></div>
</main>
<footer>
Chaque citation est une œuvre. Chaque mot raconte une histoire.
</footer>
<script>
const citationsInitiales = [
{
texte: "La vie est un mystère qu'il faut vivre, et non un problème à résoudre.",
auteur: "Gandhi"
},
{
texte: "Le seul véritable voyage ne serait pas d'aller vers de nouveaux paysages, mais d'avoir d'autres yeux.",
auteur: "Marcel Proust"
},
{
texte: "On ne voit bien qu'avec le cœur. L'essentiel est invisible pour les yeux.",
auteur: "Antoine de Saint-Exupéry"
}
];
let citations = [...citationsInitiales];
const galerie = document.getElementById("galerie");
const formulaire = document.getElementById("formCitation");
function afficherCitations() {
galerie.replaceChildren();
citations.forEach((citation, index) => {
const cadre = document.createElement("article");
cadre.className = "cadre";
const toile = document.createElement("div");
toile.className = "toile";
const guillemet = document.createElement("div");
guillemet.className = "guillemet";
guillemet.textContent = "“";
const texte = document.createElement("div");
texte.className = "citation";
texte.textContent = citation.texte;
const auteur = document.createElement("div");
auteur.className = "auteur";
auteur.textContent = "— " + citation.auteur;
toile.append(guillemet, texte, auteur);
const actions = document.createElement("div");
actions.className = "actions";
const supprimer = document.createElement("button");
supprimer.className = "supprimer";
supprimer.textContent = "Retirer du musée";
supprimer.type = "button";
supprimer.addEventListener("click", () => {
citations.splice(index, 1);
afficherCitations();
});
actions.append(supprimer);
cadre.append(toile, actions);
galerie.append(cadre);
});
}
formulaire.addEventListener("submit", function(event) {
event.preventDefault();
const texte = document.getElementById("texte").value.trim();
const auteur = document.getElementById("auteur").value.trim();
if (!texte || !auteur) return;
citations.unshift({ texte, auteur });
afficherCitations();
formulaire.reset();
});
afficherCitations();
</script>
</body>
</html>
5,229 chars · codepastes.com