Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#591 Enhance Dark Mode Experience: Add a New Logo for Improved Visibility #593

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion about.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<nav class="navbar">
<div class="logo">
<a href="index.html" class="logo"><img src="img/logo.png" alt=""></a>
<a href="index.html"><img src="img/cabz.png.png" alt="Logo" class="navbar-logo" /></a>
<a href="index.html"><img src="img/cabz.png" alt="Logo" class="navbar-logo" /></a>
</div>
<ul>
<li><a href="index.html">Home</a></li>
Expand Down
Binary file modified img/.DS_Store
Binary file not shown.
Binary file added img/cabz-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/cabz.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed img/cabz.png.png
Binary file not shown.
6 changes: 3 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -691,7 +691,7 @@
<!-- Header -->
<header>
<a href="index.html" class="logo"><img src="img/logo.png" alt=""></a>
<a href="index.html" class="CabRental_logo"><img src="img/cabz.png.png" alt=""></a>
<a href="index.html" class="CabRental_logo"><img src="img/cabz.png" alt=""></a>
<div class="bx bx-menu" id="menu-icon"></div>
<ul class="navbar">
<li><a href="index.html">Home</a></li>
Expand Down Expand Up @@ -1468,7 +1468,7 @@ <h2>Words from Our Clients <span class="highlight">Inspiring Testimonials of Sat
<script src="https://unpkg.com/swiper/swiper-bundle.min.js"></script>

<script src="main.js"></script>
<script src="script.js"></script>

<script>
const topButton = document.getElementById("topbtn");
window.onscroll = function () {
Expand Down Expand Up @@ -1536,7 +1536,7 @@ <h2>Words from Our Clients <span class="highlight">Inspiring Testimonials of Sat
domain="www.chatbase.co"
defer>
</script>

<script src="script.js"></script>


</body>
Expand Down
15 changes: 13 additions & 2 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const themeSwitch = document.getElementById('theme-switch'); // Ensure this matc
const body = document.body;
const header = document.querySelector('header');
const footer = document.querySelector('footer');

const CabRental_logo = document.getElementById('CabRental_logo');
document.getElementById('bookNow').addEventListener('click', function () {
const name=document.getElementById('fullName').value.trim();
const phone=document.getElementById('phone').value.trim();
Expand All @@ -155,25 +155,36 @@ document.getElementById('bookNow').addEventListener('click', function () {
alert('Booking confirmed!');
});


// Paths for light and dark mode logos

const lightModeCabRental_logo = 'img/cabz.png';
const darkModeCabRental_logo = 'img/cabz-dark.png'; // New dark mode logo for CabRental

// Function to enable dark mode
function enableDarkMode() {
themeSwitch.classList.add('dark-theme'); // Update the switch appearance
body.classList.add('dark-mode');
header.classList.add('dark-mode');
footer.classList.add('dark-mode');
CabRental_logo.src = darkModeCabRental_logo;
console.log('Dark mode enabled: Logo changed to dark mode logo.'); // Switch to dark mode CabRental logo
}


// Function to disable dark mode
function disableDarkMode() {
themeSwitch.classList.remove('dark-theme'); // Update the switch appearance
body.classList.remove('dark-mode');
header.classList.remove('dark-mode');
footer.classList.remove('dark-mode');
CabRental_logo.src = lightModeCabRental_logo;
}


// Event listener for dark mode toggle button
themeSwitch.addEventListener('click', () => {
if (body.classList.contains('dark-mode')) {
if (body.classList .contains('dark-mode')) {
localStorage.removeItem('dark-mode'); // Remove from local storage
disableDarkMode(); // Switch to light mode
} else {
Expand Down
2 changes: 2 additions & 0 deletions serv.css
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ body {
}
.CabRental_logo img{
padding-top: 20px;
height: 60px;
width: 220px;
}

.navbar {
Expand Down
2 changes: 1 addition & 1 deletion serv.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<body>
<header>
<a href="index.html" class="logo"><img src="img/logo.png" alt=""></a>
<a href="index.html" class="CabRental_logo"><img src="img/cabz.png.png" alt=""></a>
<a href="index.html" class="CabRental_logo"><img src="img/cabz.png" alt=""></a>
<div class="bx bx-menu" id="menu-icon"></div>
<ul class="navbar">
<li><a href="index.html">Home</a></li>
Expand Down
2 changes: 2 additions & 0 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ header {
border-radius: 10px; /* This creates 10px rounded corners */
}
.CabRental_logo img {
height: 60px;
width: 220px;
margin: 9px 30px 0px 0px;
}

Expand Down