From 6f9e20283fc237617d81c45752e1c384e8b32146 Mon Sep 17 00:00:00 2001 From: Esenjin Date: Sat, 11 Jan 2025 16:59:30 +0100 Subject: [PATCH] =?UTF-8?q?les=20vignettes=20des=20albums=20matures=20sont?= =?UTF-8?q?=20toujours=20flout=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- albums.php | 9 ++++++++- fonctions.php | 13 ++++++++++--- styles.css | 31 +++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 4 deletions(-) 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;