GithubHelp home page GithubHelp logo

banderson623 / ibooks-html-widget-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from trevorburnham/ibooks-html-widget-boilerplate

0.0 3.0 0.0 103 KB

A minimal HTML widget compatible with iBooks Author

ibooks-html-widget-boilerplate's Introduction

iBooks HTML Widget Boilerplate

This is a minimal project for an HTML Widget that can be embedded in an iBook with iBooks Author.

Created by the author of CoffeeScript: An Interactive Reference, now available in the iBooks store.

Why?

Because the recommended approach for creating an HTML widget for iBooks Author is currently to create a Dashboard widget in Dashcode. This adds a lot of distracting cruft, and things that work fine in Dashcode have a tendency to stop working in iBooks. In short, it's better to treat an iBooks widget as a web page rather than as a Dashboard widget.

Usage

Clone this git repo as a directory with a .wdgt extension. Modify the HTML, CSS, and JavaScript with the tools of your choice, just as you would any other web page.

Click-and-drag the .wdgt file into iBooks Author. And that's it!

Preview image

Notice, however, that when you drag the .wdgt into iBooks Author, you just get an image that says "Preview." iBooks doesn't load anything from your HTML widget other than Default.png until the user taps it.

If you just delete Default.png, iBooks Author will generate a preview automatically, but it probably won't have the proportions that you want, and some of the content may overflow. I recommend replacing Default.png with a nice screenshot of the widget, and cropped and scaled to the right dimensions. You should probably make this the last step in your book production process, and do without Default.png until then.

Widget dimensions

Open up Info.plist to set the appropriate width and height for your widget. When opened on the iPad, the widget will be scaled to fit the screen but will maintain the correct width/height proportion. Also note that 1px in your markup refers to 1px according to the Info.plist dimensions, not the actual pixels on the device screen.

Currently, HTML widgets can only be viewed in landscape orientation, so you'll probably want a size of 1024x768 adjusted slightly for the title, caption, and background margin that you can customize from the Widget inspector in iBooks Author like so:

Widget layout settings in iBooks Author

License

http://trevorburnham.mit-license.org/

ibooks-html-widget-boilerplate's People

Contributors

trevorburnham avatar

Watchers

 avatar  avatar  avatar

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.