Skip to content

Commit fac559e

Browse files
committed
new version
1 parent dbeec1d commit fac559e

File tree

11 files changed

+85
-71
lines changed

11 files changed

+85
-71
lines changed

_includes/footer.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
<script src="<?php $this->options->themeUrl('asserts/lib/lazyload.min.js'); ?>"></script>
3636
<script src="<?php $this->options->themeUrl('asserts/js/article.js'); ?>"></script>
37+
<link rel="stylesheet" href="<?php $this->options->themeUrl('asserts/lib/highlight/vscode.css'); ?>">
3738
<script src="<?php $this->options->themeUrl('script.js'); ?>"></script>
3839

3940
<?php if (array_key_exists('is_archive', $GLOBALS) && $GLOBALS['is_archive']): ?>
@@ -48,6 +49,15 @@
4849
</script>
4950
<?php endif ?>
5051

52+
<?php if($this->options->blurCard === "true"): ?>
53+
<style>
54+
.card{
55+
backdrop-filter: blur(10px) saturate(1.8);
56+
background-color: rgba(255,255,255,.75);
57+
}
58+
</style>
59+
<?php endif; ?>
60+
<?php if($this->options->musicUrl): ?>
5161
<script src="<?php $this->options->themeUrl('asserts/lib/plyr/plyr.polyfilled.min.js'); ?>"></script>
5262
<script>
5363
const player = new Plyr('#player', { controls: '',loadSprite: false });
@@ -96,5 +106,6 @@
96106
}, 2000)
97107
})
98108
</script>
109+
<?php endif; ?>
99110
<?php $this -> footer(); ?>
100111
</footer>

_includes/nav.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636

3737
<div class="site-controls text-center align-middle">
3838
<div class="row">
39-
<div class="col-4 active" data-tab="navigation"><a href="javascript:;"><i
40-
data-feather="compass"></i><br /><span>导航</span></a></div>
41-
<div class="col-4" data-tab="folder"><a href="javascript:;"><i
42-
data-feather="folder"></i><br /><span>归档</span></a></div>
43-
<div class="col-4" data-tab="setting"><a href="javascript:;"><i
44-
data-feather="settings"></i><br /><span>设置</span></a></div>
39+
<div class="col-4 active" data-tab="navigation"><a href="javascript:;"><div><i
40+
data-feather="compass"></i><br /><span>导航</span></div></a></div>
41+
<div class="col-4" data-tab="folder"><a href="javascript:;"><div><i
42+
data-feather="folder"></i><br /><span>归档</span></div></a></div>
43+
<div class="col-4" data-tab="setting"><a href="javascript:;"><div><i
44+
data-feather="settings"></i><br /><span>设置</span></div></a></div>
4545
</div>
4646
</div>
4747

_includes/sidebar.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@
2222
<div class="title">作者信息</div>
2323
<div class="site-meta row text-center">
2424
<div class="col-4">
25-
<div><?php echo get_PublishedPostsNum($this->_archiveSlug); ?></div>
25+
<div><?php echo get_post_num($this->_archiveSlug); ?></div>
2626
<div>文章</div>
2727
</div>
2828
<div class="col-4">
29-
<div><?php echo get_SpamCommentsNum($this->_archiveSlug); ?></div>
29+
<div><?php echo get_comment_num($this->_archiveSlug); ?></div>
3030
<div>评论</div>
3131
</div>
3232
<div class="col-4">

_layouts/default-0.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
<link rel="shortcut icon" href="<?php if($this->options->favicon)$this->options->favicon(); ?>">
2020
<link rel="stylesheet" href="<?php $this->options->themeUrl('asserts/lib/bootstrap/bootstrap.min.css'); ?>">
2121
<link rel="stylesheet" href="<?php $this->options->themeUrl('style.css'); ?>">
22-
<link rel="stylesheet" href="<?php $this->options->themeUrl('asserts/lib/highlight/vscode.css'); ?>">
2322
<?php $this->header(); ?>
2423
</head>
2524

asserts/css/morecho.css

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -298,37 +298,47 @@ button.bg-darker:focus {
298298
}
299299
/* from argon end */
300300

