12-28-2023, 10:09 AM | #16 | |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Can you please provide links to the download for the other two programs? Last edited by JSWolf; 12-28-2023 at 10:13 AM. |
|
12-28-2023, 01:11 PM | #17 | ||
Wizard
Posts: 1,549
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
BibiReader: https://github.com/satorumurmur/bibi EpubJS Reader: https://github.com/futurepress/epubjs-reader Quote:
|
||
Advert | |
|
12-28-2023, 04:50 PM | #18 |
Enthusiast
Posts: 33
Karma: 2538
Join Date: Aug 2023
Location: NW US
Device: none
|
Yep JSW you're right again. I had to add a temporary colored border around each element just to see the problems. Reading about centering suggestions at an excellent codepen post has provided some interesting pointers.
Shaw's Codepen |
12-28-2023, 06:02 PM | #19 | |
Wizard
Posts: 1,549
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
Quote:
1) In your css stylesheet: Code:
.cover { margin: 0; height: 99vh; max-width: 100%; overflow: hidden !important; } .picWrapper { margin: 0; padding: 0; height: 100%; } .pic { display: block; margin: auto; width: 100%; position: absolute; top: 0; bottom: 0; left: 0; right: 0; } Code:
<body class="cover"> <div class="picWrapper"> <svg class="pic" xmlns="http://www.w3.org/2000/svg" height="100%" preserveAspectRatio="xMidYMid meet" version="1.1" viewBox="0 10 600 800" width="100%" xmlns:xlink="http://www.w3.org/1999/xlink"><image height="800" width="600" xlink:href="../Images/Your_Cover.jpg"/></svg> </div> </body> Regarding the code in CodePen many things are not applicable to epub and others are old. For example, under ePub3 with only three lines of code you can absolute center whatever; you don't need so much code. Last edited by RbnJrg; 12-28-2023 at 06:11 PM. |
|
12-28-2023, 07:06 PM | #20 |
Enthusiast
Posts: 33
Karma: 2538
Join Date: Aug 2023
Location: NW US
Device: none
|
Your cover method is an ideal solution due to its ultra short code + SVG. Your example (or JSW's example) are both fine. Epub designers certainly should use either to suit their needs.
|
Advert | |
|
12-29-2023, 05:17 AM | #21 |
Wizard
Posts: 1,549
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
|
12-29-2023, 08:33 AM | #22 | |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
vh and vw do not work in too many places s recommending them is not a good idea. You want cover code that works in both ePub 2 and ePub 3. Does FBReader work with SVG? |
|
12-29-2023, 08:35 AM | #23 |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
12-29-2023, 08:58 AM | #24 |
A Hairy Wizard
Posts: 3,101
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Same argument in two different locations….
vh/vw work just fine, if the device/app doesn’t support it then it will fallback to the alternative code. |
12-29-2023, 12:49 PM | #25 |
Wizard
Posts: 1,549
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
The cover code I posted above (that makes use of a svg wrapper), so far worked everywhere (epub2 and epub3), and even in FBReader. But if you find an app/program where the code does not work (that can be perfectly possible) I will thank a lot if you tell me about the issue.
|
12-29-2023, 02:22 PM | #26 |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
|
12-29-2023, 02:24 PM | #27 | |
Resident Curmudgeon
Posts: 74,037
Karma: 129333114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
Last edited by JSWolf; 12-29-2023 at 02:46 PM. |
|
12-29-2023, 02:52 PM | #28 |
A Hairy Wizard
Posts: 3,101
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
|
12-29-2023, 03:02 PM | #29 |
Wizard
Posts: 1,549
Karma: 6613969
Join Date: Mar 2013
Location: Rosario - Santa Fe - Argentina
Device: Kindle 4 NT
|
So far, the code I posted is working in:
So, if you say that the code that I posted above could fail, well, I cannot deny that because it may fail. But I ask where? Because in all the programs and applications in which I have tested it so far, it works. |
12-29-2023, 06:22 PM | #30 |
Enthusiast
Posts: 33
Karma: 2538
Join Date: Aug 2023
Location: NW US
Device: none
|
Question about your SVG cover code. There's a curious factor occurring when I temporarily add a color border around several elements in your cover code, just to see how its layered. For this example I temporarily shortened the first height:90vh so as to better see how its layered. Tested using a square SVG, and your wrapper code as is. Blue outer container, the red inner container (neither color spacing will be used by me in the final cover - these are just temp visuals) which I do by merely adding a 10px border to each of the two wrappers.
Here's the xhtml svg code: Code:
<body class="cover"> <div class="picWrapper"> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" height="100%" width="100%" preserveAspectRatio="xMidYMid meet" viewBox="0 0 500 500" xml:space="preserve"> <rect fill="#BADD8C" height="100%" width="100%"/> </svg> </div> </body> Code:
.cover {border: 10px solid blue;} .picWrapper {border: 10px solid red;} Why does the lower red wrapper run over the lower outer blue border? Should one container fit inside the other container (or be bound by the other container in some way)? Or is none of this (i.e. container inside of container) really going to effect the epub cover (because the principal theory works based on your extensive test list in an above post!), + using the shortest most concise code is simply the ideal solution for epub3 (+ its fallback for epub2)? Thank you! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Command line: How to embed color default cover instead of missing cover? | EbokJunkie | Conversion | 9 | 07-22-2015 12:30 AM |
Sell Nook Glowlight + cover, PRS600, Kindle 3 m-edge cover, K2 cover | Waba | Flea Market | 3 | 10-12-2014 10:36 AM |
Sell HP TouchPad 32gb NIB + ipad cover + non-reflective LCD cover | Waba | Flea Market | 3 | 09-26-2011 12:45 PM |
Ended Sony PRS-505 SC w/ Cover and Separate Wedge Light Cover in Canada | notsure | Flea Market | 2 | 11-13-2010 03:28 PM |
PRS-300 Pictures: Pink 300 + Sony red cover + custom cover | h0bbes | Sony Reader | 5 | 01-04-2010 12:41 PM |