diff --git a/base/article.style.php b/base/article.style.php new file mode 100644 index 0000000..ccc9500 --- /dev/null +++ b/base/article.style.php @@ -0,0 +1,410 @@ + + diff --git a/base/footer.php b/base/footer.php index b06384b..b2dc53d 100644 --- a/base/footer.php +++ b/base/footer.php @@ -1,53 +1,55 @@ - \ No newline at end of file + setInterval(siteTime, 1e3) +
+ + + + + + \ No newline at end of file diff --git a/base/header.php b/base/header.php index 681c19f..da7f09a 100644 --- a/base/header.php +++ b/base/header.php @@ -41,67 +41,68 @@ if (!defined('__TYPECHO_ROOT_DIR__')) exit; - + + need('base/style.php'); ?> - + + diff --git a/base/style.php b/base/style.php index a4ef0b5..8343363 100644 --- a/base/style.php +++ b/base/style.php @@ -44,4 +44,21 @@ pre[class*=language-] { white-space: pre !important } + /*文章标签样式*/ + .article-tag a, .article-tags a { + display: inline-block; + height: 32px; + font-size: 13px; + font-weight: 500; + color: rgb(255, 255, 255) !important; + line-height: 32px; + padding: 0 12px; + border-radius: 16px; + background-color: #e4e4e4; + margin-bottom: 5px; + margin-right: 5px; + + background-image: linear-gradient(to right,#4f5555 0,#4f5555 100%); + opacity: .9; + } diff --git a/functions.php b/functions.php index 8d228a9..dbeea4b 100644 --- a/functions.php +++ b/functions.php @@ -1,2 +1,68 @@ 文章第一张图片 > 系统图库 + * @param $obj + * @return 获取文章头图 + */ +function get_postthumb($obj) { + + if(isset($obj->fields->thumb)){ + return $obj->fields->thumb; + } + + preg_match( "/]+src\s*=\s*['\"]([^'\"]+)['\"][^>]*>/ ", $obj->content, $matches ); + if(isset($matches[1])){ + return $matches[1]; + } + + preg_match( "/!\[(.*?)\]\((.*?)\)/ ", $obj->content, $matches ); + if(isset($matches[2])) { + return$matches[2]; + } + + $thumbPath = __DIR__ .'/static/medias/featureimages/'; + $files = scandir($thumbPath); + $thumbs = []; + for ($i = 0; $i < count($files); $i++) { + if(is_file($thumbPath . $files[$i])){ + $thumbs[] = $files[$i]; + } + } + + return Helper::options()->themeUrl .'/static/medias/featureimages/'. $thumbs[rand(0, count($thumbs) - 1)]; +} + +/** + * @param $obj 对象 + * @return string 上一页url + */ +function getPrevPageLink($obj){ + ob_start(); + $obj->pagelink("prev", "prev"); + $pageLink = ob_get_contents(); + ob_end_clean(); + preg_match("/]+href\s*=\s*['\"]([^'\"]+)['\"][^>]*>/", $pageLink, $matches); + if(isset($matches[1])){ + return $matches[1]; + } + return "#"; +} + +/** + * @param $obj 对象 + * @return string 下一页url + */ +function getNextPageLink($obj){ + ob_start(); + $obj->pageLink("next", "next"); + $pageLink = ob_get_contents(); + ob_end_clean(); + preg_match("/]+href\s*=\s*['\"]([^'\"]+)['\"][^>]*>/", $pageLink, $matches); + if(isset($matches[1])){ + return $matches[1]; + } + return "#"; +} \ No newline at end of file diff --git a/index.php b/index.php index ca46865..4765a62 100644 --- a/index.php +++ b/index.php @@ -10,41 +10,305 @@ $this->need('base/header.php'); ?> - - -
-
-
-
-
- -
-
  音乐
-
-
-
-
+ +
+
+
+
+
+ +
+
  音乐
+
+
+
- - -
-
  推荐文章
-
-
-
-
-
博客
-

博客地址更换为https://www.mobaijun.com

-
-

博客地址已经更换,请大家奔走相告新地址为:https://www.mobaijun.com - document.querySelectorAll('.gi

阅读更多 -
+
+ + +
+
  推荐文章
+
+
+
+
+
博客
+ +

博客地址更换为https://www.mobaijun.com

+
+

博客地址已经更换,请大家奔走相告新地址为:https://www.mobaijun.com + document.querySelectorAll('.gi

阅读更多
@@ -53,122 +317,139 @@ $this->need('base/header.php');
-
-
- next()): ?> -
-
-
<?php $this->title() ?> title() ?>
-
-
-
博客地址已经更换,请大家奔走相告新地址为:https://www.mobaijun.com - document.querySelectorAll('.github-emoji') .forEach(el
-
date('c'); ?> category(','); ?>
+
+ -
- - - need('/base/sidebar.php'); ?> - need('/base/footer.php'); ?> -
- + +
+ +
+
+
"> +
+
+
getCurrentPage());?> / getTotalPage());?>
+
+
- - -
- - - - - - - - - - - - - - - - - + +
+ + + + + + + + + + + + + + + + + - + + o(), n.addEventListener("scroll", function () { + var t = o, e = n; + clearTimeout(t.tId), t.tId = setTimeout(function () { + t.call(e) + }, 500) + }) + }(this) + \ No newline at end of file diff --git a/post.php b/post.php new file mode 100644 index 0000000..9bd7719 --- /dev/null +++ b/post.php @@ -0,0 +1,314 @@ +need('base/header.php'); +$this->need('base/article.style.php'); +?> +
+
+
+
+
+
title() ?>
+
+
+
+
+
+
+ +
+
+
+
+ +
+
+
+ content() ?> +
+
+
+
文章作者: author(); ?>
+
文章链接: permalink() ?> +
+
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 !
+
+ +
+ +
+ +
+ + +
+
+
+
+ +
+ +
+
+ + +
+
+ 评论
+
+
+ + +
+
+
+ + + +
+
+
+
 本篇 +
