Warning 1

X

Table of content

CSS Anime

Anime is a CSS library to build animations, inspired on Dan Eden's Animate.css, Codrops and ElementTransitions.js.

Create beautiful animations and cool slides with a simple HTML markup. Also, Animate can be used in combination with javascript to create slides, models and everything you can imagine.

	<link href="http://hipertextos.github.io/src/css/anime.css" rel="stylesheet" media="screen">
	<!-- Jquery is needed to use slides and animation on scroll -->	
	<script src="http://hipertextos.github.io/src/js/jquery.js" type="text/javascript"></script>
	<script src="http://hipertextos.github.io/src/js/anime.js" type="text/javascript"></script>
							
http://hipertextos.github.io/src/css/anime.css +

Ways to animate

In the HTML markup

Sample
content
content

Markup
	<!-- Syntax -->
	<div class="anm-[animationName]">content</div>

	<!-- Example -->
	<div class="anm-tada">content</div>
	<div class="anm-shake">content</div>
							

With jquery: on load

Sample
#animation1

Markup
	<!-- Snippets -->
	<div id="animation1">#animation1</div>

	<!-- jQuery -->
	<script>
	$(document).ready(function(){
		$('#animation1').addClass('anm-fadeIn');
	});
	</script>
								

With jquery: on click

Sample
#animation2
Markup
	<!-- Snippets -->
	<button id="clickthis">#clickthis</button>
	<div id="animation2">#animation2</div>

	<!-- jQuery -->
	<script>
		$('#clickthis').click(function(){
			$('#animation2').toggleClass('anm-fadeIn');
		});
	</script>
								

Applying animations in collapse, tabs and modals

Sample

Cite

Quid te vis alicui præferre; cum plures doctiores te inveniantur, et magis in lege periti. Si vis utiliter aliquid scire et discere: ama nesciri et pro nihilo reputari.

Cite

Quid te vis alicui præferre; cum plures doctiores te inveniantur, et magis in lege periti. Si vis utiliter aliquid scire et discere: ama nesciri et pro nihilo reputari.

Cite

Quid te vis alicui præferre; cum plures doctiores te inveniantur, et magis in lege periti. Si vis utiliter aliquid scire et discere: ama nesciri et pro nihilo reputari.

Stuff for Tab One

Stuff for Tab Two

Stuff for Tab Three


Open dialog
Markup
<!-- Accordion demo -->
<div class="accordion">
	<h4>Cite</h4>
	<section>Quid te vis alicui præferre; cum plures doctiores te inveniantur, et magis in lege periti. Si vis utiliter aliquid scire et discere: ama nesciri et pro nihilo reputari.</section>
	<h4>Cite</h4>
	<section>Quid te vis alicui præferre; cum plures doctiores te inveniantur, et magis in lege periti. Si vis utiliter aliquid scire et discere: ama nesciri et pro nihilo reputari.</section>
	<h4>Cite</h4>
	<section>Quid te vis alicui præferre; cum plures doctiores te inveniantur, et magis in lege periti. Si vis utiliter aliquid scire et discere: ama nesciri et pro nihilo reputari.</section>
</div>

<script>
$(function() {
	$('.accordion section').toggleClass('closed');
	$('.accordion h4').click(function(e){
		$(this).next('section').toggleClass('closed anm-shake')
		.siblings('section:visible').toggleClass('closed anm-shake');
		e.preventDefault();
	});
});
</script>

<!-- Tabs demo -->
<div class="tabs">
	<div class="tab">
		<label class="idtrigger tab-active" href="#one">Tab One</label>
		<label class="idtrigger" href="#two">Tab Two</label>
		<label class="idtrigger" href="#three">Tab Three</label>
	</div>
	<div class="container">
		<div class="tab-panel idpanel closed" id="one">
		   <p>Stuff for Tab One</p>
		</div> 
		<div class="tab-panel idpanel" id="two">
		   <p>Stuff for Tab Two</p>
   
</div> 
		<div class="tab-panel idpanel" id="three">
		   <p>Stuff for Tab Three</p>
   
</div> 
	</div>
</div>

<script>
	// Tabs & sliders
	$('.idpanel').toggleClass('closed');
	$('.idtrigger').click(function(e){
		e.preventDefault(); 
		var currentPanel = $(this).attr('href');
		$(this).toggleClass('tab-active').siblings('.idtrigger').removeClass('tab-active');
		$(currentPanel).toggleClass('closed anm-fadeIn').siblings('.idpanel:visible').toggleClass('closed anm-fadeIn');
		if ($('.idpanel:visible').length) {
		} else {
		}
	});
</script>

	<!-- Dialog -->
	<a class="button button-modal" href="#warning1">Open dialog</a>
	<section class="dialog" id="warning1"><h4>Warning 1</h4><a class="button-close" href="#warning1">X</a></section>

	<script>
	$(function() {
		$('.dialog').toggleClass('closed');
		$('.button-modal, .dialog .button-close').click(function(){
			var currentDialog = $(this).attr('href');
			$('.overlay').toggleClass('closed anm-fadeIn');
			$(currentDialog).toggleClass('closed anm-moveFromTop');
		});
	});
	</script>
								

