' . $titre . '
'; + + // Si les tags ne sont pas vides alors afficher + if (!empty($tags)) { + echo ''; + } + + // Ajout de la description et fin des classes + echo '' . $description . '
'; + echo 'diff --git a/functions/listProject.php b/functions/listProject.php index df03a4d..42422e7 100644 --- a/functions/listProject.php +++ b/functions/listProject.php @@ -1,23 +1,77 @@ prepare('SELECT * FROM projects'); + // Essayer + try { + // Requête SQL qui récupère titre, tags, description, image_url + $stmt = $dbh->prepare('SELECT title, tags, description, image_url FROM projects'); + // Execution de la requête SQL + $stmt->execute(); + // Retourne toutes les données collectés dans un ARRAY + return $stmt->fetchAll(PDO::FETCH_ASSOC); + } catch (PDOException $e) { // En cas d'erreur + die("Erreur de connexion à la base de donnée portfolio :".$e->getMessage()); + return []; + } +} - // Execution de la requête - $stmt->execute(); - // On pourra même prévoir plus tard grâce à cette requête préparer d'ajouter des filtrages pour la liste (ex : En cours/Défjà fini etc...) +// Fonction qui va afficher les projets +function afficherProjets() { + // Récupération de la liste des projets + $projets = listeProjets(); - // On sauvegarde les données renvoyées - $donneerenvoyee = $stmt->fetch(); + // Ajout de la class pour la liste des projets FUTUR CSS + echo '
' . $description . '
'; + echo 'Liste des projets
+Liste des projets
\ No newline at end of file diff --git a/styles/primary_css.css b/styles/primary_css.css index 25c0543..b46fabd 100644 --- a/styles/primary_css.css +++ b/styles/primary_css.css @@ -120,7 +120,7 @@ nav a { padding: 40px 20px; } -.project-card { +.project-form-card { background-color: #111116; /* Fond très sombre comme sur l'image */ border: 1px dashed #3a3a5e; /* Bordure pointillée */ border-radius: 12px; @@ -164,9 +164,9 @@ nav a { } /* Inputs reprenant ton style login */ -.project-card input[type="text"], -.project-card input[type="url"], -.project-card textarea { +.project-form-card input[type="text"], +.project-form-card input[type="url"], +.project-form-card textarea { width: 100%; background-color: #1a1a24; border: 1px solid #2a2a3e; @@ -209,4 +209,73 @@ nav a { .btn-submit:hover { background-color: #5a52e0; +} + +.projects-title { + color: white; + font-size: 22px; + font-weight: bold; + margin: 0; + padding: 0 40px 20px 40px; +} + +.projects-list { + display: grid; + grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); + gap: 24px; + padding: 0 40px 40px 40px; +} + +.projects-list .project-card { + background-color: #111116; + border: 1px solid #2a2a3e; + border-radius: 16px; + overflow: hidden; + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); + transition: transform 0.2s ease, box-shadow 0.2s ease; +} + +.projects-list .project-card:hover { + transform: translateY(-4px); + box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35); +} + +.project-banner img { + width: 100%; + height: 220px; + object-fit: cover; + display: block; +} + +.project-content { + padding: 20px; +} + +.project-content h2 { + margin: 0 0 12px; + font-size: 22px; + color: white; +} + +.project-content p { + margin: 0; + color: #b8b8c7; + line-height: 1.6; +} + +.project-tags { + display: flex; + flex-wrap: wrap; + gap: 10px; + margin-bottom: 16px; +} + +.tag { + background-color: rgba(108, 99, 255, 0.15); + color: #8f88ff; + border: 1px solid rgba(108, 99, 255, 0.35); + padding: 6px 12px; + border-radius: 999px; + font-size: 13px; + font-weight: bold; } \ No newline at end of file