-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f1f8f41
commit 31b7f38
Showing
3 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** | ||
* jquery.snow - jQuery Snow Effect Plugin | ||
* | ||
* Available under MIT licence | ||
* | ||
* @version 1 (21. Jan 2012) | ||
* @author Ivan Lazarevic | ||
* @requires jQuery | ||
* @see http://workshop.rs | ||
* | ||
* @params minSize - min size of snowflake, 10 by default | ||
* @params maxSize - max size of snowflake, 20 by default | ||
* @params newOn - frequency in ms of appearing of new snowflake, 500 by default | ||
* @params flakeColor - color of snowflake, #FFFFFF by default | ||
* @example $.fn.snow({ maxSize: 200, newOn: 1000 }); | ||
*/ | ||
|
||
(function($){$.fn.snow=function(options){var $flake=$('<div id="flake" style="z-index:999;" />').css({'position':'absolute','top':'-50px'}).html('❄'),documentHeight=$(document).height(),documentWidth=$(document).width(),defaults={minSize:10,maxSize:20,newOn:500,flakeColor:"#FFFFFF"},options=$.extend({},defaults,options);var interval=setInterval(function(){var startPositionLeft=Math.random()*documentWidth-100,startOpacity=0.5+Math.random(),sizeFlake=options.minSize+Math.random()*options.maxSize,endPositionTop=documentHeight-40,endPositionLeft=startPositionLeft-100+Math.random()*200,durationFall=documentHeight*10+Math.random()*5000;$flake.clone().appendTo('body').css({left:startPositionLeft,opacity:startOpacity,'font-size':sizeFlake,color:options.flakeColor}).animate({top:endPositionTop,left:endPositionLeft,opacity:0.2},durationFall,'linear',function(){$(this).remove()});},options.newOn);};})(jQuery); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"name": "Let It Snow", | ||
"description": "Let it snow on your site", | ||
"version": "1.0.0", | ||
"demo": "http://varoystrand.se/sidor/let-it-snow-for-koken/", | ||
"author": { | ||
"name": "Bjarne Varoystrand", | ||
"link": "http://varoystrand.se/" | ||
}, | ||
|
||
"data": { | ||
"let_it_snow_minsize": { | ||
"label": "Min size", | ||
"info": "Min size of snowflake.", | ||
"type": "number", | ||
"value": 10 | ||
}, | ||
"let_it_snow_maxsize": { | ||
"label": "Max size", | ||
"info": "Max size of snowflake.", | ||
"type": "number", | ||
"value": 20 | ||
}, | ||
"let_it_snow_newon": { | ||
"label": "Snow frequency", | ||
"info": "Frequency in ms of appearing of new snowflake.", | ||
"type": "number", | ||
"value": "500" | ||
}, | ||
"let_it_snow_flakecolor": { | ||
"label": "Color", | ||
"info": "Color of snowflake.", | ||
"type": "color", | ||
"value": "#FFFFFF" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
class BaldursPhotographyLetItSnow extends KokenPlugin { | ||
|
||
function __construct() | ||
{ | ||
$this->require_setup = true; | ||
$this->register_hook('before_closing_body', 'render'); | ||
} | ||
|
||
function render() | ||
{ | ||
|
||
$minsize = $this->data->let_it_snow_minsize; | ||
$maxsize = $this->data->let_it_snow_maxsize; | ||
$newon = $this->data->let_it_snow_newon; | ||
$flakecolor = $this->data->let_it_snow_flakecolor; | ||
$path = $this->get_path(); | ||
|
||
echo <<<OUT | ||
<script src="{$path}/jquery.snow.min.1.0.js"></script> | ||
<script> | ||
$(document).ready( function(){ | ||
$.fn.snow({ minSize: {$minsize}, maxSize: {$maxsize}, newOn: {$newon}, flakeColor: '{$flakecolor}' }); | ||
}); | ||
</script> | ||
OUT; | ||
} | ||
} |