Skip to content

Commit

Permalink
Update:小部分重构
Browse files Browse the repository at this point in the history
  • Loading branch information
ZigZagK committed Apr 3, 2020
1 parent bb7bad9 commit 90c4def
Show file tree
Hide file tree
Showing 13 changed files with 402 additions and 311 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

## 如何使用

请使用 PHP 7+,typecho开发版(版本`>=17.11.15`) 获得最佳体验。

1.[Releases](https://github.com/ZigZagK/typecho-theme-MDUI2333/releases)中下载最新版,**改名为MDUI2333**放入主题目录,之后启用主题。
2. 在设置外观中设置一下主题色强调色,背景图片等。
3. 更多帮助详见[MDUI2333Wiki](https://github.com/ZigZagK/typecho-theme-MDUI2333/wiki),也可以在[留言板](https://zigzagk.top/messages#comments)中询问我(注:关于typecho设置的问题和Wiki中有的问题很大概率**得不到解答**)。
Expand Down Expand Up @@ -66,7 +68,7 @@

[MDUI](https://mdui.org) | [jQuery](https://github.com/jquery/jquery) | [jquery-pjax](https://github.com/defunkt/jquery-pjax)

[highlight.js](https://highlightjs.org/) | [Prism](https://prismjs.com/) | [MathJax](https://www.mathjax.org/) | [Fancybox](https://fancyapps.com/fancybox/3/) | [jquery_headindex](https://github.com/mnnyang/jquery_headindex) | [twemoji-colr](https://github.com/mozilla/twemoji-colr)
[highlight.js](https://highlightjs.org/) | [Prism](https://prismjs.com/) | [MathJax](https://www.mathjax.org/) | [Fancybox](https://fancyapps.com/fancybox/3/) | [jquery_headindex](https://github.com/mnnyang/jquery_headindex) | [Animate.css](https://github.com/daneden/animate.css) | [twemoji-colr](https://github.com/mozilla/twemoji-colr)

[Meting](https://github.com/MoePlayer/APlayer-Typecho) | [ExSearch](https://github.com/AlanDecode/Typecho-Plugin-ExSearch) | [Mailer](https://github.com/AlanDecode/Typecho-Plugin-Mailer)

Expand Down
6 changes: 5 additions & 1 deletion comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,4 +112,8 @@ function threadedComments($comment,$options){ ?>
<?php } ?>
</div>
</div>
<?php $this->need('js/commentjs.php'); ?>
<script>
typechocomment('<?php $this->respondId(); ?>');smoothscroll('.haveat a');QAQTABreload();smiliesreload();
visitorfunction(<?php echo ($this->user->hasLogin()?'true':'false'); ?>,'<?php echo $this->options->gravatarurl; ?>');
ajaxcomment({highlightmode:'<?php echo $this->options->highlightmode; ?>',commentsuccess:'<?php echo $this->options->commentsuccess; ?>'});
</script>
63 changes: 63 additions & 0 deletions css/MDUI2333.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*index.php*/
::selection {background:#b3d4fc;text-shadow:none;}
a {color:unset;text-decoration:unset;}
a.a-no-bottom:hover:before,a.a-no-bottom:focus:before {display:none!important;}
.a-no-bottom a:hover:before,.a-no-bottom a:focus:before {display:none!important;}
body {background:var(--backgroundpic);background-position:center;background-size:cover;background-repeat:no-repeat;background-attachment:fixed;display:flex;flex-flow:column;min-height:calc(100vh - 56px);}
@media (min-width:600px) {body {min-height:calc(100vh - 64px);}}
@media (orientation:landscape) and (max-width:959px) {body {min-height:calc(100vh - 48px);}}
#pjax-overlay {position:fixed;top:0;left:0;width:100vw;height:100vh;z-index:2000;background:rgb(0,0,0,0.8);}
#pjax-progress {top:calc(50% - 33px);display:block;height:66px;width:300px;z-index:9999;}
#pjax-container {flex:1;}
#header-title {font-weight:500;}
.pre-numbering {float:left!important;font-size:14px!important;padding:10px!important;margin:0!important;border-right:1px solid #C3CCD0!important;background:#EEE!important;text-align:right!important;text-shadow:none!important;color:#666!important;list-style:none!important;line-height:1.5!important;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;}
pre {padding:0!important;background:#F7F7F7!important;}
pre code {background:#F7F7F7!important;font-size:14px!important;line-height:1.5!important;padding:10px!important;display:block;white-space:pre;overflow-x:auto;border-left:none!important;box-shadow:none!important;text-shadow:none!important;}
.token.string,.token.string,.token.entity,.token.operator,.token.url,.token.variable {background:unset!important;}
.thumbnail {height:300px;background-position:center center!important;background-size:cover!important;}
.ins-search.show .ins-search-overlay {z-index:19260817!important;}
.ins-search-container {z-index:19260817!important;}
.ins-section-wrapper::-webkit-scrollbar {background:#fff!important;}
.mdui-checkbox input[type='checkbox']:focus:checked:not(:disabled) + .mdui-checkbox-icon {-webkit-box-shadow:none!important;box-shadow:none!important;}
.mdui-checkbox input[type='checkbox']:focus + .mdui-checkbox-icon {-webkit-box-shadow:none!important;box-shadow:none!important;}
.mdui-switch input[type='checkbox']:focus:checked:not(:disabled) + .mdui-switch-icon:before {-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12)!important;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12)!important;}
.mdui-switch input[type='checkbox']:focus + .mdui-switch-icon:before {-webkit-box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12)!important;box-shadow:0 2px 1px -1px rgba(0,0,0,.2),0 1px 1px 0 rgba(0,0,0,.14),0 1px 3px 0 rgba(0,0,0,.12)!important;}
/*comments.php*/
div#comments form {margin-bottom:0;}
#commentcontent > .comment-list {margin:16px 0;}
#commentcontent > .comment-list > .mdui-panel > .mdui-panel-item > .mdui-panel-item-body > .comment-children {margin-top:16px;}
#commentcontent .mdui-panel-item p img,.dairy-content p img {max-height:400px;vertical-align:middle;}
#QAQ {height:75%!important;max-height:400px!important;}
#QAQ .mdui-dialog-content {height:calc(100% - 100px)!important;}
#QAQ a {color:unset!important;text-transform:unset!important;}
#QAQ .mdui-dialog-content .mdui-btn {text-transform:unset!important;}
#QAQ .mdui-dialog-content .QAQPicture .mdui-btn {min-width:unset;padding:5px;height:unset;margin-bottom:-13px;}
#QAQ .mdui-dialog-content .QAQTextclose .mdui-btn {min-width:unset;}
div.page-navigator div {display:inline-block;margin:2px 1%;border-radius:4px;width:30px;height:30px;line-height:30px;background:var(--themeaccent);}
div.page-navigator div a,div.page-navigator div span{color:#fff!important;}
div.page-navigator div.next a,div.page-navigator div.prev a {line-height:28px!important;}
div.page-navigator div.current {background:var(--themeprimary);}
/*post.php & page.php*/
.mdui-typo hr {margin:0 0 1.2em 0;height:4px;border:0;background:var(--themeaccent);}
a.Fancybox {margin-bottom:-8px!important;}
.post-container h1,.post-container h2,.post-container h3,.post-container h4,.post-container h5,.post-container h6 {color:var(--themeprimary);}
.post-container p .Fancybox {vertical-align:middle;}
@media (min-width:600px) {#post-tocbtn {top:80px!important;}}
@media (orientation:landscape) and (max-width:959px) {#post-tocbtn {top:64px!important;}}
#post-toc {width:unset!important;min-width:160px!important;}
#post-toc ul {padding:0;margin:0;list-style:none;}
#post-toc .index-subItem-box {display:none;}
#post-toc .index-item,#post-toc .index-link {width:100%;display:block;color:#333333;text-decoration:none;box-sizing:border-box;}
#post-toc .index-link {padding:4px 8px 4px 12px;cursor:pointer;-webkit-transition:background-color 0.3s,border-left-color 0.3s;-moz-transition:background-color 0.3s,border-left-color 0.3s;-o-transition:background-color 0.3s,border-left-color 0.3s;transition:background-color 0.3s,border-left-color 0.3s;border-left:3px solid transparent;word-break:break-all;}
#post-toc .index-item.current > .index-link {background-color:rgba(0,0,0,0.1);border-left:3px solid var(--themeaccent);}
#post-toc .index-link:hover {background-color:rgba(0,0,0,0.1);}
#post-toc .index-subItem-box .index-item {padding-left:1em;}
#tag-container a {display:inline-block;}
.dairy-content {height:200px;overflow-y:auto;}
#bangumi .bangumi-cover {padding-top:133%;background-position:center;background-size:cover;background-repeat:no-repeat;}
#bangumi .bangumi-title {font-weight:500;text-align:center;}
#bangumi .bangumi-star {margin:0 -16px;text-align:center;font-size:14px;height:24px;}
#bangumi .bangumi-star .mdui-icon {font-size:16px;vertical-align:text-top;}
#bangumi a {width:100%;color:unset;}
/*footer.php*/
.footerlink {font-size:24px!important;}
69 changes: 0 additions & 69 deletions css/MDUI2333css.php

This file was deleted.

28 changes: 25 additions & 3 deletions footer.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $plugin=Typecho_Plugin::export(); ?>
<?php if ($this->options->AplayerCode) echo APlayerSalt($this->options->AplayerCode); ?>
<a class="mdui-fab mdui-fab-fixed mdui-fab-mini mdui-color-theme-accent mdui-ripple mdui-fab-hide" id="gototop" style="z-index:1"><i class="mdui-icon material-icons">&#xe316;</i></a>
<footer>
Expand All @@ -16,22 +17,43 @@
<div class="mdui-text-center">
<div>Copyright &copy; <?php echo date("Y"); ?> <a href="<?php $this->options->siteUrl(); ?>"><?php $this->options->title(); ?></a></div>
<?php if ($this->options->filing){ ?><div><a href="http://www.beian.miit.gov.cn" target="_blank" rel="nofollow"><?php echo $this->options->filing; ?></a></div><?php } ?>
<?php if ($this->options->gafiling){ ?><div><img src="<?php Helper::options()->themeUrl(); ?>/img/gaba.png" /><?php echo $this->options->gafiling; ?></div><?php } ?>
<?php if ($this->options->gafiling){ ?><div><img src="<?php echo asseturl('img/gaba.png'); ?>" /><?php echo $this->options->gafiling; ?></div><?php } ?>
</div>
</div>
<!-- 如果您能保留下面的主题信息,会使我更有动力哒QwQ -->
<div class="mdui-typo mdui-col-xs-4 mdui-col-md-3">
<div class="mdui-float-right">
<div>Powered by <a href="http://typecho.org" target="_blank">Typecho</a></div>
<div>Theme by <a href="https://github.com/ZigZagK/typecho-theme-MDUI2333" target="_blank">MDUI2333</a></div>
<?php if ($this->options->upyuncdn=='true'){ ?><div><span style="line-height:28px;">CDN by </span><a href="https://www.upyun.com" target="_blank"><img src="<?php Helper::options()->themeUrl(); ?>/img/upyun.png" height=28 /></a></div><?php } ?>
<?php if ($this->options->upyuncdn=='true'){ ?><div><span style="line-height:28px;">CDN by </span><a href="https://www.upyun.com" target="_blank"><img src="<?php echo asseturl('img/upyun.png'); ?>" height=28 /></a></div><?php } ?>
</div>
</div>
</div>
</div>
</div>
</footer>
<?php $this->need('js/footerjs.php'); ?>
<script>
globallistener();changetitle();
$(function(){
showannouncement('<?php echo $this->options->announcement; ?>','<?php echo $this->options->announcementpos; ?>');
highlightinit('<?php echo $this->options->highlightmode; ?>');codelinenumber('#pjax-container');
showposttoc(<?php echo $this->options->posttoc=='true'; ?>);mdui.mutation();
});
$(document).pjax('a:not(a[target="_blank"],a[no-pjax])',{container:'#pjax-container',fragment:'#pjax-container',timeout:8000});
$(document).on('submit','form[role="search"]',function(event){$.pjax.submit(event,{container:'#pjax-container',fragment:'#pjax-container',timeout:8000});});
$(document).on('pjax:send',function(){if (announcement!=null) announcement.close();sidebar.close();showoverlay();});
$(document).on('pjax:complete',function(){
changetitle();mathjaxreload('pjax-container');codelinenumber('#pjax-container');
highlightreload('<?php echo $this->options->highlightmode; ?>','#pjax-container');
showposttoc(<?php echo $this->options->posttoc=='true'; ?>);closeoverlay();
});
$(document).on('pjax:end',function(){
mdui.mutation();<?php if (array_key_exists('Meting',$plugin['activated'])){ ?>loadMeting();<?php } ?>
<?php echo $this->options->pjaxreload; ?>
});
$(document).on('pjax:error',function(e){closeoverlay();mdui.alert('PJAX加载超时,请检查网络','加载失败');e.preventDefault();});
</script>
<?php if ($this->options->customjs) echo $this->options->customjs; ?>
<?php $this->footer(); ?>
</body>
</html>
Loading

0 comments on commit 90c4def

Please sign in to comment.