stumpapp / stump

A free and open source comics, manga and digital book server with OPDS support (WIP)
https://stumpapp.dev
MIT License
949 stars 45 forks source link

[FEATURE] Custom EPUB reader themes #122

Open aaronleopold opened 1 year ago

aaronleopold commented 1 year ago

This is fairly simple to support, but would require basic JavaScript knowledge for the user. Themes would be stored as a blob that can be loaded if selected. For example, the current (lacking) dark theme is just a few lines:

export interface EpubTheme {
    [tag: string]: object
}

export const stumpDark: EpubTheme = {
    a: { color: '#4299E1' },
    body: { background: '#1B1C1E' },
    h1: { color: '#E8EDF4' },
    h2: { color: '#E8EDF4' },
    h3: { color: '#E8EDF4' },
    h4: { color: '#E8EDF4' },
    h5: { color: '#E8EDF4' },
    p: { color: '#E8EDF4', 'font-size': 'unset' },
}

This will get more complicated once the streamable reader is actually working some day. But that isn't really a concern yet.

hollisticated-horse commented 2 months ago

Hello, How about having multiple by default fonts ? And the possibility of uploauding new ones ?

I'm thinking for people with dyslexia, having the opendyslexic font is essential. (Maybe at system level even)

Maybe some Serifs and Sans-Serifs (three each ?). I really like the Libre Baskerville one for example.

I can open a seperate issue if you want.

hollisticated-horse commented 2 months ago

here are other things that would be geat Quality Of Life features for epubs:

For colors, you could also have an area with UI where you can input the colors you want for each element mentioned above ? And better yet, have the possibility of downloading the .js and being able to import it ?

aaronleopold commented 2 months ago

I'm thinking for people with dyslexia, having the opendyslexic font is essential. (Maybe at system level even)

TIL

I can open a seperate issue if you want.

I think a separate issue for fonts would work. Offhand, I'm not sure how it would really work (e.g. is it just a matter of ensuring the host/client has it installed, or something else). If there is a ticket for font loading specifically, it would be easier to eventually prioritize and implement 🙂

here are other things that would be geat Quality Of Life features for epubs:

  • adjustable line-heights
  • margins around the whole book (top, bottom, left and right synced)
  • word spacing, maybe some presets ?

Yep! I love all of these! Would you mind creating a ticket for QOL epub reader improvements?

And better yet, have the possibility of downloading the .js and being able to import it ?

I'm not sure what you mean here, are you referring to that JS example block from the issue description?

hollisticated-horse commented 2 months ago

I'm not sure what you mean here, are you referring to that JS example block from the issue description?

That is indeed what I was trying to mention. A middle ground, for non-technical users, would be to have UI to generate that file. That got me thinking that maybe it would be cool to be able to share the themes, with colors etc., and be able to load them from file.

Hope it's clearer :D