-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
🔤 Added customizable title support and 🌙 Automatic dark mode switching (sunrise/sunset) #80
base: master
Are you sure you want to change the base?
Conversation
8534276
to
119ba9d
Compare
- Customizable titles through a very small script to change the window's title. - Configurable with a value in config.js This could be in the <head> but a script fits the pattern.
Use lat/long | browser location data to automatically set light/dark mode. Sunrise/sunset is already returned in the openweathermap API, so this is fairly simple. Converted the functions in weather.js to async as opposed to using .then chains
@@ -7,56 +7,55 @@ const iconElement = document.querySelector('.weatherIcon'); | |||
const tempElement = document.querySelector('.weatherValue p'); | |||
const descElement = document.querySelector('.weatherDescription p'); | |||
|
|||
const weather = {}; | |||
weather.temperature = { | |||
unit: 'celsius', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I couldn't see anywhere this was called, weather.temperature is now the value
Hi! @lewisdoesstuff I loved the title feature. But the Automatic theme switch is already implemented here! |
Ah, that would have saved me a while. I don't use auto light/dark on my OS, but I do toggle light mode in the day on Bento; I assume I'm not the only one who does this so I thought it'd be useful |
Configurable through config.js, this just sets the CSS variable to the provided URL. Defaults to ./assets/background.jpg. Again, this is more for convenience when running in docker as it's not as easy to just swap the file.
Added support for custom themes without editing the main app.css file. Themes configurable through config.js, with several pre-included themes. Some of these don't map particularly well to the limited selection of colors we use, but I've done what i can to match them. Some themes only have a dark mode variant, so this is copied onto the light theme as well.
Hi @lewisdoesstuff I love the location automatically change but some people just needs to change it at the time they want and having two automatically change features can be confusing. I'll accept the PR for the custom title feature (And I'll read the other PR you have) Thank you! |
Sounds good! Not a problem. I'm maintaining my own fork at lewisdoesstuff/bento-next with any features that are out of the scope of this, feel free to grab anything you think fits! |
These were in their own branches, merge to master and update docs
This should have been 2 PR's! You caught me off-guard with that refactor commit and I messed up my merge :/
🌙 Automatic theme switching from location
🔤 Customizable titles
Currently, changing the title isn't too difficult but it's a bit more annoying to do in Docker.
This could be in the <head> but a file fits the style.