Skip to content

Commit

Permalink
resolve #27
Browse files Browse the repository at this point in the history
增加幻灯片自定义颜色与大小
侧边栏可选操作
底部站点名称自定义
  • Loading branch information
dyedd committed Mar 29, 2022
1 parent cac8d24 commit 94d27dd
Show file tree
Hide file tree
Showing 10 changed files with 218 additions and 42 deletions.
87 changes: 75 additions & 12 deletions assets/css/main.css
Expand Up @@ -12,16 +12,20 @@
--box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
--theme-color: rgb(29, 161, 242);
--theme-choose-color: #1da1f21a;
--text-shadw: 0 0.1875rem 0.3125rem rgba(0, 0, 0, 0.3);
--text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
--theme-text-color: #4a4a4a;
--light-background: #fff;
--radius: 6px;
--text1:#18191c;
--text2:#61666D;
--text3: #dcdfe6;
--text4: #e4e7ed;
--dark-text-normal-color: rgba(255, 255, 255, 0.87);
--dark-content: rgba(52, 50, 50, 0.7);
--dark-text-gray-color: rgba(255, 255, 255, 0.6);
--dark-background: #121212;
--routine: #606266;
--dark-routine: #888;
}

/**
Expand Down Expand Up @@ -195,17 +199,25 @@ header {
display: inline-block;
}

.carousel-caption {
bottom: 3.25rem;
}

.carousel-caption h4 {
font-size: 2rem;
}

.carousel-inner {
box-shadow: var(--box-shadow);
}
.ol.carousel-indicators{
bottom: 0px;
margin-bottom: 0px;
}
ol.carousel-indicators li {
width: 6px;
height: 6px;
}
ol.carousel-indicators li.active {
width: 8px;
height: 8px;
}
.carousel-control-prev,.carousel-control-next {
display: none;
}
/**
文章列表
*/
Expand Down Expand Up @@ -302,7 +314,7 @@ article .sticky {
.post-category a {
font-size: .5rem;
color: var(--theme-text-color);
text-shadow: var(--text-shadw);
text-shadow: var(--text-shadow);
font-weight: 700;
}

Expand Down Expand Up @@ -470,7 +482,6 @@ article .sticky {

.card-icon {
justify-content: center;
margin: 10px 0 0;
width: 100%;
display: flex;
background: #ececec1f;
Expand All @@ -490,7 +501,12 @@ article .sticky {
text-align: center;
margin-top: -6px;
}

.time-text{
text-align: center;
color: #b5b5b5;
font-size: .6rem;
margin: .2rem 0;
}
#our-company {
text-align: center;
margin: 1rem auto;
Expand Down Expand Up @@ -580,7 +596,36 @@ article .sticky {
.sidebar-reply-content {
color: var(--theme-text-color);
}

.count {
padding: 15px 0;
display: flex;
align-items: center;
border-bottom: 1px solid var(--text3);
user-select: none;
}
.count .item {
min-width: 0;
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
color: var(--routine);
font-size: .6rem;
}
.count .item:not(:last-of-type) {
border-right: 1px solid var(--text3);
}
.count .num {
max-width: 70px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
font-weight: 500;
font-size: 1rem;
color: var(--theme-text-color);
margin-bottom: 3px;
text-shadow: var(--text-shadow);
}
/*
返回顶部
*/
Expand Down Expand Up @@ -882,4 +927,22 @@ fix*/

.theme-dark .logo-shine {
animation-play-state: paused;
}
.theme-dark .count {
border-bottom: none;
}
.theme-dark .count .item:not(:last-of-type) {
border-right: 1px solid var(--dark-routine);
}
.theme-dark .count .num {
color: var(--dark-text-gray-color);
}
.theme-dark .count .item {
min-width: 0;
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
color: var(--dark-routine);
font-size: .6rem;
}
4 changes: 2 additions & 2 deletions assets/css/post.css
Expand Up @@ -28,7 +28,7 @@
.article-title {
font-weight: 700;
word-break: break-all;
text-shadow: var(--text-shadw);
text-shadow: var(--text-shadow);
width: 100%;
text-align: center;
}
Expand All @@ -55,7 +55,7 @@
font-weight: 400;
margin: 0 .5rem;
display: inline-flex;
text-shadow: var(--text-shadw);
text-shadow: var(--text-shadow);
user-select: none;
}

Expand Down
13 changes: 13 additions & 0 deletions assets/js/lanstarApp.js
Expand Up @@ -29,6 +29,7 @@ let lanstar = {
this.addProcess();
this.addInitTabs();
this.addInitCollapse();
this.addCarouselEnter();
},
addFunc: () => {
let getCookie = function (cookieName)
Expand Down Expand Up @@ -86,6 +87,7 @@ let lanstar = {
let storage = window.localStorage;
if (storage.getItem('gmtNightMode')) {
$('body').addClass('theme-dark');
$('#carouselCaptions').addClass('carousel-dark')
$('.chose-mode-day').css('display', 'none');
$('.chose-mode-moon').css('display', 'inline-block');
document.cookie = "night=1;path=/";
Expand All @@ -94,8 +96,10 @@ let lanstar = {
if (!this.addFunc().getCookie('night')) {
if (hours > 6 && hours < 19) {
$('body').removeClass('theme-dark');
$('#carouselCaptions').removeClass('carousel-dark')
} else {
$('body').addClass('theme-dark');
$('#carouselCaptions').addClass('carousel-dark')
}
}

Expand Down Expand Up @@ -131,6 +135,7 @@ let lanstar = {
$('.moon').css('display', 'none');
}
$('body')[0].classList.toggle('theme-dark');
$('#carouselCaptions')[0].classList.toggle('carousel-dark')
}, 900)
setTimeout(function () {
$(".ze_DarkSky").fadeOut(1e3, function () {
Expand Down Expand Up @@ -529,5 +534,13 @@ let lanstar = {
next.slideToggle(200);
$('.article-collapse .collapse-body').not(next).slideUp();
});
},
addCarouselEnter(){
$('#carouselCaptions').on('mouseenter',function (){
$(this).children('a').css({'display':'flex'})
})
$('#carouselCaptions').on('mouseleave',function (){
$(this).children('a').hide(1000)
})
}
}
4 changes: 2 additions & 2 deletions component/index.footer.php
Expand Up @@ -15,7 +15,7 @@
<script src="<?php if ($this->options->cdn): echo 'https://cdn.jsdelivr.net/gh/dyedd/lanstar@' . themeVersion() . '/assets/js/page.min.js'; else:utils::indexTheme('assets/js/page.js'); endif ?>"></script>
<?php endif; ?>
<script>lanstar.init();</script>
<?php if ($this->options->couple): ?>
<?php if ($this->options->sidebarBlock && in_array('ShowYourCouple', $this->options->sidebarBlock)): ?>
<script>lanstar.addCoupleTime();</script>
<?php endif; ?>
<?php if ($this->options->pjax && $this->options->pjax != 0) : ?>
Expand Down Expand Up @@ -66,4 +66,4 @@ function () {
<svg class="icon" aria-hidden="true">
<use xlink:href="#icon-fanhuidingbu"></use>
</svg>
</div>
</div>
6 changes: 4 additions & 2 deletions docs/slide.md
Expand Up @@ -3,9 +3,11 @@
!> 相比过去版本,可以不只显示图片

```text
图片链接|链接|标题|简介
图片链接|链接|标题|简介|字体颜色|标题大小|简介大小
```

以此可以实现广告位的效果或者固定链接

当然如果不想实现这样的功能 每行一个图片链接即可!
当然如果不想实现这样的功能 每行一个图片链接即可!

!> 如果不想填链接,请写# 字体颜色可以英文缩写or十六禁止 字体大小以rem为单位,1rem = 16px
14 changes: 10 additions & 4 deletions layout/footer.php
@@ -1,14 +1,20 @@
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<footer class="container footer">
&copy; <?php echo date('Y');?> <a class="footer-item"
href="<?php $this->options->siteUrl();?>"><?php $this->options->title();?></a>
&copy; <?php echo date('Y');?>
<?php if($this->options->footerName):?>
<?php $this->options->footerName();?>
<?php else:?>
<a class="footer-item" href="<?php $this->options->siteUrl();?>"><?php $this->options->title();?></a>
<span style='color:#d14836'></span>
<?php endif;?>
<br>
<?php if ($this->options->recordNo):?>
<a class="footer-item" target="_blank"
href="http://beian.miit.gov.cn/"> <?php $this->options->recordNo();?></a>
<?php endif;?>
<br>
<?php $this->options->footerEcho();?>
<div>
<?php $this->options->footerEcho();?>
</div>
<p class="footer-item">Theme By <a href="https://dyedd.cn" title="禁止仿制" class="footer-item">Lanstar</a></p>
</footer>
<?php $this->footer(); ?>
30 changes: 29 additions & 1 deletion layout/right.php
Expand Up @@ -12,6 +12,7 @@
</button>
</form>
</div>
<?php if ($this->options->sidebarBlock && in_array('ShowBlogInfo', $this->options->sidebarBlock)): ?>
<div class="card user-container">
<div class="card-header user-info">
<div class="info">
Expand All @@ -22,6 +23,25 @@
<?php $this->options->rightName(); ?>
</p>
<div class="card-info-description"><?php echo $this->options->rightMotto ? $this->options->rightMotto : '博主很懒,啥都没有'; ?></div>
<?php Typecho_Widget::widget('Widget_Stat')->to($item); ?>
<div class="count">
<div class="item" title="累计文章数">
<span class="num"><?php echo number_format($item->publishedPostsNum); ?></span>
<span>文章数</span>
</div>
<div class="item" title="累计评论数">
<span class="num"><?php echo number_format($item->publishedCommentsNum); ?></span>
<span>评论量</span>
</div>
<div class="item" title="累计分类数">
<span class="num"><?php echo number_format($item->categoriesNum); ?></span>
<span>分类数</span>
</div>
<div class="item" title="累计页面数">
<span class="num"><?php echo number_format($item->publishedPagesNum + $item->publishedPostsNum); ?></span>
<span>页面数</span>
</div>
</div>
<div class="card-icon">
<a href="<?php $this->options->siteUrl(); ?>/feed" title="rss">
<svg class="icon" aria-hidden="true">
Expand All @@ -30,15 +50,20 @@
</a>
<?php echo utils::handleRightIcon() ?>
</div>
<div class="time-text">
<span>已在风雨中度过 <?php echo utils::getBuildTime($this->options->startTime);?></span>
</div>
</div>
<?php if ($this->options->couple): ?>
<?php endif; ?>
<?php if ($this->options->sidebarBlock && in_array('ShowYourCouple', $this->options->sidebarBlock)): ?>
<div class="sidebar-box couple">
<img class="pic" src="<?php $this->options->rightAvatar(); ?>" alt="博主">
<img class="couple-love" src="<?php utils::indexTheme('assets/img/love.png'); ?>" alt="爱心">
<img class="pic" src="<?php $this->options->taAvatar(); ?>" alt="另一半">
<div id="our-company" data-start="<?php $this->options->company(); ?>"></div>
</div>
<?php endif; ?>
<?php if ($this->options->sidebarBlock && in_array('ShowRecentComments', $this->options->sidebarBlock)): ?>
<?php if ($this->is('index')): ?>
<div class="sidebar-box">
<div class="p-3"><h6>最近消息</h6></div>
Expand Down Expand Up @@ -71,12 +96,15 @@ class="text-muted"><?php echo date('Y-m-d', $comments->created); ?></small>
</div>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->options->sidebarBlock && in_array('ShowRecentComments', $this->options->sidebarBlock)): ?>
<div class="sidebar-box">
<div class="p-3"><h6>可能感兴趣</h6></div>
<div class="sidebar-content px-3 pb-2">
<?php utils::getRandomPosts(3); ?>
</div>
</div>
<?php endif; ?>
<?php $this->need('layout/footer.php'); ?>
</div>
<div class="col-12 d-md-none">
Expand Down

0 comments on commit 94d27dd

Please sign in to comment.