A Javascript library for wrapping your websites up as a present
To demo the script, follow lab.jakiestfu.com/giftjs
$(document).ready(function(){
Gift.wrap({
paper: 'http://lab.jakiestfu.com/giftjs/menorah.jpg', // Your tilable background
message: ['To: Mom & Dad', 'With Love, from Emily & Jacob'], // To and From text
curl: true,
animationSpeed: 1000
});
});
This will "wrap" up your website and allow it to be "unwrapped" when clicked.
Currently, the styles are applied via javascript because I felt the temporary nature of this script would be complemented by only using jQuery as a dependency.
An additional curl
parameter has been added. If set to true, the page will "curl" away using simple CSS properties and custom animations.
If your browser supports the localStorage
object, the gift paper will not display on subsequent visits (so the receiver of your lovely gift doesn't have to unwrap it each page load).
To reset the script, visit the page with #resetgift in your url. That will unset the Gift.js identifier in localStorage
.