Sepitus-exe / WKElementaryDark

A user css theme for the wanikani domain
MIT License
3 stars 1 forks source link

Create userscript to install ED #66

Closed wrex closed 1 year ago

wrex commented 1 year ago

It occurred to me that it would be trivial to write a javascript wrapper to add the stylesheet(s) to the DOM in addition to publishing it as a stylus stylesheet.

It could have a UI to optionally install any additional userscript ED stylesheets the user desired.

Finally, it could use [jscolor](jscolor.com] or something similar to make it easy to create a custom override stylesheet.

I'll definitely do this once things settle a bit and the next version is published.

I think more people on WK have tampermonkey installed than stylus (though I could be wrong), but supporting both installation methods would let us cover the widest audience:

wrex commented 1 year ago

Created a v.next label for things that won't make it into the upcoming release.

Sepitus-exe commented 1 year ago

I wouldn't be opposed per se, and see the value of adding another distribution stream, but this would fall well outside of my area of expertise. I don't feel like it would be reasonable for me to take on the responsibility for such a project.

I will however fully encourage you to make this into a related project or a fork, that we could point people to from the WK forums or the readme on this git repository.

wrex commented 1 year ago

Oh, yeah, this was mainly just a reminder to myself and to let you know what I was thinking.

I'd definitely create another repository to develop it.

wrex commented 1 year ago

Also, adding the stylesheet to the DOM is trivial, the rest of the app I have in mind won't be. :smile:

Sepitus-exe commented 1 year ago

Also, adding the stylesheet to the DOM is trivial, the rest of the app I have in mind won't be. 😄

You sometimes scare me in the most delightful way

wrex commented 1 year ago

Heh. I've been known to overdo things.

I've decided against a userscript and in favor of a standalone web app with a much smaller userscript that just reads the values produced from the app and adds it to the DOM.

My working idea is something very similar to this: https://pick-palette.netlify.app/ (I might just fork that to start, but I'd rather write it in SvelteKit).

Thinking three panels in the app:

  1. The palette section at the bottom (color picker to mix individual colors, then auto generate shades and tints).

  2. The USER property section at the top (allows you to pick colors from either the palette or other USER variables)

  3. A tabbed section of sample layouts:

    • One tab with generic overlapping surfaces (all containing text in all three colors + brand icons). Also includes large swatches for R/KV, A/G/M/E/B, Meaning/Reading, and correct/incorrect
    • One tab mocking up a review page (with buttons to control state)
    • One tab mocking up the dashboard.

The app just stores everything in IndexedDB locally on the browser. The userscript just reads from what's in IndexedDB and overrides the --USER- variables. I'll use svelte store pub-sub semantics to keep things synchronized.

In theory this won't be too difficult, but it will be a fair bit of work.

wrex commented 1 year ago

Still a long way from complete, but to give you an idea of where I'm heading: https://wked.rexs.tools

Remaining work (high priority items):

I think I can actually finish all this by Wednesday. :smile:

The repository for the code is here: https://github.com/wrex/ed-themer

wrex commented 1 year ago

Hey, it works!

Please take a peak at https://wked.rexs.tools and let me know if you have any suggestions or find anything broke.

It's basically functional (and useful!) at this point, but there is still some remaining work:

wrex commented 1 year ago

Closing this one, dev version is at https://github.com/wrex/ed-themer