From 467366b3788943eefbbd0c18fabbe23ac5692376 Mon Sep 17 00:00:00 2001 From: outtime Date: Thu, 19 Dec 2019 13:48:42 +0800 Subject: =?UTF-8?q?=F0=9F=8D=ADAdd=EF=BC=9A=E6=B7=BB=E5=8A=A0=E8=B9=A6?= =?UTF-8?q?=E8=B7=B6=E7=9A=84=E9=A2=9C=E6=96=87=E5=AD=97=E4=B8=8E=E5=BB=BA?= =?UTF-8?q?=E7=AB=99=E6=97=B6=E9=97=B4=E9=A1=B9=EF=BC=8C=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BA=86=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/css/main/special.css | 249 ++++++++++++++++++++++++++++++++++++++++++++ assets/js/miracles.min.js | 28 +++++ functions.php | 14 +++ includes/footer.php | 46 ++++---- includes/head.php | 17 +-- libs/Options.php | 13 ++- 6 files changed, 325 insertions(+), 42 deletions(-) diff --git a/assets/css/main/special.css b/assets/css/main/special.css index 6b3c342..1ae2867 100644 --- a/assets/css/main/special.css +++ b/assets/css/main/special.css @@ -243,4 +243,253 @@ iframe[src*="//player.bilibili.com/player.html"] { } .fadein { opacity: 1; +} +/*底部动画字符*/ +.anime-face { + animation: anime-face 5s infinite ease-in-out; + display: inline-block; + margin: 0 5px; +} +@-webkit-keyframes anime-face { + 2%,24%,80% { + -webkit-transform: translate(0,1.5px) rotate(1.5deg); + transform: translate(0,1.5px) rotate(1.5deg) + } + + 4%,68%,98% { + -webkit-transform: translate(0,-1.5px) rotate(-.5deg); + transform: translate(0,-1.5px) rotate(-.5deg) + } + + 38%,6% { + -webkit-transform: translate(0,1.5px) rotate(-1.5deg); + transform: translate(0,1.5px) rotate(-1.5deg) + } + + 8%,86% { + -webkit-transform: translate(0,-1.5px) rotate(-1.5deg); + transform: translate(0,-1.5px) rotate(-1.5deg) + } + + 10%,72% { + -webkit-transform: translate(0,2.5px) rotate(1.5deg); + transform: translate(0,2.5px) rotate(1.5deg) + } + + 12%,64%,78%,96% { + -webkit-transform: translate(0,-.5px) rotate(1.5deg); + transform: translate(0,-.5px) rotate(1.5deg) + } + + 14%,54% { + -webkit-transform: translate(0,-1.5px) rotate(1.5deg); + transform: translate(0,-1.5px) rotate(1.5deg) + } + + 16% { + -webkit-transform: translate(0,-.5px) rotate(-1.5deg); + transform: translate(0,-.5px) rotate(-1.5deg) + } + + 18%,22% { + -webkit-transform: translate(0,.5px) rotate(-1.5deg); + transform: translate(0,.5px) rotate(-1.5deg) + } + + 20%,36%,46% { + -webkit-transform: translate(0,-1.5px) rotate(2.5deg); + transform: translate(0,-1.5px) rotate(2.5deg) + } + + 26%,50% { + -webkit-transform: translate(0,.5px) rotate(.5deg); + transform: translate(0,.5px) rotate(.5deg) + } + + 28% { + -webkit-transform: translate(0,.5px) rotate(1.5deg); + transform: translate(0,.5px) rotate(1.5deg) + } + + 30%,40%,62%,76%,88% { + -webkit-transform: translate(0,-.5px) rotate(2.5deg); + transform: translate(0,-.5px) rotate(2.5deg) + } + + 32%,34%,66% { + -webkit-transform: translate(0,1.5px) rotate(-.5deg); + transform: translate(0,1.5px) rotate(-.5deg) + } + + 42% { + -webkit-transform: translate(0,2.5px) rotate(-1.5deg); + transform: translate(0,2.5px) rotate(-1.5deg) + } + + 44%,70% { + -webkit-transform: translate(0,1.5px) rotate(.5deg); + transform: translate(0,1.5px) rotate(.5deg) + } + + 48%,74%,82% { + -webkit-transform: translate(0,-.5px) rotate(.5deg); + transform: translate(0,-.5px) rotate(.5deg) + } + + 52%,56%,60% { + -webkit-transform: translate(0,2.5px) rotate(2.5deg); + transform: translate(0,2.5px) rotate(2.5deg) + } + + 58% { + -webkit-transform: translate(0,.5px) rotate(2.5deg); + transform: translate(0,.5px) rotate(2.5deg) + } + + 84% { + -webkit-transform: translate(0,1.5px) rotate(2.5deg); + transform: translate(0,1.5px) rotate(2.5deg) + } + + 90% { + -webkit-transform: translate(0,2.5px) rotate(-.5deg); + transform: translate(0,2.5px) rotate(-.5deg) + } + + 92% { + -webkit-transform: translate(0,.5px) rotate(-.5deg); + transform: translate(0,.5px) rotate(-.5deg) + } + + 94% { + -webkit-transform: translate(0,2.5px) rotate(.5deg); + transform: translate(0,2.5px) rotate(.5deg) + } + + 0%,100% { + -webkit-transform: translate(0,0) rotate(0); + transform: translate(0,0) rotate(0) + } +} + +@keyframes anime-face { + 2%,24%,80% { + -webkit-transform: translate(0,1.5px) rotate(1.5deg); + transform: translate(0,1.5px) rotate(1.5deg) + } + + 4%,68%,98% { + -webkit-transform: translate(0,-1.5px) rotate(-.5deg); + transform: translate(0,-1.5px) rotate(-.5deg) + } + + 38%,6% { + -webkit-transform: translate(0,1.5px) rotate(-1.5deg); + transform: translate(0,1.5px) rotate(-1.5deg) + } + + 8%,86% { + -webkit-transform: translate(0,-1.5px) rotate(-1.5deg); + transform: translate(0,-1.5px) rotate(-1.5deg) + } + + 10%,72% { + -webkit-transform: translate(0,2.5px) rotate(1.5deg); + transform: translate(0,2.5px) rotate(1.5deg) + } + + 12%,64%,78%,96% { + -webkit-transform: translate(0,-.5px) rotate(1.5deg); + transform: translate(0,-.5px) rotate(1.5deg) + } + + 14%,54% { + -webkit-transform: translate(0,-1.5px) rotate(1.5deg); + transform: translate(0,-1.5px) rotate(1.5deg) + } + + 16% { + -webkit-transform: translate(0,-.5px) rotate(-1.5deg); + transform: translate(0,-.5px) rotate(-1.5deg) + } + + 18%,22% { + -webkit-transform: translate(0,.5px) rotate(-1.5deg); + transform: translate(0,.5px) rotate(-1.5deg) + } + + 20%,36%,46% { + -webkit-transform: translate(0,-1.5px) rotate(2.5deg); + transform: translate(0,-1.5px) rotate(2.5deg) + } + + 26%,50% { + -webkit-transform: translate(0,.5px) rotate(.5deg); + transform: translate(0,.5px) rotate(.5deg) + } + + 28% { + -webkit-transform: translate(0,.5px) rotate(1.5deg); + transform: translate(0,.5px) rotate(1.5deg) + } + + 30%,40%,62%,76%,88% { + -webkit-transform: translate(0,-.5px) rotate(2.5deg); + transform: translate(0,-.5px) rotate(2.5deg) + } + + 32%,34%,66% { + -webkit-transform: translate(0,1.5px) rotate(-.5deg); + transform: translate(0,1.5px) rotate(-.5deg) + } + + 42% { + -webkit-transform: translate(0,2.5px) rotate(-1.5deg); + transform: translate(0,2.5px) rotate(-1.5deg) + } + + 44%,70% { + -webkit-transform: translate(0,1.5px) rotate(.5deg); + transform: translate(0,1.5px) rotate(.5deg) + } + + 48%,74%,82% { + -webkit-transform: translate(0,-.5px) rotate(.5deg); + transform: translate(0,-.5px) rotate(.5deg) + } + + 52%,56%,60% { + -webkit-transform: translate(0,2.5px) rotate(2.5deg); + transform: translate(0,2.5px) rotate(2.5deg) + } + + 58% { + -webkit-transform: translate(0,.5px) rotate(2.5deg); + transform: translate(0,.5px) rotate(2.5deg) + } + + 84% { + -webkit-transform: translate(0,1.5px) rotate(2.5deg); + transform: translate(0,1.5px) rotate(2.5deg) + } + + 90% { + -webkit-transform: translate(0,2.5px) rotate(-.5deg); + transform: translate(0,2.5px) rotate(-.5deg) + } + + 92% { + -webkit-transform: translate(0,.5px) rotate(-.5deg); + transform: translate(0,.5px) rotate(-.5deg) + } + + 94% { + -webkit-transform: translate(0,2.5px) rotate(.5deg); + transform: translate(0,2.5px) rotate(.5deg) + } + + 0%,100% { + -webkit-transform: translate(0,0) rotate(0); + transform: translate(0,0) rotate(0) + } } \ No newline at end of file diff --git a/assets/js/miracles.min.js b/assets/js/miracles.min.js index 567b192..b1488eb 100644 --- a/assets/js/miracles.min.js +++ b/assets/js/miracles.min.js @@ -468,6 +468,34 @@ function getWordsNum() { time = Math.ceil(sLen / 450); idGetEl("readTip").innerHTML = "本文约 " + sLen + "字 阅读大概需要 " + time + " 分钟"; } +/** + * Build Time Echo + */ +function startTime(time = '2010-01-01') { + startTimeV = time; + var $time = new Date().getTime() - new Date(startTimeV); + if ($time < 0) return '0秒'; + let result = ''; + if ($time >= 365 * 86400000) { + result += parseInt($time / (365 * 86400000)) + ' 年 '; + $time = ($time % (365 * 86400000)); + } + if ($time >= 86400000) { + result += parseInt($time / 86400000) + ' 天 '; + $time = ($time % 86400000); + } + if ($time >= 3600000) { + result += parseInt($time / 3600000) + ' 小时 '; + $time = ($time % 3600000); + } + if ($time >= 60000) { + result += parseInt($time / 60000) + ' 分 '; + $time = ($time % 60000); + } + result += parseInt($time / 1000) + ' 秒 '; + $('#build-time').html(result); + buildTimeout = setTimeout('startTime(startTimeV)', 1000) +} /** * Copyright */ diff --git a/functions.php b/functions.php index 9490c0d..85b0afc 100644 --- a/functions.php +++ b/functions.php @@ -75,3 +75,17 @@ array_push($views, $cid); } echo $row['views']; } +/** + * 自动生成引用 + */ +function generate_require($files,$type,$cdn = NULL) { + if ($cdn) + $path = $cdn.themeVersion()."/"; + else $path = Helper::options()->themeUrl("","Miracles"); + foreach ($files as $file) { + if ($type == "js") + echo ""; + elseif ($type == "css") + echo ""; + } +} \ No newline at end of file diff --git a/includes/footer.php b/includes/footer.php index 66d4702..6b9b26e 100644 --- a/includes/footer.php +++ b/includes/footer.php @@ -3,9 +3,16 @@ @@ -13,35 +20,22 @@ - options->CDN && $this->options->CDN=1): ?> - - - - - - - - - - options->cat!=0 || $this->options->customModel!=''): ?> - - - - - - - - - - - + options->CDN?"https://cdn.jsdelivr.net/gh/BigCoke233/miracles@":""); + ?> - - - + + diff --git a/includes/head.php b/includes/head.php index cf25c22..03f982c 100644 --- a/includes/head.php +++ b/includes/head.php @@ -38,19 +38,10 @@ header('description=&'); ?> options->headerEcho(); ?> - options->CDN && $this->options->CDN=1): ?> - - - - - - - - - - - - + options->CDN?"https://cdn.jsdelivr.net/gh/BigCoke233/miracles@":""); + ?> diff --git a/libs/Options.php b/libs/Options.php index a94d509..cc305df 100644 --- a/libs/Options.php +++ b/libs/Options.php @@ -127,11 +127,18 @@ function themeConfig($form) { ]; $LoadingImage = new Typecho_Widget_Helper_Form_Element_Radio('loading_image', $LoadingOptions, 'block', _t('选择图片加载动画'),_t("
")); $form->addInput($LoadingImage); - + + //SiteBuildTime + $buildTime = new Typecho_Widget_Helper_Form_Element_Text('build_time', NULL, NULL, _t('在页脚输出建站至今时间'), _t('填写格式如2020-01-01的时间,将输出在站点信息之前,不想开启请留空。')); + $form->addInput($buildTime); + //AnimeFace + $AnimeFace = new Typecho_Widget_Helper_Form_Element_Text('anime_face', NULL, NULL, _t('在其之后输出一个蹦跶的颜文字'), _t('如果开启了建站时间将会输出在其之后,反之会输出在站点信息之后。在此写上你想展示的颜文字,多个颜文字用"&&"分割,每次刷新更换。如不想开启请留空。')); + $form->addInput($AnimeFace); + //developer - $headerEcho = new Typecho_Widget_Helper_Form_Element_Textarea('headerEcho', NULL, NULL, _t('

开发者设置

自定义头部信息'), _t('填写 html 代码,将输出在 <head> 标签中')); + $headerEcho = new Typecho_Widget_Helper_Form_Element_Textarea('headerEcho', NULL, NULL, _t('

开发者设置

自定义头部信息'), _t('填写 html 代码,将输出在 <head> 标签中,可以在这里写上统计代码')); $form->addInput($headerEcho); - $footerEcho = new Typecho_Widget_Helper_Form_Element_Textarea('footerEcho', NULL, NULL, _t('自定义页脚部信息'), _t('填写 html 代码,将输出在页脚的版权信息后')); + $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); -- cgit v1.2.3