From b406c5a2f9c0d9e32ae6cc2d966b124d91cea454 Mon Sep 17 00:00:00 2001 From: Seyed Date: Sun, 15 Sep 2024 10:40:20 +0330 Subject: [PATCH] feat: Add toggle switch for theme change at the top of the page - Implemented a toggle switch at the top of the page for switching between dark and light themes. - Positioned the toggle switch above the main header ("Modern Configuration Profile Generator"). - Enhanced the toggle design to be more prominent and visually appealing with larger size, center alignment, and background effects. - Updated CSS for better styling, including transitions, shadows, and colors for both themes. - Updated JavaScript to handle theme switching effectively. --- index.html | 285 +++++++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 245 insertions(+), 40 deletions(-) diff --git a/index.html b/index.html index 10da542..4e003d9 100644 --- a/index.html +++ b/index.html @@ -7,65 +7,74 @@ + + .alert { + background-color: #1f1f1f; + color: #e0e0e0; + border: 1px solid #444; + } + + /* Light theme styles */ + body.light-theme { + background: #ffffff; + color: #000000; + } + + body.light-theme .container { + background-color: #ffffff; + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.05); + } + + body.light-theme h1, + body.light-theme label, + body.light-theme .support h4 { + color: #000000; + } + + body.light-theme .form-text, + body.light-theme .support p { + color: #333333; + } + + body.light-theme input, + body.light-theme select, + body.light-theme textarea { + background-color: #ffffff; + color: #000000; + border-color: #cccccc; + } + + body.light-theme input:focus, + body.light-theme select:focus, + body.light-theme textarea:focus { + border-color: #6E85B7; + outline: none; + } + + body.light-theme button { + background-color: #6E85B7; + color: #ffffff; + } + + body.light-theme button:hover { + background-color: #4A6FA5; + } + + body.light-theme .alert { + background-color: #ffffff; + color: #000000; + border: 1px solid #dddddd; + } + + body.light-theme footer { + background-color: #ffffff; + color: #000000; + } + + body.light-theme .support { + background-color: #ffffff; + border: 1px solid #e0e0e0; + } + + body.light-theme .support a { + background-color: #6E85B7; + color: #ffffff; + } + + body.light-theme .support a:hover { + background-color: #4A6FA5; + } + + + + + .theme-toggle-container { + display: flex; + align-items: center; + justify-content: center; + padding: 10px 0; + margin-bottom: 20px; + background-color: rgba(0, 0, 0, 0.05); + border-bottom: 1px solid #ddd; + } + + /* Styling for the toggle switch */ + .theme-switch { + position: relative; + display: inline-block; + width: 80px; + height: 40px; + margin-right: 15px; + } + + .theme-switch input { + opacity: 0; + width: 0; + height: 0; + } + + .slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #ccc; + transition: .4s; + border-radius: 34px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); + } + + .slider:before { + position: absolute; + content: ""; + height: 30px; + width: 30px; + left: 5px; + bottom: 5px; + background-color: white; + transition: .4s; + border-radius: 50%; + } + + input:checked + .slider { + background-color: #6E85B7; + } + + input:checked + .slider:before { + transform: translateX(40px); + } + + /* Text label for the toggle */ + .theme-label { + color: #333; + font-size: 18px; + font-weight: 700; + } + + body.light-theme .theme-label { + color: #000000; + } + + -
+ + +
+ + Dark Mode +
+ +

Modern Configuration Profile Generator

@@ -152,24 +330,51 @@

Modern Configuration Profile Generator

-
- - +