301-
.nav-pills .nav-link {
301+
.flex-column.nav-pills .nav-link {
302302
font-weight: 600;
303-
border-radius: 0.5rem;
304303
position: relative;
305-
transition: all 0.1s ease 0s;
304+
z-index: 0;
305+
background-color: transparent !important;
306+
transition: all 0.2s ease 0s;
306307
}
307-
.flex-column.nav-pills .nav-link {
308+
.flex-column.nav-pills .nav-link:after {
309+
content: '';
308310
width: 100%;
311+
height: 100%;
312+
left: 0;
313+
top: 0;
314+
z-index: -1;
315+
background-color: transparent;
316+
border-radius: 0.5rem;
317+
position: absolute;
318+
transition: all 0.2s ease 0s;
309319
}
310-
.flex-column.nav-pills:hover .nav-link.active {
311-
font-size: 1rem;
312-
padding: 0.5rem 1rem;
320+
.flex-column.nav-pills .nav-link {
313321
width: 100%;
314-
color: #007bff;
315-
background-color: transparent;
316-
transform: unset;
317-
box-shadow: unset !important;
318322
}
319323
.flex-column.nav-pills .nav-link.active,
320-
.flex-column.nav-pills:hover .nav-link:hover {
321-
transition: all 0.3s ease 0s;
322-
transform: translateX(-2rem);
323-
width: calc(100% + 3rem);
324-
padding: 0.5rem 2.5rem;
325-
box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
326-
}
327-
.nav-pills .nav-link.active,
328-
.nav-pills:hover .nav-link:hover,
329-
.nav-pills:hover .nav-link.active:hover {
324+
.flex-column.nav-pills:hover .nav-link:hover,
325+
.flex-column.nav-pills:hover .nav-link.active:hover{
330326
color: #fff;
327+
transform: translateX(-.7rem);
328+
}
329+
.flex-column.nav-pills .nav-link.active:after,
330+
.flex-column.nav-pills:hover .nav-link:hover:after,
331+
.flex-column.nav-pills:hover .nav-link.active:hover:after{
331332
background-color: #007bff;
333+
transform: scaleX(1.2);
334+
}
335+
.flex-column.nav-pills:hover .nav-link.active {
336+
color: #007bff;
337+
transform: unset;
338+
}
339+
.flex-column.nav-pills:hover .nav-link.active:after {
340+
background-color: transparent;
341+
transform: unset;
332342
}
333343
/* timeline */
334344
.timeline {

functions.php

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
function themeInit($data)
55
{
66
if($data->is('category')||$data->is('search')||$data->is('tag')||$data->is('author')||$data->parameter->type == 'Morecho_archive_page')
7-
$data->parameter->pageSize = 2^32;
7+
$data->parameter->pageSize = 2<<30;
88
}
99

1010
function themeConfig($form)
@@ -48,6 +48,9 @@ function themeConfig($form)
4848
$backgroundsm = new Typecho_Widget_Helper_Form_Element_Text('backgroundsm', NULL, NULL, _t('移动端背景图片地址'), _t('在移动端使用长图替换宽图体验更好'));
4949
$form->addInput($backgroundsm->addRule('xssCheck', _t('请不要使用特殊字符')));
5050

51+
$blurCard = new Typecho_Widget_Helper_Form_Element_Radio('blurCard', array('false' => _t('不启用'), 'true' => _t('启用')), 'false', _t('是否启用半透明卡片效果(实验性)'), _t(''));
52+
$form->addInput($blurCard);
53+
5154
$title2 = new Typecho_Widget_Helper_Layout('div', array('class=' => 'typecho-page-title'));
5255
$title2->html('<h2>头衔</h2>
5356
<p>会在左侧栏和评论区显示</p>');
@@ -70,15 +73,15 @@ function themeFields($layout)
7073
if (preg_match("/write-page.php/", $_SERVER['REQUEST_URI'])) {
7174
$textIndent = new Typecho_Widget_Helper_Form_Element_Select('textIndent', array('false' => '不缩进', 'true' => '缩进'), 'false', '开启全文首行缩进');
7275
$layout->addItem($textIndent);
73-
$headImage = new Typecho_Widget_Helper_Form_Element_Text('headImage', NULL, NULL, _t('头图'), _t(''));
76+
$headImage = new Typecho_Widget_Helper_Form_Element_Text('headImage', NULL, NULL, _t('头图'), _t('输入图片链接'));
7477
$layout->addItem($headImage);
7578
}
7679
if (preg_match("/write-post.php/", $_SERVER['REQUEST_URI'])) {
7780
$textIndent = new Typecho_Widget_Helper_Form_Element_Select('textIndent', array('false' => '不缩进', 'true' => '缩进'), 'false', '开启全文首行缩进');
7881
$layout->addItem($textIndent);
7982
$foldInIndex = new Typecho_Widget_Helper_Form_Element_Select('foldInIndex', array('false' => '不折叠', 'true' => '折叠'), 'false', '在主页列表中折叠');
8083
$layout->addItem($foldInIndex);
81-
$headImage = new Typecho_Widget_Helper_Form_Element_Text('headImage', NULL, NULL, _t('头图'), _t(''));
84+
$headImage = new Typecho_Widget_Helper_Form_Element_Text('headImage', NULL, NULL, _t('头图'), _t('输入图片链接'));
8285
$layout->addItem($headImage);
8386
$subtitle = new Typecho_Widget_Helper_Form_Element_Text('subtitle', NULL, NULL, _t('副标题'), _t('首页模板功能'));
8487
$layout->addItem($subtitle);
@@ -95,18 +98,30 @@ function get_user($uid){
9598

9699
function get_post_num($id = false){
97100
$db = Typecho_Db::get();
98-
if($id == false) $postnum=$db->fetchRow($db->select(array('COUNT(authorId)'=>'allpostnum'))->from ('table.contents')->where('table.contents.type=?', 'post'));
99-
else $postnum=$db->fetchRow($db->select(array('COUNT(authorId)'=>'allpostnum'))->from ('table.contents')->where ('table.contents.authorId=?',$id)->where('table.contents.type=?', 'post'));
100-
$postnum = $postnum['allpostnum'];
101-
return $postnum;
101+
if($id == false) $postnum=$db->fetchRow($db
102+
->select(array('COUNT(authorId)'=>'allpostnum'))
103+
->from ('table.contents')
104+
->where('table.contents.type=?', 'post'));
105+
else $postnum=$db->fetchRow($db
106+
->select(array('COUNT(authorId)'=>'allpostnum'))
107+
->from ('table.contents')
108+
->where ('table.contents.authorId=?',$id)
109+
->where('table.contents.type=?', 'post'));
110+
return $postnum['allpostnum'];
102111
}
103112

104113
function get_comment_num($id = false){
105114
$db = Typecho_Db::get();
106-
if($id == false) $commentnum=$db->fetchRow($db->select(array('COUNT(authorId)'=>'commentnum'))->from ('table.comments')->where ('table.comments.authorId=?',$id)->where('table.comments.type=?', 'comment'));
107-
else $commentnum=$db->fetchRow($db->select(array('COUNT(authorId)'=>'commentnum'))->from ('table.comments')->where('table.comments.type=?', 'comment'));
108-
$commentnum = $commentnum['commentnum'];
109-
return $commentnum;
115+
if($id == false) $commentnum=$db->fetchRow($db
116+
->select(array('COUNT(authorId)'=>'commentnum'))
117+
->from ('table.comments')
118+
->where('table.comments.type=?', 'comment'));
119+
else $commentnum=$db->fetchRow($db
120+
->select(array('COUNT(authorId)'=>'commentnum'))
121+
->from ('table.comments')
122+
->where ('table.comments.authorId=?',$id)
123+
->where('table.comments.type=?', 'comment'));
124+
return $commentnum['commentnum'];
110125
}
111126

112127
function get_last_update(){
@@ -123,23 +138,6 @@ function get_last_update(){
123138
}
124139
}
125140

126-
function get_PublishedPostsNum($uid){
127-
$db = Typecho_Db::get();
128-
return $db->fetchObject($db->select(array('COUNT(cid)' => 'num'))
129-
->from('table.contents')
130-
->where('table.contents.type = ?', 'post')
131-
->where('table.contents.status = ?', 'publish')
132-
->where('table.contents.authorId = ?', $uid))->num;
133-
}
134-
135-
function get_SpamCommentsNum($uid){
136-
$db = Typecho_Db::get();
137-
return $db->fetchObject($db->select(array('COUNT(coid)' => 'num'))
138-
->from('table.comments')
139-
->where('table.comments.status = ?', 'spam')
140-
->where('table.comments.ownerId = ?', $uid))->num;
141-
}
142-
143141
function get_user_group($name = NULL){
144142
$options = Helper::options();
145143
$db = Typecho_Db::get();

index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* @package Morecho Theme
66
* @author MuZhou233
7-
* @version 0.4.4
7+
* @version 0.5.1
88
* @link https://typecho.mosar.in
99
*/
1010

page.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<h1 class="title"><?php $this->title() ?></h1>
1616

1717
<article class="card card-article">
18-
<?php if($this->fields->headImage): ?><img class="headimg" href="<?php $this->fields->subtitle() ?>"></img><?php endif ?>
18+
<?php if($this->fields->headImage): ?><img class="headimg" src="<?php $this->fields->headImage() ?>"></img><?php endif ?>
1919
<?php if($this->fields->subtitle): ?><h2 class="subtitle"><?php $this->fields->subtitle() ?></h2><?php endif ?>
2020
<?php $this->content(); ?>
2121
</article>

post.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<h1 class="title"><?php $this->title() ?></h1>
1616

1717
<article class="card card-article">
18-
<?php if($this->fields->headImage): ?><img class="headimg" href="<?php $this->fields->subtitle() ?>"></img><?php endif ?>
18+
<?php if($this->fields->headImage): ?><img class="headimg" src="<?php $this->fields->headImage() ?>"></img><?php endif ?>
1919
<?php if($this->fields->subtitle): ?><h2 class="subtitle"><?php $this->fields->subtitle() ?></h2><?php endif ?>
2020
<?php $this->content(); ?>
2121
</article>

screenshot.jpg

0 Bytes
Loading

0 commit comments

Comments
 (0)