On scroll page with jquery

On scroll with jQuery (and re-when come back to top).

Sample

Demo

Markup
	<!-- Snippets -->
	<label class="animeinscroll button flat red">.animeinscroll</label>
	<label id="animeinscroll">#animeinscroll</label>

	<!-- jQuery -->
	<script>
		// Animations on scroll
		// Create a window variable to set the scroll
		var win = $(window);
		// Create a variable for .anim
		var variable1 = $('.animeonscroll');
		var variable2 = $('#animeonscroll');
		// Apply the animations on scroll
		win.scroll(function(event) {
		  variable1.each(function(i, el) {
			var el = $(el);
			if (el.visible(true)) {
			  el.addClass('anm-moveFromLeftFade slow'); 
			} else {
			  el.removeClass('anm-moveFromLeftFade slow'); 
			} 
		  });
		});
		win.scroll(function(event) {
		  variable2.each(function(i, el) {
			var el = $(el);
			if (el.visible(true)) {
			  el.addClass('anm-moveFromRightFade slow'); 
			} else {
			  el.removeClass('anm-moveFromRightFade slow'); 
			} 
		  });
		});
	</script>
								

As a slide transitions

Sample

Slides are explained in the next chapter: Slides.


http://hipertextos.github.io/src/css/anime.css + http://hipertextos.github.io/src/js/anime.js

Slides

Default

A start point to build CSS animations. With a small jQuery scripts can be used to build presentations and transitions between panels. Based on Dan Eden's Animate.css, Codrops and ElementTransitions.js. Distribute under the MIT license.

Sample
Simple slides

Page 1

Page 2

Slides with buttons

Page 1

Page 2

Combining animations and steps

Page 1

Page 2

Page 3


Demo

Markup
	<!-- Simple slides -->
	<div class="slide-wrapper slide-trigger" slide-in="rotateSlideIn" slide-out="rotateSlideOut">
		<div class="flat orange slide-page">
		   <h2>Page 1</h2>
		</div>
		<div class="flat soft-violet slide-page">
			<h2>Page 2</h2>
		</div>
	</div>

	<!-- Slides with buttons -->
	<div class="slide-wrapper">
		<button class="flat violet slide-trigger" slide-in="rotateCubeRightIn" slide-out="rotateCubeRightOut">Next</button>	
		<div class="flat soft-yellow slide-page">
			<h2>Page 1</h2>
		</div>
		<div class="flat soft-violet slide-page">
			<h2>Page 2</h2>
		</div>
	</div>

	<!-- Combining animations and steps -->
	<div class="slide-wrapper">
		<div class="flat violet slide-page">
			<h2>Page 1</h2>
			<button class="flat blue slide-trigger previous" slide-step="-1" slide-in="rotateInNewspaper" slide-out="rotateOutNewspaper">Prev</button>	
			<button class="flat blue slide-trigger" slide-in="rotateInNewspaper" slide-out="rotateOutNewspaper">Next</button>	
		</div>
		<div class="flat sky slide-page">
			<h2>Page 2</h2>
			<button class="flat blue slide-trigger previous" slide-step="-1" slide-in="rotateInNewspaper" slide-out="rotateOutNewspaper">Prev</button>	
			<button class="flat blue slide-trigger" slide-in="flipInRight delay500" slide-out="flipOutLeft">Next</button>	
		</div>
		<div class="flat soft-sky slide-page">
			<h2>Page 3</h2>
			<button class="flat blue slide-trigger previous" slide-step="-1" slide-in="rotateInNewspaper" slide-out="rotateOutNewspaper">Prev</button>	
			<button class="flat blue slide-trigger" slide-in="rotateCubeRightIn" slide-out="rotateCubeRightOut">Next</button>	
		</div>
	</div>

								

http://hipertextos.github.io/src/css/anime.css +

Custom delay

.delay-[value]

Sample
anm-bounce delay-100
anm-bounce delay-200
anm-bounce delay-300
anm-bounce delay-400
anm-bounce delay-500
anm-bounce delay-600
anm-bounce delay-700
anm-bounce delay-800
anm-bounce delay-900
anm-bounce delay-1000
anm-bounce delay-2000
anm-bounce delay-3000
anm-bounce delay-4000
anm-bounce delay-5000
anm-bounce delay-6000
anm-bounce delay-7000
anm-bounce delay-8000
anm-bounce delay-9000

