This commit is contained in:
Van 2019-07-11 00:07:57 +08:00
parent 8e3cd405ff
commit 69451c2535
No known key found for this signature in database
GPG Key ID: 7059B8783A78F16C
6 changed files with 527 additions and 381 deletions

View File

@ -23,43 +23,39 @@
<!DOCTYPE html>
<html>
<head>
<@head title="${article.articleTitle} - ${blogTitle}" description="${article.articleAbstract?html}">
<link rel="stylesheet"
href="${staticServePath}/skins/${skinDirName}/css/base.css?${staticResourceVersion}"/>
<#if previousArticlePermalink??>
<link rel="prev" title="${previousArticleTitle}" href="${servePath}${previousArticlePermalink}">
</#if>
<#if nextArticlePermalink??>
<link rel="next" title="${nextArticleTitle}" href="${servePath}${nextArticlePermalink}">
</#if>
</@head>
<@head title="${article.articleTitle} - ${blogTitle}" description="${article.articleAbstract?html}">
<link rel="stylesheet"
href="${staticServePath}/skins/${skinDirName}/css/base.css?${staticResourceVersion}"/>
<#if previousArticlePermalink??>
<link rel="prev" title="${previousArticleTitle}" href="${servePath}${previousArticlePermalink}">
</#if>
<#if nextArticlePermalink??>
<link rel="next" title="${nextArticleTitle}" href="${servePath}${nextArticlePermalink}">
</#if>
</@head>
</head>
<body class="fn__flex-column">
<div id="pjax" class="fn__flex-1">
<#if pjax><!---- pjax {#pjax} start ----></#if>
<#include "macro-header.ftl">
<@header type="article"></@header>
<div class="article__top">
<div class="fn__clear">
<div class="toc fn__none" onclick="$('.post__toc').slideToggle()">${tocLabel}</div>
<div class="title fn__pointer" onclick="Util.goTop()">${article.articleTitle}</div>
<#include "../../common-template/share.ftl">
</div>
<progress class="article__progress"></progress>
<div class="article__top" style="background-image: url(${article.articleImg1URL})">
<canvas id="articleTop"></canvas>
</div>
<div class="article">
<div class="ft__center">
<div class="item__meta">
<div class="article__meta">
<time>
${article.articleCreateDate?string("yyyy-MM-dd")}
${article.articleCreateDate?string("yyyy-MM-dd")}
</time>
/
<#list article.articleTags?split(",") as articleTag>
<a class="tag" rel="tag" href="${servePath}/tags/${articleTag?url('UTF-8')}">${articleTag}</a> &nbsp;
<a rel="tag"
href="${servePath}/tags/${articleTag?url('UTF-8')}">${articleTag}</a> &nbsp;
</#list>
</div>
<h2 class="item__title">
${article.articleTitle}
<h2 class="article__title">
${article.articleTitle}
<#if article.articlePutTop>
<sup>
${topArticleLabel}
@ -71,28 +67,31 @@
</sup>
</#if>
</h2>
<#include "../../common-template/share.ftl">
</div>
<div class="item__cover" style="background-image: url(${article.articleImg1URL})"></div>
<section class="vditor-reset item__content item__content--article wrapper">
${article.articleContent}
<#if "" != article.articleSign.signHTML?trim>
<div>
${article.articleSign.signHTML}
</div>
</#if>
</section>
<div class="wrapper">
<section class="vditor-reset articles article__content">
${article.articleContent}
<#if "" != article.articleSign.signHTML?trim>
<div>
${article.articleSign.signHTML}
</div>
</#if>
</section>
</div>
</div>
<#if article?? && article.articleToC?? && article.articleToC?size &gt; 0>
<div class="post__toc">
<#include "../../common-template/toc.ftl"/>
</div>
<div class="post__toc">
<#include "../../common-template/toc.ftl"/>
</div>
</#if>
<@comments commentList=articleComments article=article></@comments>
<div class="article__bottom">
<div class="wrapper">
<div class="fn__flex">
<#if 0 != externalRelevantArticlesDisplayCount>
<div class="item" id="externalRelevantArticles"></div>
<div class="item" id="externalRelevantArticles"></div>
</#if>
<div class="item" id="randomArticles"></div>
<div class="item" id="relevantArticles"></div>
@ -101,19 +100,22 @@
</div>
<#if pjax><!---- pjax {#pjax} end ----></#if>
</div>
<script type="text/javascript"
src="${staticServePath}/skins/${skinDirName}/js/TweenMax${miniPostfix}.js?${staticResourceVersion}"
charset="utf-8"></script>
<#include "footer.ftl">
<#if pjax><!---- pjax {#pjax} start ----></#if>
<@comment_script oId=article.oId commentable=article.commentable>
page.tips.externalRelevantArticlesDisplayCount = "${externalRelevantArticlesDisplayCount}";
<#if 0 != randomArticlesDisplayCount>
page.loadRandomArticles('<h3>${randomArticlesLabel}</h3>');
page.loadRandomArticles('<h3>${randomArticlesLabel}</h3>');
</#if>
<#if 0 != externalRelevantArticlesDisplayCount>
page.loadExternalRelevantArticles("<#list article.articleTags?split(",") as articleTag>${articleTag}<#if articleTag_has_next>,</#if></#list>",
'<h3>${externalRelevantArticlesLabel}</h3>');
page.loadExternalRelevantArticles("<#list article.articleTags?split(",") as articleTag>${articleTag}<#if articleTag_has_next>,</#if></#list>",
'<h3>${externalRelevantArticlesLabel}</h3>');
</#if>
<#if 0 != relevantArticlesDisplayCount>
page.loadRelevantArticles('${article.oId}', '<h3>${relevantArticlesLabel}</h3>');
page.loadRelevantArticles('${article.oId}', '<h3>${relevantArticlesLabel}</h3>');
</#if>
Skin.initArticle()
</@comment_script>

