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
How can I set full-screen background image #204
Comments
About the second question, I have found the solution. Using "background-repeat: repeat-x;" and "background-size: 100vw 100vh; |
I had a feed back from Jiminy, the author of Readium CSS. I suggested that such modification should better be done at the app level, to avoid any clash with the author CSS on viewport height value. |
Hi, Readium CSS maintainer there. I’m not sure how you’re applying the background image but assume it is set in the DOM itself considering you’re using CSS? A little bit of history about the top/bottom margins for the web view: we had to do it this way because we could not add The preferred method would be setting the background-image at the app level, and make the web view transparent (you might need to set a transparent background for |
Also, on a related note, we discussed an API to size and inject the content of your choice in those header/footer last week. You might want to pay attention to this API as it may create some issues when it ships, if you choose to keep your current solution – which would be reasonable if you control the input and know there is no |
Thanks @JayPanoz @llemeurfr /* default full-screen background image / /* default main body background */ Or we could handle the body background image at app-level? I just try the easier way to start. @JayPanoz |
@JayPanoz |
So yeah, this is something we’ve avoided as any element with an height declared with In other words, what you have is this (outer is web view, inner is the
To sum things up, the
But if an element happens to be
Applying the author’s
Mind you, that is something we may revisit at some point but yeah, it’s one of those complex issues with a lot of side effects and we decided to prioritize those side effects since they impacted the samples publishers provided to us. |
I tried the css you provided.
And the result is the same. In both cases (padding-top/top), there is another background image with some offset-Y cover the original background image. I thought it just the original background image shift down at begin, but then I found the extra background image's position is related to the first element in html. Like this:
When I change the first element, the position of the extra background image changes. For example, I reduce the font size of the first element, the image goes up. I think it is the unit of vh that control the WKWebview's pagination. And I assume that I can control the input ebook not use something like 100vh (at the moment). So I just don't know why it displays as this. Is there some matter with this which I apply to body?
And is this can be solved? |
On the other hand, I have been considering the app-level solution which you suggested.(But I still prefer the css solution at temporary, If possible.😁) Since the full-screen reading bring better user experience,I think the background image should scroll along with the content. (Maybe the top/bottom view should be, too.) That is say, the background image could not be a single image. It may be many same image added to the scroll view or two/three image reuse for transform. This seems to be the navigator's job, perhaps?The most important is where should I put the flag to let app know the background image. Do you have any standard/suggestion about this? |
So yeah this can somewhat be solved. Basically, if the heading ( Pink is the background-color for This is an issue we encountered at the very beginning of ReadiumCSS, because we had empty pages for short XHTML files like the title page, dedication, etc. That may explain the offset but, strictly speaking, is more of an authoring issue because you have to do the following in CSS to solve it:
On a related note, as you can see in this second screenshot, the height of the So tu put it simply, if you can avoid duplicating the background-image for |
Maybe it works on web, but it doesn't work on iOS app... There is what I get. Start with this:
The first page: top part of background image still shift down. It seems that the begin point shift down. Besides, notice that the image It is really strange that the extra background image is The next page and to the last page are normal. Maybe the
If I set P.S. The left-top view of "人名索引" is a part of app's view which just like the demo's top bar. |
Yeah, this won’t work on the web either and is the reason why I advised to avoid duplicating the background-image for
If you set By extension, that also explains our logic behind setting sepia and night modes for It’s also worth mentioning we’ve been trying to keep some sort of interoperability with other reading apps in this case. So Sorry, there is something I’m failing to understand about that. If the background-images are exactly the same, why not using one for |
That is what I exactly want! It works. Thank you very much! The final solution is:
P.S. There is something should be noticed. When setting background-image, the reading system's background-color mode may not work well. But in my case, I will not allow user to change the background-color mode if the ePub has already set the background-image. I will close the issue. Thanks again! @JayPanoz |
Also,because of the 80vh of content, the media guard ( |
There are two questions:
I try to set full-screen background image to each page of one chapter and the cover page. To do so, I set the Navigator full-screen, then the top bar and bottom bar just cover the Navigator. The first question is how to set the top/bottom margin of each page, since the top/bottom line of text is covered by the top/bottom bar content. Another question is about the background image. I use the css style "background-repeat: repeat-y;". It work well in Android with Readium SDK, but not work in iOS with R2.
The text was updated successfully, but these errors were encountered: