ajout de la page de présentation des romans
This commit is contained in:
parent
f6a9f031c0
commit
5c573181c6
@ -244,6 +244,155 @@ body {
|
||||
animation-delay: calc(0.1s * var(--i, 0));
|
||||
}
|
||||
|
||||
/* Styles pour la page de présentation des romans */
|
||||
.novel-header {
|
||||
position: relative;
|
||||
background-color: var(--bg-secondary);
|
||||
height: 250px;
|
||||
padding: 0;
|
||||
margin-bottom: var(--spacing-xl);
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.novel-header-background {
|
||||
position: absolute;
|
||||
top: -5%;
|
||||
left: -5%;
|
||||
right: -5%;
|
||||
bottom: -5%;
|
||||
background-size: cover;
|
||||
background-position: center center;
|
||||
background-repeat: no-repeat;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
opacity: 0.7;
|
||||
transform: scale(1.1);
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
.novel-header::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: linear-gradient(to bottom, rgba(44, 36, 36, 0.4), rgba(44, 36, 36, 0.6));
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.novel-header h1 {
|
||||
font-family: 'Parisienne', cursive;
|
||||
font-size: 3.5rem;
|
||||
color: var(--text-primary);
|
||||
max-width: var(--content-width);
|
||||
margin: 0 auto;
|
||||
padding: 0 var(--spacing-md);
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
width: 100%;
|
||||
z-index: 2;
|
||||
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.novel-content {
|
||||
max-width: var(--content-width);
|
||||
margin: 0 auto;
|
||||
padding: 0 var(--spacing-md);
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 300px;
|
||||
gap: var(--spacing-xl);
|
||||
}
|
||||
|
||||
.novel-description {
|
||||
background: var(--bg-tertiary);
|
||||
padding: var(--spacing-lg);
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.novel-description img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
margin: var(--spacing-md) 0;
|
||||
border-radius: var(--radius-sm);
|
||||
}
|
||||
|
||||
.chapters-menu {
|
||||
background: var(--bg-tertiary);
|
||||
padding: var(--spacing-lg);
|
||||
border-radius: var(--radius-md);
|
||||
border: 1px solid var(--border-color);
|
||||
position: sticky;
|
||||
top: var(--spacing-lg);
|
||||
align-self: start;
|
||||
}
|
||||
|
||||
.chapters-menu h2 {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: var(--spacing-md);
|
||||
color: var(--text-primary);
|
||||
padding-bottom: var(--spacing-sm);
|
||||
border-bottom: 2px solid var(--accent-primary);
|
||||
}
|
||||
|
||||
.chapters-list {
|
||||
list-style: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.chapters-list li {
|
||||
margin-bottom: var(--spacing-sm);
|
||||
}
|
||||
|
||||
.chapters-list a {
|
||||
display: block;
|
||||
padding: var(--spacing-sm);
|
||||
color: var(--text-primary);
|
||||
text-decoration: none;
|
||||
border-radius: var(--radius-sm);
|
||||
transition: var(--transition);
|
||||
}
|
||||
|
||||
.chapters-list a:hover {
|
||||
background: var(--bg-secondary);
|
||||
color: var(--accent-primary);
|
||||
}
|
||||
|
||||
.chapters-list .current-chapter {
|
||||
background: var(--accent-primary);
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
.chapters-list .current-chapter:hover {
|
||||
background: var(--accent-secondary);
|
||||
color: var(--text-tertiary);
|
||||
}
|
||||
|
||||
/* Lien de retour */
|
||||
.back-to-home {
|
||||
max-width: var(--content-width);
|
||||
margin: var(--spacing-xl) auto;
|
||||
padding: 0 var(--spacing-md);
|
||||
}
|
||||
|
||||
.back-to-home a {
|
||||
display: inline-block;
|
||||
color: var(--text-secondary);
|
||||
text-decoration: none;
|
||||
transition: var(--transition);
|
||||
}
|
||||
|
||||
.back-to-home a:hover {
|
||||
color: var(--accent-primary);
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 1200px) {
|
||||
:root {
|
||||
@ -251,6 +400,21 @@ body {
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.novel-content {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
|
||||
.chapters-menu {
|
||||
position: static;
|
||||
margin-top: var(--spacing-xl);
|
||||
}
|
||||
|
||||
.novel-header h1 {
|
||||
font-size: 2.5rem;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.site-header {
|
||||
flex-direction: column;
|
||||
|
75
roman.php
Normal file
75
roman.php
Normal file
@ -0,0 +1,75 @@
|
||||
<?php
|
||||
require_once 'includes/config.php';
|
||||
require_once 'includes/stories.php';
|
||||
|
||||
// Récupération de l'ID du roman depuis l'URL
|
||||
$storyId = $_GET['id'] ?? '';
|
||||
if (!$storyId) {
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
// Chargement du roman
|
||||
$story = Stories::get($storyId);
|
||||
if (!$story) {
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$config = Config::load();
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?= htmlspecialchars($story['title']) ?> - <?= htmlspecialchars($config['site']['name']) ?></title>
|
||||
|
||||
<?php if (file_exists(__DIR__ . '/assets/images/site/favicon.png')): ?>
|
||||
<link rel="icon" type="image/png" href="assets/images/site/favicon.png">
|
||||
<?php endif; ?>
|
||||
|
||||
<link rel="stylesheet" href="assets/css/public.css">
|
||||
|
||||
<meta name="description" content="<?= htmlspecialchars(strip_tags($story['description'])) ?>">
|
||||
</head>
|
||||
<body>
|
||||
<!-- En-tête avec image de fond -->
|
||||
<header class="novel-header">
|
||||
<?php if (!empty($story['cover'])): ?>
|
||||
<div class="novel-header-background" style="background-image: url('<?= htmlspecialchars($story['cover']) ?>');"></div>
|
||||
<?php endif; ?>
|
||||
<h1><?= htmlspecialchars($story['title']) ?></h1>
|
||||
</header>
|
||||
|
||||
<!-- Contenu principal -->
|
||||
<div class="novel-content">
|
||||
<div class="novel-description">
|
||||
<?= $story['description'] ?>
|
||||
</div>
|
||||
|
||||
<aside class="chapters-menu">
|
||||
<h2>Chapitres</h2>
|
||||
<?php if (!empty($story['chapters'])): ?>
|
||||
<ul class="chapters-list">
|
||||
<?php foreach ($story['chapters'] as $index => $chapter): ?>
|
||||
<li>
|
||||
<a href="chapitre.php?story=<?= urlencode($story['id']) ?>&chapter=<?= urlencode($chapter['id']) ?>">
|
||||
<?= htmlspecialchars($chapter['title']) ?>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php else: ?>
|
||||
<p>Aucun chapitre disponible pour le moment.</p>
|
||||
<?php endif; ?>
|
||||
</aside>
|
||||
</div>
|
||||
|
||||
<?php if (!empty($config['site']['name'])): ?>
|
||||
<div class="back-to-home">
|
||||
<a href="index.php">← Retour à l'accueil</a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user