ActionSlideJS
Ready? Steady? Action!
Simple animation library for action movie credits (aka "action slide") in JavaScript, supporting all major browsers:
- IE9+
- Firefox
- Safari
- Chrome
- Opera
Prerequisite: JQuery
Copyright (c) 2013 - 2013 Liron Aichel
Project homepage: http://lironaichel.com/lironaichel/jsworks/actionslide/
Github homepage: http://liri.github.io/ActionSlideJS.
CSS3 Demo: http://lironaichel.com/lironaichel/jsworks/actionslide/samples/css3Background.html
Documentation: http://lironaichel.com/lironaichel/jsworks/actionslide/docs/index.html
Licensed under MIT-style license: Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ActionSlideJS is a tiny animation library for creating a "action movie opening" like animation (also works as jQuery plugin).
To start use ActionSlideJS, include jQuery library:
<script src="js/jquery.min.js"></script>
Include ActionSlideJS library:
<script src="js/actionslide.min.js"></script>
Include ActionSlideJS styling (CSS):
<link rel="stylesheet" type="text/css" href="css/actionslide.css" />
You're good to go!
Zero lines of code!
ActionSlideJS automatically detect your DOM element. Just place "data-role='actionSlide'" on your list element (ul):
<ul data-role="actionSlide"> <li data-title="Slide I" data-duration="3000"> <span>Slide I Content</span> </li> <li data-title="Slide II" data-duration="2000"> <span>Slide II Content</span> </li> </ul
Stage Animation
There is an option to animate background lines, you can disable it using:
data-animate-background
<ul data-role="actionSlide" data-animate-background="false">
It's pretty cool and enhanch the "action" style.
Slide Animation
Each slide has default properties during the slideshow:
- title = (empty)
- duration = 2000 (2 seconds)
- animation = slide
- direction = left-to-right
- textAlign = left
- easing = linear
You can change any of the default values using "data-" on each slide element (li).
data-title
Appears as the slide title, different just in style from the slide content.
<li data-title="Slide I">
data-duration
The duration of the slide animation.
<li data-duration="5000">
data-animation
The animaiton type for this slide, possible values are currently 'fade' or 'slide'.
<li data-animation="slide/fade">
data-direction
Only relevant for 'slide' animation. Controls the direction of the animation, possible values are 'rtl' or 'ltr'.
<li data-direction="rtl/ltr">
data-textAlign
The slide content text alignment.
<li data-textAlign="center">
data-easing
The easing function of the slide animation.
<li data-easing="linear">
Using easing functions other than 'linear' requires jQuery UI library.
ActionSlideJS works on top of your container element, you can style the container as you wish.
In order to match ActionSlideJS styling to your container, use the following classes:
actionslide-container
Container for each animated slide.
.actionslide-container a { color: white; text-decoration: underline; } .actionslide-container a:hover { text-decoration: none; }
<h4>actionslide-title</h4>
<p>Slide title style</p>
<pre class="prettyprint linenums">
.actionslide-title { font-size: 34px; font-style: italic; font-weight: bold; color: black; margin-bottom: 10px; text-shadow: -1px -1px #bbb,1px 1px #bbb; color:#eee; letter-spacing: 2px; }
actionslide-content
Slide content style
.actionslide-content { font-size: 18px; text-shadow: -1px -1px #bbb,1px 1px #bbb; color:#eee; }
actionslide-bglines
Background lines animation
.actionslide-bglines { height: 2px; background-color: white; opacity: 0.1 }