+
+
博客地址更换为https://www.mobaijun.com 博客地址更换为https://www.mobaijun.com
+
+
+
+ 博客地址已经更换,请大家奔走相告新地址为:https://www.mobaijun.com + document.querySelectorAll('.github-emoji') .forEach(el +
+
2020-04-23 +
+
+ +
+
+
+
下一篇 
+
+
Hello World Hello World
+
+
+
+ 生活就是,只有勇于攀登才能创造辉煌;生活就是创新,只有与时俱进才能跟上时代;生活就是付出,只有吃苦流汗才能实现理想;生活就是享受,只有品尝人生才能感知生活的快乐。 +
+
2019-12-06 +
+
+ +
+
+
+
+
+ + + + + +
+
+
+
  目录
+
+
+
+
+
+ + +
+ +need('base/footer.php'); +?> \ No newline at end of file diff --git a/static/js/anime.min.js b/static/js/anime.min.js new file mode 100644 index 0000000..c399324 --- /dev/null +++ b/static/js/anime.min.js @@ -0,0 +1,33 @@ +/* + 2017 Julian Garnier + Released under the MIT license +*/ +var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(e,r,p){if(p.get||p.set)throw new TypeError("ES3 does not support getters and setters.");e!=Array.prototype&&e!=Object.prototype&&(e[r]=p.value)};$jscomp.getGlobal=function(e){return"undefined"!=typeof window&&window===e?e:"undefined"!=typeof global&&null!=global?global:e};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_"; +$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(e){return $jscomp.SYMBOL_PREFIX+(e||"")+$jscomp.symbolCounter_++}; +$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var e=$jscomp.global.Symbol.iterator;e||(e=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[e]&&$jscomp.defineProperty(Array.prototype,e,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(e){var r=0;return $jscomp.iteratorPrototype(function(){return rb&&(b+=1);1b?c:b<2/3?a+(c-a)*(2/3-b)*6:a}var d=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(a)||/hsla\((\d+),\s*([\d.]+)%,\s*([\d.]+)%,\s*([\d.]+)\)/g.exec(a);a=parseInt(d[1])/360;var b=parseInt(d[2])/100,f=parseInt(d[3])/100,d=d[4]||1;if(0==b)f=b=a=f;else{var n=.5>f?f*(1+b):f+b-f*b,k=2*f-n,f=c(k,n,a+1/3),b=c(k,n,a);a=c(k,n,a-1/3)}return"rgba("+ +255*f+","+255*b+","+255*a+","+d+")"}function y(a){if(a=/([\+\-]?[0-9#\.]+)(%|px|pt|em|rem|in|cm|mm|ex|ch|pc|vw|vh|vmin|vmax|deg|rad|turn)?$/.exec(a))return a[2]}function V(a){if(-1=g.currentTime)for(var G=0;G=w||!k)g.began||(g.began=!0,f("begin")),f("run");if(q>n&&q=k&&r!==k||!k)b(k),x||e();f("update");a>=k&&(g.remaining?(t=h,"alternate"===g.direction&&(g.reversed=!g.reversed)):(g.pause(),g.completed||(g.completed=!0,f("complete"),"Promise"in window&&(p(),m=c()))),l=0)}a=void 0===a?{}:a;var h,t,l=0,p=null,m=c(),g=fa(a);g.reset=function(){var a=g.direction,c=g.loop;g.currentTime= +0;g.progress=0;g.paused=!0;g.began=!1;g.completed=!1;g.reversed="reverse"===a;g.remaining="alternate"===a&&1===c?2:c;b(0);for(a=g.children.length;a--;)g.children[a].reset()};g.tick=function(a){h=a;t||(t=h);k((l+h-t)*q.speed)};g.seek=function(a){k(d(a))};g.pause=function(){var a=v.indexOf(g);-1=c&&0<=b&&1>=b){var e=new Float32Array(11);if(c!==d||b!==f)for(var k=0;11>k;++k)e[k]=a(.1*k,c,b);return function(k){if(c===d&&b===f)return k;if(0===k)return 0;if(1===k)return 1;for(var h=0,l=1;10!==l&&e[l]<=k;++l)h+=.1;--l;var l=h+(k-e[l])/(e[l+1]-e[l])*.1,n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(.001<=n){for(h=0;4>h;++h){n=3*(1-3*b+3*c)*l*l+2*(3*b-6*c)*l+3*c;if(0===n)break;var m=a(l,c,b)-k,l=l-m/n}k=l}else if(0=== +n)k=l;else{var l=h,h=h+.1,g=0;do m=l+(h-l)/2,n=a(m,c,b)-k,0++g);k=m}return a(k,d,f)}}}}(),Q=function(){function a(a,b){return 0===a||1===a?a:-Math.pow(2,10*(a-1))*Math.sin(2*(a-1-b/(2*Math.PI)*Math.asin(1))*Math.PI/b)}var c="Quad Cubic Quart Quint Sine Expo Circ Back Elastic".split(" "),d={In:[[.55,.085,.68,.53],[.55,.055,.675,.19],[.895,.03,.685,.22],[.755,.05,.855,.06],[.47,0,.745,.715],[.95,.05,.795,.035],[.6,.04,.98,.335],[.6,-.28,.735,.045],a],Out:[[.25, +.46,.45,.94],[.215,.61,.355,1],[.165,.84,.44,1],[.23,1,.32,1],[.39,.575,.565,1],[.19,1,.22,1],[.075,.82,.165,1],[.175,.885,.32,1.275],function(b,c){return 1-a(1-b,c)}],InOut:[[.455,.03,.515,.955],[.645,.045,.355,1],[.77,0,.175,1],[.86,0,.07,1],[.445,.05,.55,.95],[1,0,0,1],[.785,.135,.15,.86],[.68,-.55,.265,1.55],function(b,c){return.5>b?a(2*b,c)/2:1-a(-2*b+2,c)/2}]},b={linear:A(.25,.25,.75,.75)},f={},e;for(e in d)f.type=e,d[f.type].forEach(function(a){return function(d,f){b["ease"+a.type+c[f]]=h.fnc(d)? +d:A.apply($jscomp$this,d)}}(f)),f={type:f.type};return b}(),ha={css:function(a,c,d){return a.style[c]=d},attribute:function(a,c,d){return a.setAttribute(c,d)},object:function(a,c,d){return a[c]=d},transform:function(a,c,d,b,f){b[f]||(b[f]=[]);b[f].push(c+"("+d+")")}},v=[],B=0,ia=function(){function a(){B=requestAnimationFrame(c)}function c(c){var b=v.length;if(b){for(var d=0;db&&(c.duration=d.duration);c.children.push(d)});c.seek(0);c.reset();c.autoplay&&c.restart();return c};return c};q.random=function(a,c){return Math.floor(Math.random()*(c-a+1))+a};return q}); \ No newline at end of file