-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from VaagenIM/feature/front-end
Added theme support for piggy
- Loading branch information
Showing
10 changed files
with
488 additions
and
84 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const modal = document.getElementById('theme-modal'); | ||
const currentTheme = localStorage.getItem('theme') || 'dark'; // Default to dark mode | ||
|
||
// Function to close the modal | ||
const closeModal = () => { | ||
modal.style.display = 'none'; | ||
}; | ||
|
||
// Set the current theme on page load | ||
document.documentElement.setAttribute('data-theme', currentTheme); | ||
|
||
document.getElementById('theme-modal-btn').addEventListener('click', function() { | ||
document.getElementById('theme-modal').style.display = 'block'; // Show the modal | ||
}); | ||
|
||
// Optional: Close modal if user clicks outside the modal content | ||
window.addEventListener('click', function(event) { | ||
if (event.target === modal) { | ||
closeModal(); | ||
} | ||
}); | ||
|
||
const themeButtons = document.querySelectorAll('.theme-option'); | ||
themeButtons.forEach(button => { | ||
button.addEventListener('click', function() { | ||
const selectedTheme = button.getAttribute('data-theme'); | ||
document.documentElement.setAttribute('data-theme', selectedTheme); | ||
localStorage.setItem('theme', selectedTheme); // Save theme to localStorage | ||
document.getElementById('theme-modal').style.display = 'none'; // Hide modal | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,50 @@ | ||
<!-- fonts --> | ||
<link rel="preconnect" href="https://fonts.googleapis.com" /> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap" | ||
rel="preload" | ||
as="style" | ||
/> | ||
|
||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Baloo+2:[email protected]&display=swap" | ||
rel="stylesheet" | ||
/> | ||
|
||
<link | ||
href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,100;0,300;0,400;0,700;0,900;1,100;1,300;1,400;1,700;1,900&family=Montserrat:ital,wght@0,100..900;1,100..900&family=Nunito:ital,wght@0,200..1000;1,200..1000&display=swap" | ||
rel="stylesheet" | ||
as="style" | ||
/> | ||
|
||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Quicksand:[email protected]&display=swap" | ||
rel="stylesheet" | ||
/> | ||
|
||
<link rel="preconnect" href="https://fonts.googleapis.com"> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap" | ||
rel="stylesheet" | ||
/> | ||
|
||
<!-- Styles --> | ||
|
||
<link | ||
href="{{ url_for('static', filename='css/styles.css') }}" | ||
rel="stylesheet" | ||
/> | ||
|
||
<style> | ||
body { | ||
font-family: "Nunito", sans-serif; | ||
font-family: "Quicksand"; | ||
font-optical-sizing: auto; | ||
font-weight: 100; | ||
font-style: normal; | ||
} | ||
</style> |
Submodule piggybank
updated
from 443c81 to 3e9db7