Skip to content
Open
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
74 changes: 72 additions & 2 deletions src/pages/user-guide/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,16 @@
max-width: 60%;
align-items: center;
font-size: larger;

color: #333;
background-color: #f8f8f8;
transition: background-color 0.3s, color 0.3s;
}
a {
color: #3498db;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
html{
scroll-behavior: smooth;
Expand Down Expand Up @@ -126,10 +135,50 @@
height: 150px;
padding-top: 10px;
}

/* Dark Mode Styles */
body.dark-mode {
color: #eee;
background-color: #121212;
}

body.dark-mode h1,
body.dark-mode h2 {
color: #eee;
}

body.dark-mode code {
background-color: #222;
color: #eee;
}

body.dark-mode a {
color: #9b59b6;
}

/* Toggle Button Styles */
#dark-mode-toggle {
position: fixed;
top: 20px;
right: 20px;
background-color: #4CAF50;
border: none;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
border-radius: 5px;
z-index: 1000;
}
</style>
</head>

<body>
<button id="dark-mode-toggle">Toggle Dark Mode</button>
<img id="logo" src="map-logo.png" alt="Logo of World-Map-Explorer">
<h1>World-Map-Explorer – Explore the world with ease</h1>

Expand Down Expand Up @@ -413,7 +462,28 @@ <h1 style=" text-align: center; border-collapse: collapse;"id="credits">Credits<
</footer>



<script>
const toggleButton = document.getElementById('dark-mode-toggle');
const body = document.body;

if (localStorage.getItem('theme') === 'dark') {
body.classList.add('dark-mode');
toggleButton.textContent = 'Light Mode';
} else {
toggleButton.textContent = 'Dark Mode';
}

toggleButton.addEventListener('click', () => {
body.classList.toggle('dark-mode');
if (body.classList.contains('dark-mode')) {
localStorage.setItem('theme', 'dark');
toggleButton.textContent = 'Light Mode';
} else {
localStorage.setItem('theme', 'light');
toggleButton.textContent = 'Dark Mode';
}
});
</script>


</body>
Expand Down