diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..84b7cce --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 reco_luan + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..3ced62e --- /dev/null +++ b/README.md @@ -0,0 +1,41 @@ +# vuepress-theme-reco + +![vuepress](https://img.shields.io/badge/vuepress-0.14.8-brightgreen.svg) +![leancloud-storage](https://img.shields.io/badge/leancloud--storage-3.10.1-orange.svg) +![valine](https://img.shields.io/badge/valine-1.3.4-blue.svg) + +> 1. 这是一个vuepress主题,旨在添加博客所需的分类、TAB墙、分页、评论等能; +> 2. 主题追求极简,根据 vuepress 的默认主题修改而成,官方的主题配置仍然适用; +> 3. 效果:[午后南杂](http://recoluan.gitlab.io) +> 4. 文档:[vuepress-theme-reco-doc](https://recoluan.gitlab.io/vuepress-theme-reco-doc) + +## 预览 + +### 首页 +![home.png](https://upload-images.jianshu.io/upload_images/4660406-0bf9d91e9d289f75.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) + + +### 分类页面 +![category.png](https://upload-images.jianshu.io/upload_images/4660406-8c7995d750c58536.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) + + +### 标签页 +![tag.png](https://upload-images.jianshu.io/upload_images/4660406-39c0d47627869e3a.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) + + +### 文章页面 +![article.png](https://upload-images.jianshu.io/upload_images/4660406-a19cad487991409d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) + +### 加密登录页 + +![password.png](https://upload-images.jianshu.io/upload_images/4660406-7d38dc78c16b7d48.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) + +### 时间轴 + +![timeline.png](https://upload-images.jianshu.io/upload_images/4660406-1dc5a5fe6c03952e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) + +### 移动端 +![m.png](https://upload-images.jianshu.io/upload_images/4660406-7e2c78c48dd78284.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240) + +## License +[MIT](https://github.com/recoluan/vuepress-theme-reco/blob/master/LICENSE) \ No newline at end of file diff --git a/components/AlgoliaSearchBox.vue b/components/AlgoliaSearchBox.vue new file mode 100644 index 0000000..41b62af --- /dev/null +++ b/components/AlgoliaSearchBox.vue @@ -0,0 +1,155 @@ + + + + + diff --git a/components/BackToTop.vue b/components/BackToTop.vue new file mode 100644 index 0000000..7d05abb --- /dev/null +++ b/components/BackToTop.vue @@ -0,0 +1,109 @@ + + + + + \ No newline at end of file diff --git a/components/Background.vue b/components/Background.vue new file mode 100644 index 0000000..d75fdd6 --- /dev/null +++ b/components/Background.vue @@ -0,0 +1,118 @@ + + + + + diff --git a/components/Common.vue b/components/Common.vue new file mode 100644 index 0000000..af1f360 --- /dev/null +++ b/components/Common.vue @@ -0,0 +1,152 @@ + + + diff --git a/components/DropdownLink.vue b/components/DropdownLink.vue new file mode 100644 index 0000000..f859857 --- /dev/null +++ b/components/DropdownLink.vue @@ -0,0 +1,181 @@ + + + + + diff --git a/components/DropdownTransition.vue b/components/DropdownTransition.vue new file mode 100644 index 0000000..8c711a1 --- /dev/null +++ b/components/DropdownTransition.vue @@ -0,0 +1,33 @@ + + + + + diff --git a/components/Home.vue b/components/Home.vue new file mode 100644 index 0000000..2ee1f3e --- /dev/null +++ b/components/Home.vue @@ -0,0 +1,285 @@ + + + + + diff --git a/components/NavLink.vue b/components/NavLink.vue new file mode 100644 index 0000000..6c71577 --- /dev/null +++ b/components/NavLink.vue @@ -0,0 +1,52 @@ + + + diff --git a/components/NavLinks.vue b/components/NavLinks.vue new file mode 100644 index 0000000..7c4d3cd --- /dev/null +++ b/components/NavLinks.vue @@ -0,0 +1,181 @@ + + + + + diff --git a/components/Navbar.vue b/components/Navbar.vue new file mode 100644 index 0000000..aae224a --- /dev/null +++ b/components/Navbar.vue @@ -0,0 +1,125 @@ + + + + + diff --git a/components/NoteAbstract.vue b/components/NoteAbstract.vue new file mode 100644 index 0000000..a87064a --- /dev/null +++ b/components/NoteAbstract.vue @@ -0,0 +1,84 @@ + + + + + diff --git a/components/Pagation.vue b/components/Pagation.vue new file mode 100644 index 0000000..6faabdd --- /dev/null +++ b/components/Pagation.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/components/Page.vue b/components/Page.vue new file mode 100644 index 0000000..8c622f3 --- /dev/null +++ b/components/Page.vue @@ -0,0 +1,284 @@ + + + + + diff --git a/components/PageInfo.vue b/components/PageInfo.vue new file mode 100644 index 0000000..3dba962 --- /dev/null +++ b/components/PageInfo.vue @@ -0,0 +1,68 @@ + + + + + diff --git a/components/Password.vue b/components/Password.vue new file mode 100644 index 0000000..13d1deb --- /dev/null +++ b/components/Password.vue @@ -0,0 +1,283 @@ + + + + + \ No newline at end of file diff --git a/components/Sidebar.vue b/components/Sidebar.vue new file mode 100644 index 0000000..62f1286 --- /dev/null +++ b/components/Sidebar.vue @@ -0,0 +1,59 @@ + + + + + diff --git a/components/SidebarButton.vue b/components/SidebarButton.vue new file mode 100644 index 0000000..b8fb415 --- /dev/null +++ b/components/SidebarButton.vue @@ -0,0 +1,27 @@ + + + diff --git a/components/SidebarGroup.vue b/components/SidebarGroup.vue new file mode 100644 index 0000000..da7b5e8 --- /dev/null +++ b/components/SidebarGroup.vue @@ -0,0 +1,129 @@ + + + + + diff --git a/components/SidebarLink.vue b/components/SidebarLink.vue new file mode 100644 index 0000000..7d128b4 --- /dev/null +++ b/components/SidebarLink.vue @@ -0,0 +1,109 @@ + + + diff --git a/components/SidebarLinks.vue b/components/SidebarLinks.vue new file mode 100644 index 0000000..dfdb0be --- /dev/null +++ b/components/SidebarLinks.vue @@ -0,0 +1,86 @@ + + + diff --git a/components/Theme/ThemeOptions.vue b/components/Theme/ThemeOptions.vue new file mode 100755 index 0000000..198bfae --- /dev/null +++ b/components/Theme/ThemeOptions.vue @@ -0,0 +1,124 @@ + + + + + diff --git a/components/Theme/index.vue b/components/Theme/index.vue new file mode 100755 index 0000000..65061bf --- /dev/null +++ b/components/Theme/index.vue @@ -0,0 +1,140 @@ + + + + + diff --git a/components/Theme/recoConfig.js b/components/Theme/recoConfig.js new file mode 100755 index 0000000..05fa129 --- /dev/null +++ b/components/Theme/recoConfig.js @@ -0,0 +1,22 @@ +export default { + data() { + return { + reco: {}, + colors: { + blue: '#2196f3', + red: '#f26d6d', + green: '#3eaf7c', + orange: '#fb9b5f' + } + }; + }, + + mounted() { + this.reco = { + themes: ['blue', 'red', 'green', 'orange'], + disableDarkTheme: false + }; + + this.reco.hasThemes = this.$site.themeConfig.themePicker || true + }, +}; diff --git a/components/TimeLine.vue b/components/TimeLine.vue new file mode 100644 index 0000000..0a47c3b --- /dev/null +++ b/components/TimeLine.vue @@ -0,0 +1,189 @@ + + + + + diff --git a/components/Valine/AccessNumber.vue b/components/Valine/AccessNumber.vue new file mode 100644 index 0000000..4cb0ab5 --- /dev/null +++ b/components/Valine/AccessNumber.vue @@ -0,0 +1,24 @@ + + + + + + diff --git a/components/Valine/index.vue b/components/Valine/index.vue new file mode 100644 index 0000000..a33051e --- /dev/null +++ b/components/Valine/index.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/fonts/iconfont.css b/fonts/iconfont.css new file mode 100644 index 0000000..080d647 --- /dev/null +++ b/fonts/iconfont.css @@ -0,0 +1,109 @@ +@font-face {font-family: "iconfont"; + src: url('iconfont.eot?t=1555230336940'); /* IE9 */ + src: url('iconfont.eot?t=1555230336940#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAA3kAAsAAAAAGEAAAA2VAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCGPAqeSJg+ATYCJANgCzIABCAFhG0HgWQbPBQzo8LGAQBRPg/Z/+lAC7nKrp+BQ65GtdFY67Wu2OkOR2Pn6WsdTQIS7RWsH8yaDghWQvqrhu4OgLBjp/bu8FcELrA+Bw+fzvKPZiQ2wQEQVWgfIHbEJQFo9yBJlS4v9nvXrAjCRqiSrOoRKLT30uwPLM12Mim0OSAz2/ncXu8Sv0ucDzGVt2NR3SrOAq8brPCjUjM7eR1bBDac0/6hKuEB/xs/X9/fEG3z7v7FigAxGp80ChMUE6MKXeHMBbGEZbOObkAAytAmO3IZcDMvLfbgtoOk1lcDBPPN/ap6/M04TEOT12nxtq/bDjn8ULEIoVLChqlEKjQakUZIkUrOWMS2mPUrLpJQD9qI2BgCcChKZUTr58+f1ggFYwXKTA5Ot0aZEFSBtcAKMAILKkdsQMfSVmoH1tuPF7+pKSzQ0CVsU93HPmWtg88/y2W5GCyzZLsjwNtCIIHKgAItHUwWUaRnKlvOCVVW+EBFitP5Oj6+yREUkVBUWeXV1khrg0wwz+q8/Py1v37+szw3VPNrC/iqVluwaEFF7rcyVX2qvn9IEMfCwyaAwkAniksYjQgpgvP2Dy9EEhNBDIQBlfYARGnkpMBHOiMBvumMOPi2MyzwHWd44AdYilAQLIMoAowCSgBjABUFRgcqC0wUqDwwLlAtYMJAtYHRgBqBpVvUGvLpRYPAMm40ARgJNA8YB2g1nB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wpesxnL/m/OtHEDmbvdkLCQyNlif5KopGKnAfgcl/T9j+pvQVSQTPmANkg1kWCrzCNp2uSLprJu5y5+IlpsGq/9l4387fhiQ9vpNKItzupGPT36nQLMYAXfwWOUVaKX+VfVC0+q7NXJwTnakvJzF3d5MPjZZmiXYmRrg8AFw5x4f5eM0+ScqK55l+CcSoGFSBEgsSmsr/cpAx6U2MLBoBhwq0W5xlxgz6SKUDVRkaQQEYU4CjSCXgCTMA22l/wHoJPkLGISFBA59RWyFLmXFhEkrhhZk6nhTwVBtRbhMXNkvuFRqTqus+A8cQ5raVq3en/eCGtzFLPHsdiJWWaZKPUebQ1mSaphyGFl5kWa/rjY2NOvKUNWa0AoGaEQ7zFCM5OZ1Agaixg4vTAbe/wvgSJRouKDJH69/ACYSohU1HrA0WUH7hasrNTktlWdxxrFjNhGLkrUZokLRlggoeTahmB4eLwcYhBXjG2Q27KlGXY2tyq3G71/tEhwbX7NslekBoiQrqqYbJrPL3luxWG12h9Pl9nh9/lAMlcTDCjFqhy5uGERoNn5kVtZpO+Lb4ALjtXTrphrKJYiAeyZmda9CnQYuiE/HzunUJ/FBYU8VOqnpina9rPGJjI5U4JZ0PTbU3Dg4L0NtDKVahnnQdfSpHxFU0FkMtAAAAA==') format('woff2'), + url('iconfont.woff?t=1555230336940') format('woff'), + url('iconfont.ttf?t=1555230336940') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ + url('iconfont.svg?t=1555230336940#iconfont') format('svg'); /* iOS 4.1- */ +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.reco-color:before { + content: "\eae9"; +} + +.reco-message:before { + content: "\e634"; +} + +.reco-eye:before { + content: "\e669"; +} + +.reco-search:before { + content: "\e611"; +} + +.reco-category:before { + content: "\e61e"; +} + +.reco-wechat:before { + content: "\e615"; +} + +.reco-npm:before { + content: "\e88d"; +} + +.reco-twitter:before { + content: "\e609"; +} + +.reco-csdn:before { + content: "\e60d"; +} + +.reco-menu:before { + content: "\e67c"; +} + +.reco-github:before { + content: "\e628"; +} + +.reco-qq:before { + content: "\e60a"; +} + +.reco-other:before { + content: "\e60e"; +} + +.reco-home:before { + content: "\e65b"; +} + +.reco-up:before { + content: "\e68b"; +} + +.reco-tag:before { + content: "\e633"; +} + +.reco-date:before { + content: "\e63b"; +} + +.reco-bokeyuan:before { + content: "\e626"; +} + +.reco-copyright:before { + content: "\ef87"; +} + +.reco-account:before { + content: "\e607"; +} + +.reco-jianshu:before { + content: "\e600"; +} + +.reco-theme:before { + content: "\e7e8"; +} + +.reco-three:before { + content: "\e644"; +} + diff --git a/fonts/iconfont.eot b/fonts/iconfont.eot new file mode 100644 index 0000000..95c907f Binary files /dev/null and b/fonts/iconfont.eot differ diff --git a/fonts/iconfont.svg b/fonts/iconfont.svg new file mode 100644 index 0000000..98c0afb --- /dev/null +++ b/fonts/iconfont.svg @@ -0,0 +1,95 @@ + + + + + +Created by iconfont + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/fonts/iconfont.ttf b/fonts/iconfont.ttf new file mode 100644 index 0000000..3a46f0b Binary files /dev/null and b/fonts/iconfont.ttf differ diff --git a/fonts/iconfont.woff b/fonts/iconfont.woff new file mode 100644 index 0000000..2d512c6 Binary files /dev/null and b/fonts/iconfont.woff differ diff --git a/fonts/iconfont.woff2 b/fonts/iconfont.woff2 new file mode 100644 index 0000000..9f5bb4f Binary files /dev/null and b/fonts/iconfont.woff2 differ diff --git a/global-components/Badge.vue b/global-components/Badge.vue new file mode 100644 index 0000000..8255293 --- /dev/null +++ b/global-components/Badge.vue @@ -0,0 +1,44 @@ + + + diff --git a/index.js b/index.js new file mode 100644 index 0000000..c9e26bd --- /dev/null +++ b/index.js @@ -0,0 +1,46 @@ +const path = require('path') + +// Theme API. +module.exports = (options, ctx) => ({ + alias () { + const { themeConfig, siteConfig } = ctx + // resolve algolia + const isAlgoliaSearch = ( + themeConfig.algolia + || Object.keys(siteConfig.locales && themeConfig.locales || {}) + .some(base => themeConfig.locales[base].algolia) + ) + return { + '@AlgoliaSearchBox': isAlgoliaSearch + ? path.resolve(__dirname, 'components/AlgoliaSearchBox.vue') + : path.resolve(__dirname, 'noopModule.js') + } + }, + + plugins: [ + '@vuepress/active-header-links', + ['@vuepress/plugin-blog', { + permalink: '/:regular' + }], + '@vuepress/search', + '@vuepress/plugin-nprogress', + ['container', { + type: 'tip', + defaultTitle: { + '/zh/': '提示' + } + }], + ['container', { + type: 'warning', + defaultTitle: { + '/zh/': '注意' + } + }], + ['container', { + type: 'danger', + defaultTitle: { + '/zh/': '警告' + } + }] + ] +}) diff --git a/layouts/404.vue b/layouts/404.vue new file mode 100644 index 0000000..4eef36d --- /dev/null +++ b/layouts/404.vue @@ -0,0 +1,28 @@ + + + + + diff --git a/layouts/Category.vue b/layouts/Category.vue new file mode 100644 index 0000000..d15066c --- /dev/null +++ b/layouts/Category.vue @@ -0,0 +1,93 @@ + + + + + + + + + diff --git a/layouts/Layout.vue b/layouts/Layout.vue new file mode 100644 index 0000000..93c834a --- /dev/null +++ b/layouts/Layout.vue @@ -0,0 +1,42 @@ + + + + + + diff --git a/layouts/Tags.vue b/layouts/Tags.vue new file mode 100644 index 0000000..285fa4b --- /dev/null +++ b/layouts/Tags.vue @@ -0,0 +1,129 @@ + + + + + + + + + diff --git a/noopModule.js b/noopModule.js new file mode 100644 index 0000000..b1c6ea4 --- /dev/null +++ b/noopModule.js @@ -0,0 +1 @@ +export default {} diff --git a/package.json b/package.json new file mode 100644 index 0000000..f9da596 --- /dev/null +++ b/package.json @@ -0,0 +1,32 @@ +{ + "name": "vuepress-theme-reco", + "version": "1.0.0-alpha.11", + "description": "this is a vuepress theme", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/recoluan/vuepress-theme-reco.git" + }, + "keywords": [ + "vuepress", + "vue", + "theme" + ], + "author": "reco_luan", + "license": "MIT", + "bugs": { + "url": "https://github.com/recoluan/vuepress-theme-reco/issues" + }, + "homepage": "https://recoluan.gitlab.io/vuepress-theme-reco-doc/", + "_from": "vuepress-theme-reco@0.2.1", + "_resolved": "http://registry.npm.taobao.org/vuepress-theme-reco/download/vuepress-theme-reco-0.2.1.tgz", + "dependencies": { + "leancloud-storage": "^3.10.1", + "valine": "^1.3.4", + "@vuepress/plugin-blog": "^1.0.0-alpha.46", + "vue-click-outside": "^1.0.7" + } +} \ No newline at end of file diff --git a/styles/arrow.styl b/styles/arrow.styl new file mode 100644 index 0000000..20bffc0 --- /dev/null +++ b/styles/arrow.styl @@ -0,0 +1,22 @@ +@require './config' + +.arrow + display inline-block + width 0 + height 0 + &.up + border-left 4px solid transparent + border-right 4px solid transparent + border-bottom 6px solid $arrowBgColor + &.down + border-left 4px solid transparent + border-right 4px solid transparent + border-top 6px solid $arrowBgColor + &.right + border-top 4px solid transparent + border-bottom 4px solid transparent + border-left 6px solid $arrowBgColor + &.left + border-top 4px solid transparent + border-bottom 4px solid transparent + border-right 6px solid $arrowBgColor diff --git a/styles/code.styl b/styles/code.styl new file mode 100644 index 0000000..bc5701e --- /dev/null +++ b/styles/code.styl @@ -0,0 +1,135 @@ +.content + code + color lighten($textColor, 20%) + padding 0.25rem 0.5rem + margin 0 + font-size 0.85em + background-color rgba(27,31,35,0.05) + border-radius 3px + .token + &.deleted + color #EC5975 + &.inserted + color $accentColor + +.content + pre, pre[class*="language-"] + line-height 1.4 + padding 1.25rem 1.5rem + margin 0.85rem 0 + background-color $codeBgColor + border-radius 6px + overflow auto + code + color #fff + padding 0 + background-color transparent + border-radius 0 + +div[class*="language-"] + position relative + background-color $codeBgColor + border-radius 6px + .highlight-lines + user-select none + padding-top 1.3rem + position absolute + top 0 + left 0 + width 100% + line-height 1.4 + .highlighted + background-color rgba(0, 0, 0, 66%) + pre, pre[class*="language-"] + background transparent + position relative + z-index 1 + &::before + position absolute + z-index 3 + top 0.8em + right 1em + font-size 0.75rem + color rgba(255, 255, 255, 0.4) + &:not(.line-numbers-mode) + .line-numbers-wrapper + display none + &.line-numbers-mode + .highlight-lines .highlighted + position relative + &:before + content ' ' + position absolute + z-index 3 + left 0 + top 0 + display block + width $lineNumbersWrapperWidth + height 100% + background-color rgba(0, 0, 0, 66%) + pre + padding-left $lineNumbersWrapperWidth + 1 rem + vertical-align middle + .line-numbers-wrapper + position absolute + top 0 + width $lineNumbersWrapperWidth + text-align center + color rgba(255, 255, 255, 0.3) + padding 1.25rem 0 + line-height 1.4 + br + user-select none + .line-number + position relative + z-index 4 + user-select none + font-size 0.85em + &::after + content '' + position absolute + z-index 2 + top 0 + left 0 + width $lineNumbersWrapperWidth + height 100% + border-radius 6px 0 0 6px + border-right 1px solid rgba(0, 0, 0, 66%) + background-color $codeBgColor + + +for lang in $codeLang + div{'[class~="language-' + lang + '"]'} + &:before + content ('' + lang) + +div[class~="language-javascript"] + &:before + content "js" + +div[class~="language-typescript"] + &:before + content "ts" + +div[class~="language-markup"] + &:before + content "html" + +div[class~="language-markdown"] + &:before + content "md" + +div[class~="language-json"]:before + content "json" + +div[class~="language-ruby"]:before + content "rb" + +div[class~="language-python"]:before + content "py" + +div[class~="language-bash"]:before + content "sh" + +div[class~="language-php"]:before + content "php" diff --git a/styles/colorMode/colorMixin.styl b/styles/colorMode/colorMixin.styl new file mode 100644 index 0000000..5dc699b --- /dev/null +++ b/styles/colorMode/colorMixin.styl @@ -0,0 +1,55 @@ +color-mode(accountColor , colorName) + .reco-theme-{colorName} + input + color accountColor!important; + .search-box input + border-color: accountColor!important; + &:focus + border-color: accountColor!important; + .navbar + box-shadow: 0 1px 6px 0 rgba(32,33,36,.28) + .nav-links a:hover, + .nav-links a.router-link-active, + .nav-links a:hover .iconfont, + .nav-links a.router-link-active .iconfont + color accountColor!important; + .home + .hero + .description + color accountColor!important; + .action-button, img + background-color accountColor!important; + color: #fff!important + .features + .feature + h2, p + color accountColor!important; + .footer + a + color accountColor!important; + .abstract-wrapper .abstract-item .title + a + color accountColor!important; + a:after + background-color accountColor!important; + .back-to-ceiling i + color accountColor!important; + .dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active::after + border-left: 5px solid accountColor!important; + .tags + .tag-item.active, .tag-item:hover + color accountColor!important; + .timeline-wrapper .year-wrapper li:hover + .title + color accountColor!important; + .date::before + background: accountColor!important; + .date + color accountColor!important; + @media (min-width: 765px) + .nav-item > a:not(.external):hover, + .nav-item > a:not(.external).router-link-active + border-color: accountColor!important; + @media (max-width: 959px) + .search-box input + border-color: transparent!important; \ No newline at end of file diff --git a/styles/colorMode/colorMode.styl b/styles/colorMode/colorMode.styl new file mode 100644 index 0000000..fda4853 --- /dev/null +++ b/styles/colorMode/colorMode.styl @@ -0,0 +1,17 @@ +@require './colorMixin.styl' + +$fc-red = #f26d6d +$fc-red-name = 'red' +color-mode($fc-red, $fc-red-name) + +$fc-blue = #2196f3 +$fc-blue-name = 'blue' +color-mode($fc-blue, $fc-blue-name) + +$fc-green = #3eaf7c +$fc-green-name = 'green' +color-mode($fc-green, $fc-green-name) + +$fc-orange = #fb9b5f +$fc-orange-name = 'orange' +color-mode($fc-orange, $fc-orange-name) \ No newline at end of file diff --git a/styles/colorMode/index.styl b/styles/colorMode/index.styl new file mode 100644 index 0000000..2ff8a58 --- /dev/null +++ b/styles/colorMode/index.styl @@ -0,0 +1,2 @@ +@require './nightMode.styl' +@require './colorMode.styl' \ No newline at end of file diff --git a/styles/colorMode/nightMode.styl b/styles/colorMode/nightMode.styl new file mode 100644 index 0000000..974603b --- /dev/null +++ b/styles/colorMode/nightMode.styl @@ -0,0 +1,114 @@ +$bc = #000 +$fc = #9e9e9e +$bdc = #9e9e9e +$fcActive = #fff + + +bc() { + background-color: $bc!important +} +fc() { + color: $fc!important +} +bdc() { + border-color: $bdc!important +} +fc-active() { + color: $fcActive!important +} + +.reco-theme-night + bc() + fc() + bdc() + h1, h2, h3, h4, h5, h6, a, hr + bdc() + fc() + input + bc() + fc() + .search-box input + bdc() + &:focus + bdc() + .navbar + bc() + box-shadow: 0 2px 20px 0 rgba(255,255,255,0.4); + border-bottom: 1px solid $bdc + .site-name, .links + bc() + fc() + .nav-links a:hover, + .nav-links a.router-link-active, + .nav-links a:hover .iconfont, + .nav-links a.router-link-active .iconfont + fc-active() + .tags .tag-item:hover + fc-active() + @media (min-width: 765px) + .nav-item > a:not(.external):hover, + .nav-item > a:not(.external).router-link-active + border-color: $fcActive; + .dropdown-wrapper .nav-dropdown + bc() + box-shadow: 0 2px 20px 0 rgba(255,255,255,0.4); + border: 1px solid $bdc + @media (min-width: 719px) + .nav-item > a:not(.external):hover, + .nav-item > a:not(.external).router-link-active + border-bottom: 2px solid $fcActive!important; + @media (max-width: 959px) + .search-box input + border-color: transparent!important; + .home + .hero + .description + fc() + .features + bdc() + .feature + h2, p + fc() + .footer + bdc() + a + fc() + .abstract-wrapper .abstract-item + background-color: lighten($bc, 20%) + .custom-block.tip, .custom-block.warning, .custom-block.danger + background-color: lighten($bc, 15%) + .pagation .pagation-list + bc() + .sidebar + bc() + bdc() + .valine-wrapper + bc() + + .v .vbtn, .v .vwrap + bc() + bdc() + .v .vlist .vcard + .vhead .vsys, .vh + bdc() + bc() + .timeline-wrapper + &::after + background: $fc + .year-wrapper li + bdc() + .back-to-ceiling + background-color: lighten($bc, 15%)!important + i + fc() + .color-picker .color-button .iconfont + fc() + .dropdown-wrapper .nav-dropdown .dropdown-item a.router-link-active::after + border-left: 5px solid $fcActive + .timeline-wrapper .year-wrapper li:hover + .title + fc() + .date::before + background: $fcActive + .date + fc() \ No newline at end of file diff --git a/styles/custom-blocks.styl b/styles/custom-blocks.styl new file mode 100644 index 0000000..d0775c3 --- /dev/null +++ b/styles/custom-blocks.styl @@ -0,0 +1,30 @@ +.custom-block + .custom-block-title + font-weight 600 + margin-bottom -0.4rem + &.tip, &.warning, &.danger + padding .1rem 1.5rem + border-left-width .5rem + border-left-style solid + margin 1rem 0 + &.tip + background-color #f3f5f7 + border-color #67cc86 + &.warning + background-color #fbf0ea + border-color #fb9b5f + // color darken(#ffe564, 70%) + .custom-block-title + color darken(#ffe564, 50%) + a + color $textColor + &.danger + background-color #fceaea + border-color #f26d6d + // color darken(red, 70%) + .custom-block-title + color darken(red, 40%) + a + color $textColor + + diff --git a/styles/loadMixin.styl b/styles/loadMixin.styl new file mode 100644 index 0000000..7c3bba5 --- /dev/null +++ b/styles/loadMixin.styl @@ -0,0 +1,11 @@ +load-start(){ + transition:all .25s; + transform:translateY(-20px); + opacity 0 +} + +load-end($delayTime){ + transform:translateY(0); + transition-delay: $delayTime + opacity 1 +} \ No newline at end of file diff --git a/styles/mobile.styl b/styles/mobile.styl new file mode 100644 index 0000000..ca6b18a --- /dev/null +++ b/styles/mobile.styl @@ -0,0 +1,37 @@ +// @require './config' + +$mobileSidebarWidth = $sidebarWidth * 0.82 + +// narrow desktop / iPad +@media (max-width: $MQNarrow) + .sidebar + font-size 15px + width $mobileSidebarWidth + .page + padding-left $mobileSidebarWidth + +// wide mobile +@media (max-width: $MQMobile) + .sidebar + top 0 + padding-top $navbarHeight + transform translateX(-100%) + transition transform .2s ease + .page + padding-left 0 + .theme-container + &.sidebar-open + .sidebar + transform translateX(0) + &.no-navbar + .sidebar + padding-top: 0 + +// narrow mobile +@media (max-width: $MQMobileNarrow) + h1 + font-size 1.9rem + .content + div[class*="language-"] + margin 0.85rem -1.5rem + border-radius 0 diff --git a/styles/recoConfig.styl b/styles/recoConfig.styl new file mode 100644 index 0000000..b7002cc --- /dev/null +++ b/styles/recoConfig.styl @@ -0,0 +1,3 @@ +// colors +$accentColor = #424242 +$textColor = #232321 \ No newline at end of file diff --git a/styles/theme.styl b/styles/theme.styl new file mode 100644 index 0000000..451a6ae --- /dev/null +++ b/styles/theme.styl @@ -0,0 +1,215 @@ +@require './recoConfig' +@require './code' +@require './custom-blocks' +@require './arrow' +@require './wrapper' +@require './toc' +@require './colorMode/index' +@require '../fonts/iconfont.css' + +html, body + padding 0 + margin 0 +body + font-family -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif + -webkit-font-smoothing antialiased + -moz-osx-font-smoothing grayscale + font-size 16px + color $textColor + background-color #fff + +.page + padding-left $sidebarWidth + +.navbar + position fixed + z-index 20 + top 0 + left 0 + right 0 + height $navbarHeight + background-color #fff + box-sizing border-box + +.sidebar-mask + position fixed + z-index 9 + top 0 + left 0 + width 100vw + height 100vh + display none + background-color: rgba(0,0,0,.65); + +.sidebar + font-size 16px + background-color #fff + width $sidebarWidth + position fixed + z-index 10 + margin 0 + top $navbarHeight + left 0 + bottom 0 + box-sizing border-box + border-right 1px solid $borderColor + overflow-y auto + +.content:not(.custom) + @extend $wrapper + // > *:first-child + // margin-top 1.6rem + a:hover + text-decoration underline + p.demo + padding 1rem 1.5rem + border 1px solid #ddd + border-radius 4px + img + max-width 100% + +.content.custom + padding 0 + margin 0 + img + max-width 100% + +a + font-weight 500 + color $accentColor + text-decoration none + +p a code + font-weight 400 + color $accentColor + +kbd + background #eee + border solid 0.15rem #ddd + border-bottom solid 0.25rem #ddd + border-radius 0.15rem + padding 0 0.15em + +blockquote + font-size .9rem + color #999 + border-left .25rem solid #dfe2e5 + margin 0.5rem 0 + padding .25rem 0 .25rem 1rem + & > p + margin 0 + +ul, ol + padding-left 1.2em + +strong + font-weight 600 + +h1, h2, h3, h4, h5, h6 + font-weight 500 + line-height 1.25 + .content:not(.custom) > & + margin-top (0.5rem - $navbarHeight) + padding-top ($navbarHeight + 1rem) + margin-bottom 0 + &:first-child + margin-top -1.5rem + margin-bottom 1rem + + p, + pre, + .custom-block + margin-top 2rem + &:hover .header-anchor + opacity: 1 + +h1 + font-size 2.2rem + +h2 + font-size 1.65rem + padding-bottom .3rem + border-bottom 1px solid $borderColor + +h3 + font-size 1.35rem + +a.header-anchor + font-size 0.85em + float left + margin-left -0.87em + padding-right 0.23em + margin-top 0.125em + opacity 0 + &:hover + text-decoration none + +code, kbd, .line-number + font-family source-code-pro, Menlo, Monaco, Consolas, "Courier New", monospace + +p, ul, ol + line-height 1.7 + +hr + border 0 + border-top 1px solid $borderColor + +table + border-collapse collapse + margin 1rem 0 + display: block + overflow-x: auto + +tr + border-top 1px solid #dfe2e5 + &:nth-child(2n) + background-color #f6f8fa + +th, td + border 1px solid #dfe2e5 + padding .6em 1em + +.theme-container + &.sidebar-open + .sidebar-mask + display: block + &.no-navbar + .content:not(.custom) > h1, h2, h3, h4, h5, h6 + margin-top 1.5rem + padding-top 0 + .sidebar + top 0 + +@media (min-width: ($MQMobile + 1px)) + .theme-container.no-sidebar + .sidebar + display none + .page + padding-left 0 + +@require 'mobile.styl' + +.iconfont + font-size: 0.9rem; + color: #999; + // &:not(:first-child) + // margin-left: 1rem + // span + // margin-left: .5rem + +/************** 滚动条 **************/ +::-webkit-scrollbar + width: 5px; + height: 5px; + +::-webkit-scrollbar-track-piece + background-color: rgba(0, 0, 0, 0.2); + -webkit-border-radius: 6px; + +::-webkit-scrollbar-thumb:vertical + height: 5px; + background-color: rgba(125, 125, 125, 0.7); + -webkit-border-radius: 6px; + +::-webkit-scrollbar-thumb:horizontal + width: 5px; + background-color: rgba(125, 125, 125, 0.7); + -webkit-border-radius: 6px; + diff --git a/styles/toc.styl b/styles/toc.styl new file mode 100644 index 0000000..d3e7106 --- /dev/null +++ b/styles/toc.styl @@ -0,0 +1,3 @@ +.table-of-contents + .badge + vertical-align middle diff --git a/styles/wrapper.styl b/styles/wrapper.styl new file mode 100644 index 0000000..a99262c --- /dev/null +++ b/styles/wrapper.styl @@ -0,0 +1,9 @@ +$wrapper + max-width $contentWidth + margin 0 auto + padding 2rem 2.5rem + @media (max-width: $MQNarrow) + padding 2rem + @media (max-width: $MQMobileNarrow) + padding 1.5rem + diff --git a/util/index.js b/util/index.js new file mode 100644 index 0000000..9913ff7 --- /dev/null +++ b/util/index.js @@ -0,0 +1,239 @@ +export const hashRE = /#.*$/ +export const extRE = /\.(md|html)$/ +export const endingSlashRE = /\/$/ +export const outboundRE = /^(https?:|mailto:|tel:)/ + +export function normalize (path) { + return decodeURI(path) + .replace(hashRE, '') + .replace(extRE, '') +} + +export function getHash (path) { + const match = path.match(hashRE) + if (match) { + return match[0] + } +} + +export function isExternal (path) { + return outboundRE.test(path) +} + +export function isMailto (path) { + return /^mailto:/.test(path) +} + +export function isTel (path) { + return /^tel:/.test(path) +} + +export function ensureExt (path) { + if (isExternal(path)) { + return path + } + const hashMatch = path.match(hashRE) + const hash = hashMatch ? hashMatch[0] : '' + const normalized = normalize(path) + + if (endingSlashRE.test(normalized)) { + return path + } + return normalized + '.html' + hash +} + +export function isActive (route, path) { + const routeHash = route.hash + const linkHash = getHash(path) + if (linkHash && routeHash !== linkHash) { + return false + } + const routePath = normalize(route.path) + const pagePath = normalize(path) + return routePath === pagePath +} + +export function resolvePage (pages, rawPath, base) { + if (base) { + rawPath = resolvePath(rawPath, base) + } + const path = normalize(rawPath) + for (let i = 0; i < pages.length; i++) { + if (normalize(pages[i].regularPath) === path) { + return Object.assign({}, pages[i], { + type: 'page', + path: ensureExt(pages[i].path) + }) + } + } + console.error(`[vuepress] No matching page found for sidebar item "${rawPath}"`) + return {} +} + +function resolvePath (relative, base, append) { + const firstChar = relative.charAt(0) + if (firstChar === '/') { + return relative + } + + if (firstChar === '?' || firstChar === '#') { + return base + relative + } + + const stack = base.split('/') + + // remove trailing segment if: + // - not appending + // - appending to trailing slash (last segment is empty) + if (!append || !stack[stack.length - 1]) { + stack.pop() + } + + // resolve relative path + const segments = relative.replace(/^\//, '').split('/') + for (let i = 0; i < segments.length; i++) { + const segment = segments[i] + if (segment === '..') { + stack.pop() + } else if (segment !== '.') { + stack.push(segment) + } + } + + // ensure leading slash + if (stack[0] !== '') { + stack.unshift('') + } + + return stack.join('/') +} + +/** + * @param { Page } page + * @param { string } regularPath + * @param { SiteData } site + * @param { string } localePath + * @returns { SidebarGroup } + */ +export function resolveSidebarItems (page, regularPath, site, localePath) { + const { pages, themeConfig } = site + + const localeConfig = localePath && themeConfig.locales + ? themeConfig.locales[localePath] || themeConfig + : themeConfig + + const pageSidebarConfig = page.frontmatter.sidebar || localeConfig.sidebar || themeConfig.sidebar + if (pageSidebarConfig === 'auto') { + return resolveHeaders(page) + } + + const sidebarConfig = localeConfig.sidebar || themeConfig.sidebar + if (!sidebarConfig) { + return [] + } else { + const { base, config } = resolveMatchingConfig(regularPath, sidebarConfig) + return config + ? config.map(item => resolveItem(item, pages, base)) + : [] + } +} + +/** + * @param { Page } page + * @returns { SidebarGroup } + */ +function resolveHeaders (page) { + const headers = groupHeaders(page.headers || []) + return [{ + type: 'group', + collapsable: false, + title: page.title, + path: null, + children: headers.map(h => ({ + type: 'auto', + title: h.title, + basePath: page.path, + path: page.path + '#' + h.slug, + children: h.children || [] + })) + }] +} + +export function groupHeaders (headers) { + // group h3s under h2 + headers = headers.map(h => Object.assign({}, h)) + let lastH2 + headers.forEach(h => { + if (h.level === 2) { + lastH2 = h + } else if (lastH2) { + (lastH2.children || (lastH2.children = [])).push(h) + } + }) + return headers.filter(h => h.level === 2) +} + +export function resolveNavLinkItem (linkItem) { + return Object.assign(linkItem, { + type: linkItem.items && linkItem.items.length ? 'links' : 'link' + }) +} + +/** + * @param { Route } route + * @param { Array | Array | [link: string]: SidebarConfig } config + * @returns { base: string, config: SidebarConfig } + */ +export function resolveMatchingConfig (regularPath, config) { + if (Array.isArray(config)) { + return { + base: '/', + config: config + } + } + for (const base in config) { + if (ensureEndingSlash(regularPath).indexOf(encodeURI(base)) === 0) { + return { + base, + config: config[base] + } + } + } + return {} +} + +function ensureEndingSlash (path) { + return /(\.html|\/)$/.test(path) + ? path + : path + '/' +} + +function resolveItem (item, pages, base, groupDepth = 1) { + if (typeof item === 'string') { + return resolvePage(pages, item, base) + } else if (Array.isArray(item)) { + return Object.assign(resolvePage(pages, item[0], base), { + title: item[1] + }) + } else { + if (groupDepth > 3) { + console.error( + '[vuepress] detected a too deep nested sidebar group.' + ) + } + const children = item.children || [] + if (children.length === 0 && item.path) { + return Object.assign(resolvePage(pages, item.path, base), { + title: item.title + }) + } + return { + type: 'group', + path: item.path, + title: item.title, + sidebarDepth: item.sidebarDepth, + children: children.map(child => resolveItem(child, pages, base, groupDepth + 1)), + collapsable: item.collapsable !== false + } + } +}