Skip to content

jakiestfu/Gift.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Gift.js

A Javascript library for wrapping your websites up as a present

To demo the script, follow lab.jakiestfu.com/giftjs

Usage

$(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.

Curling

An additional curl parameter has been added. If set to true, the page will "curl" away using simple CSS properties and custom animations.

Resetting

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.

Happy Gifting!

About

A Javascript library for wrapping your websites up as a present

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published