Skip to content

Commit

Permalink
Merge branch 'master' of github.com:AlanDecode/Typecho-Theme-VOID
Browse files Browse the repository at this point in the history
  • Loading branch information
AlanDecode committed Apr 21, 2019
2 parents 9446783 + 353bcd1 commit 7ce79f4
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 41 deletions.
3 changes: 3 additions & 0 deletions advanceSetting.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@
// 夜间模式精确切换(需要用户允许网站访问位置)
"accurateDarkMode": true,

// 底部显示最近访客
"showRecentGuest": true,

// 自定义添加栏下拉列表
"nav" : [
{
Expand Down
28 changes: 11 additions & 17 deletions assets/parts/_footer.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ footer{
section{
flex: 1;
position: relative;
margin-top: 1rem;
padding-top: 1rem;
margin: 1rem 0.5rem 0 0.5rem;
&,& *{
color: #ddd;
.theme-dark &{
Expand All @@ -34,17 +33,6 @@ footer{
}
font-weight: 300;
}
&:nth-child(2){
margin: 0 15px;
margin-top: 1rem;
}
&::before{
content: attr(data-title);
position: absolute;
color: #ddd;
font-weight: normal;
top: 0;
}
ul{
list-style: none;
text-indent: 0;
Expand All @@ -70,19 +58,25 @@ footer{
&:first-child{
margin-top: 1rem;
}
&#hitokoto{
margin: 1rem 0;
}
}
}
@media screen and (max-width:767px) {
flex-direction: column;
section{
margin: 15px;
.avatar-list{
margin-bottom: 0;
}
}
}
}
&.no-rg{
@media screen and (max-width:767px){
section:nth-child(2) {
margin-top: 0.5rem;
p:nth-child(1) {
margin-top: 0;
}
}
}
}
}
53 changes: 30 additions & 23 deletions includes/footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,35 @@
if (!defined('__TYPECHO_ROOT_DIR__')) exit;
$setting = $GLOBALS['VOIDSetting'];
?>
<footer <?php if(!$setting['showRecentGuest']) echo 'class="no-rg"' ?>>
<div class="container">
<section>
<?php if($setting['showRecentGuest']): ?>
<div class="avatar-list">
<?php
$recentComments=Contents::getRecentComments(14);
foreach ($recentComments as $comment){ ?>
<a href="<?php echo $comment['permalink']; ?>"><img class="avatar" alt="<?php echo $comment['author'] ?>" src="<?php Utils::gravatar($comment['mail'], 64, ''); ?>" width="64" height="64"></a>
<?php } ?>
</div>
<?php else: ?>
<p>感谢陪伴:<span id="uptime"></span></p>
<p id="hitokoto"></p>
<?php endif; ?>
</section>
<section>
<?php if($setting['showRecentGuest']): ?>
<p>感谢陪伴:<span id="uptime"></span></p>
<p id="hitokoto"></p>
<?php endif; ?>
<p>© <?php echo date('Y '); ?> <span class="brand"><?php echo $this->options->title; ?></span></p>
<p>Powered by <a href="http://typecho.org/">Typecho</a> • <a href="https://blog.imalan.cn/archives/247/">Theme VOID</a></p>
<p><?php echo $setting['footer']; ?></p>
</section>
</div>
</footer>
<div id="back-top" onclick="goTop(500);"><div></div></div>

<?php if(!empty($setting['serviceworker'])): ?>
<script>
var serviceWorkerUri = '/<?php echo $setting['serviceworker']; ?>';
Expand All @@ -30,8 +59,6 @@
<?php endif; ?>
<script src="<?php Utils::indexTheme('/assets/bundle.js'); ?>"></script>
<script src="<?php Utils::indexTheme('/assets/VOID.js'); ?>"></script>
<?php $this->footer(); ?>

<?php if($setting['enableMath']): ?>
<script src='<?php Utils::indexTheme('/assets/libs/mathjax/2.7.4/MathJax.js'); ?>' async></script>
<script type="text/x-mathjax-config">
Expand Down Expand Up @@ -73,26 +100,6 @@ function ExSearchCall(item){
</script>
<?php endif; ?>
<link rel="stylesheet" href="https://lab.lepture.com/social/dist/widget.css">
<footer>
<div class="container">
<section data-title="Recent Guests"> <!-- 最近访客 -->
<div class="avatar-list">
<?php
$recentComments=Contents::getRecentComments(14);
foreach ($recentComments as $comment){ ?>
<a href="<?php echo $comment['permalink']; ?>"><img class="avatar" alt="<?php echo $comment['author'] ?>" src="<?php Utils::gravatar($comment['mail'], 64, ''); ?>" width="64" height="64"></a>
<?php } ?>
</div>
</section>
<section data-title="Site Info"> <!-- 一言与页底信息 -->
<p>感谢陪伴:<span id="uptime"></span></p>
<p id="hitokoto"></p>
<p>© <?php echo date('Y '); ?> <span class="brand"><?php echo $this->options->title; ?></span></p>
<p>Powered by <a href="http://typecho.org/">Typecho</a> • <a href="https://blog.imalan.cn/archives/247/">Theme VOID</a></p>
<p><?php echo $setting['footer']; ?></p>
</section>
</div>
</footer>
<div id="back-top" onclick="goTop(500);"><div></div></div>
<?php $this->footer(); ?>
</body>
</html>
3 changes: 2 additions & 1 deletion libs/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ public static function getVOIDSettings()
'headerMode' => 1,
'followSystemColorScheme' => false,
'accurateDarkMode' => false,
"useNotoSerif" => false
"useNotoSerif" => false,
"showRecentGuest" => false
);

$options = Helper::options();
Expand Down

0 comments on commit 7ce79f4

Please sign in to comment.