View Full Version : Epub3 and Interactivity


Thornchan
05-08-2012, 09:45 AM
So... I'm in the biggest rut ever and this is for my bachelor degree... Are you up for a challenge? :help:
(I know the threads on here - it says animation is not supported, etc etc)

I want to create a children's story (it's a poem with 5 pages about stress relief, a friend of mine is illustrating it) with interaction using Epub3.
The epub will be free on various platforms when done. My first direction is however towards iPad.

As long as something HAPPENS when touching different hotspots, I'm happy, BUT...

No code that embeds .svg's seems to work and spritesheet animation with css doesn't work as far as I've tried it.
I'd love to use and manipulate pixel images (jpeg/png/gif etc etc), not only vector.
Embedding a video is supposed to work, but the interface comes with it - an ugly big white "play" button, and there's no real interactivity in staring at a video playing...
The only thing so far that works in the epub3 reader I've found (AZARDI), Safari, and on iPad, is a fading rectangle:


<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<rect x="20" y="20" width="250" height="250" style="fill:blue">
<animate attributeType="CSS" attributeName="opacity" from="1" to="0" dur="5s" repeatCount="indefinite" />
</rect>
</svg>

So some manual codes work. I tried using the svg tag to insert a pixel image, but to no avail.

That said, I have also found this:
http://blog.threepress.org/2011/01/31/cost-effective-development-of-enhanced-content-with-epub3-digital-book-world-2011/
But of course the code she uses is not shown, just a mild outline.

And as far as I've researched - javascript is not to be trusted and shouldn't be used? Or is there javascript that works with epub3?

Is there any code you know of using some sort of interaction or animation that actually works except that fading rectangle?

JSWolf
05-08-2012, 03:00 PM
It won't work on various platforms as various platforms don't support ePub3. The best you'll get maybe is using iBooks. iBooks is not standard, so you'll have to figure out iBooks' oddities. But any eink reader does not support ePub3 nor ePub with animations.

Toxaris
05-08-2012, 05:48 PM
The animation part of SVG is also not supported in ePUB v3, just like in ePUB v2. It is in the specifications:

The [SVG] Animation Elements and Animation event attributes must not occur.

The specifications are on the site of the IDPF.

Please be aware that there are hardly any ePUB v3 readers or reading applications. The iBooks program is not, as JSWolf already said, a good example. It is tuned to Apple's version of ePUB and deviates from the IDPF specifications. YMMV.