improve code formatting and whitespace consistency

This commit is contained in:
2025-07-17 15:09:01 +04:00
parent 1809af1ad6
commit 5bb4c4cec3
2 changed files with 117 additions and 118 deletions
+44 -44
View File
@@ -14,7 +14,7 @@ setSecurityHeaders();
<link rel="stylesheet" href="css/styles.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<link rel="stylesheet" href="css/mastodon-timeline.min.css">
<!-- Favicons -->
<link rel="apple-touch-icon" sizes="180x180" href="img/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="img/favicon-32x32.png">
@@ -32,10 +32,10 @@ setSecurityHeaders();
<div class="hero-mastodon-wrapper">
<!-- Hero Banner -->
<div class="hero">
<?php
<?php
// Vérifier s'il y a un direct en cours
$liveStream = getLiveStream();
if ($liveStream) {
// Afficher le direct en cours
?>
@@ -43,9 +43,9 @@ setSecurityHeaders();
<i class="fas fa-circle"></i> DIRECT
</div>
<div class="hero-video-container">
<iframe
src="<?php echo PEERTUBE_URL; ?>/videos/embed/<?php echo $liveStream['id']; ?>?autoplay=1&muted=1"
frameborder="0"
<iframe
src="<?php echo PEERTUBE_URL; ?>/videos/embed/<?php echo $liveStream['id']; ?>?autoplay=1&muted=1"
frameborder="0"
allowfullscreen="allowfullscreen"
allow="autoplay; fullscreen"
title="<?php echo htmlspecialchars($liveStream['title']); ?>">
@@ -64,7 +64,7 @@ setSecurityHeaders();
<span class="channel-name"><?php echo $liveStream['channel']; ?></span>
</div>
</div>
<?php
<?php
} else {
// Aucun direct en cours
?>
@@ -88,24 +88,24 @@ setSecurityHeaders();
</div>
</div>
<!-- Hashtags en ligne -->
<div class="tags-section">
<?php
<?php
if (defined('POPULAR_TAGS') && !empty(POPULAR_TAGS)):
foreach (POPULAR_TAGS as $tag):
$encodedTag = urlencode('#' . $tag);
?>
<a href="recherche.php?q=<?php echo $encodedTag; ?>" class="tag">#<?php echo htmlspecialchars($tag); ?></a>
<?php
<?php
endforeach;
endif;
?>
</div>
<!-- Séparateur stylisé -->
<hr class="section-divider">
<!-- Section Shorts -->
<div class="video-section">
<div class="section-header">
@@ -114,13 +114,13 @@ setSecurityHeaders();
</div>
<h2 class="section-title">Shorts</h2>
</div>
<div class="carousel">
<div class="carousel-container">
<?php
<?php
// Récupérer les shorts depuis l'API PeerTube
$shorts = getShorts();
// Traiter le cas où aucun short n'est trouvé
if (empty($shorts)) {
echo '<div class="no-results">Aucun short disponible pour le moment</div>';
@@ -137,12 +137,12 @@ setSecurityHeaders();
</div>
</div>
</div>
<?php
<?php
endforeach;
}
?>
</div>
<?php if (!empty($shorts) && count($shorts) > 1): ?>
<div class="carousel-controls">
<?php for ($i = 0; $i < count($shorts); $i++): ?>
@@ -152,10 +152,10 @@ setSecurityHeaders();
<?php endif; ?>
</div>
</div>
<!-- Séparateur stylisé -->
<hr class="section-divider">
<!-- Section Dernières vidéos -->
<div class="video-section">
<div class="section-header">
@@ -164,12 +164,12 @@ setSecurityHeaders();
</div>
<h2 class="section-title">Dernières vidéos</h2>
</div>
<div class="video-grid">
<?php
// Récupérer les vidéos récentes depuis l'API PeerTube
$recentVideos = getRecentVideos();
// Traiter le cas où aucune vidéo n'est trouvée
if (empty($recentVideos)) {
echo '<div class="no-results">Aucune vidéo disponible pour le moment</div>';
@@ -202,18 +202,18 @@ setSecurityHeaders();
</div>
</div>
</div>
<?php
<?php
endforeach;
}
?>
</div>
<button class="view-more">Voir plus</button>
</div>
<!-- Séparateur stylisé -->
<hr class="section-divider">
<!-- Section Tendances -->
<div class="video-section">
<div class="section-header">
@@ -222,12 +222,12 @@ setSecurityHeaders();
</div>
<h2 class="section-title">Tendances</h2>
</div>
<div class="video-grid">
<?php
// Récupérer les vidéos tendances depuis l'API PeerTube
$trendingVideos = getTrendingVideos();
// Traiter le cas où aucune vidéo n'est trouvée
if (empty($trendingVideos)) {
echo '<div class="no-results">Aucune vidéo disponible pour le moment</div>';
@@ -260,23 +260,23 @@ setSecurityHeaders();
</div>
</div>
</div>
<?php
<?php
endforeach;
}
?>
</div>
<button class="view-more">Voir plus</button>
</div>
<!-- Séparateur stylisé -->
<hr class="section-divider">
<!-- Sections par catégorie -->
<?php
// Récupérer les catégories avec leurs vidéos
$displayCategories = getDisplayCategories();
// Afficher chaque catégorie qui a des vidéos
foreach ($displayCategories as $category):
if (!empty($category['videos'])):
@@ -289,7 +289,7 @@ setSecurityHeaders();
</div>
<h2 class="section-title"><?php echo $category['name']; ?></h2>
</div>
<div class="video-grid">
<?php foreach ($category['videos'] as $video): ?>
<div class="video-card" data-video-id="<?php echo $video['id']; ?>">
@@ -320,25 +320,25 @@ setSecurityHeaders();
</div>
<?php endforeach; ?>
</div>
<button class="view-more">Voir plus</button>
</div>
<!-- Séparateur stylisé -->
<hr class="section-divider">
<?php
<?php
endif;
endforeach;
?>
<!-- Section Flexbox pour Informations et Tendances Hashtags -->
<div class="info-tags-container">
<?php if (defined('MOVEMENT_DESCRIPTION') && !empty(MOVEMENT_DESCRIPTION)): ?>
<!-- Section Informations -->
<div class="info-section">
<h2 class="info-header"><?php echo MOVEMENT_DESCRIPTION; ?></h2>
<?php if (defined('MOVEMENT_IMAGE') && !empty(MOVEMENT_IMAGE)): ?>
<figure class="movement-figure">
<img src="<?php echo MOVEMENT_IMAGE; ?>" alt="<?php echo defined('MOVEMENT_IMAGE_ALT') ? MOVEMENT_IMAGE_ALT : ''; ?>" class="info-image">
@@ -351,19 +351,19 @@ setSecurityHeaders();
<?php endif; ?>
</div>
<?php endif; ?>
<!-- Section Tendances Hashtags -->
<div class="tags-section-container">
<h2 class="section-title centered">Tendances</h2>
<div class="tags-section">
<?php
<?php
if (defined('POPULAR_TAGS') && !empty(POPULAR_TAGS)):
foreach (POPULAR_TAGS as $tag):
$encodedTag = urlencode('#' . $tag);
?>
<a href="recherche.php?q=<?php echo $encodedTag; ?>" class="tag">#<?php echo htmlspecialchars($tag); ?></a>
<?php
<?php
endforeach;
endif;
?>
@@ -378,4 +378,4 @@ setSecurityHeaders();
<script src="js/mastodon-timeline.umd.js"></script>
<script src="js/mastodon-config.php"></script>
</body>
</html>
</html>