This commit is contained in:
85
Snowstorm/Plugin.php
Normal file
85
Snowstorm/Plugin.php
Normal file
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* 博客飘雪插件
|
||||
*
|
||||
* 让你的博客飘起雪花来...
|
||||
*
|
||||
* 1.0.1 2013-11-08 增加雪花随机色功能
|
||||
*
|
||||
* @package Snowstorm
|
||||
* @author 阳光
|
||||
* @version 1.0.1
|
||||
* @link http://ysido.com
|
||||
*/
|
||||
class Snowstorm_Plugin implements Typecho_Plugin_Interface
|
||||
{
|
||||
/**
|
||||
* 激活插件方法,如果激活失败,直接抛出异常
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @throws Typecho_Plugin_Exception
|
||||
*/
|
||||
public static function activate()
|
||||
{
|
||||
Typecho_Plugin::factory('Widget_Archive')->footer = array('Snowstorm_Plugin', 'Snowstorm');
|
||||
return _t('插件已激活,现在可以对插件进行设置!');
|
||||
}
|
||||
|
||||
/**
|
||||
* 禁用插件方法,如果禁用失败,直接抛出异常
|
||||
*
|
||||
* @static
|
||||
* @access public
|
||||
* @return void
|
||||
* @throws Typecho_Plugin_Exception
|
||||
*/
|
||||
public static function deactivate(){
|
||||
return _t('插件已禁用!');
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取插件配置面板
|
||||
*
|
||||
* @access public
|
||||
* @param Typecho_Widget_Helper_Form $form 配置面板
|
||||
* @return void
|
||||
*/
|
||||
public static function config(Typecho_Widget_Helper_Form $form){
|
||||
$freezeOnBlur = new Typecho_Widget_Helper_Form_Element_Radio('freezeOnBlur', array('1'=>_t('是'), '0'=>_t('否')), '1', _t('失去焦点时停止'),_t('可节约CPU资源'));
|
||||
$form->addInput($freezeOnBlur);
|
||||
$followMouse = new Typecho_Widget_Helper_Form_Element_Radio('followMouse', array('1'=>_t('是'), '0'=>_t('否')), '1', _t('是否开启鼠标跟随效果'),_t('雪花飘动方向跟随鼠标'));
|
||||
$form->addInput($followMouse);
|
||||
$animationInterval = new Typecho_Widget_Helper_Form_Element_Radio('animationInterval', array('20'=>_t('快'), '30'=>_t('中'),'40'=>_t('慢')), '30', _t('雪花飘动速度'),_t('雪花飘动速度,建议设置中'));
|
||||
$form->addInput($animationInterval);
|
||||
$snowColorRand = new Typecho_Widget_Helper_Form_Element_Radio('snowColorRand', array('1'=>_t('开启'), '0'=>_t('关闭')), '0', _t('雪花颜色随机'),_t('若打开此选项,则雪花颜色设置将无效'));
|
||||
$form->addInput($snowColorRand);
|
||||
$snowColor = new Typecho_Widget_Helper_Form_Element_Text('snowColor', NULL, '#FFFFFF', _t('雪花颜色'), _t('必须为16位颜色值'));
|
||||
$form->addInput($snowColor);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 个人用户的配置面板
|
||||
*
|
||||
* @access public
|
||||
* @param Typecho_Widget_Helper_Form $form
|
||||
* @return void
|
||||
*/
|
||||
public static function personalConfig(Typecho_Widget_Helper_Form $form){}
|
||||
|
||||
|
||||
/**
|
||||
* 设置参数,并加入脚部
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public static function Snowstorm()
|
||||
{
|
||||
$options = Typecho_Widget::widget('Widget_Options')->plugin('Snowstorm');
|
||||
$color = preg_match('/^#[0-9a-f]{3,6}$/is', $options->snowColor); //判断是否为颜色代码
|
||||
$color = ($color) ? $options->snowColor : '#fff';
|
||||
echo '<script>snowColor = "'.$color.'";freezeOnBlur = '.$options->freezeOnBlur.';followMouse = '.$options->followMouse.';animationInterval = '.$options->animationInterval.';snowColorRand='.$options->snowColorRand.';</script>'."\n\r".'<script type="text/javascript" src="/usr/plugins/Snowstorm/res/snowstorm.min.js"></script>';
|
||||
}
|
||||
}
|
||||
9
Snowstorm/README.md
Normal file
9
Snowstorm/README.md
Normal file
@@ -0,0 +1,9 @@
|
||||
### (娱乐向)博客飘雪插件Snowstorm v1.0.1
|
||||
|
||||
> :warning:使用相对路径,暂不支持子目录型博客。
|
||||
|
||||
==========
|
||||
|
||||
1.0.1 20131108 增加随机色雪花....
|
||||
|
||||
1.0.0 20131108 特别注意,仅适用于0.9+,手头没有0.8,未测
|
||||
11
Snowstorm/res/font.css
Normal file
11
Snowstorm/res/font.css
Normal file
@@ -0,0 +1,11 @@
|
||||
@font-face {
|
||||
font-family: 'wwflakesregular';
|
||||
src: url('wwflakes-webfont.eot');
|
||||
src: url('wwflakes-webfont.eot') format('embedded-opentype'),
|
||||
url('wwflakes-webfont.woff') format('woff'),
|
||||
url('wwflakes-webfont.ttf') format('truetype'),
|
||||
url('wwflakes-webfont.svg#wwflakesregular') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
|
||||
}
|
||||
13
Snowstorm/res/snowstorm.min.js
vendored
Normal file
13
Snowstorm/res/snowstorm.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
11
Snowstorm/res/style.css
Normal file
11
Snowstorm/res/style.css
Normal file
@@ -0,0 +1,11 @@
|
||||
@font-face {
|
||||
font-family: 'wwflakesregular';
|
||||
src: url('wwflakes-webfont.eot');
|
||||
src: url('wwflakes-webfont.eot') format('embedded-opentype'),
|
||||
url('wwflakes-webfont.woff') format('woff'),
|
||||
url('wwflakes-webfont.ttf') format('truetype'),
|
||||
url('wwflakes-webfont.svg#wwflakesregular') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
|
||||
}
|
||||
BIN
Snowstorm/res/wwflakes-webfont.eot
Normal file
BIN
Snowstorm/res/wwflakes-webfont.eot
Normal file
Binary file not shown.
28
Snowstorm/res/wwflakes-webfont.svg
Normal file
28
Snowstorm/res/wwflakes-webfont.svg
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" standalone="no"?>
|
||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||
<svg xmlns="http://www.w3.org/2000/svg">
|
||||
<metadata></metadata>
|
||||
<defs>
|
||||
<font id="wwflakesregular" horiz-adv-x="2048" >
|
||||
<font-face units-per-em="2048" ascent="1638" descent="-410" />
|
||||
<missing-glyph horiz-adv-x="500" />
|
||||
<glyph />
|
||||
<glyph />
|
||||
<glyph unicode="
" />
|
||||
<glyph unicode="j" horiz-adv-x="1796" d="M20 1442q0 -14 13.5 -22.5t23.5 -12.5q6 -4 24.5 -15.5t39 -22.5t39 -21.5t24.5 -14.5q0 -2 1 -5t1 -5q0 -6 -1 -9t-9 -9q-8 -4 -29.5 -17.5t-44 -28t-44 -27.5t-29.5 -18v-4v-6q2 0 5 -4t5 -4q6 -4 27.5 -14.5t27.5 -12.5q0 -2 4 -2t4 2l174 101h9h10q6 -4 27.5 -14.5 t27.5 -14.5v-4q0 -18 -24.5 -29.5t-54 -24t-54 -26.5t-24.5 -35l2 -8q6 -4 26.5 -14t28.5 -15h4q27 0 50.5 14.5t47 33t47 33t52.5 14.5q16 0 37.5 -9.5t42 -22.5t38 -25.5t27.5 -18.5v-8q0 -25 -24.5 -37t-53.5 -22.5t-53.5 -23t-24.5 -36.5q0 -12 21.5 -24.5t50.5 -26 t55.5 -27.5t38.5 -33q-4 -6 -23.5 -19t-42 -27.5t-46 -25t-35.5 -10.5h-8l-156 82q-2 2 -6 2h-6q-14 0 -38 -8t-24 -24v-5l10 -10q8 -4 28 -16t41.5 -24.5t40.5 -25t28 -16.5v-4q0 -18 -25 -26.5t-37 -8.5q-4 0 -12 1t-10 1l-138 74h-16q-14 0 -39.5 -7t-25.5 -26v-4l10 -10 q8 -4 27.5 -16.5t41 -24.5t41 -24.5t27.5 -16.5v-4v-4q-12 -20 -44 -40.5t-63.5 -38t-55 -31t-21.5 -19.5l28 -53q0 -2 9 -2q25 0 47 12t44.5 27.5t46 29t50.5 13.5v-172q0 -2 4 -5.5t8 -3.5q2 -2 6 -2h2q2 0 2 2q4 2 22.5 12.5t23 14.5t11.5 10t7 8v193q0 2 7 9t17.5 14.5 t18.5 13.5t12 8h4h4l11 -10q0 -8 2 -27.5t3 -41t2 -41t1 -27.5q2 -8 0 -22.5t14 -14.5l4 2q4 2 18.5 8t18.5 10t13 11l10 6v202l9 8q9 7 13 11q4 2 17.5 9t28 16.5t27.5 16.5t19 11l22 11l15 7l15 -8v-190l186 98l8 -8v-166l-172 -104v-80q12 0 18.5 3t18.5 9q6 4 24.5 14 t39 21.5t39 22t24.5 14.5l8 -9v-77l-172 -105v-88l156 88h30v-203q0 -2 5.5 -5t9.5 -3h26h29q4 0 8 3t4 5v220l170 -91l9 9v82l-164 92q-14 8 -17.5 24.5t-3.5 30.5q0 4 1 11l1 7l19 9l155 -78v78q0 4 -10 10q-4 2 -21.5 11t-37 20.5t-38 20.5t-22.5 11q-2 2 -12 8.5 t-21.5 15.5t-11.5 13v156h19l155 -82l13 8v182l14 11l21 -11q22 -12 34 -18q2 0 11.5 -6t20.5 -12.5t20.5 -11.5t11.5 -7q8 -4 20.5 -9t12.5 -18v-182q0 -2 4 -12t8 -16q2 0 5 -4.5t5 -4.5q12 -6 32.5 -17t22.5 -9l13 8v180q4 0 12 2t12 0q8 -2 21.5 -9t13.5 -9l19 -219 q0 -10 10 -17.5t24.5 -11.5t27.5 -7t19 -3v186l4 3q5 3 7 5h4h4l156 -82h18q16 0 22.5 22.5t6.5 37.5q0 20 -25 35.5t-54.5 29t-54 25.5t-24.5 29l2 4q6 4 24.5 16t39 24.5t39 24.5t24.5 17l10 10v4v4l-9 6q-9 6 -20.5 13.5t-22.5 12.5t-17 5h-5q-6 -4 -24.5 -14.5 t-39 -21.5t-38.5 -22.5t-27 -15.5q-6 -4 -20 -10l-14 -6q-6 -2 -17.5 2t-22 10t-18.5 14.5t-8 14.5v4q2 0 5 4t5 4q4 2 19.5 13.5t34 23.5t35 22.5t20.5 14.5q2 2 6 5l4 3v6q0 16 -22.5 24.5t-34.5 8.5q-25 0 -47.5 -13.5t-43 -29t-42 -28.5t-43.5 -13h-4q-6 2 -23.5 9 l-22.5 9q-12 6 -29.5 14.5t-33.5 17.5t-27 17l-12 7v8l156 100l2 4q0 6 -21.5 21.5t-48 32t-53.5 32t-35 21.5v4q0 8 18.5 23.5t43 29.5t47 24.5t30.5 10.5t9 -2l174 -90h4q12 0 35.5 14t23.5 31v10q-8 4 -26.5 14.5t-38 21.5t-38 21.5t-26.5 14.5q-2 2 -8 9t-10 9v4v6 q18 16 31.5 22.5t33.5 6.5q4 0 10.5 -1t8.5 -1l153 -82q2 0 6 -1t9 -1q18 0 37.5 11.5t31.5 27.5q-12 14 -37.5 28.5t-52.5 26.5t-46 24.5t-19 24.5v4q0 2 3 5.5t5 5.5q8 6 29.5 18t44 26.5t44 28t29.5 17.5v10q0 14 -8 39t-25 25q-25 0 -47 -12.5t-43.5 -27t-44 -26.5 t-47.5 -12v174q-49 0 -68.5 -26.5t-25.5 -64.5q-4 -25 -4 -52q0 -14 1 -28q2 -25 2 -46q0 -13 -1 -25q-2 -4 -9 -11t-16.5 -13.5t-17.5 -10.5t-12 -2l-15 8v177q-16 0 -40.5 -14.5t-26.5 -14.5q-4 -2 -9.5 -5t-5.5 -5v-201q0 -6 -20.5 -20.5t-48 -30t-55 -26.5t-40.5 -11 v180l-5 3q-5 3 -9 5h-4h-4q-6 -4 -24.5 -14t-39 -21.5t-39 -22.5t-26.5 -15q-10 -6 -13 -7.5t-14 -1.5h-8q-10 27 -11 54.5t-1 56.5q0 8 1 25.5t1 19.5l10 18q8 4 27.5 15.5t41 25t41 24.5t25.5 17q37 25 37 64q0 10 -3 23.5t-5 13.5h-10l-146 -82l-4 -2q-14 0 -14 18v25 q0 14 2 27.5t16 21.5l156 92v84q-8 0 -10 -2q-6 -2 -31 -15.5t-52.5 -27.5t-48.5 -26l-22 -13l-10 10q0 4 -2 26.5t-4 56.5t-2 52v37q-2 4 -5 11.5t-6 7.5h-67v-201l-14 -8l-164 86v-86q0 -8 26.5 -21.5t58 -29t61.5 -32.5t36 -36q2 -6 -3 -26.5t-5 -26.5q-49 0 -84 21.5 t-82 50.5h-8v-84l182 -105v-160l-8 -8l-166 82h-23v-174l-14 -10q-2 2 -20.5 11t-46 22.5t-42.5 21.5q-4 2 -14 8t-14 11q0 2 -3 5l-5 5q0 8 -1 27.5t-3.5 41t-3.5 41t-1 27.5q-2 8 -2 35t-16 37q-12 8 -33 18l-22 10l-15 -10v-164l-14 -10l-15 7q-14 7 -20 11.5t-15 11.5 l-9 7v182q0 2 -8.5 8t-14.5 11q-10 8 -31 18l-22 10l-10 -10v-164h-19l-164 82h-4q-18 0 -25.5 -21.5t-7.5 -33.5zM596 977v4v4q6 6 19.5 15.5t27.5 18.5t28.5 15t24.5 6q25 0 55.5 -16t45.5 -39q-14 -18 -48 -40.5t-57 -22.5h-4q-23 8 -52.5 20t-39.5 35zM741 739v92 q0 10 16.5 21.5t37 22t41 17.5t28.5 7v-20q0 -12 -1 -27.5t-2 -29t-1 -19.5q-2 -18 -22.5 -29.5t-30.5 -15.5q-12 -6 -33 -18l-22 -11zM741 1133v90q0 2 4.5 5t6.5 5h4h4q10 -4 37.5 -22.5t36.5 -24.5q4 -2 11 -10l7 -7v-92h-8q-2 0 -13.5 5t-25.5 12.5t-29.5 15.5t-23.5 12 q-2 2 -6.5 5t-4.5 6zM944 795v100l3 4q3 4 5 4h4h5q59 -18 80.5 -43.5t21.5 -83.5v-37l-10 -10h-4q-16 0 -44 17.5t-44 29.5l-10.5 10.5t-6.5 8.5zM944 1077v101q0 2 10.5 12t16.5 14q16 10 43 24q25 13 29 13h1l9 -8v-100q0 -2 -3 -5.5t-6 -5.5q-12 -8 -35.5 -21.5 t-39 -22.5t-17.5 -11zM1016 991q0 8 8 16.5t20.5 15.5t24.5 12t21 5q20 0 53 -18t47 -37q-14 -18 -37 -32.5t-45 -14.5q-10 0 -25.5 4t-30 10t-25.5 16.5t-11 22.5z" />
|
||||
<glyph unicode=" " horiz-adv-x="977" />
|
||||
<glyph unicode=" " horiz-adv-x="1954" />
|
||||
<glyph unicode=" " horiz-adv-x="977" />
|
||||
<glyph unicode=" " horiz-adv-x="1954" />
|
||||
<glyph unicode=" " horiz-adv-x="651" />
|
||||
<glyph unicode=" " horiz-adv-x="488" />
|
||||
<glyph unicode=" " horiz-adv-x="325" />
|
||||
<glyph unicode=" " horiz-adv-x="325" />
|
||||
<glyph unicode=" " horiz-adv-x="244" />
|
||||
<glyph unicode=" " horiz-adv-x="390" />
|
||||
<glyph unicode=" " horiz-adv-x="108" />
|
||||
<glyph unicode=" " horiz-adv-x="390" />
|
||||
<glyph unicode=" " horiz-adv-x="488" />
|
||||
<glyph unicode="" horiz-adv-x="500" d="M0 0z" />
|
||||
</font>
|
||||
</defs></svg>
|
||||
|
After Width: | Height: | Size: 5.7 KiB |
BIN
Snowstorm/res/wwflakes-webfont.ttf
Normal file
BIN
Snowstorm/res/wwflakes-webfont.ttf
Normal file
Binary file not shown.
BIN
Snowstorm/res/wwflakes-webfont.woff
Normal file
BIN
Snowstorm/res/wwflakes-webfont.woff
Normal file
Binary file not shown.
Reference in New Issue
Block a user