feat: add COUNTDOWN_TIMEZONES to countdown
This commit is contained in:
+39
-2
@@ -98,8 +98,45 @@ setSecurityHeaders();
|
||||
<p>La plateforme ouvrira ses portes le <strong><?php
|
||||
$targetDate = new DateTime(COUNTDOWN_TARGET_DATE);
|
||||
setlocale(LC_TIME, 'fr_FR.UTF-8');
|
||||
echo strftime('%e %B %Y', $targetDate->getTimestamp());
|
||||
?></strong>.</p>
|
||||
echo strftime('%e %B %Y à %H:%M', $targetDate->getTimestamp());
|
||||
?></strong> (heure de La Réunion).</p>
|
||||
|
||||
<!-- Heures des autres territoires -->
|
||||
<div class="countdown-other-timezones">
|
||||
<?php
|
||||
$timezones = defined('COUNTDOWN_TIMEZONES') ? COUNTDOWN_TIMEZONES : [
|
||||
'Martinique/Guadeloupe' => 'America/Martinique',
|
||||
'Guyane' => 'America/Cayenne',
|
||||
'France' => 'Europe/Paris',
|
||||
'Ma\'ohi Nui' => 'Pacific/Tahiti',
|
||||
'Kanaky' => 'Pacific/Noumea'
|
||||
];
|
||||
|
||||
foreach($timezones as $name => $timezone):
|
||||
$targetDateLocal = new DateTime(COUNTDOWN_TARGET_DATE, new DateTimeZone('Indian/Reunion'));
|
||||
$targetDateLocal->setTimezone(new DateTimeZone($timezone));
|
||||
|
||||
// Vérifier si c'est un jour différent
|
||||
$reunionDate = new DateTime(COUNTDOWN_TARGET_DATE);
|
||||
$dayDiff = $targetDateLocal->format('j') - $reunionDate->format('j');
|
||||
|
||||
$dayIndicator = '';
|
||||
if ($dayDiff > 0) {
|
||||
$dayIndicator = ' <span class="day-indicator next-day">+1j</span>';
|
||||
} elseif ($dayDiff < 0) {
|
||||
$dayIndicator = ' <span class="day-indicator prev-day">-1j</span>';
|
||||
}
|
||||
?>
|
||||
<div class="timezone-item">
|
||||
<span class="timezone-name"><?php echo $name; ?></span>
|
||||
<span class="timezone-time">
|
||||
<?php echo $targetDateLocal->format('H:i'); ?>
|
||||
<?php echo $dayIndicator; ?>
|
||||
</span>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
<p>Restez connectés et suivez-nous sur nos réseaux sociaux !</p>
|
||||
</div>
|
||||
|
||||
|
||||
+130
-2
@@ -32,14 +32,14 @@
|
||||
.countdown-title {
|
||||
font-size: 3rem;
|
||||
font-weight: bold;
|
||||
margin-bottom: 20px;
|
||||
margin-bottom: 10px;
|
||||
color: #FF0000;
|
||||
text-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.countdown-subtitle {
|
||||
font-size: 1.5rem;
|
||||
margin-bottom: 50px;
|
||||
margin-bottom: 20px;
|
||||
color: #ffffff;
|
||||
opacity: 0.9;
|
||||
}
|
||||
@@ -92,6 +92,89 @@
|
||||
line-height: 1.6;
|
||||
}
|
||||
|
||||
.countdown-other-timezones {
|
||||
margin: 25px 0;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 12px;
|
||||
max-width: 800px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
|
||||
.timezone-item {
|
||||
background: linear-gradient(135deg, rgba(255, 0, 0, 0.15) 0%, rgba(255, 0, 0, 0.05) 100%);
|
||||
padding: 12px 16px;
|
||||
border-radius: 12px;
|
||||
font-size: 0.95rem;
|
||||
color: #ffffff;
|
||||
backdrop-filter: blur(15px);
|
||||
border: 1px solid rgba(255, 0, 0, 0.3);
|
||||
text-align: center;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.timezone-item::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: -100%;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
|
||||
transition: left 0.5s ease;
|
||||
}
|
||||
|
||||
.timezone-item:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(255, 0, 0, 0.2);
|
||||
border-color: rgba(255, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.timezone-item:hover::before {
|
||||
left: 100%;
|
||||
}
|
||||
|
||||
.timezone-name {
|
||||
display: block;
|
||||
font-weight: bold;
|
||||
color: #FF0000;
|
||||
margin-bottom: 4px;
|
||||
font-size: 0.85rem;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
}
|
||||
|
||||
.timezone-time {
|
||||
display: block;
|
||||
font-size: 1.1rem;
|
||||
font-weight: bold;
|
||||
text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
.day-indicator {
|
||||
font-size: 0.75rem;
|
||||
font-weight: bold;
|
||||
padding: 2px 6px;
|
||||
border-radius: 10px;
|
||||
margin-left: 5px;
|
||||
text-shadow: none;
|
||||
}
|
||||
|
||||
.day-indicator.next-day {
|
||||
background: rgba(0, 255, 0, 0.2);
|
||||
color: #00ff88;
|
||||
border: 1px solid rgba(0, 255, 0, 0.4);
|
||||
}
|
||||
|
||||
.day-indicator.prev-day {
|
||||
background: rgba(255, 165, 0, 0.2);
|
||||
color: #ffaa00;
|
||||
border: 1px solid rgba(255, 165, 0, 0.4);
|
||||
}
|
||||
|
||||
.countdown-social {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
@@ -156,6 +239,28 @@
|
||||
width: 100px;
|
||||
}
|
||||
|
||||
.countdown-other-timezones {
|
||||
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.timezone-item {
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
||||
.timezone-name {
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
.timezone-time {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.day-indicator {
|
||||
font-size: 0.65rem;
|
||||
padding: 1px 4px;
|
||||
}
|
||||
|
||||
.countdown-social {
|
||||
gap: 15px;
|
||||
}
|
||||
@@ -182,6 +287,29 @@
|
||||
.countdown-label {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
.countdown-other-timezones {
|
||||
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.timezone-item {
|
||||
padding: 8px 10px;
|
||||
}
|
||||
|
||||
.timezone-name {
|
||||
font-size: 0.7rem;
|
||||
}
|
||||
|
||||
.timezone-time {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
|
||||
.day-indicator {
|
||||
font-size: 0.6rem;
|
||||
padding: 1px 3px;
|
||||
margin-left: 3px;
|
||||
}
|
||||
}
|
||||
|
||||
/* Animation d'entrée */
|
||||
|
||||
@@ -112,4 +112,25 @@ if (!defined('POPULAR_TAGS')) {
|
||||
'Océan Indien'
|
||||
]);
|
||||
}
|
||||
|
||||
// =========================================
|
||||
// Système de compte à rebours / maintenance
|
||||
// =========================================
|
||||
|
||||
// Activer le mode compte à rebours (true/false) - valeur par défaut
|
||||
if (!defined('COUNTDOWN_ENABLED')) define('COUNTDOWN_ENABLED', false);
|
||||
|
||||
// Date de fin du compte à rebours par défaut (format: Y-m-d H:i:s)
|
||||
if (!defined('COUNTDOWN_TARGET_DATE')) define('COUNTDOWN_TARGET_DATE', '2025-10-11 00:00:00');
|
||||
|
||||
// Territoires et fuseaux horaires par défaut pour la page de compte à rebours
|
||||
if (!defined('COUNTDOWN_TIMEZONES')) {
|
||||
define('COUNTDOWN_TIMEZONES', [
|
||||
'Martinique/Guadeloupe' => 'America/Martinique',
|
||||
'Guyane' => 'America/Cayenne',
|
||||
'France' => 'Europe/Paris',
|
||||
'Ma\'ohi Nui' => 'Pacific/Tahiti',
|
||||
'Kanaky' => 'Pacific/Noumea'
|
||||
]);
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -243,6 +243,14 @@ define('COUNTDOWN_ENABLED', false);
|
||||
// Date de fin du compte à rebours (format: Y-m-d H:i:s)
|
||||
define('COUNTDOWN_TARGET_DATE', '2025-10-11 00:00:00');
|
||||
|
||||
// Territoires et fuseaux horaires à afficher sur la page de compte à rebours
|
||||
define('COUNTDOWN_TIMEZONES', [
|
||||
'Martinique/Guadeloupe' => 'America/Martinique',
|
||||
'Guyane' => 'America/Cayenne',
|
||||
'France' => 'Europe/Paris',
|
||||
'Ma\'ohi Nui' => 'Pacific/Tahiti',
|
||||
'Kanaky' => 'Pacific/Noumea'
|
||||
]);
|
||||
|
||||
// =========================================
|
||||
// Texte de présentation du mouvement
|
||||
|
||||
Reference in New Issue
Block a user