Giter Site home page Giter Site logo

reveal-inline-svg's Introduction

reveal-inline-svg

Automatically inlines SVG files in Reveal.js presentations. Allows the application of fragments, animations etc. to SVG DOM elements.

Note on browser compatibility:

It seems that out of IE, Edge, Chrome and Firefox, reveal-inline-svg is only compatible with Firefox. The other browsers seem to not implement the same JS API for the object html element so the selection and extraction of the svg element fails for various reasons. I do not expect to have the time to try and fix this in the near fututre. :-(

Installation

Just include inline_svg.js as a dependency of Reveal inside the Reveal.initialize function in your presentation's HTML file. See test.html for an example.

Usage

The script will replace any object element in your presentation with an SVG element of the included SVG file. In addition, you can apply any attribute to any SVG element in the SVG DOM using param elements. Example:

<object type="image/svg+xml" data="drawing.svg">
  <param id="rect10" class="fragment" data-fragment-index="3">
</object>

This code will replace the object element with an SVG element using the SVG in drawing.svg. In addition, it will add the class="fragment" data-fragment-index="3" attributes to #rect10 inside the SVG DOM.

Demo

To see a simple demo slide put all files within your reveal.js folder and point your browser to test.html.

Dependencies

The example presentation (test.html) uses Velocity.js to demonstrate animation of SVG elements.

reveal-inline-svg's People

Contributors

ranr01 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

marcelbrueckner

reveal-inline-svg's Issues

Browser compatibility

Out of IE, Edge, Chrome and Firefox, reveal-inline-svg is only compatible with Firefox.
The other browsers seem to not implement the same JS API for the object html element so the selection and extraction of the svg element fails for various reasons.

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.