diff --git a/albums.php b/albums.php
index 1ee0979..6800a03 100644
--- a/albums.php
+++ b/albums.php
@@ -92,7 +92,14 @@ $config = getSiteConfig();
$image): ?>
-
+
diff --git a/fonctions.php b/fonctions.php
index 0430e6a..0b0ea48 100644
--- a/fonctions.php
+++ b/fonctions.php
@@ -139,15 +139,22 @@ function getImagesRecursively($albumPath, $limit = 4) {
if ($file->isFile()) {
$extension = strtolower($file->getExtension());
if (in_array($extension, ALLOWED_EXTENSIONS)) {
+ // Récupérer les infos du dossier parent de l'image
+ $parentDir = dirname($file->getPathname());
+ $parentInfo = getAlbumInfo($parentDir);
+
$relativePath = str_replace('\\', '/', substr($file->getPathname(), strlen(realpath('./'))));
- $images[] = $baseUrl . '/' . ltrim($relativePath, '/');
+ $images[] = [
+ 'url' => $baseUrl . '/' . ltrim($relativePath, '/'),
+ 'is_mature' => $parentInfo['mature_content']
+ ];
}
}
}
usort($images, function($a, $b) {
- $pathA = realpath('.') . str_replace(getBaseUrl(), '', $a);
- $pathB = realpath('.') . str_replace(getBaseUrl(), '', $b);
+ $pathA = realpath('.') . str_replace(getBaseUrl(), '', $a['url']);
+ $pathB = realpath('.') . str_replace(getBaseUrl(), '', $b['url']);
return filectime($pathB) - filectime($pathA);
});
diff --git a/styles.css b/styles.css
index a0447a0..450012b 100644
--- a/styles.css
+++ b/styles.css
@@ -223,6 +223,36 @@ body {
z-index: 2;
}
+.image-background {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background-size: cover;
+ background-position: center;
+ background-repeat: no-repeat;
+}
+
+.image-background.mature-preview {
+ filter: blur(10px);
+}
+
+.mature-preview-indicator {
+ position: absolute;
+ top: 5px;
+ right: 5px;
+ width: 24px;
+ height: 24px;
+ border-radius: 50%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ z-index: 10;
+ font-size: 14px;
+ text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
+}
+
.album-card {
background-color: #1e1e1e;
border-radius: 1rem;
@@ -256,6 +286,7 @@ body {
}
.album-image {
+ position: relative;
width: 100%;
height: 100%;
background-size: cover;