diff options
| author | Eltrac <45323514+BigCoke233@users.noreply.github.com> | 2019-07-21 16:49:35 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-21 16:49:35 +0800 |
| commit | 1fc5a9328769b28a92e918e05206265cb1428404 (patch) | |
| tree | 4da595555c4441ae5fc00cb315f893a712a71470 | |
| parent | 0b4a6faa04150b1e9f907370199a927308404e41 (diff) | |
后台样式、支持主题备份、支持 CDN 加速静态资源、个性化设置
| -rw-r--r-- | assets/css/dark.miracles.css | 39 | ||||
| -rw-r--r-- | assets/css/miracles.min.css | 20 | ||||
| -rw-r--r-- | assets/css/setting.miracles.css | 183 | ||||
| -rw-r--r-- | assets/js/miracles.min.js | 2 | ||||
| -rw-r--r-- | includes/comments.php | 6 | ||||
| -rw-r--r-- | includes/footer.php | 11 | ||||
| -rw-r--r-- | includes/head.php | 29 | ||||
| -rw-r--r-- | libs/Options.php | 115 |
8 files changed, 385 insertions, 20 deletions
diff --git a/assets/css/dark.miracles.css b/assets/css/dark.miracles.css index e9071d5..fb4dd7a 100644 --- a/assets/css/dark.miracles.css +++ b/assets/css/dark.miracles.css @@ -173,7 +173,8 @@ filter: brightness(90%);
}
.body-dark .post-banner,
-.body-dark iframe {
+.body-dark iframe,
+.body-dark .aplayer-pic {
filter: brightness(75%);
}
/* Need Transparent dark background */
@@ -192,4 +193,40 @@ }
.body-dark .pio-action span {
background-color: rgba(90,90,90,.9)
+}
+/* Meting Plugin in dark theme */
+.body-dark .aplayer,
+.body-dark .aplayer-list-index,
+.body-dark .aplayer-list-author,
+.body-dark .aplayer .aplayer-icon,
+.body-dark .aplayer .aplayer-lrc-contents p,
+.body-dark .aplayer .aplayer-controller,
+.body-dark .aplayer .aplayer-info,
+.body-dark .aplayer .aplayer-author {
+ color: rgb(240,240,240)!important;
+}
+.body-dark .aplayer {
+ background: rgb(100,100,100);
+}
+.body-dark .aplayer-list-light,
+.body-dark .aplayer .aplayer-list ol li:hover {
+ background: rgb(140,140,140)!important;
+}
+.body-dark .aplayer .aplayer-lrc:before,
+.body-dark .aplayer .aplayer-lrc:after {
+ background: transparent;
+ background: transparent;
+ filter: none;
+}
+.body-dark .aplayer .aplayer-list ol li {
+ border-color: rgb(120,120,120);
+}
+.body-dark .aplayer-list::-webkit-scrollbar {
+ background: rgb(110,110,110)!important;
+}
+.body-dark .aplayer-list::-webkit-scrollbar-thumb {
+ background: rgb(80,80,80);
+}
+.body-dark .aplayer-info {
+ border: none;
}
\ No newline at end of file diff --git a/assets/css/miracles.min.css b/assets/css/miracles.min.css index 681577a..9c9606e 100644 --- a/assets/css/miracles.min.css +++ b/assets/css/miracles.min.css @@ -28,6 +28,9 @@ body,html { transition: background 0.2s;
width: 100%;
}
+body {
+ font-family: 'Noto Sans SC',sans-serif
+}
hr {
border: none;
border-bottom: 1px solid #ccc;
@@ -62,9 +65,6 @@ hr { filter: grayscale(100%);
-webkit-filter: grayscale(100%);
}
-.body-sans-serif {
- font-family: 'Noto Sans SC',sans-serif
-}
.body-serif {
font-family: 'Noto Serif SC',serif
}
@@ -764,7 +764,7 @@ hr { }
.comment-content p {
color: #000;
- font-size: 22px;
+ font-size: 16px;
word-break: break-all;
vertical-align: center;
padding: 10px 16px;
@@ -1002,6 +1002,10 @@ iframe[src*="//player.bilibili.com/player.html"] { }
/* > Pad and up */
@media (min-width:768px) {
+ .comment-content p {
+ font-size: 18px;
+ }
+
.nav-content a {
font-size: 19px;
padding: 27.5px 8px
@@ -1078,6 +1082,10 @@ iframe[src*="//player.bilibili.com/player.html"] { }
/* Desktop and up */
@media (min-width:992px) {
+ .comment-content p {
+ font-size: 19px;
+ }
+
.nav-content a {
font-size: 20px;
padding: 28px 8px
@@ -1159,6 +1167,10 @@ iframe[src*="//player.bilibili.com/player.html"] { }
/* Computer screen and up */
@media (min-width:1200px) {
+ .comment-content p {
+ font-size: 21px;
+ }
+
.nav-content a {
font-size: 20px;
padding: 28px 8px
diff --git a/assets/css/setting.miracles.css b/assets/css/setting.miracles.css new file mode 100644 index 0000000..2e1cea0 --- /dev/null +++ b/assets/css/setting.miracles.css @@ -0,0 +1,183 @@ +@charset 'utf-8';
+
+/*
+ * Setting style for Miracles
+ * Author: Eltrac
+ * Lisence: MIT
+ */
+
+/* 全局样式 */
+:root {
+ --theme-color: #4D90FE;
+}
+
+body {
+ width: 100%;
+ background: rgb(252,252,252);
+ font-family: 'Noto Sans SC',sans-serif
+}
+
+hr {
+ border: none;
+ border-bottom: 1px solid rgb(220,220,220);
+ margin: 30px 0;
+}
+
+/* 面板 */
+.miracles-pannel {
+ background: rgba(90,90,90,0.8);
+ border-radius: 5px;
+ padding: 28px 30px;
+ margin: 40px 0;
+ margin-top: 10px;
+ color: #fff;
+ box-shadow: 0 2px 8px #ddd;
+ -moz-box-shadow: 0 2px 8px #ddd;
+ -webkit-box-shadow: 0 2px 8px #ddd;
+}
+.miracles-pannel a {
+ color: rgb(250,250,250);
+ position: relative;
+}
+.miracles-pannel a:hover {
+ text-decoration: none;
+}
+.miracles-pannel a::before {
+ content: '';
+ position: absolute;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ height: 2px;
+ background-color: rgb(250,250,250);
+ transform-origin: bottom right;
+ transform: scaleX(0);
+ transition: transform 0.5s ease;
+}
+.miracles-pannel a:hover::before {
+ transform-origin: bottom left;
+ transform: scaleX(1);
+}
+
+/* Backup */
+.miracles-backup-alert {
+ transition: all .2s;
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+ padding: 15px 0;
+ background: #4D90FE;
+ text-align: center;
+}
+.miracles-backup-alert,
+.miracles-backup-alert a {
+ color: #fff;
+}
+.miracles-backup-button {
+ margin: 15px 0;
+ margin-bottom: 0;
+ padding: 6px 10px;
+ border-radius: 2px;
+ color: #fff;
+ background: rgb(100,100,100);
+ box-shadow: 0 1px 1px #000;
+ -moz-box-shadow: 0 1px 1px #000;
+ -webkit-box-shadow: 0 1px 1px #000;
+ border: none;
+}
+
+/* Para */
+.miracles-para-attention {
+ padding: 10px 12px;
+ background: red;
+ color: #fff;
+ border-radius: 3px;
+}
+
+/* 滚动条 */
+::-webkit-scrollbar {
+ width: 6px;
+ height: 5px
+}
+::-webkit-scrollbar-button {
+ display: none
+}
+::-webkit-scrollbar-thumb {
+ background: gray;
+}
+
+/* 覆盖原有样式 */
+.typecho-head-nav {
+ box-shadow: 0 0 30px #ddd;
+ -moz-box-shadow: 0 0 30px #ddd;
+ -webkit-box-shadow: 0 0 30px #ddd;
+ padding: 15px 0;
+ font-size: 15px;
+ position: fixed;
+ top: 0;
+ left: 0;
+ right: 0;
+}
+
+.typecho-page-title {
+ visibility: hidden;
+ margin-top: 90px;
+}
+
+.typecho-option li input,
+.typecho-option li textarea,
+.typecho-option li select,
+.typecho-option .btn {
+ border-radius: 4px;
+ background: #fff;
+ padding: 10px 12px;
+ box-shadow: 0 1px 5px #ddd;
+ -moz-box-shadow: 0 1px 5px #ddd;
+ -webkit-box-shadow: 0 1px 5px #ddd;
+ border-color: #ddd;
+}
+
+.typecho-option li select {
+ padding: 0 4px;
+ min-width: 100px;
+}
+
+.typecho-option li textarea {
+ resize: none;
+ height: 160px!important;
+}
+
+.typecho-option li .typecho-label {
+ font-size: 15px;
+ letter-spacing: 1px;
+ margin: 15px 0;
+ margin-top: 20px;
+}
+
+.typecho-option .btn {
+ display: block;
+ width: 100%;
+ margin: 25px 0;
+ height: 50px;
+ text-align: center;
+ background: var(--theme-color);;
+ font-size: 18px;
+}
+
+/* Media */
+@media (min-width:768px) {
+ .typecho-option-tabs {
+ margin-left: 122px;
+ }
+}
+@media (min-width:992px) {
+ .typecho-option-tabs {
+ margin-left: 160px;
+ }
+}
+@media (min-width:1200px) {
+ .typecho-option-tabs {
+ margin-left: 194px;
+ }
+}
\ No newline at end of file diff --git a/assets/js/miracles.min.js b/assets/js/miracles.min.js index 9890962..d07c5f3 100644 --- a/assets/js/miracles.min.js +++ b/assets/js/miracles.min.js @@ -68,7 +68,7 @@ function owoLoad() { }
//pjax-loader
if(loadPjax = true) {
- $(document).pjax('a[href^="'+siteurl+'"]:not(a[target="_blank"], a[no-pjax])', {
+ $(document).pjax('a[href^="'+siteurl+'"]:not(a[target="_blank"], a[no-pjax], .comment-reply a, .cancel-comment-reply a)', {
container: '#pjax-container',fragment: '#pjax-container',timeout: 8000
}).on('pjax:send', function () {
GoTop();
diff --git a/includes/comments.php b/includes/comments.php index 257755d..5291561 100644 --- a/includes/comments.php +++ b/includes/comments.php @@ -26,7 +26,9 @@ echo $commentClass; </div>
<div class="comment-main comment-author-info col-md-11">
<div class="comment-content bubble">
- <span class="comment-reply"><?php $comments->reply('<i class="iconfont icon-return"></i>'); ?></span>
+ <span class="comment-reply">
+ <?php $comments->reply('<i class="iconfont icon-return"></i>'); ?>
+ </span>
<?php $comments->content(); ?>
</div>
<p class="comment-meta">
@@ -82,7 +84,7 @@ echo $commentClass; <!-- 如果当前用户已经登录 -->
<?php if($this->user->hasLogin()): ?>
<!-- 显示当前登录用户的用户名以及登出连接 -->
- <p><?php _e('登录身份: '); ?><a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a>. <a href="<?php $this->options->logoutUrl(); ?>" title="Logout"><?php _e('退出'); ?> »</a></p>
+ <p class="col-md-12"><?php _e('登录身份: '); ?><a href="<?php $this->options->profileUrl(); ?>"><?php $this->user->screenName(); ?></a>. <a href="<?php $this->options->logoutUrl(); ?>" title="Logout"><?php _e('退出'); ?> »</a></p>
<!-- 若当前用户未登录 -->
<?php else: ?>
<!-- 要求输入名字、邮箱、网址 -->
diff --git a/includes/footer.php b/includes/footer.php index 865d4fb..671ee49 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -14,6 +14,15 @@ <button onclick="Dark()" title="护眼模式" class="dark-button"><i class="iconfont icon-envira"></i></button> </div> <!-- JavaScript --> + <?php if($this->options->CDN && $this->options->CDN=1): ?> + <script src="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/js/jquery.js"></script> + <script src="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/js/pjax.jquery.js"></script> + <script src="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/js/jquery.fancybox.js"></script> + <script src="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/js/jquery.lazyload.js"></script> + <script src="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/js/nprogress.js"></script> + <script src="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/js/OwO.min.js"></script> + <script src="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/js/prism.js"></script> + <?php else: ?> <script src="<?php Utils::indexTheme('assets/js/jquery.js'); ?>"></script> <script src="<?php Utils::indexTheme('assets/js/pjax.jquery.js'); ?>"></script> <script src="<?php Utils::indexTheme('assets/js/jquery.fancybox.js'); ?>"></script> @@ -21,6 +30,7 @@ <script src="<?php Utils::indexTheme('assets/js/nprogress.js'); ?>"></script> <script src="<?php Utils::indexTheme('assets/js/OwO.min.js'); ?>"></script> <script src="<?php Utils::indexTheme('assets/js/prism.js'); ?>"></script> + <?php endif; ?> <script>var siteurl = '<?php $this->options->SiteUrl() ;?>'; var owoJson = '<?php Utils::indexTheme('assets/OwO.json'); ?>'; <?php if($this->options->pjax && $this->options->pjax!=0) :?> @@ -30,5 +40,6 @@ <?php endif; ?></script> <script src="<?php Utils::indexTheme('assets/js/miracles.min.js'); ?>"></script> <script>LazyLoad();PrismLoad();owoLoad();<?php $this->options->jsEcho(); ?></script> + <?php $this->footer(); ?> </body> </html> diff --git a/includes/head.php b/includes/head.php index b39867a..725841a 100644 --- a/includes/head.php +++ b/includes/head.php @@ -40,29 +40,34 @@ if (isset($_POST['action'])) { <meta name="twitter:description" content="<?php if($description != '') echo $description; else $this->excerpt(50); ?>" /> <meta name="twitter:card" content="summary" /> <meta name="twitter:image" content<?php echo $banner; ?>" /> - <link rel="icon" type="image/png" href="<?php Utils::indexTheme('favicon.ico'); ?>" /> <?php $this->header('description=&'); ?> <?php $this->options->headerEcho(); ?> <!-- css --> - <link rel="stylesheet" href="<?php Utils::indexTheme('assets/css/normalize.css'); ?>" /> - <link rel="stylesheet" href="<?php Utils::indexTheme('assets/css/nprogress.css'); ?>" /> + <?php if($this->options->CDN && $this->options->CDN=1): ?> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/css/prism.css" /> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/css/owo.min.css" /> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/css/normalize.css" /> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/css/fancybox.css" /> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/css/prism.css" /> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/css/miracles.min.css" /> + <link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/BigCoke233/miracles@<?php themeVersion(); ?>/assets/css/dark.miracles.css" /> + <?php else: ?> <link rel="stylesheet" href="<?php Utils::indexTheme('assets/css/prism.css'); ?>" /> <link rel="stylesheet" href="<?php Utils::indexTheme('assets/css/owo.min.css'); ?>" /> + <link rel="stylesheet" href="<?php Utils::indexTheme('assets/css/normalize.css'); ?>" /> + <link rel="stylesheet" href="<?php Utils::indexTheme('assets/css/nprogress.css'); ?>" /> <link rel="stylesheet" href="<?php Utils::indexTheme('assets/css/fancybox.css'); ?>" /> <link rel="stylesheet" href="<?php Utils::indexTheme('assets/css/miracles.min.css'); ?>" /> <link rel="stylesheet" href="<?php Utils::indexTheme('assets/css/dark.miracles.css'); ?>" /> - + <?php endif; ?> <!-- icon font --> <link rel="stylesheet" href="//at.alicdn.com/t/font_1165190_q4ccniy74h.css" /> <!-- Google Fonts --> <link href="https://fonts.googleapis.com/css?family=Noto+Sans+SC:300|Noto+Serif+SC:300&display=swap" rel="stylesheet"> - - <style>.body-dark .pio-action .pio-home{background-image: url(<?php Utils::indexTheme('images/icons/home.png'); ?>);}.body-dark .pio-action .pio-close{background-image: url(<?php Utils::indexTheme('images/icons/remove.png'); ?>);}.body-dark .pio-action .pio-skin{background-image: url(<?php Utils::indexTheme('images/icons/skin.png'); ?>);}.body-dark .pio-action .pio-info{background-image: url(<?php Utils::indexTheme('images/icons/info.png'); ?>);}.body-dark .pio-action .pio-night{background-image: url(<?php Utils::indexTheme('images/icons/night.png'); ?>);}@media (min-width:992px) {.search{background-image:url(<?php Utils::indexTheme('images/search.png'); ?>);}.login{background-image:url(<?php Utils::indexTheme('images/login.png'); ?>)}} - .search {background-position: bottom right;background-repeat: no-repeat} - .login {background-position: bottom left;background-repeat:no-repeat} - <?php $this->options->cssEcho(); ?> - <?php $this->options->cssEcho(); ?> - </style> + <style>.body-dark .pio-action .pio-home{background-image: url(<?php Utils::indexTheme('images/icons/home.png'); ?>);}.body-dark .pio-action .pio-close{background-image: url(<?php Utils::indexTheme('images/icons/remove.png'); ?>);}.body-dark .pio-action .pio-skin{background-image: url(<?php Utils::indexTheme('images/icons/skin.png'); ?>);}.body-dark .pio-action .pio-info{background-image: url(<?php Utils::indexTheme('images/icons/info.png'); ?>);}.body-dark .pio-action .pio-night{background-image: url(<?php Utils::indexTheme('images/icons/night.png'); ?>);}@media (min-width:992px) {.search{background-image:url(<?php Utils::indexTheme('images/search.png'); ?>);}.login{background-image:url(<?php Utils::indexTheme('images/login.png'); ?>)}}.search {background-position: bottom right;background-repeat: no-repeat}.login {background-position: bottom left;background-repeat:no-repeat}<?php $this->options->cssEcho(); ?></style> </head> - <body class="body-sans-serif">
\ No newline at end of file + <body class="<?php if($this->options->bodyFonts && $this->options->bodyFonts=1): ?> body-serif<?php endif; ?><?php if($this->options->grayTheme && $this->options->grayTheme=1): ?> body-gray<?php endif; ?>"> + <!--[if lt IE 9]> + <div class="message error browsehappy" role="dialog">当前网页 <strong>不支持</strong> 你正在使用的浏览器. 为了正常的访问, 请 <a href="http://browsehappy.com/">升级你的浏览器</a>.</div> + <![endif]-->
\ No newline at end of file diff --git a/libs/Options.php b/libs/Options.php new file mode 100644 index 0000000..eba42a1 --- /dev/null +++ b/libs/Options.php @@ -0,0 +1,115 @@ +<?php
+/**
+ * 主题后台设置
+ */
+function themeConfig($form) {
+ /**
+ * 主题设置备份
+ * From https://qqdie.com/archives/typecho-templates-backup-and-restore.html
+ */
+ $db = Typecho_Db::get();
+ $sjdq=$db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:Miracles'));
+ $ysj = $sjdq['value'];
+ if(isset($_POST['type'])){
+ if($_POST["type"]=="备份模板数据"){
+ if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:MiraclesBackup'))){
+ $update = $db->update('table.options')->rows(array('value'=>$ysj))->where('name = ?', 'theme:MiraclesBackup');
+ $updateRows= $db->query($update);
+ echo '<div class="miracles-backup-alert">备份已更新,请等待自动刷新!如果等不到请点击';
+?><a href="<?php Helper::options()->adminUrl('options-theme.php'); ?>">这里</a></div><script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 2500);</script>
+<?php }else{
+ if($ysj){
+ $insert = $db->insert('table.options')
+ ->rows(array('name' => 'theme:MiraclesBackup','user' => '0','value' => $ysj));
+ $insertId = $db->query($insert);
+ echo '<div class="miracles-backup-alert">备份完成,请等待自动刷新!如果等不到请点击';
+?><a href="<?php Helper::options()->adminUrl('options-theme.php'); ?>">这里</a></div><script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 2500);</script>
+<?php
+ }
+ }
+ }
+ if($_POST["type"]=="还原模板数据"){
+ if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:MiraclesBackup'))){
+ $sjdub=$db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:MiraclesBackup'));
+ $bsj = $sjdub['value'];
+ $update = $db->update('table.options')->rows(array('value'=>$bsj))->where('name = ?', 'theme:Miracles');
+ $updateRows= $db->query($update);
+ echo '<div class="miracles-backup-alert">检测到模板备份数据,恢复完成,请等待自动刷新!如果等不到请点击';
+?><a href="<?php Helper::options()->adminUrl('options-theme.php'); ?>">这里</a></div><script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 2000);</script>
+<?php
+ }else{
+ echo '<div class="miracles-backup-alert">没有模板备份数据,恢复不了哦!</div>';
+ }
+ }
+ if($_POST["type"]=="删除备份数据"){
+ if($db->fetchRow($db->select()->from ('table.options')->where ('name = ?', 'theme:MiraclesBackup'))){
+ $delete = $db->delete('table.options')->where ('name = ?', 'theme:MiraclesBackup');
+ $deletedRows = $db->query($delete);
+ echo '<div class="miracles-backup-alert">删除成功,请等待自动刷新,如果等不到请点击';
+?><a href="<?php Helper::options()->adminUrl('options-theme.php'); ?>">这里</a></div><script language="JavaScript">window.setTimeout("location=\'<?php Helper::options()->adminUrl('options-theme.php'); ?>\'", 2500);</script>
+<?php
+ }else{
+ echo '<div class="miracles-backup-alert">不用删了!备份不存在!!!</div>';
+ }
+ }
+}
+
+ /**
+ * 设置样式+面板
+ */
+ $ver = themeVersion();
+
+ echo '<link rel="stylesheet" href="/usr/themes/Miracles/assets/css/setting.miracles.css"><link href="https://fonts.googleapis.com/css?family=Noto+Sans+SC:300|Noto+Serif+SC:300&display=swap" rel="stylesheet">';
+ echo '<div class="miracles-pannel">
+ <h1>Miracles 主题设置面板</h1>
+ <p>欢迎使用 Miracles 主题,目前版本是:'. $ver .'</span><br>
+ 作者博客:<a href="https://guhub.cn">Eltrac\'s</a> | 帮助文档:<a href="https://github.com/BigCoke233/miracles/wiki">WIKI</a> | 问题反馈:<a href="https://github.com/BigCoke233/miracles/issues">issues</a></p>
+ <form class="protected" action="?MiraclesBackup" method="post">
+ <input type="submit" name="type" class="miracles-backup-button backup" value="备份模板数据" />
+ <input type="submit" name="type" class="miracles-backup-button recover" value="还原模板数据" />
+ <input type="submit" name="type" class="miracles-backup-button delete" value="删除备份数据" /></form>
+ </div>';
+
+ /**
+ * 设置项
+ */
+ //nav
+ $nav_position = new Typecho_Widget_Helper_Form_Element_Select('nav_position',array('0'=>'不固定','1'=>'固定'),'0','<h2>导航栏 Nav</h2>是否固定','固定后,导航栏不会随滚动条滚动而移动在屏幕上的位置<hr>');
+ $form->addInput($nav_position);
+
+ //index-banner
+ $bannerUrl = new Typecho_Widget_Helper_Form_Element_Text('bannerUrl', NULL, 'https://s2.ax1x.com/2019/07/10/ZcRGX8.png', _t('<h2>首页大图 Banner</h2>图片 Url'), _t('首页大图的图片地址'));
+ $form->addInput($bannerUrl);
+ $bannerHeight = new Typecho_Widget_Helper_Form_Element_Text('bannerHeight', NULL, '60', _t('高度'), _t('首页大图所占屏幕的高度,100为最大,填入纯数字,如"35"'));
+ $form->addInput($bannerHeight);
+ $bannerTitle = new Typecho_Widget_Helper_Form_Element_Text('bannerTitle', NULL, NULL, _t('标题'), _t('这里是首页大图显示的的标题'));
+ $form->addInput($bannerTitle);
+ $bannerIntro = new Typecho_Widget_Helper_Form_Element_Text('bannerIntro', NULL, NULL, _t('介绍'), _t('这里是首页大图标题下的简介<hr>'));
+ $form->addInput($bannerIntro);
+
+ //pjax
+ $pjax = new Typecho_Widget_Helper_Form_Element_Select('pjax',array('0'=>'关闭','1'=>'开启'),'1','<h2>Pjax 预加载</h2>是否开启','Pjax 预加载功能的开关');
+ $form->addInput($pjax);
+ $pjax_complete = new Typecho_Widget_Helper_Form_Element_Textarea('pjax_complete', NULL, NULL, _t('完成后执行事件'), _t('Pjax 跳转页面后执行的事件,写入 js 代码,一般将 Pjax 重载(回调)函数写在这里。<hr>'));
+ $form->addInput($pjax_complete);
+
+ //improve
+ $CDN = new Typecho_Widget_Helper_Form_Element_Select('CDN',array('0'=>'关闭','1'=>'开启'),'0','<h2>优化</h2>CDN 加速加载静态资源','开启后静态资源文件调用 JSdelivr 的 CDN 公用库,加快网页加载速度。本身有 CDN 的就不用了,不然反而可能会拖慢速度。<hr>');
+ $form->addInput($CDN);
+
+ //custom style
+ $grayTheme = new Typecho_Widget_Helper_Form_Element_Select('grayTheme',array('0'=>'关闭','1'=>'开启'),'0','<h2>个性化</h2>哀悼模式','为京阿尼纵火时间而设计的开关,打开后网站变为黑白,Pray for 京阿尼');
+ $form->addInput($grayTheme);
+ $bodyFonts = new Typecho_Widget_Helper_Form_Element_Select('bodyFonts',array('0'=>'无衬线字体','1'=>'衬线字体'),'0','网站字体','选择网站的字体,无衬线字体即“思源黑体”,衬线字体即“思源宋体”<hr>');
+ $form->addInput($bodyFonts);
+
+ //developer
+ $headerEcho = new Typecho_Widget_Helper_Form_Element_Textarea('headerEcho', NULL, NULL, _t('<h2>开发者设置</h2>自定义头部信息'), _t('填写 html 代码,将输出在 <head> 标签中'));
+ $form->addInput($headerEcho);
+ $footerEcho = new Typecho_Widget_Helper_Form_Element_Textarea('footerEcho', NULL, NULL, _t('自定义页脚部信息'), _t('填写 html 代码,将输出在页脚的版权信息后'));
+ $form->addInput($footerEcho);
+ $cssEcho = new Typecho_Widget_Helper_Form_Element_Textarea('cssEcho', NULL, NULL, _t('自定义 CSS'), _t('填写 CSS 代码,输出在 head 标签结束之前的 style 标签内'));
+ $form->addInput($cssEcho);
+ $jsEcho = new Typecho_Widget_Helper_Form_Element_Textarea('jsEcho', NULL, NULL, _t('自定义 JavaScript'), _t('填写 JavaScript代码,输出在 body 标签结束之前'));
+ $form->addInput($jsEcho);
+}
\ No newline at end of file |
