WebExtension Seasonal Theme

After looking at (dynamic-theme) I had an idea.

“Wouldn’t it be cool if you could have a different theme for each season and wouldn’t it be even cooler if the seasonal theme changed depending upon whether or not it was daytime or nighttime?”

Since I thought this would indeed be cool the next step was to put a prototype together. This GitHub repository (all-seasons-theme-webext) is the result.

This is my first attempt at creating a WebExtension so I am sure it is rough around the edges, but I welcome feedback, just please, keep it civil and remember I am still learning.


Please excuse and forgive me if this topic was posted in the wrong section. My thinking was that this relates more to Add-on Development (specifically WebExtensions) than to Themes even though this is asking about a WebExtension Theme.

3 Likes

I’d suggest to add a feature to let the user choose when they want the season to switch. Either by date pickers (the native ones probably won’t work in the options page yet, unless that’s been fixed) or to switch by astromomical equinox or meteorological definitions (~20th march vs. 1st march).

The other big thing would be to provide selectors for user installed lightweight themes as alternative to the default season themes. You can get all themes and change themes using the management API.

2 Likes

Thank you for your reply and insights @freaktechnik. I hadn’t even looked at management API yet, but I will now.

My confusion with seasonal themes comes from wanting to display them properly (right season at right time) for the Northern and Southern Hemispheres. Your suggestion of user choice sounds like it could simplify this quite a bit.

Again, many thanks for your reply and insight @freaktechnik.

1 Like

just a idea collection (based on and detailing what i imagine under the things @freaktechnik mentioned):

give the user an option to specify in what location/timezone he/she is.
(eventually add an option to try to guess with some ip2location service)

create a list where you can add ‘date’ ranges. the ranges are not allowed to overlap.
each range can be a fixed start and end date or an similar calendar/seasonal event
(internally its just dates - the user interface can display an seasonal/calendar special name…)
each range entry has minimum one sub entries for time based decision:
default would be just one sub entry thats for the full day.
other possible sub entries could be night / day / noon or else…
for this you could look into suncalc.js library
or just fixed time slots (12:00-13:00 for example…).
than for every sub entry you can choose one of the installed themes.

would be good to have an option to save/import/export these configurations.
and to provide a default configuration for example four seasons with the winter season day and night settings or something like this…

just ideas how to handle it a bit abstract to give all possible options…

sunny greetings
stefan

For location you could use the web location API, and for the default timezone you can get that from the browser too (new Date().getTimezoneOffset() returns the difference to UTC in minutes).

What I was mainly aiming at were boundaries that move year-by-year, as astronomical starts of seasons move around, since our year is not perfectly in sync with everything going on, from what I understand. Whereas the meteorogical definitions could easily be set by a user using date inputs.