Ripple
posted: October 04, 2009 at 03:00 PM categories: animation, filters, interactive view comments
Download Video: WebM | MP4 | OGG
This demo shows interactive animated SVG filter effects.
The animation is made by animating a displacement map image, with a radial gradient mask to smoothly fade out the edges. To be able to run the animation the browser must support SVG filters, declarative animation (SMIL) and scripting.
See attributions.
Running the demo
Click on the "Start SVG Demo" at the top of this page.
Then click anywhere on the image to start animating a droplet ripple effect from that point.
Animated Lyrics
posted: October 04, 2009 at 03:00 PM categories: audio, animation, interactive view comments
Download Video: WebM | MP4 | OGG
This example illustrates the use of the following features:
- Depending on the implementation, SVG or HTML 5 <audio> in a <foreignObject>
- Web fonts
- Text on a path
- Scripted animation
Note that the demo uses setTimer to synchronize the lyrics with the audio because the new audio timeupdate event is not supported in all the browsers yet. However, as explained on Silvia Pfeiffer's site it would be a better way to synchronize the lyrics in a pure HTML5 context.
See attributions about the song and fonts used in this demo (also showing at the end of the demo). The code leverages the YUI library with an extension to allow animation of SVG transform attributes.
Running the demo
Click on the "Start SVG Demo" at the top of this page. When the demo has loaded, click in the center of the image. Then, once the menu has settled, click on the "ancient sun" item.
Pattern1
posted: October 04, 2009 at 03:00 PM categories: pattern, interactive view comments
This example illustrates the use of
the svg <pattern> element. The background rectangle
is drawn with a simple pattern made of dots and rectangles,
similar to that found in modern art work and designs
(e.g., Vasarely, Verner Panton). The "svg" text is painted with
a similar, inverted pattern.
Patterns a common in computer graphics. However, SVG patterns are powerful in that they can be defined not only as bitmap content, which is the common case in graphics libraries, but also as vector content. In other words, the content of an SVG pattern can be any arbitrary SVG graphics. Furthermore, SVG patterns can be created by scripts.
In the initial rendering, there is actually no outline for the text, and our perception still makes out the 'svg' shape outline by assuming continuity between unconnected path segments. This is an optical illusion similar to what happens with the famous Kanizsa triangle.
Note, however, that even though there is no real "svg" shape in the visual rendering, a shape is actually filled with a different pattern...
Running the demo
After loading the demo, move the cursor over the rectangle. This will first show the 'SVG' text filled with a different pattern. Then, move the cursor over the text iteself to show the text in another, colored pattern.
Light Table
posted: October 04, 2009 at 03:00 PM categories: animation, interactive view comments
Download Video: WebM | MP4 | OGG
Like the Photo Album demo, this demo shows how SVG can be used to render images retrieved from the Flickr interesting photo source and provide a dynamic, interactive user experience.
This demo leverages the Yahoo YUI library with extensions to make it work with SVG elements, in particular to allow the animation of the transform attribute.
The magnifier effect used in this demo was inspired by Jared Tarbell's text sphere.
See attributions for details on the YUI library.
Running the demo
Click on the "Start SVG Demo" at the top of this page. When the demo has loaded a first page of images, click on the 'prev' or 'next' links at the bottom left of the page to load a new page.
WARNING: the demo runs very slowly in Firefox as of version 3.6.
Pebbles
posted: October 04, 2009 at 03:00 PM categories: animation, interactive view comments
Download Video: WebM | MP4 | OGG
This demo illustrates the use of the getPointAtLength() API on the SVG <path> element.
The script simply accesses the path of an object and gets the coordinates of points along that path. Then, it positions a 'pebble' of random size at a pseudo-random position about the coordinates returned by getPointAtLength
Inkscape was used to convert the "SVG" and "Wow!" texts to SVG paths elements which the demo code manipulates.
See attributions for the OpenClipArt play/pause icons.
Running the demo
Click on the "Start SVG Demo" at the top of this page. When the demo has loaded, click in the play button at the bottom right. Once the "SVG" text has fully appeared, click on the display.