Skip to content

Commit

Permalink
code css: add basic code css
Browse files Browse the repository at this point in the history
  • Loading branch information
morizunzhu committed Jul 10, 2020
1 parent faab5fe commit 040fba2
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 14 deletions.
21 changes: 21 additions & 0 deletions Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* @link http://alomerry.com
* version 1.0.0 基本特效
* version 1.1.0 新增配置单个特效
* https://api.github.com/repos/morizunzhu/skymo/releases/latest
*/
class SkyMo_Plugin implements Typecho_Plugin_Interface
{
Expand Down Expand Up @@ -58,6 +59,7 @@ public static function config(Typecho_Widget_Helper_Form $form)
'<p>此插件帮助你美化 Handsome 主题的一些细节。你可以对插件进行非商用的二次开发。</p>'.
'<p>有任何问题请联系发邮件至<strong><a href="mailto:[email protected]"> [email protected] </a></strong>'.
'<p>更多信息请参阅 <b><a href="https://github.com/Morizunzhu/SkyMo">详细说明</a></b> '.
'<p><b><a href="https://github.com/Morizunzhu/SkyMo/releases/tag/1.1.0">最新版地址</a></b> '.
'<hr />';
echo $html;

Expand Down Expand Up @@ -104,6 +106,19 @@ public static function config(Typecho_Widget_Helper_Form $form)
"style.css" => "style.css"
),"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));
$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;'>");
$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);

//背景彩带特效
$form->addInput(new ExTitle_Plugin('btnTitle', NULL, NULL, _t('背景彩带特效'), NULL));
Expand Down Expand Up @@ -176,6 +191,12 @@ public static function footer()
echo "<script src='" . $path . "/js/footer.js'></script>";
}

//代码样式
if($SkyMo->codeStyle == 'open'){
echo "<link rel='stylesheet' type='text/css' href='" . $path . "/css/code/code.css' />";
// echo "<link rel='stylesheet' type='text/css' href='" . $path . "/css/code/" .$SkyMo->codeCSS."' />";
}

//星星鼠标轨迹
if($SkyMo->starTrack == 'open'){
$tmp = $path . '/js/mouse/star/canvas.js';
Expand Down
14 changes: 14 additions & 0 deletions css/code/code.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* 修改 code 样式 */

#post-content pre code {
margin: 0px 0px 0px 5px !important;
padding: 5px 0px 0px 0px !important;
}
#post-content pre ::before {
content: "" !important;
}
#post-content pre:before {
background: #474949 !important;
color: #ffffff !important;
padding: 5px 5px 10px 15px !important;
}
14 changes: 0 additions & 14 deletions css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,6 @@ div.dropdown.wrapper span img.normal-shadow {
border-radius: 6px 6px 6px 6px;
}


/* 修改 code 样式 */

#post-content pre code {
margin: 0px 0px 0px 40px !important;
padding: 5px 0px 0px 0px !important;
}

#post-content pre:before {
background: #474949 !important;
color: #ffffff !important;
padding: 5px 5px 10px 15px !important;
}

/* bilibili视频挂载 */

.iframe_video {
Expand Down

0 comments on commit 040fba2

Please sign in to comment.