From 5e481ca3d70bd4370c043e70ec952a2fa5a7857c Mon Sep 17 00:00:00 2001 From: F Tempez Date: Fri, 9 Apr 2021 13:29:11 +0200 Subject: [PATCH] News OK + blur option --- module/news/news.php | 33 +++++++++++++++++++-------- module/news/ressource/defaultdata.php | 5 ++-- module/news/view/config/config.php | 19 +++++++++------ module/news/view/index/index.css | 21 ++++++++--------- 4 files changed, 48 insertions(+), 30 deletions(-) diff --git a/module/news/news.php b/module/news/news.php index e5ef6a8f..a49b8afa 100755 --- a/module/news/news.php +++ b/module/news/news.php @@ -44,7 +44,7 @@ class news extends common { public static $users = []; // Nombre d'objets par page - public static $ItemsList = [ + public static $itemsList = [ 4 => '4 articles', 8 => '8 articles', 12 => '12 articles', @@ -52,7 +52,7 @@ class news extends common { 22 => '22 articles' ]; // Nombre de colone par page - public static $Columns = [ + public static $columns = [ 12 => '1 Colonne', 6 => '2 Colonnes', 4 => '3 Colonnes', @@ -60,10 +60,18 @@ class news extends common { ]; public static $nbrCol = 1; - public static $ItemsHeight = [ - '200px' => 'Petit', - '300px' => 'Moyen', - '400px' => 'Grand' + public static $itemsHeight = [ + '200px' => 'Petite', + '300px' => 'Moyenne', + '400px' => 'Grande', + 'auto' => 'Article complet' + ]; + + public static $itemsBlur = [ + '100%' => 'Aucun', + '90%' => 'Petit', + '80%' => 'Moyen', + '70%' => 'Grand', ]; // Signature de l'article @@ -176,8 +184,11 @@ class news extends common { // Soumission du formulaire if($this->isPost()) { - // Générer la feuille de CSS + // Générer la feuille de CSS $style = '.newsContent {height:' . $this->getInput('newsConfigItemsHeight',helper::FILTER_STRING_SHORT) . ';}'; + $style .= '.newsBlur {background: linear-gradient(#333 ' . $this->getInput('newsConfigItemsBlur',helper::FILTER_STRING_SHORT) . ',#FFF );'; + $style .= ' background-clip: text;-webkit-background-clip: text;-webkit-text-fill-color: transparent;}'; + // Dossier de l'instance if (!is_dir(self::DATADIRECTORY)) { mkdir (self::DATADIRECTORY, 0777, true); @@ -189,7 +200,8 @@ class news extends common { $this->setData(['module', $this->getUrl(0), 'theme',[ 'style' => $success ? self::DATADIRECTORY . $this->getUrl(0) . '.css' : '', - 'itemsHeight' => $this->getInput('newsConfigItemsHeight',helper::FILTER_STRING_SHORT) + 'itemsHeight' => $this->getInput('newsConfigItemsHeight',helper::FILTER_STRING_SHORT), + 'itemsBlur' => $this->getInput('newsConfigItemsBlur',helper::FILTER_STRING_SHORT) ]]); $this->setData(['module', $this->getUrl(0), 'config',[ @@ -405,7 +417,7 @@ class news extends common { 'showBarEditButton' => true, 'showPageContent' => true, 'view' => 'index', - 'style' => $this->getData(['module', $this->getUrl(0),'config', 'style']) + 'style' => $this->getData(['module', $this->getUrl(0),'theme', 'style']) ]); } @@ -461,6 +473,9 @@ class news extends common { // Générer la feuille de CSS $style = '.newsContent {height: ' . $this->getData([ 'module', $moduleId, 'theme', 'itemsHeight' ]) .';}'; + $style .= '.newsBlur {background: linear-gradient(#333 ' . $this->getData([ 'module', $moduleId, 'theme', 'itemsBlur' ]) . ',#FFF );'; + $style .= ' background-clip: text;-webkit-background-clip: text;-webkit-text-fill-color: transparent;}'; + // Dossier de l'instance if (!is_dir(self::DATADIRECTORY)) { mkdir (self::DATADIRECTORY, 0777, true); diff --git a/module/news/ressource/defaultdata.php b/module/news/ressource/defaultdata.php index 25eb86e3..cf2d5649 100644 --- a/module/news/ressource/defaultdata.php +++ b/module/news/ressource/defaultdata.php @@ -3,11 +3,12 @@ class init extends search { public static $defaultData = [ 'feeds' => false, 'feedsLabel' => '', - 'itemsperPage' => 16, - 'itemsperCol' => 6, + 'itemsperPage' => 8, + 'itemsperCol' => 12, 'versionData' => '3.0' ]; public static $defaultTheme = [ 'itemsHeight' => '200px', + 'itemsBlur' => '0%' ]; } \ No newline at end of file diff --git a/module/news/view/config/config.php b/module/news/view/config/config.php index 8597e346..114beb98 100755 --- a/module/news/view/config/config.php +++ b/module/news/view/config/config.php @@ -37,27 +37,32 @@ ]); ?> -
-
- + 'Pagination', 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol']), 'help' => 'Nombre de colonnes par page' ]); ?>
-
- + 'Articles par page', 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']) ]); ?>
-
- + 'Hauteur', 'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'itemsHeight']) ]); ?>
+
+ 'Effet flou', + 'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'itemsBlur']) + ]); ?> +
diff --git a/module/news/view/index/index.css b/module/news/view/index/index.css index 01708395..04b5023c 100755 --- a/module/news/view/index/index.css +++ b/module/news/view/index/index.css @@ -23,22 +23,19 @@ }*/ .newsContent { overflow: hidden; /* les dépassements seront masqués */ - position: relative; -} - -.newsBlur { - background: linear-gradient(#333 70%,#FFF ); - background-clip: text; - -webkit-background-clip: text; - -webkit-text-fill-color: transparent; -} - - -.newsContent { + position: relative; clear: left; margin-left: 10px; margin-bottom: 5px; } +/* +.newsBlur { + background: linear-gradient(#333 90%,#FFF ); + background-clip: text; + -webkit-background-clip: text; + -webkit-text-fill-color: transparent; +}*/ + .newsSignature { margin-right: 10px;