Skip to content

jeremt/origami

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Origami

Make pretty 'folding' animations using suites or equations. Take a look at the demo.

HOW TO

Add jquery into your html page:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>

Next, add origami.css and origami.js:

<link rel="stylesheet" href="path/to/origami.min.css"></script>
<script src="path/to/origami.min.js"></script>

Eventualy, use it!

// Create animation...
$('#your-elem').origami({
  delay: 35,
  f: function (x) {
    return 10 * x + 10; // f(x) = 10x + 10
  }
}, function (anim) {
  // ...and trigger it :)
  $('#on').on('click', anim.on)
  $('#off').on('click', anim.off)
})

Markup:

<div id="your-elem">
  <!-- Add `back` class to the elem behind -->
  <div class="back">
    Hello world!
  </div>
  <!-- ...then add your image -->
  <img src="path/to/img">
</div> <!-- #your-elem -->

You can create animations from :

  • an equation like f(x) = 10x² + 10
  • a sequence giving a step, a start, and a type (arithmetic or geometric)

Options

  • f - equation to use to create the curve
  • suite - suite to use (instead of equation)
  • delay - animation delay (ms)
  • shadows - boolean to activate or not the shadows
  • frags - fragments number

TODO

  • Translate variables names in english
  • Check if the image is loaded in demo
  • Make a Origami object to use it without jQuery

License

(The MIT License)

Copyright (c) 2012 Jeremie T. taboada.jeremie@gmail.com

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 above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

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.

About

Make pretty 'folding' css3 animations using suites or equations.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published