File diff suppressed because one or more lines are too long

View File

@ -159,7 +159,7 @@ a {
}
.wrapper {
max-width: 1040px;
max-width: 892px;
margin: 0 auto;
padding: 0 10px;
}
@ -182,6 +182,10 @@ a {
}
}
&--article {
display: none;
}
&__title {
position: relative;
align-items: center;
@ -460,9 +464,9 @@ a {
&:after {
background: url(../images/footer.png) no-repeat center center / cover;
position: absolute;
bottom: 65px;
left: 0;
width: 100%;
bottom: 62px;
left: -64px;
width: 1040px;
pointer-events: none;
content: "";
height: 315px;
@ -493,7 +497,6 @@ a {
}
.articles {
width: 892px;
margin: 40px auto;
box-shadow: 8px 14px 38px rgba(39, 44, 49, .06), 1px 3px 8px rgba(39, 44, 49, .03);
background-color: rgba(255, 255, 255, .9);
@ -502,8 +505,7 @@ a {
.item {
border-bottom: 1px solid #f0f2f7;
margin-bottom: 25px;
padding: 25px;
padding: 20px;
&:last-child {
border-bottom-width: 0;
@ -608,24 +610,19 @@ a {
}
.article {
background-color: #fff;
&__bottom {
background-color: #fff;
position: relative;
.fn__flex {
flex-wrap: wrap;
margin: 0 -20px;
}
.item {
position: relative;
flex: 1 1 300px;
margin: 40px 20px 40px;
box-shadow: 8px 14px 38px rgba(39, 44, 49, .06), 1px 3px 8px rgba(39, 44, 49, .03);
flex: 1 1 270px;
margin: 40px 10px 40px;
box-shadow: 8px 14px 38px rgba(39, 44, 49, 0.06), 1px 3px 8px rgba(39, 44, 49, 0.03);
border-radius: 5px;
padding: 40px;
padding: 20px;
overflow: hidden;
text-align: center;
box-sizing: border-box;
@ -639,7 +636,7 @@ a {
width: 100%;
background: url(../images/header-bg.jpg) no-repeat center center;
background-size: cover;
filter: brightness(48%);
filter: brightness(68%) opacity(0.9);
}
h3 {
@ -665,37 +662,53 @@ a {
}
&__top {
position: fixed;
width: 100%;
top: -61px;
background-color: rgba(255, 255, 255, 0.9);
border-bottom: 1px solid rgba($gray, 0.1);
height: 60px;
transition: all .3s ease;
height: 50vh;
background-size: cover;
background-position: center center;
max-width: 1404px;
filter: sepia(0.2) contrast(1.3);
position: relative;
z-index: 1;
.title {
float: left;
margin-left: 20px;
line-height: 60px;
font-size: 22px;
canvas {
height: 100%;
width: 100%;
}
}
&__meta {
padding-top: 40px;
text-transform: uppercase;
color: rgba($gray, .8);
a {
color: $gray;
}
}
&__title {
font-size: 28px;
margin: 10px 0;
sup {
font-size: 14px;
font-weight: normal;
color: rgba($gray, .8);
}
}
&__share {
float: right;
margin-bottom: 40px;
position: relative;
width: 200px;
margin: 0 auto;
.item {
height: 60px;
width: 60px;
float: left;
text-align: center;
padding: 20px 0;
box-sizing: border-box;
color: #fdc200;
cursor: pointer;
transition: all .3s ease;
margin: 0 10px;
svg {
height: 20px;
@ -704,111 +717,42 @@ a {
&[data-type="wechat"] {
color: #3caf36;
&:hover {
background-color: #3caf36;
}
}
&[data-type="twitter"] {
color: #18a3fa;
&:hover {
background-color: #18a3fa;
}
}
&[data-type="weibo"] {
color: #f93;
&:hover {
background-color: #f93;
}
}
&:hover {
color: #fff;
background-color: #fdc200;
opacity: 0.6;
}
&__qr {
position: absolute;
top: 61px;
top: 24px;
left: 60px;
}
}
}
.item {
&__meta {
padding-top: 76px;
font-size: 14px;
text-transform: uppercase;
color: rgba($gray, .8);
a {
color: $gray;
}
}
&__title {
font-size: 28px;
margin-bottom: 40px;
sup {
font-size: 14px;
font-weight: normal;
color: rgba($gray, .8);
}
}
&__cover {
height: 800px;
background-size: cover;
background-position: center center;
max-width: 1404px;
margin: 0 auto;
border-radius: 5px;
filter: sepia(0.2) contrast(1.3) opacity(.86);
}
&__content {
padding: 70px 100px 0;
box-sizing: border-box;
background-color: #fff;
&--article {
margin-top: -164px;
position: relative;
}
}
&__tip {
margin-bottom: 40px;
border-radius: 5px;
box-shadow: 8px 14px 38px rgba(39, 44, 49, .06), 1px 3px 8px rgba(39, 44, 49, .03);
transition: all .3s ease;
padding: 20px 0;
text-align: center;
background: #f4f8fb;
cursor: pointer;
font-size: 18px;
&:hover {
box-shadow: 8px 28px 50px rgba(39, 44, 49, .07), 1px 6px 12px rgba(39, 44, 49, .04);
transform: translate3D(0, -1px, 0) scale(1.02);
}
}
&__content {
padding: 40px;
box-sizing: border-box;
}
}
.post__toc {
display: none;
position: fixed;
top: 84px;
bottom: 80px;
overflow: auto;
padding-left: 3px;
right: 20px;
max-width: 160px;
&::-webkit-scrollbar {
display: none;
@ -852,19 +796,10 @@ a {
}
.comment {
background-color: #f4f8fb;
position: relative;
&__wrapper {
margin: 0 auto;
padding: 0 100px 0.1px;
box-sizing: border-box;
}
&-body-ref {
position: absolute;
left: 80px;
width: 76%;
right: 0;
}
&__title {
@ -873,11 +808,15 @@ a {
color: $gray;
}
#comments {
position: relative;
}
.item {
margin-bottom: 40px;
border: 1px solid $fade-lighter;
border-radius: 5px;
background: #fff;
background: rgba(255, 255, 255, .9);
box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
list-style: none;
padding: 20px;
@ -919,16 +858,11 @@ a {
}
}
#comments {
position: relative;
}
#comment {
position: relative;
margin-bottom: 30px;
padding: 20px;
border-radius: 3px;
background: #fff;
background: rgba(255, 255, 255, .9);
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
border: 0;
resize: none;
@ -939,133 +873,36 @@ a {
}
@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;
}
.pagination__item {
margin: 0 3px 5px 2px;
}
.footer {
.fn__left,
.fn__right {
float: none;
text-align: center;
margin-top: 0;
.wrapper:after {
content: none;
}
}
.post__toc {
display: none;
}
.articles {
margin: 10px auto;
.item {
padding: 10px;
&__title a {
font-size: 18px;
}
}
}
.article {
&__top {
height: 40px;
.title {
display: none;
}
.toc {
display: block;
float: left;
line-height: 40px;
padding: 0 10px;
cursor: pointer;
}
}
&__share .item {
height: 40px;
width: 40px;
padding: 10px 0;
}
.item {
&__meta {
padding-top: 40px;
}
&__cover {
display: none;
}
&__content {
padding: 10px 10px 0;
&--article {
margin-top: -20px;
}
}
}
&__bottom {
.fn__flex {
margin: 0 0 10px 0;
}
.item {
margin: 10px 0 0 0;
}
&__bottom .item {
margin: 0 0 10px 0;
}
}
@ -1074,41 +911,14 @@ a {
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;
.item__avatar {
margin: 0 10px 10px 0;
}
&__meta--list {
margin-bottom: 40px;
}
}
.post__toc {
left: 0;
background-color: #fff;
width: 100%;
top: 41px;
bottom: 0;
}
}

366
Bubble/js/TweenMax.js Normal file

File diff suppressed because one or more lines are too long

View File

@ -38,7 +38,7 @@ var Skin = {
attr('max', parseInt($('body').outerHeight() -
$(window).height()))
if ($(window).scrollTop() > $(window).height() - 20) {
if ($(window).scrollTop() > $(window).height() / 2 - 20) {
$('.side__menu').addClass('side__menu--edge')
$('.side__top').removeClass('side__top--bottom')
} else {
@ -47,26 +47,6 @@ var Skin = {
}
})
$('.header').circleMagic({
clearOffset: 0.3,
color: 'rgba(255,255,255, .2)',
density: 0.2,
radius: 15,
})
new Ribbons({
colorSaturation: '60%',
colorBrightness: '50%',
colorAlpha: 0.5,
colorCycleSpeed: 5,
verticalPosition: 'random',
horizontalSpeed: 200,
ribbonCount: 3,
strokeSize: 0,
parallaxAmount: -0.2,
animateSections: true,
})
$('.side__menu').click(function () {
$('.side__main').addClass('side__main--show').show()
})
@ -101,63 +81,53 @@ var Skin = {
}, false)
$(window).scroll()
new Ribbons({
colorSaturation: '60%',
colorBrightness: '50%',
colorAlpha: 0.5,
colorCycleSpeed: 5,
verticalPosition: 'random',
horizontalSpeed: 200,
ribbonCount: 3,
strokeSize: 0,
parallaxAmount: -0.2,
animateSections: true,
})
if ($('#comments').length === 1) {
return
}
$('.header').circleMagic({
clearOffset: 0.3,
color: 'rgba(255,255,255, .2)',
density: 0.2,
radius: 15,
})
},
initArticle: function () {
page.share()
initCanvas('articleTop');
var $articleTocs = $('.vditor-reset [id^=b3_solo_h]')
var $articleToc = $('.article__toc')
var $articleProgress = $('.article__progress')
if ($articleToc.length === 1) {
if ($(window).width() > 876) {
$('.post__toc').
css('left', $('.article .item__content').offset().left +
$('.article .item__content').outerWidth() - 80)
} else {
$('.post__toc a').click(function () {
$('.post__toc').hide()
})
}
}
$articleToc.find('a').click(function (event) {
var id = $(this).attr('href')
window.location.hash = id
$(window).scrollTop($(id).offset().top - 60)
$(window).scrollTop($(id).offset().top)
event.preventDefault()
event.stopPropagation()
return false
})
$(window).unbind('scroll').scroll(function (event) {
if ($articleProgress.length === 0) {
return false
}
$articleProgress.attr('value', parseInt($(window).scrollTop())).
attr('max', parseInt($('body').outerHeight() -
$(window).height()))
if ($(window).scrollTop() > 236) {
$('.article__top').css('top', 0)
} else {
$('.article__top').css('top', -61)
}
$(window).scroll(function (event) {
if ($('.article__toc li').length === 0) {
return false
}
if ($(window).width() > 876) {
if ($(window).scrollTop() > 975 && $(window).scrollTop() <
$('.article').outerHeight() + 100) {
$('.post__toc').show()
} else {
$('.post__toc').hide()
}
}
// 界面各种图片加载会导致帖子目录定位
var toc = []
$articleTocs.each(function (i) {
@ -170,7 +140,7 @@ var Skin = {
// 当前目录样式
var scrollTop = $(window).scrollTop()
for (var i = 0, iMax = toc.length; i < iMax; i++) {
if (scrollTop < toc[i].offsetTop - 61) {
if (scrollTop < toc[i].offsetTop) {
$articleToc.find('li').removeClass('current')
var index = i > 0 ? i - 1 : 0
$articleToc.find('a[href="#' + toc[index].id + '"]').
@ -179,13 +149,11 @@ var Skin = {
break
}
}
if (scrollTop >= toc[toc.length - 1].offsetTop - 61) {
if (scrollTop >= toc[toc.length - 1].offsetTop) {
$articleToc.find('li').removeClass('current')
$articleToc.find('li:last').addClass('current')
}
})
$(window).scroll()
},
}

View File

@ -19,7 +19,7 @@
-->
<#macro comments commentList article>
<div class="comment">
<div class="comment__wrapper wrapper">
<div class="wrapper">
<div class="comment__title">
${commentLabel}
</div>