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

Adding a service worker for offline functionality #9

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

danielpietzsch
Copy link
Contributor

Hi @bastianallgeier ,

I’ve added @adactio ’s service worker script to be able to host this on a server without the penalty of not being able to use it offline.
So, I’ve lately been serving my fork via GitHub Pages, which I prefer to opening a local file in the browser.

Feel free to merge, if you like this, too. Or simply close it.

This is useful, when you have this page open in a long running tap. This 
way, when it's a new day, it'll highlight the appropriate textarea 
(without the need to refresh the page).
Simply overwriting the color variables when the user prefers dark mode.
The additional color statement for textarea is necessary, because 
otherwise (most) browser stylesheet overwrite the intended value, due to 
higher specificity
This makes the UI adopt a little better to smaller screens
…highlighting the current day.

Also 've done some refactoring and applying .focus() to the textarea 
(because simply adding the autofocus attribute is not enough (in all 
cases) to focus it).
It's the minimal viable service worker script by Jeremy Keith: 
https://gist.github.com/adactio/3717b7da007a9363ddf21f584aae34af
…o that it works with Github's default Pages URLs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant