Merge branch 'develop' into develop

This commit is contained in:
reco_luan 2019-12-20 18:04:23 +08:00 committed by GitHub
commit 954acbdb27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 265 additions and 332 deletions

View File

@ -4,39 +4,7 @@
:class="pageClasses" :class="pageClasses"
@touchstart="onTouchStart" @touchstart="onTouchStart"
@touchend="onTouchEnd"> @touchend="onTouchEnd">
<div v-if="absoluteEncryption"> <div v-if="!absoluteEncryption">
<transition name="fade">
<LoadingPage v-if="firstLoad" />
<Password v-else-if="!isHasKey" />
<div v-else>
<Navbar
v-if="shouldShowNavbar"
@toggle-sidebar="toggleSidebar"/>
<div
class="sidebar-mask"
@click="toggleSidebar(false)"></div>
<Sidebar
:items="sidebarItems"
@toggle-sidebar="toggleSidebar">
<slot
name="sidebar-top"
slot="top"/>
<slot
name="sidebar-bottom"
slot="bottom"/>
</Sidebar>
<Password v-if="!isHasPageKey" :isPage="true"></Password>
<div v-else>
<slot></slot>
<Comments :isShowComments="shouldShowComments"/>
</div>
</div>
</transition>
</div>
<div v-else>
<transition name="fade"> <transition name="fade">
<LoadingPage v-show="firstLoad" class="loading-wrapper" /> <LoadingPage v-show="firstLoad" class="loading-wrapper" />
</transition> </transition>
@ -70,6 +38,38 @@
</div> </div>
</div> </div>
</div> </div>
<div v-else>
<transition name="fade">
<LoadingPage v-if="firstLoad" />
<Password v-else-if="!isHasKey" />
<div v-else>
<Navbar
v-if="shouldShowNavbar"
@toggle-sidebar="toggleSidebar"/>
<div
class="sidebar-mask"
@click="toggleSidebar(false)"></div>
<Sidebar
:items="sidebarItems"
@toggle-sidebar="toggleSidebar">
<slot
name="sidebar-top"
slot="top"/>
<slot
name="sidebar-bottom"
slot="bottom"/>
</Sidebar>
<Password v-if="!isHasPageKey" :isPage="true"></Password>
<div v-else>
<slot></slot>
<Comments :isShowComments="shouldShowComments"/>
</div>
</div>
</transition>
</div>
</div> </div>
</template> </template>

View File

@ -3,40 +3,40 @@
<div class="hero"> <div class="hero">
<ModuleTransition> <ModuleTransition>
<img <img
v-if="data.isShowHeroImage !== false && recoShowModule" v-if="recoShowModule && $frontmatter.heroImage"
:style="heroImageStyle" :style="heroImageStyle || {}"
:src="data.heroImage ? $withBase(data.heroImage) : require('../images/icon_vuepress_reco.png')" :src="$withBase($frontmatter.heroImage)"
alt="hero"> alt="hero">
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.04">
<h1 v-if="recoShowModule && $frontmatter.isShowTitleInHome !== false">{{ $frontmatter.heroText || $title || '午后南杂' }}</h1>
</ModuleTransition>
<ModuleTransition delay="0.08"> <ModuleTransition delay="0.08">
<h1 v-if="data.isShowTitleInHome !== false && recoShowModule">{{ data.heroText || $title || '午后南杂' }}</h1> <p v-show="recoShowModule" class="description">{{ $description || 'Welcome to your vuePress-theme-reco site' }}</p>
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.16"> <ModuleTransition delay="0.16">
<p v-if="recoShowModule" class="description">{{ $description || 'Welcome to your vuePress-theme-reco site' }}</p> <p class="huawei" v-if="recoShowModule && $themeConfig.huawei === true">
</ModuleTransition>
<ModuleTransition delay="0.24">
<p class="huawei" v-if="$themeConfig.huawei === true && recoShowModule">
<i class="iconfont reco-huawei" style="color: #fc2d38"></i> <i class="iconfont reco-huawei" style="color: #fc2d38"></i>
&nbsp;&nbsp;&nbsp;华为为中华而为之 &nbsp;&nbsp;&nbsp;华为为中华而为之
</p> </p>
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.32"> <ModuleTransition delay="0.24">
<p class="action" v-if="data.actionText && data.actionLink && recoShowModule"> <p class="action" v-if="recoShowModule && $frontmatter.actionText && $frontmatter.actionLink">
<NavLink class="action-button" :item="actionLink"/> <NavLink class="action-button" :item="actionLink"/>
</p> </p>
</ModuleTransition> </ModuleTransition>
</div> </div>
<ModuleTransition delay="0.4"> <ModuleTransition delay="0.32">
<div class="features" v-if="data.features && data.features.length && recoShowModule"> <div class="features" v-if="recoShowModule && $frontmatter.features && $frontmatter.features.length">
<div v-for="(feature, index) in data.features" :key="index" class="feature"> <div v-for="(feature, index) in $frontmatter.features" :key="index" class="feature">
<h2>{{ feature.title }}</h2> <h2>{{ feature.title }}</h2>
<p>{{ feature.details }}</p> <p>{{ feature.details }}</p>
</div> </div>
</div> </div>
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.48"> <ModuleTransition delay="0.4">
<Content class="home-center" v-if="recoShowModule" custom/> <Content class="home-center" v-show="recoShowModule" custom/>
</ModuleTransition> </ModuleTransition>
</div> </div>
</template> </template>
@ -44,23 +44,22 @@
<script> <script>
import NavLink from '@theme/components/NavLink' import NavLink from '@theme/components/NavLink'
import ModuleTransition from '@theme/components/ModuleTransition' import ModuleTransition from '@theme/components/ModuleTransition'
import moduleTransitonMixin from '@theme/mixins/moduleTransiton'
export default { export default {
mixins: [moduleTransitonMixin],
components: { NavLink, ModuleTransition }, components: { NavLink, ModuleTransition },
computed: { computed: {
data () {
return this.$frontmatter
},
actionLink () { actionLink () {
return { return {
link: this.data.actionLink, link: this.$frontmatter.actionLink,
text: this.data.actionText text: this.$frontmatter.actionText
} }
}, },
heroImageStyle () { heroImageStyle () {
return this.data.heroImageStyle || { return this.$frontmatter.heroImageStyle || {
maxHeight: '200px', maxHeight: '200px',
margin: '6rem auto 1.5rem' margin: '6rem auto 1.5rem'
} }

View File

@ -1,15 +1,23 @@
<template> <template>
<div class="home-blog"> <div class="home-blog">
<div <div class="hero" :style="{ ...bgImageStyle }">
class="hero" <div
:style="{ class="mask"
background: `url(${$frontmatter.bgImage ? $withBase($frontmatter.bgImage) : require('../images/home-bg.jpg')}) center/cover no-repeat`, ...bgImageStyle}"> :style="{
background: `url(${$frontmatter.bgImage ? $withBase($frontmatter.bgImage) : require('../images/home-bg.jpg')}) center/cover no-repeat`}"></div>
<ModuleTransition> <ModuleTransition>
<h1 v-if="recoShowModule">{{ $frontmatter.heroText || $title || '午后南杂' }}</h1> <img
v-if="recoShowModule && $frontmatter.heroImage"
:style="heroImageStyle || {}"
:src="$withBase($frontmatter.heroImage)"
alt="hero">
</ModuleTransition>
<ModuleTransition delay="0.04">
<h1 v-if="$frontmatter.isShowTitleInHome !== false">{{ $frontmatter.heroText || $title || '午后南杂' }}</h1>
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.08"> <ModuleTransition delay="0.08">
<p v-if="recoShowModule" class="description"> <p v-show="recoShowModule" class="description">
{{ $description || 'Welcome to your vuePress-theme-reco site' }} {{ $description || 'Welcome to your vuePress-theme-reco site' }}
</p> </p>
</ModuleTransition> </ModuleTransition>
@ -24,7 +32,7 @@
</div> </div>
<ModuleTransition delay="0.24"> <ModuleTransition delay="0.24">
<div v-if="recoShowModule" class="home-blog-wrapper"> <div v-show="recoShowModule" class="home-blog-wrapper">
<div class="blog-list"> <div class="blog-list">
<!-- 博客列表 --> <!-- 博客列表 -->
<note-abstract <note-abstract
@ -39,19 +47,7 @@
@getCurrentPage="getCurrentPage" /> @getCurrentPage="getCurrentPage" />
</div> </div>
<div class="info-wrapper"> <div class="info-wrapper">
<img class="personal-img" :src="$frontmatter.faceImage ? $withBase($frontmatter.faceImage) : require('../images/home-head.png')" alt="hero"> <PersonalInfo/>
<h3 class="name" v-if="$themeConfig.author || $site.title">{{ $themeConfig.author || $site.title }}</h3>
<div class="num">
<div>
<h3>{{$recoPosts.length}}</h3>
<h6>文章</h6>
</div>
<div>
<h3>{{$tags.list.length}}</h3>
<h6>标签</h6>
</div>
</div>
<hr>
<h4><i class="iconfont reco-category"></i> 分类</h4> <h4><i class="iconfont reco-category"></i> 分类</h4>
<ul class="category-wrapper"> <ul class="category-wrapper">
<li class="category-item" v-for="(item, index) in this.$categories.list" :key="index"> <li class="category-item" v-for="(item, index) in this.$categories.list" :key="index">
@ -71,7 +67,7 @@
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.36"> <ModuleTransition delay="0.36">
<Content v-if="recoShowModule" class="home-center" custom/> <Content v-show="recoShowModule" class="home-center" custom/>
</ModuleTransition> </ModuleTransition>
</div> </div>
</template> </template>
@ -82,11 +78,13 @@ import FriendLink from '@theme/components/FriendLink'
import NoteAbstract from '@theme/components/NoteAbstract' import NoteAbstract from '@theme/components/NoteAbstract'
import pagination from '@theme/mixins/pagination' import pagination from '@theme/mixins/pagination'
import ModuleTransition from '@theme/components/ModuleTransition' import ModuleTransition from '@theme/components/ModuleTransition'
import PersonalInfo from '@theme/components/PersonalInfo'
import { getOneColor } from '@theme/helpers/other' import { getOneColor } from '@theme/helpers/other'
import moduleTransitonMixin from '@theme/mixins/moduleTransiton'
export default { export default {
mixins: [pagination], mixins: [pagination, moduleTransitonMixin],
components: { NoteAbstract, TagList, FriendLink, ModuleTransition }, components: { NoteAbstract, TagList, FriendLink, ModuleTransition, PersonalInfo },
data () { data () {
return { return {
recoShow: false, recoShow: false,
@ -169,6 +167,27 @@ export default {
margin: 0px auto; margin: 0px auto;
.hero { .hero {
position relative
.mask {
position absolute
top 0
bottom 0
left 0
right 0
z-index -1
&:after {
display block
content ' '
background var(--mask-color)
position absolute
top 0
bottom 0
left 0
right 0
z-index 0
opacity .2
}
}
figure { figure {
position absolute position absolute
background yellow background yellow
@ -215,41 +234,10 @@ export default {
border-radius $borderRadius border-radius $borderRadius
box-sizing border-box box-sizing border-box
padding 0 15px padding 0 15px
background var(--background-color)
&:hover { &:hover {
box-shadow: var(--box-shadow-hover); box-shadow: var(--box-shadow-hover);
} }
.personal-img {
display block
margin 2rem auto
width 8rem
height 8rem
}
.name {
text-align center
color var(--text-color)
}
.num {
display flex
margin 0 auto 1rem
width 80%
> div {
text-align center
flex auto
&:first-child {
border-right 1px solid #333
}
h3 {
line-height auto
margin 0 0 .6rem
color var(--text-color)
}
h6 {
line-height auto
color var(--text-color)
margin 0
}
}
}
h4 { h4 {
color var(--text-color) color var(--text-color)
} }
@ -262,6 +250,7 @@ export default {
transition: all .5s transition: all .5s
border-radius $borderRadius border-radius $borderRadius
box-shadow var(--box-shadow) box-shadow var(--box-shadow)
background-color var(--background-color)
&:hover { &:hover {
transform scale(1.04) transform scale(1.04)
} }

View File

@ -6,7 +6,8 @@ const modeOptions = {
'--text-color': '#2c3e50', '--text-color': '#2c3e50',
'--border-color': '#eaecef', '--border-color': '#eaecef',
'--bgm-bg-color': 'rgba(255, 255, 255, .7)', '--bgm-bg-color': 'rgba(255, 255, 255, .7)',
'--code-color': 'rgba(27, 31, 35, 0.05)' '--code-color': 'rgba(27, 31, 35, 0.05)',
'--mask-color': '#888'
}, },
dark: { dark: {
'--background-color': '#25272a', '--background-color': '#25272a',
@ -15,7 +16,8 @@ const modeOptions = {
'--text-color': '#aaa', '--text-color': '#aaa',
'--border-color': 'rgba(0, 0, 0, .3)', '--border-color': 'rgba(0, 0, 0, .3)',
'--bgm-bg-color': 'rgba(0, 0, 0, .7)', '--bgm-bg-color': 'rgba(0, 0, 0, .7)',
'--code-color': 'rgba(0, 0, 0, .3)' '--code-color': 'rgba(0, 0, 0, .3)',
'--mask-color': '#000'
} }
} }

View File

@ -92,6 +92,7 @@ $navbar-horizontal-padding = 1.5rem
padding $navbar-vertical-padding $navbar-horizontal-padding padding $navbar-vertical-padding $navbar-horizontal-padding
line-height $navbarHeight - 1.4rem line-height $navbarHeight - 1.4rem
box-shadow var(--box-shadow) box-shadow var(--box-shadow)
background var(--background-color)
a, span, img a, span, img
display inline-block display inline-block
.logo .logo
@ -104,6 +105,7 @@ $navbar-horizontal-padding = 1.5rem
font-weight 600 font-weight 600
color var(--text-color) color var(--text-color)
position relative position relative
background var(--background-color)
.links .links
padding-left 1.5rem padding-left 1.5rem
box-sizing border-box box-sizing border-box
@ -113,10 +115,10 @@ $navbar-horizontal-padding = 1.5rem
right $navbar-horizontal-padding right $navbar-horizontal-padding
top $navbar-vertical-padding top $navbar-vertical-padding
display flex display flex
background-color var(--background-color)
.search-box .search-box
flex: 0 0 auto flex: 0 0 auto
vertical-align top vertical-align top
margin-right 1rem
@media (max-width: $MQMobile) @media (max-width: $MQMobile)
.navbar .navbar

View File

@ -1,23 +1,12 @@
<template> <template>
<div class="abstract-wrapper"> <div class="abstract-wrapper">
<div v-if="listLoadType === 'sync'" key="sync"> <NoteAbstractItem
<NoteAbstractItem
v-for="(item, index) in data"
:key="item.path"
:item="item"
:currentPage="currentPage"
:currentTag="currentTag"
v-show="index >= (currentPage * 10 - 10) && index < currentPage * 10"/>
</div>
<div v-else-if="listLoadType === 'async'" key="async">
<NoteAbstractItem
v-for="(item) in currentPageData" v-for="(item) in currentPageData"
:key="item.path" :key="item.path"
:item="item" :item="item"
:currentPage="currentPage" :currentPage="currentPage"
:currentTag="currentTag" :currentTag="currentTag"
:hideAccessNumber="true" /> :hideAccessNumber="true" />
</div>
</div> </div>
</template> </template>
@ -28,15 +17,6 @@ export default {
components: { NoteAbstractItem }, components: { NoteAbstractItem },
props: ['data', 'currentPage', 'currentTag', 'hideAccessNumber'], props: ['data', 'currentPage', 'currentTag', 'hideAccessNumber'],
computed: { computed: {
listLoadType () {
const valineConfig = this.$themeConfig.valineConfig
if (this.$frontmatter.home) return 'async'
if (valineConfig && !valineConfig.hideListAccessNumber) {
return 'sync'
} else {
return 'async'
}
},
currentPageData () { currentPageData () {
const start = this.currentPage * 10 - 10 const start = this.currentPage * 10 - 10
const end = this.currentPage * 10 const end = this.currentPage * 10

View File

@ -51,8 +51,6 @@ export default {
font-size: 1.28rem; font-size: 1.28rem;
line-height: 36px; line-height: 36px;
display: inline-block; display: inline-block;
a
color var(--text-color)
.reco-lock .reco-lock
font-size 1.28rem font-size 1.28rem
color $accentColor color $accentColor

View File

@ -1,11 +1,11 @@
<template> <template>
<main class="page"> <main class="page">
<ModuleTransition> <ModuleTransition>
<slot v-if="recoShowModule" name="top"/> <slot v-show="recoShowModule" name="top"/>
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.08"> <ModuleTransition delay="0.08">
<div v-if="recoShowModule" class="page-title"> <div v-show="recoShowModule" class="page-title">
<h1>{{$page.title}}</h1> <h1>{{$page.title}}</h1>
<hr> <hr>
<PageInfo :pageInfo="$page" :hideAccessNumber="hideAccessNumber"></PageInfo> <PageInfo :pageInfo="$page" :hideAccessNumber="hideAccessNumber"></PageInfo>
@ -13,11 +13,11 @@
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.16"> <ModuleTransition delay="0.16">
<Content v-if="recoShowModule" class="theme-reco-content" /> <Content v-show="recoShowModule" class="theme-reco-content" />
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.24"> <ModuleTransition delay="0.24">
<footer v-if="recoShowModule" class="page-edit"> <footer v-show="recoShowModule" class="page-edit">
<div <div
class="edit-link" class="edit-link"
v-if="editLink" v-if="editLink"
@ -74,7 +74,7 @@
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.40"> <ModuleTransition delay="0.40">
<slot v-if="recoShowModule" name="bottom"/> <slot v-show="recoShowModule" name="bottom"/>
</ModuleTransition> </ModuleTransition>
</main> </main>
</template> </template>
@ -83,8 +83,10 @@
import PageInfo from '@theme/components/PageInfo' import PageInfo from '@theme/components/PageInfo'
import { resolvePage, outboundRE, endingSlashRE } from '@theme/helpers/utils' import { resolvePage, outboundRE, endingSlashRE } from '@theme/helpers/utils'
import ModuleTransition from '@theme/components/ModuleTransition' import ModuleTransition from '@theme/components/ModuleTransition'
import moduleTransitonMixin from '@theme/mixins/moduleTransiton'
export default { export default {
mixins: [moduleTransitonMixin],
components: { PageInfo, ModuleTransition }, components: { PageInfo, ModuleTransition },
props: ['sidebarItems'], props: ['sidebarItems'],

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="password-shadow"> <div class="password-shadow">
<ModuleTransition> <ModuleTransition>
<h3 v-if="recoShowModule" class="title">{{isPage ? $frontmatter.title : $site.title || $localeConfig.title}}</h3> <h3 v-show="recoShowModule" class="title">{{isPage ? $frontmatter.title : $site.title || $localeConfig.title}}</h3>
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.08"> <ModuleTransition delay="0.08">
@ -9,7 +9,7 @@
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.16"> <ModuleTransition delay="0.16">
<label v-if="recoShowModule" class="inputBox" id="box"> <label v-show="recoShowModule" class="inputBox" id="box">
<input <input
v-model="key" v-model="key"
type="password" type="password"
@ -22,7 +22,7 @@
</ModuleTransition> </ModuleTransition>
<ModuleTransition delay="0.24"> <ModuleTransition delay="0.24">
<div v-if="recoShowModule" class="footer"> <div v-show="recoShowModule" class="footer">
<span> <span>
<i class="iconfont reco-theme"></i> <i class="iconfont reco-theme"></i>
<a target="blank" href="https://vuepress-theme-reco.recoluan.com">vuePress-theme-reco</a> <a target="blank" href="https://vuepress-theme-reco.recoluan.com">vuePress-theme-reco</a>
@ -42,7 +42,10 @@
<script> <script>
import ModuleTransition from '@theme/components/ModuleTransition' import ModuleTransition from '@theme/components/ModuleTransition'
import moduleTransitonMixin from '@theme/mixins/moduleTransiton'
export default { export default {
mixins: [moduleTransitonMixin],
components: { ModuleTransition }, components: { ModuleTransition },
props: { props: {
isPage: { isPage: {

View File

@ -0,0 +1,55 @@
<template>
<div class="personal-info-wrapper">
<img class="personal-img" :src="$frontmatter.faceImage ? $withBase($frontmatter.faceImage) : require('../images/home-head.png')" alt="hero">
<h3 class="name" v-if="$themeConfig.author || $site.title">{{ $themeConfig.author || $site.title }}</h3>
<div class="num">
<div>
<h3>{{$recoPosts.length}}</h3>
<h6>文章</h6>
</div>
<div>
<h3>{{$tags.list.length}}</h3>
<h6>标签</h6>
</div>
</div>
<hr>
</div>
</template>
<style lang="stylus" scoped>
.personal-info-wrapper {
.personal-img {
display block
margin 2rem auto
width 8rem
height 8rem
border-radius 50%
}
.name {
text-align center
color var(--text-color)
}
.num {
display flex
margin 0 auto 1rem
width 80%
> div {
text-align center
flex auto
&:first-child {
border-right 1px solid #333
}
h3 {
line-height auto
margin 0 0 .6rem
color var(--text-color)
}
h6 {
line-height auto
color var(--text-color)
margin 0
}
}
}
}
</style>

View File

@ -51,10 +51,6 @@ export default {
}, },
mounted () { mounted () {
this.placeholder = this.$site.themeConfig.searchPlaceholder || '' this.placeholder = this.$site.themeConfig.searchPlaceholder || ''
document.addEventListener('keydown', this.onHotkey)
},
beforeDestroy () {
document.removeEventListener('keydown', this.onHotkey)
}, },
computed: { computed: {
showSuggestions () { showSuggestions () {
@ -114,12 +110,6 @@ export default {
} }
return '/' return '/'
}, },
onHotkey (event) {
if (event.srcElement === document.body) {
this.$refs.input.focus()
event.preventDefault()
}
},
onUp () { onUp () {
if (this.showSuggestions) { if (this.showSuggestions) {
if (this.focusIndex > 0) { if (this.focusIndex > 0) {
@ -231,6 +221,7 @@ export default {
height 2rem height 2rem
@media (max-width: $MQNarrow) and (min-width: $MQMobile) @media (max-width: $MQNarrow) and (min-width: $MQMobile)
.search-box .search-box
margin-right 0
.suggestions .suggestions
left 0 left 0
@media (max-width: $MQMobile) @media (max-width: $MQMobile)

View File

@ -1,5 +1,6 @@
<template> <template>
<aside class="sidebar"> <aside class="sidebar">
<PersonalInfo/>
<NavLinks/> <NavLinks/>
<slot name="top"/> <slot name="top"/>
<SidebarLinks :depth="0" :items="items"/> <SidebarLinks :depth="0" :items="items"/>
@ -9,12 +10,13 @@
<script> <script>
import SidebarLinks from '@theme/components/SidebarLinks' import SidebarLinks from '@theme/components/SidebarLinks'
import PersonalInfo from '@theme/components/PersonalInfo'
import NavLinks from '@theme/components/NavLinks' import NavLinks from '@theme/components/NavLinks'
export default { export default {
name: 'Sidebar', name: 'Sidebar',
components: { SidebarLinks, NavLinks }, components: { SidebarLinks, NavLinks, PersonalInfo },
props: ['items'] props: ['items']
} }
@ -22,6 +24,8 @@ export default {
<style lang="stylus"> <style lang="stylus">
.sidebar .sidebar
.personal-info-wrapper
display none
ul ul
padding 0 padding 0
margin 0 margin 0
@ -50,6 +54,8 @@ export default {
@media (max-width: $MQMobile) @media (max-width: $MQMobile)
.sidebar .sidebar
.personal-info-wrapper
display block
.nav-links .nav-links
display block display block
.dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active::after .dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active::after

View File

@ -1,9 +1,7 @@
import postMixin from '@theme/mixins/posts' import postMixin from '@theme/mixins/posts'
import appMixin from '@theme/mixins/app'
export default ({ export default ({
Vue Vue
}) => { }) => {
Vue.mixin(postMixin) Vue.mixin(postMixin)
Vue.mixin(appMixin)
} }

View File

@ -68,6 +68,14 @@ module.exports = {
// appId: '...',// your appId // appId: '...',// your appId
// appKey: '...', // your appKey // appKey: '...', // your appKey
// } // }
vssueConfig: {
admins: ['recoluan'],
platform: 'github',
owner: 'vuepress-reco',
repo: 'vuepress-reco.github.io',
clientId: '4d81cea3b3d8aac8e88e',
clientSecret: 'd23e8556b6d3c85abffbf4b8d853afb2ea08875a',
},
keyPage: { keyPage: {
keys: ['123456'] keys: ['123456']
}, },

View File

@ -1,15 +1,15 @@
--- ---
home: true home: true
heroImage: /hero.png # heroImage: /hero.png
heroImageStyle: { # heroImageStyle: {
maxWidth: '600px', # maxWidth: '600px',
width: '100%', # width: '100%',
display: block, # display: block,
margin: '9rem auto 2rem', # margin: '9rem auto 2rem',
background: '#fff', # background: '#fff',
borderRadius: '1rem', # borderRadius: '1rem',
} # }
isShowTitleInHome: false # isShowTitleInHome: false
actionText: Guide actionText: Guide
actionLink: /views/other/guide actionLink: /views/other/guide
features: features:

View File

@ -211,7 +211,7 @@ export function formatDate (time, fmt = 'yyyy-MM-dd hh:mm:ss') {
const o = { const o = {
'M+': date.getMonth() + 1, 'M+': date.getMonth() + 1,
'd+': date.getDay(), 'd+': date.getDate(),
'h+': date.getHours(), 'h+': date.getHours(),
'm+': date.getMinutes(), 'm+': date.getMinutes(),
's+': date.getSeconds() 's+': date.getSeconds()

View File

@ -42,11 +42,28 @@ export default {
<style src="../styles/theme.styl" lang="stylus"></style> <style src="../styles/theme.styl" lang="stylus"></style>
<style lang="stylus" scoped> <style lang="stylus">
.content { .content
margin 4rem auto 0 margin 4rem auto 0
max-width 800px max-width 800px
padding 0 2rem padding 0 2rem
} .mod_404
.desc
.desc_link
display: inline-block
// margin: 20px 0
background: #424242!important
color: #ffffff
padding: 6px 20px!important
text-decoration: none!important
border-radius: 4px
@media screen and (max-width: 720px)
.mod_404
.desc
margin: 50px 0
.wrapper
margin 0!important
padding-top 20px
</style> </style>

View File

@ -4,7 +4,7 @@
<Common :sidebar="false" :isComment="false"> <Common :sidebar="false" :isComment="false">
<!-- 分类集合 --> <!-- 分类集合 -->
<ModuleTransition> <ModuleTransition>
<ul v-if="recoShowModule" class="category-wrapper"> <ul v-show="recoShowModule" class="category-wrapper">
<li <li
class="category-item" class="category-item"
:class="title == item.name ? 'active': ''" :class="title == item.name ? 'active': ''"
@ -21,7 +21,7 @@
<!-- 博客列表 --> <!-- 博客列表 -->
<ModuleTransition delay="0.08"> <ModuleTransition delay="0.08">
<note-abstract <note-abstract
v-if="recoShowModule" v-show="recoShowModule"
class="list" class="list"
:data="posts" :data="posts"
:currentPage="currentPage" :currentPage="currentPage"
@ -31,7 +31,6 @@
<!-- 分页 --> <!-- 分页 -->
<ModuleTransition delay="0.16"> <ModuleTransition delay="0.16">
<pagation <pagation
v-if="recoShowModule"
class="pagation" class="pagation"
:total="posts.length" :total="posts.length"
:currentPage="currentPage" :currentPage="currentPage"
@ -48,9 +47,10 @@ import ModuleTransition from '@theme/components/ModuleTransition'
import pagination from '@theme/mixins/pagination' import pagination from '@theme/mixins/pagination'
import { sortPostsByStickyAndDate, filterPosts } from '@theme/helpers/postData' import { sortPostsByStickyAndDate, filterPosts } from '@theme/helpers/postData'
import { getOneColor } from '@theme/helpers/other' import { getOneColor } from '@theme/helpers/other'
import moduleTransitonMixin from '@theme/mixins/moduleTransiton'
export default { export default {
mixins: [pagination], mixins: [pagination, moduleTransitonMixin],
components: { Common, NoteAbstract, ModuleTransition }, components: { Common, NoteAbstract, ModuleTransition },
data () { data () {
@ -125,6 +125,7 @@ export default {
font-size: 13px; font-size: 13px;
box-shadow var(--box-shadow) box-shadow var(--box-shadow)
transition: all .5s transition: all .5s
background-color var(--background-color)
&:hover, &.active { &:hover, &.active {
background $accentColor background $accentColor
a span.category-name { a span.category-name {

View File

@ -5,15 +5,16 @@
<!-- 标签集合 --> <!-- 标签集合 -->
<ModuleTransition> <ModuleTransition>
<TagList <TagList
v-if="recoShowModule" v-show="recoShowModule"
class="tags" class="tags"
:currentTag="$currentTags.key" @getCurrentTag="tagClick"></TagList> :currentTag="$currentTags.key"
@getCurrentTag="tagClick"></TagList>
</ModuleTransition> </ModuleTransition>
<!-- 博客列表 --> <!-- 博客列表 -->
<ModuleTransition delay="0.08"> <ModuleTransition delay="0.08">
<note-abstract <note-abstract
v-if="recoShowModule" v-show="recoShowModule"
class="list" class="list"
:data="posts" :data="posts"
:currentPage="currentPage" :currentPage="currentPage"
@ -23,7 +24,6 @@
<!-- 分页 --> <!-- 分页 -->
<ModuleTransition delay="0.16"> <ModuleTransition delay="0.16">
<pagation <pagation
v-if="recoShowModule"
class="pagation" class="pagation"
:total="posts.length" :total="posts.length"
:currentPage="currentPage" :currentPage="currentPage"
@ -40,9 +40,10 @@ import TagList from '@theme/components/TagList'
import pagination from '@theme/mixins/pagination' import pagination from '@theme/mixins/pagination'
import ModuleTransition from '@theme/components/ModuleTransition' import ModuleTransition from '@theme/components/ModuleTransition'
import { sortPostsByStickyAndDate, filterPosts } from '@theme/helpers/postData' import { sortPostsByStickyAndDate, filterPosts } from '@theme/helpers/postData'
import moduleTransitonMixin from '@theme/mixins/moduleTransiton'
export default { export default {
mixins: [pagination], mixins: [pagination, moduleTransitonMixin],
components: { Common, NoteAbstract, TagList, ModuleTransition }, components: { Common, NoteAbstract, TagList, ModuleTransition },
data () { data () {

View File

@ -4,7 +4,7 @@
<!-- 标签集合 --> <!-- 标签集合 -->
<ModuleTransition> <ModuleTransition>
<TagList <TagList
v-if="recoShowModule" v-show="recoShowModule"
:currentTag="currentTag" :currentTag="currentTag"
@getCurrentTag="tagClick"></TagList> @getCurrentTag="tagClick"></TagList>
</ModuleTransition> </ModuleTransition>
@ -12,7 +12,7 @@
<!-- 博客列表 --> <!-- 博客列表 -->
<ModuleTransition delay="0.08"> <ModuleTransition delay="0.08">
<note-abstract <note-abstract
v-if="recoShowModule" v-show="recoShowModule"
class="list" class="list"
:data="$recoPosts" :data="$recoPosts"
:currentPage="currentPage" :currentPage="currentPage"
@ -23,7 +23,6 @@
<!-- 分页 --> <!-- 分页 -->
<ModuleTransition delay="0.16"> <ModuleTransition delay="0.16">
<pagation <pagation
v-if="recoShowModule"
class="pagation" class="pagation"
:total="$recoPosts.length" :total="$recoPosts.length"
:currentPage="currentPage" :currentPage="currentPage"
@ -39,9 +38,10 @@ import TagList from '@theme/components/TagList'
import NoteAbstract from '@theme/components/NoteAbstract' import NoteAbstract from '@theme/components/NoteAbstract'
import pagination from '@theme/mixins/pagination' import pagination from '@theme/mixins/pagination'
import ModuleTransition from '@theme/components/ModuleTransition' import ModuleTransition from '@theme/components/ModuleTransition'
import moduleTransitonMixin from '@theme/mixins/moduleTransiton'
export default { export default {
mixins: [pagination], mixins: [pagination, moduleTransitonMixin],
components: { Common, NoteAbstract, TagList, ModuleTransition }, components: { Common, NoteAbstract, TagList, ModuleTransition },
data () { data () {
return { return {

View File

@ -3,12 +3,13 @@
<Common :sidebar="false" :isComment="false"> <Common :sidebar="false" :isComment="false">
<ul class="timeline-wrapper"> <ul class="timeline-wrapper">
<ModuleTransition > <ModuleTransition >
<li v-if="recoShowModule" class="desc">Yesterday Once More!</li> <li v-show="recoShowModule" class="desc">Yesterday Once More!</li>
</ModuleTransition> </ModuleTransition>
<ModuleTransition <ModuleTransition
:delay="String(0.08 * (index + 1))" :delay="String(0.08 * (index + 1))"
v-for="(item, index) in $recoPostsForTimeline" :key="index"> v-for="(item, index) in $recoPostsForTimeline"
<li v-if="recoShowModule"> :key="index">
<li v-show="recoShowModule">
<h3 class="year">{{item.year}}</h3> <h3 class="year">{{item.year}}</h3>
<ul class="year-wrapper"> <ul class="year-wrapper">
<li v-for="(subItem, subIndex) in item.data" :key="subIndex"> <li v-for="(subItem, subIndex) in item.data" :key="subIndex">
@ -27,8 +28,10 @@
<script> <script>
import Common from '@theme/components/Common' import Common from '@theme/components/Common'
import ModuleTransition from '@theme/components/ModuleTransition' import ModuleTransition from '@theme/components/ModuleTransition'
import moduleTransitonMixin from '@theme/mixins/moduleTransiton'
export default { export default {
mixins: [moduleTransitonMixin],
name: 'TimeLine', name: 'TimeLine',
components: { Common, ModuleTransition }, components: { Common, ModuleTransition },
filters: { filters: {
@ -68,6 +71,7 @@ export default {
position: absolute; position: absolute;
top: 14px; top: 14px;
left: 0; left: 0;
z-index: -1;
margin-left: -2px; margin-left: -2px;
width: 4px; width: 4px;
height: 100%; height: 100%;
@ -81,7 +85,7 @@ export default {
content: " "; content: " ";
position: absolute; position: absolute;
z-index 2; z-index 2;
left: -19px; left: -20px;
top: 50%; top: 50%;
margin-left: -4px; margin-left: -4px;
margin-top: -4px; margin-top: -4px;

View File

@ -1,6 +1,6 @@
{ {
"name": "vuepress-theme-reco", "name": "vuepress-theme-reco",
"version": "1.2.0-alpha.5", "version": "1.2.0-alpha.11",
"description": "A simple and beautiful vuepress Blog & Doc theme.", "description": "A simple and beautiful vuepress Blog & Doc theme.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
@ -27,24 +27,23 @@
"_from": "vuepress-theme-reco@0.2.1", "_from": "vuepress-theme-reco@0.2.1",
"_resolved": "http://registry.npm.taobao.org/vuepress-theme-reco/download/vuepress-theme-reco-0.2.1.tgz", "_resolved": "http://registry.npm.taobao.org/vuepress-theme-reco/download/vuepress-theme-reco-0.2.1.tgz",
"dependencies": { "dependencies": {
"@vuepress-reco/vuepress-plugin-back-to-top": "^1.0.5", "@vuepress-reco/vuepress-plugin-back-to-top": "1.0.8",
"@vuepress-reco/vuepress-plugin-extract-code": "^1.0.3", "@vuepress-reco/vuepress-plugin-extract-code": "1.0.3",
"@vuepress-reco/vuepress-plugin-loading-page": "^1.0.4", "@vuepress-reco/vuepress-plugin-loading-page": "1.0.5",
"@vuepress-reco/vuepress-plugin-pagation": "^1.0.4", "@vuepress-reco/vuepress-plugin-pagation": "1.0.6",
"@vuepress-reco/vuepress-plugin-screenfull": "^1.0.1", "@vuepress-reco/vuepress-plugin-comments": "1.0.11",
"@vuepress-reco/vuepress-plugin-comments": "^1.0.8",
"@vuepress/plugin-medium-zoom": "1.2.0", "@vuepress/plugin-medium-zoom": "1.2.0",
"@vuepress/plugin-blog": "1.3.0", "@vuepress/plugin-blog": "1.3.0",
"docsearch.js": "^2.5.2", "docsearch.js": "2.5.2",
"leancloud-storage": "3.13.2", "leancloud-storage": "3.13.2",
"valine": "1.3.6", "valine": "1.3.6",
"vue-click-outside": "1.0.7", "vue-click-outside": "1.0.7",
"md5": "2.2.1" "md5": "2.2.1"
}, },
"devDependencies": { "devDependencies": {
"babel-eslint": "^10.0.3", "babel-eslint": "10.0.3",
"eslint": "^6.4.0", "eslint": "6.4.0",
"eslint-plugin-vue": "^5.2.3", "eslint-plugin-vue": "5.2.3",
"vuepress": "1.2.0" "vuepress": "1.2.0"
} }
} }

View File

@ -1,11 +0,0 @@
load-start(){
transform:translateY(-20px);
opacity 0
}
load-end($delayTime){
transition:all .25s;
transform:translateY(0);
transition-delay: $delayTime
opacity 1
}

View File

@ -6,6 +6,7 @@
--border-color $borderColor --border-color $borderColor
--bgm-bg-color $bgmBgColor --bgm-bg-color $bgmBgColor
--code-color $codeColor --code-color $codeColor
--mask-color $maskColor
@media (prefers-color-scheme: dark) @media (prefers-color-scheme: dark)
--background-color $backgroundColorDark --background-color $backgroundColorDark
--box-shadow $boxShadowDark --box-shadow $boxShadowDark
@ -14,3 +15,4 @@
--border-color $borderColorDark --border-color $borderColorDark
--bgm-bg-color $bgmBgColorDark --bgm-bg-color $bgmBgColorDark
--code-color $codeColorDark --code-color $codeColorDark
--mask-color $maskColorDark

View File

@ -21,3 +21,6 @@ $codeColorDark ?= rgba(0, 0, 0, .3)
$bgmBgColor ?= rgba(255, 255, 255, .7) $bgmBgColor ?= rgba(255, 255, 255, .7)
$bgmBgColorDark ?= rgba(0, 0, 0, .7) $bgmBgColorDark ?= rgba(0, 0, 0, .7)
$maskColor ?= #888
$maskColorDark ?= #000

View File

@ -212,119 +212,3 @@ th, td
/************** **************/ /************** **************/
.vuepress-flowchart .vuepress-flowchart
overflow: auto overflow: auto
/************** 404 **************/
.mod_404 .desc {
.desc_link {
display: inline-block
// margin: 20px 0
background: #424242!important
color: #ffffff
padding: 6px 20px!important
text-decoration: none!important
border-radius: 4px
}
}
@media screen and (max-width: 720px) {
.mod_404 .desc {
margin: 50px 0
}
}
/************** **************/
.comments-wrapper
.valine-wrapper
#valine.v
.vwrap
background: var(--code-color)
// box-shadow: var(--box-shadow)
.vcontrol
.vsubmit
background: var(--code-color)
.vinfo
padding-left: .6rem
.vlist
padding: 0 .6rem
border-radius: $borderRadius
.vcard
.vquote
margin-left: 0
border-left: 1px dashed var(--border-color)
.vimg
border-radius: $borderRadius
box-shadow: var(--box-shadow)
border: none
.vh
border-bottom: 1px dashed var(--border-color)
.vhead
.vsys
box-shadow: var(--box-shadow)
background: var(--code-color)
color: var(--text-color)
.vmeta
margin-bottom: 1rem
.vat
margin-right: .3rem
background: var(--code-color)
box-shadow: var(--box-shadow)
border-radius: $borderRadius
padding: 0 .4rem
color: var(--text-color)
border: 1px solid var(--border-color)
.vcontent
background: var(--code-color)
box-shadow: var(--box-shadow)
border-radius: $borderRadius
margin: 0 .3rem
padding: .1rem .6rem .05rem .6rem
p .at
color: #1abc9c
&.expand:before
z-index 1
background: linear-gradient(180deg, rgba(255,255,255,0), var(--background-color))
&.expand:after
background: var(--background-color)
color: var(--color-color)
.info
padding-right: .6rem
/************** **************/
.pagation
.pagation-list
background: var(--background-color)!important
.jump, .jumpinp input
background-color: var(--background-color)
color: var(--text-color)
box-shadow: var(--box-shadow)
border 1px solid var(--border-color)!important
/************** **************/
.back-to-ceiling
background-color: var(--background-color)!important
box-shadow: var(--box-shadow)!important
/********* **********/
.navbar
background var(--background-color)
.links
background var(--background-color)
.home-blog
.home-blog-wrapper
.info-wrapper
background var(--background-color)
.abstract-item
background var(--background-color)
.category-wrapper
.category-item
background var(--background-color)
.pagation
.jump
background var(--background-color)