Giter Club home page Giter Club logo

ibooks_ereader_detector's Introduction

iBooks Ereader Detector

EPUB 3 file that uses media queries to identify which iBooks platform is in use.

Download the file ibooks_ereader_detector.epub and load to iBooks for iPhone/iPad/Desktop. iBooks will display text indicating which of these platforms is in use, and (when possible) whether iBooks is in portrait, landscape, or two-up mode, e.g.

You are likely reading this ebook

  • On iBooks for iPad
  • In portrait mode

See epub.css file for annotated list of media queries used. Please feel free to make issues to report bugs and submit pull requests to suggest improvements

Platforms tested

ibooks_ereader_detector.epub has been tested on the following platforms:

  • iBooks 4 for iPad 3 Retina
  • iBooks 4 for iPhone 5S
  • iBooks Desktop for Mac on MacBook Pro Retina

Acknowledgments to Derrick Schultz and Liza Daly for their work and reports regarding testing media queries for iBooks.

ibooks_ereader_detector's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ibooks_ereader_detector's Issues

Landscape (two-up view)

Related to issue #685 in EPUB Revision

I now get why Liza Daily “couldn’t reliably target landscape mode with lower-width media queries”, why Derrick noted “this may or may not actually work with a media query” and why it went unnoticed in your Medium article.

To sum things up, iBooks has one viewport for content starting on the right page/ending on the left page but has another for content displayed on a spread (two-up). So, technically, it doesn’t have distinct portrait viewports, it just follows the Media Query spec to the letter—there is nothing provided for the width of columns.

This can lead to serious issues if you’re using media queries to change your type scale or, even worse, your global font-size e.g. contents missing at the end of your xhtml file because pagination is computed using the page width (starting on the right) while content is styled using the spread width.

In other words, you’d better design your CSS for this case and actually use two media queries (one to target a page/column and another one to target the spread/columns in landscape). Problem is a lot of other iOS apps don’t fake a spread like iBooks and will use styles declared in this second media query.

For your information, after checking my Apple Bug Reporter, I reported this behavior on 13 November 2014 (iOS 8). It’s gone unaddressed since. As a matter of fact, I guess it is kind of spec-compliant (media queries) and we’ve just got an edge case that happens to be part of our “standard”.

[Edit] In case that’s unclear, here is an image illustrating iBooks’ behavior:

page-spread

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.