This commit is contained in:
Van 2019-03-28 23:00:58 +08:00
parent acb13c5f18
commit c502f892eb
No known key found for this signature in database
GPG Key ID: 7059B8783A78F16C
9 changed files with 152 additions and 10 deletions

File diff suppressed because one or more lines are too long

View File

@ -132,6 +132,7 @@ a {
font-weight: 300;
margin: 5px 0 70px;
color: $fade-lighter;
line-height: 24px;
}
&__nav {
position: relative;
@ -326,11 +327,12 @@ a {
background-color: #fff;
position: relative;
.fn__flex {
flex-wrap: wrap;
margin: 0 -20px;
}
.item {
position: relative;
flex: 1;
flex: 1 1 300px;
margin: 40px 20px;
box-shadow: 8px 14px 38px rgba(39, 44, 49, .06), 1px 3px 8px rgba(39, 44, 49, .03);
border-radius: 5px;
@ -468,6 +470,7 @@ a {
&__cover {
height: 800px;
background-size: cover;
background-position: center center;
}
&__content {
padding: 70px 100px 0;
@ -660,6 +663,144 @@ a {
span, div {
color: $gray;
font-size: 12px;
word-break: break-all;
white-space: normal;
}
}
}
@media (max-width: 768px) {
.header {
padding: 10px 0;
&__h1 {
padding-top: 60px;
}
&__h2 {
margin-bottom: 40px;
}
&__nav {
.fn__right {
float: none;
}
a {
margin: 0 10px 0 0;
}
}
&--article {
height: auto;
.header__nav a {
line-height: 24px;
}
}
&--other {
height: 360px;
.header__nav a {
line-height: 24px;
}
}
}
.articles {
position: initial;
margin: 10px -5px 0 -5px;
.item {
margin: 0 5px 10px;
&--large {
flex-direction: column;
flex: 1 1 300px;
.item__cover {
height: 200px;
}
.item__main {
padding: 25px;
width: auto;
flex: 1;
}
}
}
}
.pagination {
margin-top: 0;
margin-bottom: 5px;
&__item {
margin-bottom: 5px;
}
}
.footer {
.fn__left,
.fn__right {
float: none;
text-align: center;
}
}
.article {
&__top {
height: 40px;
.title {
display: none;
}
}
&__share .item {
height: 40px;
width: 40px;
padding: 10px 0;
}
.item {
&__meta {
padding-top: 40px;
}
&__cover {
height: 380px;
}
&__content {
padding: 10px 10px 0;
&--article {
margin-top: -20px;
}
}
}
&__bottom {
.fn__flex {
margin: 0 0 10px 0;
}
.item {
margin: 10px 0 0 0;
}
}
}
.comment {
&__title {
padding: 10px 0;
}
&__wrapper {
padding: 0 10px 0.1px;
}
#comment,
.item {
margin-bottom: 10px;
padding: 10px;
&__avatar {
margin-bottom: 10px;
}
}
}
.other {
&__title {
margin-top: -280px;
}
&__content {
padding: 20px;
margin: 40px auto 10px;
}
&__meta--list {
margin-bottom: 40px;
}
}
}

View File

@ -20,9 +20,10 @@
<footer class="footer">
<div class="wrapper fn__clear">
<div class="fn__left">
${blogTitle} &copy; ${year} ${footerContent} <br>
Powered by <a href="https://b3log.org" target="_blank">B3log 开源</a> &nbsp;•&nbsp;
<a href="https://solo.b3log.org" target="_blank">Solo</a> &nbsp;•&nbsp;
${blogTitle} &copy; ${year} ${footerContent} &nbsp;•&nbsp;
Powered by <a href="https://b3log.org" target="_blank">B3log 开源</a> &nbsp;•&nbsp;
<a href="https://solo.b3log.org" target="_blank">Solo</a>
<br>
Theme <a rel="friend" href="https://github.com/b3log/solo-skins" target="_blank">${skinDirName}</a>
<sup>[<a href="https://github.com/TryGhost/Casper" target="_blank">ref</a>]</sup>
by <a href="http://vanessa.b3log.org" target="_blank">Vanessa</a>

View File

@ -58,7 +58,7 @@ var Skin = {
$('.article__top').css('top', -61)
}
if ($('.article__toc li').length === 0) {
if ($('.article__toc li').length === 0 || $(window).width() < 1000) {
return false
}

View File

@ -1 +1 @@
var Skin={init:function(){var t=$(".article__toc");$(window).scroll(function(){1===t.length&&($(".article__bottom").offset().top<$(window).scrollTop()?t.hide():t.show()),0!==$("#headerNav").length&&(64<$(window).scrollTop()?($("#headerNav").addClass("header__nav--fixed"),$(".main").css("margin-top","100px")):($("#headerNav").removeClass("header__nav--fixed"),$(".main").css("margin-top","50px")))}),$(window).scroll(),Util.initPjax(function(){Util.parseMarkdown(),Util.isArticlePage(location.href)&&($("#articleSideShare .article__code").qrcode||$.ajax({method:"GET",url:Label.staticServePath+"/js/lib/jquery.qrcode.min.js",dataType:"script",cache:!0})),Skin.initToc()}),Skin.initToc()},initTags:function(){for(var t=$("#tags"),e=t.find(".tag"),i=parseInt(e.first().data("count")),o=Math.ceil(i/5),a=0;a<e.length;a++)for(var n=parseInt($(e[a]).data("count")),s=0;s<5;s++)if(s*o<n&&n<=(s+1)*o){e[a].className="tag tag__level"+s;break}t.html(e.get().sort(function(t,e){var i=$(t).text().toLowerCase(),o=$(e).text().toLowerCase();return i.localeCompare(o)}))},initArticle:function(){if(0!==$("#articleShare").length){Skin._share("#articleShare"),Skin._share("#articleSideShare"),Skin._share("#articleBottomShare");var i=$(".post__side");$(window).height()>=$(".post").height()&&i.css("opacity",1),i.css("left",($(".post").offset().left-20)/2-27+"px");var o=($(window).height()-249)/2+125,a=$(window).scrollTop();$(window).scroll(function(){if(0!==$("#articleShare").length){var t=$(window).scrollTop(),e=$(".article__bottom").offset().top;65<t?(i.css("opacity",1),0<a-t?($(".header").addClass("header--fixed").css({top:"0"}),$(".main").css("padding-top","64px"),$(window).height()<=$(".post").height()&&t<e-$(window).height()&&$(".article__toolbar").css({bottom:0,opacity:1})):a-t<0&&($(".header").css({top:"-64px"}).removeClass("header--fixed"),$(".main").css("padding-top","0"),$(".article__toolbar").css({bottom:"-44px",opacity:0}))):($(window).height()<=$(".post").height()&&i.css("opacity",0),$(".header").removeClass("header--fixed").css("top","-64px"),$(".main").css("padding-top","0")),t>e-$(window).height()?e<$(window).height()?i.css({position:"absolute",top:e-125+"px"}):i.css({position:"absolute",top:e-o+"px"}):i.css({position:"fixed",top:"50%"}),a=t}}),$(window).scroll()}},_share:function(t){var e=$(t),i=e.find(".article__code"),o=i.data("url"),a=i.data("avatar"),n=encodeURIComponent(i.data("title")+" - "+i.data("blogtitle")),s=encodeURIComponent(o),r={};r.tencent="http://share.v.t.qq.com/index.php?c=share&a=index&title="+n+"&url="+s+"&pic="+a,r.weibo="http://v.t.sina.com.cn/share/share.php?title="+n+"&url="+s+"&pic="+a,r.qqz="https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+s+"&sharesource=qzone&title="+n+"&pics="+a,r.twitter="https://twitter.com/intent/tweet?status="+n+" "+s,e.find("span").click(function(){var t=$(this).data("type");if(t)return"wechat"===t?(0===i.find("canvas").length?i.qrcode({width:128,height:128,text:o}):i.slideToggle(),!1):void window.open(r[t],"_blank","top=100,left=200,width=648,height=618")})},initToc:function(){0!==$(".article__toc").length&&1e3<$(window).width()?$(".article__toc").animate({left:$(".post").outerWidth()+$(".post").offset().left+"px"},600):$(".article__toc").hide()}};Skin.init();
var Skin={init:function(){Util.initPjax()},initArticle:function(){page.share();var l=$(".vditor-reset [id^=b3_solo_h]"),s=$(".article__toc"),c=$(".article__progress");1===s.length&&$(".post__toc").css("left",$(".article .item__content").offset().left+$(".article .item__content").outerWidth()-80),$(window).unbind("scroll").scroll(function(t){if(0===c.length)return!1;if(c.attr("value",parseInt($(window).scrollTop())).attr("max",parseInt($("body").outerHeight()-$(window).height())),236<$(window).scrollTop()?$(".article__top").css("top",0):$(".article__top").css("top",-61),0===$(".article__toc li").length||$(window).width()<1e3)return!1;if(975<$(window).scrollTop()&&$(window).scrollTop()<$(".article").outerHeight()+100){$(".post__toc").show();var i=[];l.each(function(t){i.push({id:this.id,offsetTop:this.offsetTop})});for(var o=$(window).scrollTop(),e=0,r=i.length;e<r;e++)if(o<i[e].offsetTop){s.find("li").removeClass("current");var n=0<e?e-1:0;s.find('a[href="#'+i[n].id+'"]').parent().addClass("current");break}o>=i[i.length-1].offsetTop&&(s.find("li").removeClass("current"),s.find("li:last").addClass("current"))}else $(".post__toc").hide()}),$(window).scroll()}};Skin.init();

View File

@ -42,7 +42,7 @@
<a rel="friend" href="${link.linkAddress}" target="_blank">
${link.linkTitle}
</a>
<div class="ft-12 ft-green">${link.linkDescription}</div>
<div>${link.linkDescription}</div>
</div>
</#list>
</#if>

View File

@ -28,7 +28,7 @@
</@head>
</head>
<body>
<div id="pjax"></div>
<div id="pjax">
<#if pjax><!---- pjax {#pjax} start ----></#if>
<#include "marcr-header.ftl">
<@header type='article'></@header>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -33,7 +33,7 @@
<div class="wrapper other">
<h2 class="other__title"><a href="${servePath}/tags.html" class="ft__a">${allTagsLabel}</a> - ${tag.tagTitle}</h2>
<div class="other__meta--list other__meta">
${tag.tagPublishedRefCount} ${tagLabel}
${tag.tagPublishedRefCount} ${cntArticleLabel}
</div>
<#include "article-list.ftl">
</div>