News OK + blur option

This commit is contained in:
F Tempez 2021-04-09 13:29:11 +02:00
parent 1f32a6e7cc
commit 5e481ca3d7
4 changed files with 48 additions and 30 deletions

View File

@ -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);

View File

@ -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%'
];
}

View File

@ -37,27 +37,32 @@
]); ?>
</div>
</div>
<!-- Block ajouté pour le sélecteur -->
<div class="row">
<div class="col4">
<?php echo template::select('newsConfigItemsperCol', $module::$Columns, [
<div class="col3">
<?php echo template::select('newsConfigItemsperCol', $module::$columns, [
'label' => 'Pagination',
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol']),
'help' => 'Nombre de colonnes par page'
]); ?>
</div>
<div class="col4">
<?php echo template::select('newsConfigItemsperPage', $module::$ItemsList, [
<div class="col3">
<?php echo template::select('newsConfigItemsperPage', $module::$itemsList, [
'label' => 'Articles par page',
'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('newsConfigItemsHeight', $module::$ItemsHeight, [
<div class="col3">
<?php echo template::select('newsConfigItemsHeight', $module::$itemsHeight, [
'label' => 'Hauteur',
'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'itemsHeight'])
]); ?>
</div>
<div class="col3">
<?php echo template::select('newsConfigItemsBlur', $module::$itemsBlur, [
'label' => 'Effet flou',
'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'itemsBlur'])
]); ?>
</div>
</div>
</div>
</div>

View File

@ -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;