Markup
	<!-- Snippets -->
	<div class="anm-bounce delay-100">.anm-bounce delay-100</div>
	<div class="anm-bounce delay-200">.anm-bounce delay-200</div>
	<div class="anm-bounce delay-300">.anm-bounce delay-300</div>
	<div class="anm-bounce delay-400">.anm-bounce delay-400</div>
	<div class="anm-bounce delay-500">.anm-bounce delay-500</div>
	<div class="anm-bounce delay-600">.anm-bounce delay-600</div>
	<div class="anm-bounce delay-700">.anm-bounce delay-700</div>
	<div class="anm-bounce delay-800">.anm-bounce delay-800</div>
	<div class="anm-bounce delay-900">.anm-bounce delay-900</div>
	<div class="anm-bounce delay-1000">.anm-bounce delay-1000</div>
	<div class="anm-bounce delay-2000">.anm-bounce delay-2000</div>
	<div class="anm-bounce delay-3000">.anm-bounce delay-3000</div>
	<div class="anm-bounce delay-4000">.anm-bounce delay-4000</div>
	<div class="anm-bounce delay-5000">.anm-bounce delay-5000</div>
	<div class="anm-bounce delay-6000">.anm-bounce delay-6000</div>
	<div class="anm-bounce delay-7000">.anm-bounce delay-7000</div>
	<div class="anm-bounce delay-8000">.anm-bounce delay-8000</div>
	<div class="anm-bounce delay-9000">.anm-bounce delay-9000</div>
								

http://hipertextos.github.io/src/css/anime.css +

Custom speed

.[speed]

Sample
anm-bounce extra-fast
anm-bounce fast
anm-bounce slow
anm-bounce extra-slow

Markup
	<!-- Snippets -->
	<div class="anm-bounce delay-100">.anm-bounce delay-100</div>
	<div class="anm-bounce delay-200">.anm-bounce delay-200</div>
	<div class="anm-bounce delay-300">.anm-bounce delay-300</div>
	<div class="anm-bounce delay-400">.anm-bounce delay-400</div>
	<div class="anm-bounce delay-500">.anm-bounce delay-500</div>
	<div class="anm-bounce delay-600">.anm-bounce delay-600</div>
	<div class="anm-bounce delay-700">.anm-bounce delay-700</div>
	<div class="anm-bounce delay-800">.anm-bounce delay-800</div>
	<div class="anm-bounce delay-900">.anm-bounce delay-900</div>
	<div class="anm-bounce delay-1000">.anm-bounce delay-1000</div>
	<div class="anm-bounce delay-2000">.anm-bounce delay-2000</div>
	<div class="anm-bounce delay-3000">.anm-bounce delay-3000</div>
	<div class="anm-bounce delay-4000">.anm-bounce delay-4000</div>
	<div class="anm-bounce delay-5000">.anm-bounce delay-5000</div>
	<div class="anm-bounce delay-6000">.anm-bounce delay-6000</div>
	<div class="anm-bounce delay-7000">.anm-bounce delay-7000</div>
	<div class="anm-bounce delay-8000">.anm-bounce delay-8000</div>
	<div class="anm-bounce delay-9000">.anm-bounce delay-9000</div>
								

http://hipertextos.github.io/src/css/anime.css + http://hipertextos.github.io/src/js/anime.js

The animations

Basic animations

Entry

Exit animations

Exit fade
anm-fadeOut
Scale exit animations
anm-scaleDown anm-scaleDownCenter anm-scaleDownUp
Direction exit animations
anm-moveToLeft anm-moveToRight anm-moveToTop anm-moveToBottom
Direction exit animations with fade
anm-moveToLeftFade anm-moveToRightFade anm-moveToTopFade anm-moveToBottomFade
Direction exit animations with easing
anm-moveToLeftEasing anm-moveToRightEasing anm-moveToTopEasing anm-moveToBottomEasing
Zoom exit animations
anm-zoomOut anm-zoomOutLeft anm-zoomOutRight anm-zoomOutUp anm-zoomOutDown
Rotate exit animations
anm-rotateOut anm-rotateOutDownLeft anm-rotateOutDownRight anm-rotateOutUpLeft anm-rotateOutUpRight
Push exit animations
anm-rotatePushLeft anm-rotatePushRight anm-rotatePushTop anm-rotatePushBottom
Fold exit animations
anm-rotateFoldLeft anm-rotateFoldRight anm-rotateFoldTop anm-rotateFoldBottom
Flip exit animations
anm-flipOutLeft anm-flipOutRight anm-flipOutTop anm-flipOutBottom
Room exit animations
anm-rotateRoomLeftOut anm-rotateRoomRightOut anm-rotateRoomTopOut anm-rotateRoomBottomOut
Cube exit animations
anm-rotateCubeLeftOut anm-rotateCubeRightOut anm-rotateCubeTopOut anm-rotateCubeBottomOut
Carousel exit animations
anm-rotateCarouselLeftOut anm-rotateCarouselRightOut anm-rotateCarouselTopOut anm-rotateCarouselBottomOut
Side exit animations
anm-rotateSidesOut
Side direction exit animations
anm-rotateRightSideFirst anm-rotateLeftSideFirst anm-rotateTopSideFirst anm-rotateBottomSideFirst
Extra rotate animations
anm-rotateFall anm-rotateOutNewspaper

Loops animations

Don't combine loops with .anm-... class!



Other loops
  • loopToLeft
  • loopToRight
  • loopToBottom
  • loopToTop