Skip to content

Commit

Permalink
Update examples, bump version, and update minified code.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshmcrty committed Feb 5, 2017
1 parent d557d8f commit 1b506af
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 13 deletions.
94 changes: 86 additions & 8 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,21 @@
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body{
background: darkblue;
background: #443344;
color: white;
font-family: sans-serif;
}
main {
margin: 0 auto;
max-width: 80%;
}
.flurry-container {
min-height: 600px;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="jquery.flurry.js"></script>
<script>
$( document ).ready( function() {

$('body').flurry();

// Snow toggle
$('.toggle-snow').on('click', function(event) {

event.preventDefault();
Expand All @@ -32,17 +28,99 @@
$('body').flurry('destroy');
}
catch(err) {
}
finally {
$('body').flurry();
}
});

// Custom snow toggle
$('.toggle-custom-snow').on('click', function(event) {

event.preventDefault();

try {
$('body').flurry('destroy');
}
catch(err) {
}
finally {
$('body').flurry({
character: '❄❅❆*⛄☃',
height: 240,
speed: 1400,
wind: 200,
windVariance: 220,
frequency: 10,
large: 40,
small: 4
});
}
});

// Confetti toggle
$('.toggle-confetti').on('click', function(event) {

event.preventDefault();

try {
$('body').flurry('destroy');
}
catch(err) {
}
finally {
$('body').flurry({
character: "~",
color: ["#55476A", "#AE3D63", "#DB3853", "#F45C44", "#F8B646"],
speed: 2000,
height: 480,
frequency: 60,
small: 12,
large: 50,
rotation: 90,
rotationVariance: 20,
startRotation: 90,
wind: 10,
windVariance: 100,
opacityEasing: "cubic-bezier(1,0,.96,.9)"
});
}
});
});
</script>
</head>
<body>
<main>
<h1>Flurry Example</h1>
<p>Let it snow!</p>
<p><button class="toggle-snow">Toggle Snow</button></p>
<p>Click the buttons below to see examples of Flurry in action.</p>
<p><button class="toggle-snow">Toggle Snow</button> This uses the default options.</p>
<p><button class="toggle-custom-snow">Toggle Custom Snow</button> This uses custom options for a more intense snow effect (with snowmen!):</p>
<pre>$('body').flurry({
character: '❄❅❆*⛄☃',
height: 240,
speed: 1400,
wind: 200,
windVariance: 220,
frequency: 10,
large: 40,
small: 4
});</pre>
<p><button class="toggle-confetti">Toggle Confetti</button> This uses custom options to create a "confetti" effect:</p>
<pre>$('body').flurry({
character: "~",
color: ["#55476A", "#AE3D63", "#DB3853", "#F45C44", "#F8B646"],
speed: 2000,
height: 480,
frequency: 60,
small: 12,
large: 50,
rotation: 90,
rotationVariance: 20,
startRotation: 90,
wind: 10,
windVariance: 100,
opacityEasing: "cubic-bezier(1,0,.96,.9)"
});</pre>
</main>
</body>
</html>
4 changes: 2 additions & 2 deletions jquery.flurry.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
*
* Flurry is an easy-to-use animated snow plugin for jQuery. It takes advantage
* of CSS transforms, CSS transitions and requestAnimationFrame to provide
* smooth animation for modern browsers.. Props to Jonathan Nicol @f6design
* smooth animation for modern browsers. Props to Jonathan Nicol @f6design
* for boilerplate code
* (see http://jonathannicol.com/blog/2012/05/06/a-jquery-plugin-boilerplate/)
*
* @link https://github.com/joshmcrty/Flurry
* @version 1.0.2
* @version 1.1.0
* @author Josh McCarty <[email protected]>
* @copyright 2016 Josh McCarty
* @license https://github.com/joshmcrty/Flurry/blob/master/LICENSE GPLv2
Expand Down
6 changes: 3 additions & 3 deletions jquery.flurry.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 1b506af

Please sign in to comment.