-
Notifications
You must be signed in to change notification settings - Fork 3
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
Alomerry
committed
Oct 4, 2020
1 parent
6824b12
commit 4b3dada
Showing
3 changed files
with
60 additions
and
15 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 |
---|---|---|
|
@@ -4,10 +4,11 @@ | |
* | ||
* @package Sky.Mo | ||
* @author Alomerry | ||
* @version 1.1.0 | ||
* @version 1.2.0 | ||
* @link http://alomerry.com | ||
* version 1.0.0 基本特效 | ||
* version 1.1.0 新增配置单个特效 | ||
* version 1.2.0 新增字体设置 | ||
* https://api.github.com/repos/alomerry/skymo/releases/latest | ||
*/ | ||
class SkyMo_Plugin implements Typecho_Plugin_Interface | ||
|
@@ -55,11 +56,11 @@ public static function deactivate(){ | |
public static function config(Typecho_Widget_Helper_Form $form) | ||
{ | ||
|
||
$html = '<p>欢迎使用 Handsome 主题美化插件 SkyMo。</p>'. | ||
$html = '<p>欢迎使用 Handsome 主题美化插件 SkyMo V1.2.0。</p>'. | ||
'<p>此插件帮助你美化 Handsome 主题的一些细节。你可以对插件进行非商用的二次开发。</p>'. | ||
'<p>有任何问题请联系发邮件至<strong><a href="mailto:[email protected]"> [email protected] </a></strong>'. | ||
'<p>有任何问题请联系发邮件至<strong><a href="mailto:[email protected]"> [email protected] </a></strong>'. | ||
'<p>更多信息请参阅 <b><a href="https://github.com/Alomerry/SkyMo">详细说明</a></b> '. | ||
'<p><b><a href="https://github.com/Alomerry/SkyMo/releases/tag/1.1.0">最新版地址</a></b> '. | ||
'<p><b><a href="https://github.com/Alomerry/SkyMo/releases/latest">最新版地址</a></b> '. | ||
'<hr />'; | ||
echo $html; | ||
|
||
|
@@ -107,18 +108,37 @@ public static function config(Typecho_Widget_Helper_Form $form) | |
),"github-badge.css","样式选择","<strong style='color: #00b8ff9e'> 要切换自定义样式,请替换插件目录下 <code>/css/foot</code> 的 <code>style.css</code> 文件 </strong>"); | ||
$form->addInput($footCSS); | ||
|
||
//字体 | ||
$form->addInput(new ExTitle_Plugin('btnTitle', NULL, NULL, _t('字体'), NULL)); | ||
$fontStyle = new Typecho_Widget_Helper_Form_Element_Radio('fontStyle',array( | ||
'open' => _t('开启'), | ||
'close' => _t('关闭'), | ||
),'close','',""); | ||
$form->addInput($fontStyle); | ||
$fontCSS = new Typecho_Widget_Helper_Form_Element_Select("fontCSS",array( | ||
"ZCOOL-XiaoWei" => "ZCOOL-XiaoWei", | ||
"Monaco" => "Monaco" | ||
),"github-badge.css","样式选择",""); | ||
$form->addInput($fontCSS); | ||
$form->addInput(new ExTitle_Plugin('btnTitle', NULL, NULL, _t('字体生效位置'), NULL)); | ||
$fontLocation = new Typecho_Widget_Helper_Form_Element_Select("fontLocation",array( | ||
"body" => "body", | ||
"md_handsome" => "md_handsome" | ||
),"body","字体生效位置","<strong style='color: #00b8ff9e'>默认样式 ZCOOL XiaoWei,欢迎联系我添加更多字体。 </strong>"); | ||
$form->addInput($fontLocation); | ||
|
||
//代码样式 | ||
$form->addInput(new ExTitle_Plugin('btnTitle', NULL, NULL, _t('代码样式'), NULL)); | ||
$codeStyle = new Typecho_Widget_Helper_Form_Element_Radio('codeStyle',array( | ||
'open' => _t('开启'), | ||
'close' => _t('关闭'), | ||
),'open','',"<img src='https://alomerry.com/usr/uploads/2020/01/2908048897.png' style='width: 30rem;'>"); | ||
),'open','',""); | ||
$form->addInput($codeStyle); | ||
$codeCSS = new Typecho_Widget_Helper_Form_Element_Select("codeCSS",array( | ||
"github-badge.css" => "github-badge.css", | ||
"style.css" => "style.css" | ||
),"github-badge.css","样式选择","<strong style='color: #00b8ff9e'> 要切换自定义样式,请替换插件目录下 <code>/css/foot</code> 的 <code>style.css</code> 文件 </strong>"); | ||
$form->addInput($codeCSS); | ||
// $codeCSS = new Typecho_Widget_Helper_Form_Element_Select("codeCSS",array( | ||
// "github-badge.css" => "github-badge.css", | ||
// "style.css" => "style.css" | ||
// ),"github-badge.css","样式选择","<strong style='color: #00b8ff9e'> 要切换自定义样式,请替换插件目录下 <code>/css/foot</code> 的 <code>style.css</code> 文件 </strong>"); | ||
// $form->addInput($codeCSS); | ||
|
||
//背景彩带特效 | ||
$form->addInput(new ExTitle_Plugin('btnTitle', NULL, NULL, _t('背景彩带特效'), NULL)); | ||
|
@@ -138,6 +158,7 @@ public static function config(Typecho_Widget_Helper_Form $form) | |
"<img src='http://alomerry.com/usr/uploads/2020/01/3441578448.gif' style='width: 30rem;'>"); | ||
$form->addInput($headSpin); | ||
|
||
|
||
//评论打字机特效 | ||
$form->addInput(new ExTitle_Plugin('btnTitle', NULL, NULL, _t('评论打字机特效'), NULL)); | ||
$typeWriter = new Typecho_Widget_Helper_Form_Element_Radio('typeWriter', array( | ||
|
@@ -227,7 +248,30 @@ public static function footer() | |
echo "<script src='$tmp'></script>"; | ||
} | ||
|
||
|
||
//代码样式 | ||
if($SkyMo->fontStyle == 'open'){ | ||
$css = ""; | ||
switch ($SkyMo->fontCSS) | ||
{ | ||
case "ZCOOL-XiaoWei": | ||
$css = "'ZCOOL XiaoWei'"; | ||
break; | ||
case "Monaco": | ||
$css = "Menlo,Monaco,Consolas,'Courier New',monospace"; | ||
break; | ||
default: | ||
break; | ||
} | ||
$location = '#' . $SkyMo->fontLocation; | ||
$js .= '<script>'; | ||
$js .= <<<JS | ||
jQuery(document).ready(function() { | ||
$('$location').css("font-family","$css"); | ||
}); | ||
JS; | ||
$js .= '</script>'; | ||
echo $js; | ||
} | ||
} | ||
|
||
/** | ||
|
@@ -242,7 +286,6 @@ public static function header() | |
$SkyMo = Helper::options()->plugin('SkyMo'); | ||
$path = self::STATIC_DIR; | ||
|
||
echo '<link rel="stylesheet" type="text/css" href="' . $path . '/css/font.css" />'; | ||
echo '<link rel="stylesheet" type="text/css" href="' . $path . '/css/style.css" />'; | ||
echo '<link rel="stylesheet" type="text/css" href="' . $path . '/css/card.css" />'; | ||
echo '<link rel="stylesheet" type="text/css" href="' . $path . '/css/quote/quote.css" />'; | ||
|
@@ -289,6 +332,7 @@ public static function installDB(){ | |
|
||
} | ||
} | ||
|
||
class ExTitle_Plugin extends Typecho_Widget_Helper_Form_Element | ||
{ | ||
|
||
|
File renamed without changes.
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