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
+1 -1
View File
@@ -136,7 +136,7 @@
.tag {
font-size: 12px;
color: #0d6efd;
color: var(--primary-red);
}
.no-results, .search-instructions {
+105 -18
View File
@@ -26,12 +26,35 @@
--footer-bg: #f0f0f0;
--main-bg: #ffffff;
--text-color: #000000;
--text-secondary: #666666;
--tag-bg: #f8f8f8;
--tag-border: #e0e0e0;
--search-bg: #e0e0e0;
--card-bg: #ffffff;
--card-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
--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 {
@@ -86,6 +109,14 @@ select:focus {
--tag-bg: #E8E8E8;
--search-bg: #D0D0D0;
}
[data-theme="dark"] {
--text-color: #ffffff;
--primary-red: #FF6666;
--card-bg: #000000;
--sidebar-bg: #111111;
--main-bg: #000000;
}
}
img {
@@ -143,7 +174,7 @@ img {
}
.nav-item:hover {
background-color: rgba(0, 0, 0, 0.05);
background-color: var(--hover-bg);
}
/* PWA Install Button */
@@ -412,6 +443,50 @@ img {
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 */
.icon-button i.icon-facebook,
.icon-button i.icon-youtube,
@@ -666,11 +741,11 @@ img {
border-radius: 50px;
font-size: 15px;
font-weight: 600;
background: linear-gradient(135deg, var(--tag-bg), #f0f0f0);
background: var(--tag-bg);
cursor: pointer;
transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
text-decoration: none;
color: #222;
color: var(--text-color);
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
position: relative;
overflow: hidden;
@@ -819,7 +894,7 @@ img {
.video-channel {
font-size: 14px;
color: #555;
color: var(--text-secondary);
margin-bottom: 8px;
display: flex;
align-items: center;
@@ -846,7 +921,7 @@ img {
align-items: center;
justify-content: center;
background-color: #e5e5e5;
color: #666;
color: var(--text-secondary);
font-size: 16px;
}
@@ -857,6 +932,7 @@ img {
line-height: 1.4;
display: flex;
align-items: center;
color: inherit;
}
.video-metadata {
@@ -864,7 +940,7 @@ img {
align-items: center;
justify-content: space-between;
font-size: 12px;
color: #666;
color: var(--text-secondary);
margin-top: auto;
}
@@ -1219,10 +1295,10 @@ img {
width: calc(100% - 250px);
padding: 50px 30px 30px;
background-color: var(--footer-bg);
border-top: 1px solid #e0e0e0;
border-top: 1px solid var(--border-color);
box-sizing: border-box;
align-self: stretch;
color: #444;
color: var(--text-color);
}
.footer-header {
@@ -1231,7 +1307,7 @@ img {
align-items: center;
margin-bottom: 40px;
padding-bottom: 30px;
border-bottom: 1px solid #e0e0e0;
border-bottom: 1px solid var(--border-color);
max-width: 1200px;
margin-left: auto;
margin-right: auto;
@@ -1260,7 +1336,7 @@ img {
font-size: 18px;
font-weight: 600;
margin-bottom: 10px;
color: #333;
color: var(--text-color);
}
.footer-email {
@@ -1268,7 +1344,7 @@ img {
}
.footer-email a {
color: #555;
color: var(--text-secondary);
text-decoration: none;
transition: color 0.2s;
}
@@ -1299,7 +1375,7 @@ img {
font-size: 18px;
font-weight: 700;
margin-bottom: 20px;
color: #333;
color: var(--text-color);
position: relative;
padding-bottom: 10px;
}
@@ -1325,7 +1401,7 @@ img {
}
.footer-links a {
color: #555;
color: var(--text-secondary);
text-decoration: none;
font-size: 15px;
transition: all 0.2s;
@@ -1373,9 +1449,9 @@ img {
.footer-copyright {
padding-top: 25px;
border-top: 1px solid #e0e0e0;
border-top: 1px solid var(--border-color);
font-size: 14px;
color: #666;
color: var(--text-secondary);
max-width: 1200px;
margin: 0 auto;
text-align: center;
@@ -1806,6 +1882,11 @@ i.icon-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 {
color: #EE1D52 !important; /* Rouge TikTok */
}
@@ -1816,6 +1897,12 @@ i.icon-x,
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,
.fab.fa-mastodon.icon-mastodon {
color: #563ACC !important; /* Violet Mastodon */
@@ -2097,7 +2184,7 @@ i.icon-mastodon,
.no-videos-message p {
font-size: 16px;
color: #666;
color: var(--text-secondary);
margin-bottom: 25px;
}
@@ -2202,7 +2289,7 @@ i.icon-mastodon,
}
.search-instructions p {
color: #666;
color: var(--text-secondary);
line-height: 1.5;
margin-bottom: 10px;
}
@@ -2282,7 +2369,7 @@ i.icon-mastodon,
.page-dots {
margin: 0 5px;
color: #666;
color: var(--text-secondary);
}
/* Styles pour les hashtags dans le menu mobile */
+75 -68
View File
@@ -56,7 +56,7 @@
font-weight: 700;
line-height: 1.3;
margin-bottom: 1rem;
color: #000;
color: var(--text-color);
}
.video-info {
@@ -80,7 +80,7 @@
.video-views, .video-date {
font-size: 0.875rem;
color: #666;
color: var(--text-secondary);
display: flex;
align-items: center;
gap: 5px;
@@ -119,10 +119,11 @@
transition: background-color 0.2s;
height: 36px;
min-width: 80px;
color: var(--text-color);
}
.action-button:hover {
background-color: #f5f5f5;
background-color: var(--card-bg);
}
.download-button {
@@ -148,13 +149,13 @@
right: 0;
bottom: 0;
border-radius: 4px;
border: 1px dashed #999;
border: 1px dashed var(--text-secondary);
pointer-events: none;
}
.action-button i {
font-size: 1.25rem;
color: #444;
color: var(--text-secondary);
}
.action-button span {
@@ -276,7 +277,7 @@
font-size: 0.9375rem;
line-height: 1.6;
margin-bottom: 1.5rem;
color: #333;
color: var(--text-color);
}
/* Styles pour les éléments Markdown dans la description */
@@ -305,29 +306,31 @@
}
.video-description blockquote {
border-left: 4px solid #e0e0e0;
border-left: 4px solid var(--border-color);
padding-left: 1rem;
margin-left: 0;
margin-right: 0;
margin-bottom: 1rem;
color: #555;
color: var(--text-secondary);
font-style: italic;
}
.video-description code {
background-color: #f5f5f5;
background-color: var(--card-bg);
padding: 0.2rem 0.4rem;
border-radius: 3px;
font-family: monospace;
font-size: 0.875rem;
color: var(--text-color);
}
.video-description pre {
background-color: #f5f5f5;
background-color: var(--card-bg);
padding: 1rem;
border-radius: 4px;
overflow-x: auto;
margin-bottom: 1rem;
color: var(--text-color);
}
.video-description pre code {
@@ -341,7 +344,7 @@
.video-description hr {
border: 0;
height: 1px;
background-color: #e0e0e0;
background-color: var(--border-color);
margin: 2rem 0;
}
@@ -368,7 +371,7 @@
left: 0;
right: 0;
height: 60px;
background: linear-gradient(transparent, #fff);
background: linear-gradient(transparent, var(--main-bg));
pointer-events: none;
}
@@ -403,18 +406,18 @@
/* Licence de la vidéo */
.video-licence {
background-color: #f9f9f9;
background-color: var(--card-bg);
border-radius: 8px;
padding: 1rem;
margin-bottom: 1.5rem;
border: 1px solid #eee;
border: 1px solid var(--border-color);
}
.licence-title {
font-size: 0.9375rem;
font-weight: 600;
margin: 0 0 0.5rem 0;
color: #333;
color: var(--text-color);
}
.licence-info {
@@ -443,7 +446,7 @@
.licence-label {
font-size: 0.875rem;
color: #555;
color: var(--text-secondary);
}
.video-tags {
@@ -454,14 +457,14 @@
}
.tag {
background-color: #f5f5f5;
background-color: var(--tag-bg);
border-radius: 16px;
padding: 0.4rem 0.75rem;
font-size: 0.8125rem;
color: #222;
color: var(--text-color);
text-decoration: none;
transition: all 0.2s ease;
border: 1px solid #e0e0e0;
border: 1px solid var(--border-color);
display: inline-flex;
align-items: center;
}
@@ -476,7 +479,7 @@
/* Commentaires */
.comments-section {
grid-column: 1;
background-color: #fff;
background-color: var(--card-bg);
border-radius: 10px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
margin-bottom: 2rem;
@@ -489,7 +492,7 @@
align-items: center;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 1px solid #eee;
border-bottom: 1px solid var(--border-color);
}
.section-title-wrapper {
@@ -501,7 +504,7 @@
font-size: 1.25rem;
font-weight: 600;
margin: 0;
color: #000;
color: var(--text-color);
line-height: 1;
}
@@ -520,7 +523,7 @@
}
.view-on-peertube:hover {
background-color: #f5f5f5;
background-color: var(--card-bg);
}
.view-on-peertube i {
@@ -530,7 +533,7 @@
.no-comments {
text-align: center;
padding: 2rem;
color: #666;
color: var(--text-secondary);
display: flex;
flex-direction: column;
align-items: center;
@@ -539,7 +542,7 @@
.no-comments i {
font-size: 2.5rem;
color: #ddd;
color: var(--border-color);
}
.no-comments p {
@@ -550,7 +553,7 @@
}
.no-comments p:last-child {
color: #999;
color: var(--text-secondary);
font-size: 0.875rem;
}
@@ -574,12 +577,14 @@
.comment-input textarea {
width: 100%;
padding: 0.75rem;
border: 1px solid #ddd;
border: 1px solid var(--border-color);
border-radius: 4px;
resize: none;
height: 80px;
margin-bottom: 0.75rem;
font-family: inherit;
background-color: var(--main-bg);
color: var(--text-color);
}
.comment-buttons {
@@ -594,7 +599,7 @@
border: none;
cursor: pointer;
font-weight: 500;
color: #666;
color: var(--text-secondary);
}
.comment-submit {
@@ -622,7 +627,7 @@
display: flex;
gap: 1rem;
padding-bottom: 1.5rem;
border-bottom: 1px solid #eee;
border-bottom: 1px solid var(--border-color);
}
.comment:last-of-type {
@@ -657,16 +662,16 @@
.comment-author {
font-weight: 600;
color: #000;
color: var(--text-color);
}
.comment-date {
color: #666;
color: var(--text-secondary);
font-size: 0.875rem;
}
.comment-text {
color: #333;
color: var(--text-color);
line-height: 1.5;
white-space: pre-line;
margin-bottom: 0.75rem;
@@ -696,9 +701,9 @@
.comments-info {
margin-top: 1rem;
padding: 1rem;
background-color: #f8f9fa;
background-color: var(--card-bg);
border-radius: 8px;
color: #666;
color: var(--text-secondary);
display: flex;
flex-direction: column;
align-items: center;
@@ -708,7 +713,7 @@
.comments-info i {
font-size: 1.5rem;
color: #999;
color: var(--text-secondary);
}
.comments-info p {
@@ -740,8 +745,8 @@
display: flex;
flex-direction: column;
text-decoration: none;
color: inherit;
background-color: #f9f9f9;
color: var(--text-color);
background-color: var(--card-bg);
border-radius: 8px;
overflow: hidden;
transition: transform 0.2s;
@@ -790,11 +795,12 @@
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
color: var(--text-color);
}
.suggested-video-channel {
font-size: 0.75rem;
color: #666;
color: var(--text-secondary);
margin-bottom: 0.25rem;
display: flex;
align-items: center;
@@ -816,7 +822,7 @@
.suggested-video-metadata {
display: flex;
font-size: 12px;
color: #777;
color: var(--text-secondary);
gap: 10px;
}
@@ -870,13 +876,13 @@
.related-video-channel {
font-size: 12px;
color: #666;
color: var(--text-secondary);
margin-bottom: 2px;
}
.related-video-metadata {
font-size: 12px;
color: #888;
color: var(--text-secondary);
}
/* Media Queries */
@@ -1076,7 +1082,7 @@
}
.modal-content {
background-color: #fff;
background-color: var(--card-bg);
border-radius: 8px;
max-width: 500px;
width: 100%;
@@ -1101,7 +1107,7 @@
.modal-header {
padding: 15px 20px;
border-bottom: 1px solid #eee;
border-bottom: 1px solid var(--border-color);
display: flex;
justify-content: space-between;
align-items: center;
@@ -1110,14 +1116,14 @@
.modal-header h3 {
margin: 0;
font-size: 1.25rem;
color: #333;
color: var(--text-color);
}
.modal-close {
background: none;
border: none;
font-size: 1rem;
color: #888;
color: var(--text-secondary);
cursor: pointer;
padding: 5px;
display: flex;
@@ -1130,8 +1136,8 @@
}
.modal-close:hover {
background-color: #f3f3f3;
color: #333;
background-color: var(--card-bg);
color: var(--text-color);
}
.modal-body {
@@ -1142,7 +1148,7 @@
.modal-body p {
margin-top: 0;
margin-bottom: 15px;
color: #666;
color: var(--text-secondary);
}
.download-options {
@@ -1156,16 +1162,16 @@
justify-content: space-between;
align-items: center;
padding: 12px 15px;
background-color: #f5f5f5;
background-color: var(--main-bg);
border-radius: 8px;
text-decoration: none;
color: #333;
color: var(--text-color);
font-weight: 500;
transition: background-color 0.2s, transform 0.2s;
}
.download-option:hover {
background-color: #e0e0e0;
background-color: var(--card-bg);
transform: translateY(-2px);
}
@@ -1184,22 +1190,22 @@
display: flex;
align-items: center;
gap: 10px;
color: #666;
color: var(--text-secondary);
font-size: 0.875rem;
}
.download-info i {
color: #444;
color: var(--text-secondary);
}
.modal-footer {
padding: 15px 20px;
border-top: 1px solid #eee;
border-top: 1px solid var(--border-color);
}
.download-info-text {
margin: 0;
color: #888;
color: var(--text-secondary);
font-size: 0.8125rem;
text-align: center;
}
@@ -1207,7 +1213,7 @@
.no-download-options {
text-align: center;
padding: 20px;
color: #666;
color: var(--text-secondary);
}
/* Adaptations responsives */
@@ -1228,7 +1234,7 @@
.share-link-box {
display: flex;
border: 1px solid #ddd;
border: 1px solid var(--border-color);
border-radius: 4px;
overflow: hidden;
margin-top: 8px;
@@ -1239,27 +1245,27 @@
padding: 10px 12px;
border: none;
font-size: 14px;
color: #333;
background-color: #f9f9f9;
color: var(--text-color);
background-color: var(--main-bg);
}
.share-link-box input:focus {
outline: none;
background-color: #fff;
background-color: var(--card-bg);
}
.copy-btn {
background-color: #f5f5f5;
background-color: var(--card-bg);
border: none;
border-left: 1px solid #ddd;
color: #555;
border-left: 1px solid var(--border-color);
color: var(--text-secondary);
padding: 0 15px;
cursor: pointer;
transition: background-color 0.2s;
}
.copy-btn:hover {
background-color: #e5e5e5;
background-color: var(--main-bg);
}
.copy-btn.copied {
@@ -1271,6 +1277,7 @@
margin-top: 20px;
margin-bottom: 10px;
font-weight: 500;
color: var(--text-color);
}
.share-platforms {
@@ -1285,15 +1292,15 @@
flex-direction: column;
align-items: center;
text-decoration: none;
color: #333;
color: var(--text-color);
padding: 15px 10px;
border-radius: 8px;
background-color: #f5f5f5;
background-color: var(--card-bg);
transition: transform 0.2s, background-color 0.2s;
}
.share-platform-btn:hover {
background-color: #e0e0e0;
background-color: var(--main-bg);
transform: translateY(-2px);
}
@@ -1310,7 +1317,7 @@
.share-embed {
margin-top: 20px;
padding-top: 20px;
border-top: 1px solid #eee;
border-top: 1px solid var(--border-color);
}
@media (max-width: 576px) {