feat: add dark mode and switch button

This commit is contained in:
2025-07-22 12:57:49 +04:00
parent dd9dc6790c
commit f36d565ae2
11 changed files with 328 additions and 101 deletions
+13
View File
@@ -77,6 +77,19 @@ if ($categoryId && isset($allCategories[$categoryId])) {
$breadcrumbJsonLd = generateBreadcrumbJsonLd($breadcrumbs); $breadcrumbJsonLd = generateBreadcrumbJsonLd($breadcrumbs);
outputJsonLd($breadcrumbJsonLd); outputJsonLd($breadcrumbJsonLd);
?> ?>
<!-- Script pour éviter le flash en mode sombre -->
<script>
(function() {
const savedTheme = localStorage.getItem('theme');
const systemPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
const shouldUseDark = savedTheme === 'dark' || (!savedTheme && systemPrefersDark);
if (shouldUseDark) {
document.documentElement.setAttribute('data-theme', 'dark');
}
})();
</script>
</head> </head>
<body> <body>
<?php include 'includes/sidebar.php'; ?> <?php include 'includes/sidebar.php'; ?>
+1 -1
View File
@@ -136,7 +136,7 @@
.tag { .tag {
font-size: 12px; font-size: 12px;
color: #0d6efd; color: var(--primary-red);
} }
.no-results, .search-instructions { .no-results, .search-instructions {
+105 -18
View File
@@ -26,12 +26,35 @@
--footer-bg: #f0f0f0; --footer-bg: #f0f0f0;
--main-bg: #ffffff; --main-bg: #ffffff;
--text-color: #000000; --text-color: #000000;
--text-secondary: #666666;
--tag-bg: #f8f8f8; --tag-bg: #f8f8f8;
--tag-border: #e0e0e0; --tag-border: #e0e0e0;
--search-bg: #e0e0e0; --search-bg: #e0e0e0;
--card-bg: #ffffff; --card-bg: #ffffff;
--card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
--divider-color: #e5e5e5; --divider-color: #e5e5e5;
--border-color: #e0e0e0;
--hover-bg: rgba(0, 0, 0, 0.05);
}
/* Dark theme */
[data-theme="dark"] {
--primary-red: #FF4444;
--primary-green: #00AA00;
--primary-black: #ffffff;
--sidebar-bg: #1e1e1e;
--footer-bg: #1a1a1a;
--main-bg: #121212;
--text-color: #ffffff;
--text-secondary: #b3b3b3;
--tag-bg: #2d2d2d;
--tag-border: #404040;
--search-bg: #333333;
--card-bg: #1e1e1e;
--card-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
--divider-color: #404040;
--border-color: #404040;
--hover-bg: rgba(255, 255, 255, 0.1);
} }
body { body {
@@ -86,6 +109,14 @@ select:focus {
--tag-bg: #E8E8E8; --tag-bg: #E8E8E8;
--search-bg: #D0D0D0; --search-bg: #D0D0D0;
} }
[data-theme="dark"] {
--text-color: #ffffff;
--primary-red: #FF6666;
--card-bg: #000000;
--sidebar-bg: #111111;
--main-bg: #000000;
}
} }
img { img {
@@ -143,7 +174,7 @@ img {
} }
.nav-item:hover { .nav-item:hover {
background-color: rgba(0, 0, 0, 0.05); background-color: var(--hover-bg);
} }
/* PWA Install Button */ /* PWA Install Button */
@@ -412,6 +443,50 @@ img {
color: var(--text-color); color: var(--text-color);
} }
/* Theme toggle button */
#theme-toggle {
transition: transform 0.3s ease, background-color 0.3s ease;
}
#theme-toggle:hover {
background-color: var(--hover-bg);
border-radius: 50%;
transform: scale(1.1);
}
#theme-toggle:active {
transform: scale(0.95);
}
/* Theme transition for smooth switching */
* {
transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
/* Dark theme specific adjustments */
[data-theme="dark"] .mt-container {
--mt-color-bg: var(--card-bg);
--mt-color-content-txt: var(--text-color);
}
[data-theme="dark"] img {
opacity: 0.9;
}
[data-theme="dark"] .video-thumbnail img {
opacity: 0.85;
}
[data-theme="dark"] .video-thumbnail:hover img {
opacity: 1;
}
/* Améliorer le contraste des icônes en mode sombre */
[data-theme="dark"] .fa-play-circle {
color: rgba(255, 255, 255, 0.9);
text-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}
/* Priorité plus élevée pour les couleurs des réseaux sociaux */ /* Priorité plus élevée pour les couleurs des réseaux sociaux */
.icon-button i.icon-facebook, .icon-button i.icon-facebook,
.icon-button i.icon-youtube, .icon-button i.icon-youtube,
@@ -666,11 +741,11 @@ img {
border-radius: 50px; border-radius: 50px;
font-size: 15px; font-size: 15px;
font-weight: 600; font-weight: 600;
background: linear-gradient(135deg, var(--tag-bg), #f0f0f0); background: var(--tag-bg);
cursor: pointer; cursor: pointer;
transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94); transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
text-decoration: none; text-decoration: none;
color: #222; color: var(--text-color);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08); box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
position: relative; position: relative;
overflow: hidden; overflow: hidden;
@@ -819,7 +894,7 @@ img {
.video-channel { .video-channel {
font-size: 14px; font-size: 14px;
color: #555; color: var(--text-secondary);
margin-bottom: 8px; margin-bottom: 8px;
display: flex; display: flex;
align-items: center; align-items: center;
@@ -846,7 +921,7 @@ img {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
background-color: #e5e5e5; background-color: #e5e5e5;
color: #666; color: var(--text-secondary);
font-size: 16px; font-size: 16px;
} }
@@ -857,6 +932,7 @@ img {
line-height: 1.4; line-height: 1.4;
display: flex; display: flex;
align-items: center; align-items: center;
color: inherit;
} }
.video-metadata { .video-metadata {
@@ -864,7 +940,7 @@ img {
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
font-size: 12px; font-size: 12px;
color: #666; color: var(--text-secondary);
margin-top: auto; margin-top: auto;
} }
@@ -1219,10 +1295,10 @@ img {
width: calc(100% - 250px); width: calc(100% - 250px);
padding: 50px 30px 30px; padding: 50px 30px 30px;
background-color: var(--footer-bg); background-color: var(--footer-bg);
border-top: 1px solid #e0e0e0; border-top: 1px solid var(--border-color);
box-sizing: border-box; box-sizing: border-box;
align-self: stretch; align-self: stretch;
color: #444; color: var(--text-color);
} }
.footer-header { .footer-header {
@@ -1231,7 +1307,7 @@ img {
align-items: center; align-items: center;
margin-bottom: 40px; margin-bottom: 40px;
padding-bottom: 30px; padding-bottom: 30px;
border-bottom: 1px solid #e0e0e0; border-bottom: 1px solid var(--border-color);
max-width: 1200px; max-width: 1200px;
margin-left: auto; margin-left: auto;
margin-right: auto; margin-right: auto;
@@ -1260,7 +1336,7 @@ img {
font-size: 18px; font-size: 18px;
font-weight: 600; font-weight: 600;
margin-bottom: 10px; margin-bottom: 10px;
color: #333; color: var(--text-color);
} }
.footer-email { .footer-email {
@@ -1268,7 +1344,7 @@ img {
} }
.footer-email a { .footer-email a {
color: #555; color: var(--text-secondary);
text-decoration: none; text-decoration: none;
transition: color 0.2s; transition: color 0.2s;
} }
@@ -1299,7 +1375,7 @@ img {
font-size: 18px; font-size: 18px;
font-weight: 700; font-weight: 700;
margin-bottom: 20px; margin-bottom: 20px;
color: #333; color: var(--text-color);
position: relative; position: relative;
padding-bottom: 10px; padding-bottom: 10px;
} }
@@ -1325,7 +1401,7 @@ img {
} }
.footer-links a { .footer-links a {
color: #555; color: var(--text-secondary);
text-decoration: none; text-decoration: none;
font-size: 15px; font-size: 15px;
transition: all 0.2s; transition: all 0.2s;
@@ -1373,9 +1449,9 @@ img {
.footer-copyright { .footer-copyright {
padding-top: 25px; padding-top: 25px;
border-top: 1px solid #e0e0e0; border-top: 1px solid var(--border-color);
font-size: 14px; font-size: 14px;
color: #666; color: var(--text-secondary);
max-width: 1200px; max-width: 1200px;
margin: 0 auto; margin: 0 auto;
text-align: center; text-align: center;
@@ -1806,6 +1882,11 @@ i.icon-tiktok,
color: #000000 !important; /* Noir TikTok */ color: #000000 !important; /* Noir TikTok */
} }
[data-theme="dark"] .header i.icon-tiktok,
[data-theme="dark"] .header .fab.fa-tiktok.icon-tiktok {
color: #ffffff !important; /* Blanc TikTok en mode sombre - header seulement */
}
i.icon-tiktok-accent { i.icon-tiktok-accent {
color: #EE1D52 !important; /* Rouge TikTok */ color: #EE1D52 !important; /* Rouge TikTok */
} }
@@ -1816,6 +1897,12 @@ i.icon-x,
color: #000000 !important; /* Noir X (anciennement Twitter) */ color: #000000 !important; /* Noir X (anciennement Twitter) */
} }
[data-theme="dark"] .header i.icon-x,
[data-theme="dark"] .header .fab.fa-x-twitter.icon-x,
[data-theme="dark"] .header .fab.fa-x.icon-x {
color: #ffffff !important; /* Blanc X en mode sombre - header seulement */
}
i.icon-mastodon, i.icon-mastodon,
.fab.fa-mastodon.icon-mastodon { .fab.fa-mastodon.icon-mastodon {
color: #563ACC !important; /* Violet Mastodon */ color: #563ACC !important; /* Violet Mastodon */
@@ -2097,7 +2184,7 @@ i.icon-mastodon,
.no-videos-message p { .no-videos-message p {
font-size: 16px; font-size: 16px;
color: #666; color: var(--text-secondary);
margin-bottom: 25px; margin-bottom: 25px;
} }
@@ -2202,7 +2289,7 @@ i.icon-mastodon,
} }
.search-instructions p { .search-instructions p {
color: #666; color: var(--text-secondary);
line-height: 1.5; line-height: 1.5;
margin-bottom: 10px; margin-bottom: 10px;
} }
@@ -2282,7 +2369,7 @@ i.icon-mastodon,
.page-dots { .page-dots {
margin: 0 5px; margin: 0 5px;
color: #666; color: var(--text-secondary);
} }
/* Styles pour les hashtags dans le menu mobile */ /* Styles pour les hashtags dans le menu mobile */
+75 -68
View File
@@ -56,7 +56,7 @@
font-weight: 700; font-weight: 700;
line-height: 1.3; line-height: 1.3;
margin-bottom: 1rem; margin-bottom: 1rem;
color: #000; color: var(--text-color);
} }
.video-info { .video-info {
@@ -80,7 +80,7 @@
.video-views, .video-date { .video-views, .video-date {
font-size: 0.875rem; font-size: 0.875rem;
color: #666; color: var(--text-secondary);
display: flex; display: flex;
align-items: center; align-items: center;
gap: 5px; gap: 5px;
@@ -119,10 +119,11 @@
transition: background-color 0.2s; transition: background-color 0.2s;
height: 36px; height: 36px;
min-width: 80px; min-width: 80px;
color: var(--text-color);
} }
.action-button:hover { .action-button:hover {
background-color: #f5f5f5; background-color: var(--card-bg);
} }
.download-button { .download-button {
@@ -148,13 +149,13 @@
right: 0; right: 0;
bottom: 0; bottom: 0;
border-radius: 4px; border-radius: 4px;
border: 1px dashed #999; border: 1px dashed var(--text-secondary);
pointer-events: none; pointer-events: none;
} }
.action-button i { .action-button i {
font-size: 1.25rem; font-size: 1.25rem;
color: #444; color: var(--text-secondary);
} }
.action-button span { .action-button span {
@@ -276,7 +277,7 @@
font-size: 0.9375rem; font-size: 0.9375rem;
line-height: 1.6; line-height: 1.6;
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
color: #333; color: var(--text-color);
} }
/* Styles pour les éléments Markdown dans la description */ /* Styles pour les éléments Markdown dans la description */
@@ -305,29 +306,31 @@
} }
.video-description blockquote { .video-description blockquote {
border-left: 4px solid #e0e0e0; border-left: 4px solid var(--border-color);
padding-left: 1rem; padding-left: 1rem;
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
margin-bottom: 1rem; margin-bottom: 1rem;
color: #555; color: var(--text-secondary);
font-style: italic; font-style: italic;
} }
.video-description code { .video-description code {
background-color: #f5f5f5; background-color: var(--card-bg);
padding: 0.2rem 0.4rem; padding: 0.2rem 0.4rem;
border-radius: 3px; border-radius: 3px;
font-family: monospace; font-family: monospace;
font-size: 0.875rem; font-size: 0.875rem;
color: var(--text-color);
} }
.video-description pre { .video-description pre {
background-color: #f5f5f5; background-color: var(--card-bg);
padding: 1rem; padding: 1rem;
border-radius: 4px; border-radius: 4px;
overflow-x: auto; overflow-x: auto;
margin-bottom: 1rem; margin-bottom: 1rem;
color: var(--text-color);
} }
.video-description pre code { .video-description pre code {
@@ -341,7 +344,7 @@
.video-description hr { .video-description hr {
border: 0; border: 0;
height: 1px; height: 1px;
background-color: #e0e0e0; background-color: var(--border-color);
margin: 2rem 0; margin: 2rem 0;
} }
@@ -368,7 +371,7 @@
left: 0; left: 0;
right: 0; right: 0;
height: 60px; height: 60px;
background: linear-gradient(transparent, #fff); background: linear-gradient(transparent, var(--main-bg));
pointer-events: none; pointer-events: none;
} }
@@ -403,18 +406,18 @@
/* Licence de la vidéo */ /* Licence de la vidéo */
.video-licence { .video-licence {
background-color: #f9f9f9; background-color: var(--card-bg);
border-radius: 8px; border-radius: 8px;
padding: 1rem; padding: 1rem;
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
border: 1px solid #eee; border: 1px solid var(--border-color);
} }
.licence-title { .licence-title {
font-size: 0.9375rem; font-size: 0.9375rem;
font-weight: 600; font-weight: 600;
margin: 0 0 0.5rem 0; margin: 0 0 0.5rem 0;
color: #333; color: var(--text-color);
} }
.licence-info { .licence-info {
@@ -443,7 +446,7 @@
.licence-label { .licence-label {
font-size: 0.875rem; font-size: 0.875rem;
color: #555; color: var(--text-secondary);
} }
.video-tags { .video-tags {
@@ -454,14 +457,14 @@
} }
.tag { .tag {
background-color: #f5f5f5; background-color: var(--tag-bg);
border-radius: 16px; border-radius: 16px;
padding: 0.4rem 0.75rem; padding: 0.4rem 0.75rem;
font-size: 0.8125rem; font-size: 0.8125rem;
color: #222; color: var(--text-color);
text-decoration: none; text-decoration: none;
transition: all 0.2s ease; transition: all 0.2s ease;
border: 1px solid #e0e0e0; border: 1px solid var(--border-color);
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;
} }
@@ -476,7 +479,7 @@
/* Commentaires */ /* Commentaires */
.comments-section { .comments-section {
grid-column: 1; grid-column: 1;
background-color: #fff; background-color: var(--card-bg);
border-radius: 10px; border-radius: 10px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 2rem; margin-bottom: 2rem;
@@ -489,7 +492,7 @@
align-items: center; align-items: center;
margin-bottom: 1.5rem; margin-bottom: 1.5rem;
padding-bottom: 1rem; padding-bottom: 1rem;
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--border-color);
} }
.section-title-wrapper { .section-title-wrapper {
@@ -501,7 +504,7 @@
font-size: 1.25rem; font-size: 1.25rem;
font-weight: 600; font-weight: 600;
margin: 0; margin: 0;
color: #000; color: var(--text-color);
line-height: 1; line-height: 1;
} }
@@ -520,7 +523,7 @@
} }
.view-on-peertube:hover { .view-on-peertube:hover {
background-color: #f5f5f5; background-color: var(--card-bg);
} }
.view-on-peertube i { .view-on-peertube i {
@@ -530,7 +533,7 @@
.no-comments { .no-comments {
text-align: center; text-align: center;
padding: 2rem; padding: 2rem;
color: #666; color: var(--text-secondary);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@@ -539,7 +542,7 @@
.no-comments i { .no-comments i {
font-size: 2.5rem; font-size: 2.5rem;
color: #ddd; color: var(--border-color);
} }
.no-comments p { .no-comments p {
@@ -550,7 +553,7 @@
} }
.no-comments p:last-child { .no-comments p:last-child {
color: #999; color: var(--text-secondary);
font-size: 0.875rem; font-size: 0.875rem;
} }
@@ -574,12 +577,14 @@
.comment-input textarea { .comment-input textarea {
width: 100%; width: 100%;
padding: 0.75rem; padding: 0.75rem;
border: 1px solid #ddd; border: 1px solid var(--border-color);
border-radius: 4px; border-radius: 4px;
resize: none; resize: none;
height: 80px; height: 80px;
margin-bottom: 0.75rem; margin-bottom: 0.75rem;
font-family: inherit; font-family: inherit;
background-color: var(--main-bg);
color: var(--text-color);
} }
.comment-buttons { .comment-buttons {
@@ -594,7 +599,7 @@
border: none; border: none;
cursor: pointer; cursor: pointer;
font-weight: 500; font-weight: 500;
color: #666; color: var(--text-secondary);
} }
.comment-submit { .comment-submit {
@@ -622,7 +627,7 @@
display: flex; display: flex;
gap: 1rem; gap: 1rem;
padding-bottom: 1.5rem; padding-bottom: 1.5rem;
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--border-color);
} }
.comment:last-of-type { .comment:last-of-type {
@@ -657,16 +662,16 @@
.comment-author { .comment-author {
font-weight: 600; font-weight: 600;
color: #000; color: var(--text-color);
} }
.comment-date { .comment-date {
color: #666; color: var(--text-secondary);
font-size: 0.875rem; font-size: 0.875rem;
} }
.comment-text { .comment-text {
color: #333; color: var(--text-color);
line-height: 1.5; line-height: 1.5;
white-space: pre-line; white-space: pre-line;
margin-bottom: 0.75rem; margin-bottom: 0.75rem;
@@ -696,9 +701,9 @@
.comments-info { .comments-info {
margin-top: 1rem; margin-top: 1rem;
padding: 1rem; padding: 1rem;
background-color: #f8f9fa; background-color: var(--card-bg);
border-radius: 8px; border-radius: 8px;
color: #666; color: var(--text-secondary);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
@@ -708,7 +713,7 @@
.comments-info i { .comments-info i {
font-size: 1.5rem; font-size: 1.5rem;
color: #999; color: var(--text-secondary);
} }
.comments-info p { .comments-info p {
@@ -740,8 +745,8 @@
display: flex; display: flex;
flex-direction: column; flex-direction: column;
text-decoration: none; text-decoration: none;
color: inherit; color: var(--text-color);
background-color: #f9f9f9; background-color: var(--card-bg);
border-radius: 8px; border-radius: 8px;
overflow: hidden; overflow: hidden;
transition: transform 0.2s; transition: transform 0.2s;
@@ -790,11 +795,12 @@
-webkit-line-clamp: 2; -webkit-line-clamp: 2;
-webkit-box-orient: vertical; -webkit-box-orient: vertical;
overflow: hidden; overflow: hidden;
color: var(--text-color);
} }
.suggested-video-channel { .suggested-video-channel {
font-size: 0.75rem; font-size: 0.75rem;
color: #666; color: var(--text-secondary);
margin-bottom: 0.25rem; margin-bottom: 0.25rem;
display: flex; display: flex;
align-items: center; align-items: center;
@@ -816,7 +822,7 @@
.suggested-video-metadata { .suggested-video-metadata {
display: flex; display: flex;
font-size: 12px; font-size: 12px;
color: #777; color: var(--text-secondary);
gap: 10px; gap: 10px;
} }
@@ -870,13 +876,13 @@
.related-video-channel { .related-video-channel {
font-size: 12px; font-size: 12px;
color: #666; color: var(--text-secondary);
margin-bottom: 2px; margin-bottom: 2px;
} }
.related-video-metadata { .related-video-metadata {
font-size: 12px; font-size: 12px;
color: #888; color: var(--text-secondary);
} }
/* Media Queries */ /* Media Queries */
@@ -1076,7 +1082,7 @@
} }
.modal-content { .modal-content {
background-color: #fff; background-color: var(--card-bg);
border-radius: 8px; border-radius: 8px;
max-width: 500px; max-width: 500px;
width: 100%; width: 100%;
@@ -1101,7 +1107,7 @@
.modal-header { .modal-header {
padding: 15px 20px; padding: 15px 20px;
border-bottom: 1px solid #eee; border-bottom: 1px solid var(--border-color);
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
@@ -1110,14 +1116,14 @@
.modal-header h3 { .modal-header h3 {
margin: 0; margin: 0;
font-size: 1.25rem; font-size: 1.25rem;
color: #333; color: var(--text-color);
} }
.modal-close { .modal-close {
background: none; background: none;
border: none; border: none;
font-size: 1rem; font-size: 1rem;
color: #888; color: var(--text-secondary);
cursor: pointer; cursor: pointer;
padding: 5px; padding: 5px;
display: flex; display: flex;
@@ -1130,8 +1136,8 @@
} }
.modal-close:hover { .modal-close:hover {
background-color: #f3f3f3; background-color: var(--card-bg);
color: #333; color: var(--text-color);
} }
.modal-body { .modal-body {
@@ -1142,7 +1148,7 @@
.modal-body p { .modal-body p {
margin-top: 0; margin-top: 0;
margin-bottom: 15px; margin-bottom: 15px;
color: #666; color: var(--text-secondary);
} }
.download-options { .download-options {
@@ -1156,16 +1162,16 @@
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
padding: 12px 15px; padding: 12px 15px;
background-color: #f5f5f5; background-color: var(--main-bg);
border-radius: 8px; border-radius: 8px;
text-decoration: none; text-decoration: none;
color: #333; color: var(--text-color);
font-weight: 500; font-weight: 500;
transition: background-color 0.2s, transform 0.2s; transition: background-color 0.2s, transform 0.2s;
} }
.download-option:hover { .download-option:hover {
background-color: #e0e0e0; background-color: var(--card-bg);
transform: translateY(-2px); transform: translateY(-2px);
} }
@@ -1184,22 +1190,22 @@
display: flex; display: flex;
align-items: center; align-items: center;
gap: 10px; gap: 10px;
color: #666; color: var(--text-secondary);
font-size: 0.875rem; font-size: 0.875rem;
} }
.download-info i { .download-info i {
color: #444; color: var(--text-secondary);
} }
.modal-footer { .modal-footer {
padding: 15px 20px; padding: 15px 20px;
border-top: 1px solid #eee; border-top: 1px solid var(--border-color);
} }
.download-info-text { .download-info-text {
margin: 0; margin: 0;
color: #888; color: var(--text-secondary);
font-size: 0.8125rem; font-size: 0.8125rem;
text-align: center; text-align: center;
} }
@@ -1207,7 +1213,7 @@
.no-download-options { .no-download-options {
text-align: center; text-align: center;
padding: 20px; padding: 20px;
color: #666; color: var(--text-secondary);
} }
/* Adaptations responsives */ /* Adaptations responsives */
@@ -1228,7 +1234,7 @@
.share-link-box { .share-link-box {
display: flex; display: flex;
border: 1px solid #ddd; border: 1px solid var(--border-color);
border-radius: 4px; border-radius: 4px;
overflow: hidden; overflow: hidden;
margin-top: 8px; margin-top: 8px;
@@ -1239,27 +1245,27 @@
padding: 10px 12px; padding: 10px 12px;
border: none; border: none;
font-size: 14px; font-size: 14px;
color: #333; color: var(--text-color);
background-color: #f9f9f9; background-color: var(--main-bg);
} }
.share-link-box input:focus { .share-link-box input:focus {
outline: none; outline: none;
background-color: #fff; background-color: var(--card-bg);
} }
.copy-btn { .copy-btn {
background-color: #f5f5f5; background-color: var(--card-bg);
border: none; border: none;
border-left: 1px solid #ddd; border-left: 1px solid var(--border-color);
color: #555; color: var(--text-secondary);
padding: 0 15px; padding: 0 15px;
cursor: pointer; cursor: pointer;
transition: background-color 0.2s; transition: background-color 0.2s;
} }
.copy-btn:hover { .copy-btn:hover {
background-color: #e5e5e5; background-color: var(--main-bg);
} }
.copy-btn.copied { .copy-btn.copied {
@@ -1271,6 +1277,7 @@
margin-top: 20px; margin-top: 20px;
margin-bottom: 10px; margin-bottom: 10px;
font-weight: 500; font-weight: 500;
color: var(--text-color);
} }
.share-platforms { .share-platforms {
@@ -1285,15 +1292,15 @@
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
text-decoration: none; text-decoration: none;
color: #333; color: var(--text-color);
padding: 15px 10px; padding: 15px 10px;
border-radius: 8px; border-radius: 8px;
background-color: #f5f5f5; background-color: var(--card-bg);
transition: transform 0.2s, background-color 0.2s; transition: transform 0.2s, background-color 0.2s;
} }
.share-platform-btn:hover { .share-platform-btn:hover {
background-color: #e0e0e0; background-color: var(--main-bg);
transform: translateY(-2px); transform: translateY(-2px);
} }
@@ -1310,7 +1317,7 @@
.share-embed { .share-embed {
margin-top: 20px; margin-top: 20px;
padding-top: 20px; padding-top: 20px;
border-top: 1px solid #eee; border-top: 1px solid var(--border-color);
} }
@media (max-width: 576px) { @media (max-width: 576px) {
+13
View File
@@ -75,6 +75,19 @@ $liveStream = getLiveStream();
$breadcrumbJsonLd = generateBreadcrumbJsonLd($breadcrumbs); $breadcrumbJsonLd = generateBreadcrumbJsonLd($breadcrumbs);
outputJsonLd($breadcrumbJsonLd); outputJsonLd($breadcrumbJsonLd);
?> ?>
<!-- Script pour éviter le flash en mode sombre -->
<script>
(function() {
const savedTheme = localStorage.getItem('theme');
const systemPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
const shouldUseDark = savedTheme === 'dark' || (!savedTheme && systemPrefersDark);
if (shouldUseDark) {
document.documentElement.setAttribute('data-theme', 'dark');
}
})();
</script>
</head> </head>
<body> <body>
<?php include 'includes/sidebar.php'; ?> <?php include 'includes/sidebar.php'; ?>
+3
View File
@@ -40,6 +40,9 @@
</nav> </nav>
<div class="action-icons"> <div class="action-icons">
<button id="theme-toggle" class="icon-button" aria-label="Basculer entre mode clair et sombre" title="Changer le thème">
<i class="fas fa-sun" aria-hidden="true"></i>
</button>
<button id="install-pwa" class="icon-button install-pwa-button" style="display: none;" aria-label="Installer l'application"> <button id="install-pwa" class="icon-button install-pwa-button" style="display: none;" aria-label="Installer l'application">
<i class="fas fa-download" aria-hidden="true"></i> <i class="fas fa-download" aria-hidden="true"></i>
</button> </button>
+13
View File
@@ -61,6 +61,19 @@ setSecurityHeaders();
$breadcrumbJsonLd = generateBreadcrumbJsonLd($breadcrumbs); $breadcrumbJsonLd = generateBreadcrumbJsonLd($breadcrumbs);
outputJsonLd($breadcrumbJsonLd); outputJsonLd($breadcrumbJsonLd);
?> ?>
<!-- Script pour éviter le flash en mode sombre -->
<script>
(function() {
const savedTheme = localStorage.getItem('theme');
const systemPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
const shouldUseDark = savedTheme === 'dark' || (!savedTheme && systemPrefersDark);
if (shouldUseDark) {
document.documentElement.setAttribute('data-theme', 'dark');
}
})();
</script>
</head> </head>
<body> <body>
<?php include 'includes/sidebar.php'; ?> <?php include 'includes/sidebar.php'; ?>
+64 -12
View File
@@ -42,25 +42,77 @@ document.addEventListener('DOMContentLoaded', function() {
}); });
} }
// Gestion du mode sombre // Gestion du theme (mode clair/sombre)
const darkModeToggle = document.querySelector('.dark-mode-toggle'); const themeToggle = document.querySelector('#theme-toggle');
const body = document.body; const html = document.documentElement;
if (darkModeToggle) { // Charger le thème sauvegardé ou détecter la préférence système
darkModeToggle.addEventListener('click', function() { function initTheme() {
body.classList.toggle('dark-mode'); const savedTheme = localStorage.getItem('theme');
const systemPrefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches;
// Changer l'icône let currentTheme = savedTheme;
const icon = darkModeToggle.querySelector('i'); if (!savedTheme) {
if (body.classList.contains('dark-mode')) { currentTheme = systemPrefersDark ? 'dark' : 'light';
icon.classList.remove('fa-moon'); }
icon.classList.add('fa-sun');
applyTheme(currentTheme);
updateThemeIcon(currentTheme);
}
// Appliquer le thème
function applyTheme(theme) {
if (theme === 'dark') {
html.setAttribute('data-theme', 'dark');
} else { } else {
html.removeAttribute('data-theme');
}
}
// Mettre à jour l'icône du bouton
function updateThemeIcon(theme) {
if (themeToggle) {
const icon = themeToggle.querySelector('i');
if (theme === 'dark') {
icon.classList.remove('fa-sun'); icon.classList.remove('fa-sun');
icon.classList.add('fa-moon'); icon.classList.add('fa-moon');
themeToggle.setAttribute('aria-label', 'Basculer vers le mode clair');
themeToggle.setAttribute('title', 'Mode clair');
} else {
icon.classList.remove('fa-moon');
icon.classList.add('fa-sun');
themeToggle.setAttribute('aria-label', 'Basculer vers le mode sombre');
themeToggle.setAttribute('title', 'Mode sombre');
}
}
}
// Basculer le thème
function toggleTheme() {
const currentTheme = html.getAttribute('data-theme');
const newTheme = currentTheme === 'dark' ? 'light' : 'dark';
applyTheme(newTheme);
updateThemeIcon(newTheme);
localStorage.setItem('theme', newTheme);
}
// Event listener pour le bouton
if (themeToggle) {
themeToggle.addEventListener('click', toggleTheme);
}
// Écouter les changements de préférence système
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function(e) {
if (!localStorage.getItem('theme')) {
const newTheme = e.matches ? 'dark' : 'light';
applyTheme(newTheme);
updateThemeIcon(newTheme);
} }
}); });
}
// Initialiser le thème
initTheme();
// Gestion des carousels // Gestion des carousels
const carousels = document.querySelectorAll('.carousel'); const carousels = document.querySelectorAll('.carousel');
+13
View File
@@ -29,6 +29,19 @@
<meta name="twitter:title" content="Mentions Légales - kaubuntu.re"> <meta name="twitter:title" content="Mentions Légales - kaubuntu.re">
<meta name="twitter:description" content="Consultez les mentions légales de kaubuntu.re. Informations légales, conditions d'utilisation et politique de confidentialité de notre plateforme multimédia."> <meta name="twitter:description" content="Consultez les mentions légales de kaubuntu.re. Informations légales, conditions d'utilisation et politique de confidentialité de notre plateforme multimédia.">
<meta name="twitter:image" content="<?php echo 'https://' . $_SERVER['HTTP_HOST'] . '/img/logo.png'; ?>"> <meta name="twitter:image" content="<?php echo 'https://' . $_SERVER['HTTP_HOST'] . '/img/logo.png'; ?>">
<!-- Script pour éviter le flash en mode sombre -->
<script>
(function() {
const savedTheme = localStorage.getItem('theme');
const systemPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
const shouldUseDark = savedTheme === 'dark' || (!savedTheme && systemPrefersDark);
if (shouldUseDark) {
document.documentElement.setAttribute('data-theme', 'dark');
}
})();
</script>
</head> </head>
<body> <body>
<?php <?php
+13
View File
@@ -95,6 +95,19 @@ if ($resultsCount > 0) {
outputJsonLd($breadcrumbJsonLd); outputJsonLd($breadcrumbJsonLd);
?> ?>
<?php endif; ?> <?php endif; ?>
<!-- Script pour éviter le flash en mode sombre -->
<script>
(function() {
const savedTheme = localStorage.getItem('theme');
const systemPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
const shouldUseDark = savedTheme === 'dark' || (!savedTheme && systemPrefersDark);
if (shouldUseDark) {
document.documentElement.setAttribute('data-theme', 'dark');
}
})();
</script>
</head> </head>
<body> <body>
<?php include 'includes/sidebar.php'; ?> <?php include 'includes/sidebar.php'; ?>
+13
View File
@@ -157,6 +157,19 @@ if (empty($videoData) || isset($videoData['error'])) {
outputJsonLd($breadcrumbJsonLd); outputJsonLd($breadcrumbJsonLd);
?> ?>
<?php endif; ?> <?php endif; ?>
<!-- Script pour éviter le flash en mode sombre -->
<script>
(function() {
const savedTheme = localStorage.getItem('theme');
const systemPrefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
const shouldUseDark = savedTheme === 'dark' || (!savedTheme && systemPrefersDark);
if (shouldUseDark) {
document.documentElement.setAttribute('data-theme', 'dark');
}
})();
</script>
</head> </head>
<body> <body>
<?php include 'includes/sidebar.php'; ?> <?php include 'includes/sidebar.php'; ?>