删除旧主题

This commit is contained in:
结发受长生 2019-04-14 17:54:17 +08:00
parent 9aad0275e8
commit ed6e66780e
158 changed files with 0 additions and 28661 deletions

View File

@ -1,148 +0,0 @@
# Xups 主题安装及 Hexo 使用教程
![预览](./xups.png)
## 主题的一些特性
1. 扁平。思路源于大前端 WordPress 主题。
2. 自带博客评论系统。博客主题自带评论系统,基于 github issues 实现,了解更多请点击[基于 github issues实现的评论框](http://jelon.top/posts/xups-comment-box/)。
## 使用指引
1. 安装hexo
```
npm i hexo-cli -g
hexo init blog
cd blog
npm install
```
2. 将主题拉到本地,并解压
```
cd themes
git clone https://github.com/jangdelong/hexo-theme-xups.git
```
3. 配置 _config.yml 的 theme 配置
```
theme: hexo-theme-xups
```
4. 运行 `hexo s --watch`
```
cd ..
hexo generate # 或者 hexo g
hexo s --watch
```
运行上述命令后,浏览器打开 [http://localhost:4000](http://localhost:4000) 即可本地访问我们的网站
## 创建文章
有两种方法创建文章,可任选其一:
> 注意:文件名不要出现中文!!!
1. 使用`hexo new` 命令
``` bash
$ hexo new "My New Post"
```
2. 拷贝现有的文章进行修改
hexo使用markdown来编辑文章在source目录下拷贝任意md文件进行创建新的文章。具体可参考下hexo的官方说明
## 文章规范
1. 使用markdown写博文
2. 建议图片进行单独 cdn 存储
3. 标准配图
- xups主题现默认有0-9共10张博客配图
- 博客封面配图200x140命名xxx_thumbnail
4. 指明文章的标题、作者信息、封面图片地址、博客摘要
```
---
title: {{ title }}
date: {{ date }}
author:
tags:
categories:
- Web技术
- 生活琐事
thumbnail:
blogexcerpt:
---
```
> 另外, 如果您需保留原主题的关于页about、留言页面comment、实验室页lab的话 请将 __source/ 目录下的 about/、comment/、lab/ 三个目录及里面的页面放到您的 Hexo 程序的 source 目录下注意不是theme主题下的目录将 __scaffolds 目录下的 draft.md、page.md、post.md 放到 Hexo 程序的 scaffolds 目录注意不是theme主题下的目录
5. 利用`<!-- more --> `或者`post.blogexcerpt`设置文章的摘要
示例:
```
---
title: 文章标题
blogexcerpt: 这里是自定义文章摘要
...
---
这里是文章正文内容
...
```
这部分是文章摘要这部分是文章摘要。在hexo模版里可通过 `<%- post.blogexcerpt || post.excerpt || post.content %>` 来引用。
- post.blogexcerpt自定义摘要
- post.excerpt通过`<!-- more -->`分隔符来获取的文章摘要
- post.content如不设置摘要情况则直接输出文章全部内容
## 评论系统
1. 创建 Github Application
2. 创建仓库
3. 主题 _config.yml 配置
```python
#----------------------------
# 是否开启评论
#----------------------------
comment:
enable: false # 是否开启配置
owner: jangdelong # 你的 github 账户名
repo: blog_comments # github repository
client_id: xxxxxxxxxx # github application client id
client_secret: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # github application secret
```
4. 评论框使用
```html
<div id="comments" class="comment">
</div>
<script>
JELON.Comment({
container: 'comments', // 评论框容器id或对象留空是默认为 comments
label: '<%- post.slug %>' || '<%- post.path %>', // 文章标签
owner: '<%- theme.comment.owner %>', // GitHub application 创建者
repo: '<%- theme.comment.repo %>', // issue 所在仓库名
clientId: '<%- theme.comment.client_id %>', // GitHub application client_id
clientSecret: '<%- theme.comment.client_secret %>' // GitHub application client_secret
});
</script>
```
## 其他
- [Jelon前端小站](http://jelon.top)
## LICENCE
The MIT License (MIT)

View File

@ -1,10 +0,0 @@
---
title: {{ title }}
author:
tags:
categories:
- Web技术
- 生活琐事
thumbnail:
blogexcerpt:
---

View File

@ -1,4 +0,0 @@
---
title: {{ title }}
date: {{ date }}
---

View File

@ -1,10 +0,0 @@
---
title: {{ title }}
author:
tags:
categories:
- Web技术
- 生活琐事
thumbnail:
blogexcerpt:
---

View File

@ -1,150 +0,0 @@
#############################
# Xups for Hexo 主题配置文件
# Jelon
# http://jelon.top
#############################
#----------------------------
# 头部导航
#----------------------------
menu:
home:
name: 首页
link: /
icon: icon-home
lab:
name: 归档
link: /archives/
icon: icon-drawer
about:
name: 关于
link: /about/
icon: icon-user-tie
rss:
name: RSS
link: /atom.xml
icon: icon-rss
#----------------------------
# 副导航
#----------------------------
subnav:
github: "#"
weibo: "#"
rss: "#"
zhihu: "#"
#----------------------------
# RSS
#----------------------------
rss: /atom.xml
feed:
type: atom
path: atom.xml
limit: 20
hub:
content:
content_limit: 140
content_limit_delim: ' '
#----------------------------
# Favicon
#----------------------------
favicon: /favicon.ico
#----------------------------
# 头像url
#----------------------------
avatar: https://i.loli.net/2018/05/04/5aeb37415a0dc.jpg
#----------------------------
# 是否开启分享
#----------------------------
share:
enable: true
list:
1: weibo
2: qqzone
3: qq
4: douban
#----------------------------
# 是否开启评论
#----------------------------
comment:
enable: true
owner: sookie2010
repo: hexo_blog
client_id: 90e8f648da2a669f7975
client_secret: 7d2b602616387748ef0df10f7a8a626bdfd1034c
#----------------------------
# 是否开启云标签
#----------------------------
tagcloud:
enable: true
start_color: e87474
end_color: 524ac5
#----------------------------
# 是否开启文章归档
#----------------------------
archives:
enable: true
date_format: YYYY年MM月
#----------------------------
# 常用链接
#----------------------------
links:
enable: true
list:
1:
name: 实验室
link: /lab/
target: _self
#----------------------------
# 头部链接
#----------------------------
head_links:
enable: true
list:
sup:
0:
name: Github
link: https://github.com/sookie2010
last:
name: Hosted by Coding Pages
link: https://pages.coding.me
sub:
sinaweibo:
name: 新浪微博
link: https://weibo.com/2633013641
qqweibo:
name: Facebook
link: https://www.facebook.com/profile.php?id=100016469831631
#----------------------------
# SEO
#----------------------------
SEO:
keywords: 前端, Web, Java
description: 个人前端小站
#----------------------------
# 百度分析
#----------------------------
baidu_analytics: false
#----------------------------
# 高亮样式
#----------------------------
highlight_theme: night
#----------------------------
# CDN
# 如: //7xs305.com1.z0.glb.clouddn.com/
# 主要以下两个目录进行 cdn 存储
# - img 图片资源下的 thumbnail 目录
# - css 样式资源下的 fonts 目录
#----------------------------
CDN: https://blog-cdn.nos-eastchina1.126.net/

View File

@ -1,53 +0,0 @@
<!-- 自定义关于页 -->
<p style="color: #444;">
<span class="icon-cogs"></span>
关于我
</p>
<ul style="list-style-type: none;">
<li>
<span class="icon-profile"></span>
查看<a href="javascript: alert('更新中...');">个人介绍</a>
</li>
<li>
<span class="icon-newspaper"></span>
现工作于北京,任职前端开发
</li>
<li>
<span class="icon-envelop"></span>
联系邮箱 init_pro#aliyun.com'#'改为'@'
</li>
</ul>
<p style="color: #444;">
<span class="icon-cogs"></span>
关于博客
</p>
<ul style="list-style-type: none;">
<li>
<span class="icon-files-empty"></span>
博客采用<a href="https://hexo.io/">Hexo</a>静态博客系统、主题为<a href="https://github.com/jangdelong/hexo-theme-xups" target="_blank">Xups</a> (<a href="https://hexo.io/themes/" target="_blank">Hexo 官网</a>已收录)
</li>
<li>
<span class="icon-files-empty"></span>
博客内容主要是学习工作过程中的一些Web总结和日志琐事除非特殊声明博客内容皆为个人原创转载烦请标注文章来源
</li>
<li>
<span class="icon-files-empty"></span>
为了提升博客的访问速度,博客的字体文件以及绝大部分图片采用了某 CDN 存储,代码托管采用 <a target="_blank" href="https://coding.net/">Coding</a>
</li>
</ul>
<p style="color: #444;">
<span class="icon-cogs"></span>
Github账号
</p>
<ul style="list-style-type: none;">
<li>
<span class="icon-github"></span>
<a href="https://github.com/sookie2010" target="_blank">我的Github</a>
</li>
</ul>

View File

@ -1,7 +0,0 @@
<%- page.content %>
<style>
</style>

View File

@ -1,65 +0,0 @@
<!-- 文章 -->
<article class="post">
<header>
<!-- 分类 -->
<% if (post.categories && post.categories.length) { %>
<%-
list_categories(post.categories, {
show_count: false,
class: 'cat',
style: 'none',
separator: '|'
})
%>
<% } else { %>
<a href="javascript: void(0);" class="cat">未分类</a>
<% } %>
<!-- 文章标题 -->
<%- partial('post/title', { class_name: 'post-title' }) %>
</header>
<p class="post-meta">
<%- post.author || config.author %> 发表于
<%- partial('post/date', { date_format: 'YYYY-MM-DD' }) %>
&nbsp;&nbsp;
<span class="post-tags">
标签:
<%- partial('post/tag') %>
</span>
</p>
<div class="post-content">
<div class="post-excerpt">
<% if (index == true) { %>
<%- post.blogexcerpt || post.excerpt || post.content %>
<% } %>
<p class="more">
<a href="<%- url_for(post.permalink) %>">阅读全文</a>
</p>
</div>
<div class="post-thumbnail" data-img="<%- post.photos[0] %>">
<a href="<%= post.permalink %>" title="<%= post.title %>">
<%
var numSum = 0
let dateNum = parseInt(date(post.date, 'YYYYMMDDHHmmss'))
let mutipart = 10
while(dateNum % mutipart != dateNum) {
numSum += Math.floor(dateNum % mutipart / (mutipart/10))
mutipart *= 10
}
if (post.thumbnail) {
%>
<!--
<%- image_tag(post.thumbnail, { class: "thumbnail" }) %>
-->
<img class="thumbnail" src="<%- url_for('img/default-image.jpg') %>" data-echo="<%= post.thumbnail %>" alt="<%= post.title %>" >
<% } else if (post.photos.length) { %>
<img class="thumbnail" src="<%- url_for('img/default-image.jpg') %>" data-echo="<%= url_for(post.photos[0]) %>" alt="<%= post.title %>" >
<% } else if (theme.CDN) { %>
<img class="thumbnail" src="<%- url_for('img/default-image.jpg') %>" data-echo="<%- url_for(theme.CDN + 'thumbnail/' + numSum%10 + '.jpg') %>" alt="默认配图" >
<% } else { %>
<img class="thumbnail" src="<%- url_for('img/default-image.jpg') %>" data-echo="<%- url_for('img/thumbnail/' + numSum%10 + '.jpg') %>" alt="默认配图" >
<% } %>
</a>
</div>
</div>
</article>

View File

@ -1,63 +0,0 @@
<h3 class="widget-hd">
<strong>
<% if (pagination == 1) { %>
最近动态
<% } else if (pagination == 2) { %>
<%- page.category %> 分类下的文章
<% } else if (pagination == 3) { %>
<%- page.tag %> 标签下的文章
<% } else { %>
文章归档
<% } %>
</strong>
</h3>
<%
if(pagination) {
page.posts.each(function(post) {
%>
<%-partial('archive-post', { post: post }) %>
<%
})
} else {
let lastYear, lastMonth;
let currentPosts = [];
site.posts.each(function(post) {
if((post.date.year() == page.year || !page.year) && (post.date.month()+1 == page.month || !page.month)) {
currentPosts.push(post)
}
})
currentPosts.sort(function(a, b){ return b.date - a.date;});
currentPosts.forEach(function(post) {
if(post.date.year() !== lastYear || post.date.month()+1 !== lastMonth) {
if(lastYear && lastMonth) { %> </ul> <% }
%>
<h3 class="widget-date">
<strong><%= post.date.year() %>年<%= post.date.month()+1 %>月</strong>
</h3>
<ul class="archive-wapper">
<%
}
%>
<li class="archive-item">
<a href="<%=url_for(post.permalink) %>">
<span class="title"><%=post.title %></span>
<span class="date">---- <%=date(post.date, 'YYYY-MM-DD HH:mm') %></span>
</a>
</li>
<%
lastYear = post.date.year();
lastMonth = post.date.month()+1;
})
%> </ul> <%
}
%>
<% if (pagination && page.total >= 1){ %>
<nav class="page-navigator">
<%- paginator({
prev_text: '前一页',
next_text: '后一页'
}) %>
</nav>
<% } %>

View File

@ -1,35 +0,0 @@
<!-- 文章 -->
<article class="post article">
<header class="text-center">
<h3 class="post-title"><span><%= post.title %></span></h3>
</header>
<p class="post-meta text-center">
<%- post.author || '柠烟夏季' %> 发表于
<%- partial('post/date', { date_format: 'YYYY-MM-DD HH:mm' }) %>
</p>
<div class="post-content">
<%- post.content %>
</div>
<p class="post-meta">
<span class="post-cat">分类:
<%-
list_categories(post.categories, {
show_count: false,
class: 'cat',
style: 'none',
separator: '|'
})
%>
</span>
<span class="post-tags">
标签:
<%- partial('post/tag') %>
</span>
</p>
</article>
<!-- 分享按钮 -->
<%- partial('post/share') %>
<%- partial('post/nav', { post: post }) %>
<!-- 文章评论 -->
<%- partial('post/comment') %>

View File

@ -1,11 +0,0 @@
<% if (theme.baidu_analytics) { %>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?fd459238242776d173cdc64918fb32f2";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
<% } %>

View File

@ -1,13 +0,0 @@
<footer class="footer">
&copy;
<% if (new Date().getFullYear() == 2016) { %>
<%- new Date().getFullYear() %>
<% } else { %>
2016-<%- new Date().getFullYear() %>
<% } %>
<a href="<%- url_for() %>">Power By Hexo</a>
</footer>
<div class="back-to-top" id="JELON__backToTop" title="返回顶部">返回顶部</div>
<script src="<%=config.root %>js/lib/require.min.js" defer async="true"
data-main="<%=config.root %>js/main.js"></script>

View File

@ -1,55 +0,0 @@
<!doctype html>
<html lang="zh-CN">
<!--
..
.' @`._
~ ...._.' ,__.-;
_..------/` .-' ~
: __./' , .'-'--.._
~ `---(.-'''---. \`._ `. ~
_.--'( .______.'.-' `-.` `.
: `-..____`-. ;
`. ```` 稻花香里说丰年, ; ~
`-.__ 听取人生经验。 __.-'
````-----.......-----''' ~
~ ~
-->
<head>
<meta charset="UTF-8" >
<meta http-equiv="X-UA-Compatible" content="IE=11,IE=10,IE=9,IE=8" >
<meta name="baidu-site-verification" content="dIcXMeY8Ya" />
<%
var title = page.title;
if (is_archive()) {
title = '文章归档';
if (is_month()){
title += ': ' + page.year + '/' + page.month;
} else if (is_year()) {
title += ': ' + page.year;
}
} else if (is_category()) {
title = '`' + page.category + '`分类下的文章';
} else if (is_tag()) {
title = '`' + page.tag + '`标签下的文章';
}
%>
<title><% if (title) { %><%= title %> | <% } %><%= config.title %></title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" >
<meta name="keywords" content="<%- theme.SEO.keywords %>" >
<meta name="description" content="<%- theme.SEO.description %>" >
<% if (theme.rss) { %>
<link rel="alternative" href="<%- theme.rss %>" title="<%= config.title %>" type="application/atom+xml" >
<% } %>
<% if (config.favicon) { %>
<link rel="shortcut icon" href="<%- url_for(config.favicon) %>" >
<% } else { %>
<link rel="shortcut icon" href="<%- url_for(theme.favicon) %>" >
<% } %>
<%- css('css/style') %>
<!--[if lt IE 9]>
<%- js('js/html5') %>
<![endif]-->
<%- partial('baidu-analytics') %>
</head>

View File

@ -1,65 +0,0 @@
<header class="header">
<section class="container header-main">
<div class="logo">
<a href="<%- url_for() %>">
<div class="cover">
<div class="name"><%= config.title %></div>
<div class="description"><%= config.subtitle %></div>
</div>
</a>
</div>
<div class="dropnav icon-paragraph-justify" id="JELON__btnDropNav"></div>
<!-- 导航栏 -->
<ul class="menu hidden" id="JELON__menu">
<% for (var i in theme.menu) { %>
<li rel="<%= url_for(path) %>" class="item <%= url_for(theme.menu[i].link) == url_for(path).substring(0, url_for(path).lastIndexOf('/') + 1) ? 'current' : '' %>">
<a href="<%= url_for(theme.menu[i].link) %>" title="<%= theme.menu[i].name %>" class="<%= theme.menu[i].icon %>">&nbsp;<%= theme.menu[i].name %></a>
</li>
<% } %>
</ul>
<!-- 搜索框 -->
<div id="search-box">
<div class="icon"><span class="icon-search"></span></div>
<div class="input-box"><input type="text" id="search-input" v-model="queryText" @focus="searchInit" placeholder="站内搜索"/></div>
<!-- 搜索结果区 -->
<div id="search-result-box" >
<ul class="search-result-list" v-if="searchResult.length && !searchIniting">
<li v-for="(article,index) in searchResult" :key="index">
<a :href='article.url' class='search-result-title' target='_blank'>{{article.title || '无标题'}}</a>
<p class="search-result" v-html="article.matchContent"></p>
</li>
</ul>
<!-- 搜索未初始化完毕时显示 -->
<div style="text-align:center;padding:10px 0" v-else-if="searchIniting">
<img src="<%= config.root%>img/loading-bar.gif" style="height:8px;width:auto"/>
</div>
<!-- 无匹配时显示 -->
<p class="search-result" v-else>没有搜索到任何结果</p>
</div>
</div>
<div class="profile clearfix">
<div class="feeds fl">
<% if (theme.head_links.enable) { %>
<%
var supList = theme.head_links.list.sup,
subList = theme.head_links.list.sub;
%>
<p class="links">
<% for (var i in supList) { %>
<a href="<%= supList[i]['link'] %>" target="_blank"><%= supList[i]['name'] %></a>
<% if (i != 'last') { %>|<% } %>
<% } %>
</p>
<p class="sns">
<% for (var j in subList) { %>
<a href="<%= subList[j]['link'] %>" class="<%= j %>" target="_blank"><b>■</b> <%= subList[j]['name'] %></a>
<% } %>
</p>
<% } %>
</div>
<div class="avatar fr">
<img src="<%- theme.avatar %>" alt="avatar" title="Sookie">
</div>
</div>
</section>
</header>

View File

@ -1,14 +0,0 @@
<% if (theme.comment.enable) { %>
<%- js('js/comment') %>
<div id="comments" class="comment"></div>
<script>
JELON.Comment({
container: 'comments',
label: '<%- post.slug %>' || '<%- post.path %>',
owner: '<%- theme.comment.owner %>',
repo: '<%- theme.comment.repo %>',
clientId: '<%- theme.comment.client_id %>',
clientSecret: '<%- theme.comment.client_secret %>'
});
</script>
<% } %>

View File

@ -1 +0,0 @@
<time datetime="<%= date_xml(post.date) %>"><%= date(post.date, date_format) %></time>

View File

@ -1,40 +0,0 @@
<!-- 上一篇/下一篇 -->
<% if (post.prev || post.next) { %>
<div class="article-nav clearfix">
<% if (post.prev) { %>
<span class="prev fl">
上一篇<br >
<a href="<%- url_for(post.prev.path) %>">
<% if (post.prev.title) { %>
<%= post.prev.title %>
<% } else { %>
无标题
<% } %>
</a>
</span>
<% } else { %>
<span class="prev fl">
上一篇<br >
<a href="javascript: void(0);">没有上一篇了</a>
</span>
<% } %>
<% if (post.next) { %>
<span class="next fr">
下一篇<br >
<a href="<%- url_for(post.next.path) %>">
<% if (post.next.title) { %>
<%= post.next.title %>
<% } else { %>
无标题
<% } %>
</a>
</span>
<% } else { %>
<span class="next fr">
下一篇<br >
<a href="javascript: void(0);">没有下一篇了</a>
</span>
<% } %>
</div>
<% } %>

View File

@ -1,10 +0,0 @@
<% if (theme.share.enable) { %>
<div class="article-share clearfix text-center">
<div class="share-area">
<span class="share-txt">分享到:</span>
<% for (let i in theme.share.list) { %>
<a href="javascript:void(0);" class="share-icon <%= theme.share.list[i] %>" onclick="JELON.Utils.share('<%= theme.share.list[i] %>')"></a>
<% } %>
</div>
</div>
<% } %>

View File

@ -1,5 +0,0 @@
<% if (post.tags && post.tags.length) { %>
<% post.tags.forEach(function(tag, i) { %>
<%- link_to(tag.path, tag.name) %><% if (i != post.tags.length - 1) { %> / <% } %>
<% }); %>
<% } %>

View File

@ -1,13 +0,0 @@
<% if (post.link) { %>
<h3 class="<%= class_name || 'post-title' %>">
<a href="<%= url_for(post.link) %>">
<%= post.title || post.link %>
</a>
</h3>
<% } else if (post.title) { %>
<h3 class="<%= class_name || 'post-title' %>">
<a href="<%= url_for(post.permalink) %>">
<%= post.title %>
</a>
</h3>
<% } %>

View File

@ -1,30 +0,0 @@
<!-- 侧栏部分 -->
<aside class="sidebar">
<section class="widget">
<h3 class="widget-hd"><strong>文章分类</strong></h3>
<%- partial('_widget/categorys') %>
</section>
<% if (theme.tagcloud.enable) { %>
<section class="widget">
<h3 class="widget-hd"><strong>热门标签</strong></h3>
<%- partial('_widget/tags_cloud') %>
</section>
<% } %>
<% if (theme.archives.enable) { %>
<section class="widget">
<h3 class="widget-hd"><strong>文章归档</strong></h3>
<%- list_archives({format: theme.archives.date_format}) %>
</section>
<% } %>
<% if (theme.links.enable && theme.links['list']) { %>
<!-- 常用链接 -->
<section class="widget">
<h3 class="widget-hd"><strong>常用链接</strong></h3>
<%- partial('_widget/links') %>
</section>
<% } %>
</aside>
<!-- / 侧栏部分 -->

View File

@ -1,9 +0,0 @@
<!-- 文章分类 -->
<ul class="widget-bd">
<% site.categories.forEach(function(cat){ %>
<li>
<a href="<%= url_for(cat.path) %>"><%= cat.name %></a>
<span class="badge"><%= cat.length %></span>
</li>
<% }); %>
</ul>

View File

@ -1,8 +0,0 @@
<!-- 常用链接 -->
<ul class="widget-bd">
<% for (var i in theme.links['list']) { %>
<li>
<a href="<%= theme.links.list[i].link %>" target="<%= theme.links.list[i].target || '_blank' %>" ><%= theme.links.list[i].name %></a>
</li>
<% } %>
</ul>

View File

@ -1,11 +0,0 @@
<!-- 标签云 -->
<div class="tags-cloud">
<%- tagcloud({
min_font: 14,
max_font: 30,
amount: 999,
color: true,
start_color: '#'+theme.tagcloud.start_color,
end_color: '#'+theme.tagcloud.end_color
}) %>
</div>

View File

@ -1,2 +0,0 @@
<!-- 文章归档 -->
<%- partial('_partial/archive', { pagination: false, index: true }) %>

View File

@ -1,2 +0,0 @@
<!-- 文章分类 -->
<%- partial('_partial/archive', { pagination: 2, index: true }) %>

View File

@ -1,6 +0,0 @@
<!-- 首页 -->
<% if (page.content) { %>
<%- page.content %>
<% } else { %>
<%- partial('_partial/archive', { pagination: 1, index: true }) %>
<% } %>

View File

@ -1,29 +0,0 @@
<%- partial('_partial/head') %>
<body class="home">
<!--[if lt IE 9]>
<div class="browsehappy">
当前网页 <strong>不支持</strong>
你正在使用的浏览器. 为了正常的访问, 请 <a href="http://browsehappy.com/">升级你的浏览器</a>.
</div>
<![endif]-->
<!-- 博客头部 -->
<%- partial('_partial/header') %>
<!-- 看板娘 -->
<div class="banner">
<div class="banner-tips"></div>
<canvas id="live2d" width="280" height="250" class="live2d"></canvas>
</div>
<!-- 博客正文 -->
<div class="container body clearfix">
<section class="content">
<div class="content-main widget">
<%- body %>
</div>
</section>
<%- partial('_partial/sidebar') %>
</div>
<!-- 博客底部 -->
<%- partial('_partial/footer') %>
</body>
</html>

View File

@ -1,13 +0,0 @@
<!-- 独立页面 -->
<article class="post article">
<header class="text-center">
<h4 class="post-title"><a href="javascript: void(0);"><%- page.title %></a></h4>
</header>
<div class="post-content">
<% if (page.pageid) { %>
<%- partial('_custom/' + page.pageid, { page: page, post: page }) %>
<% } else { %>
<%- page.content %>
<% } %>
</div>
</article>

View File

@ -1,2 +0,0 @@
<!-- 文章页 -->
<%- partial('_partial/article', { index: false, post: page }) %>

View File

@ -1,2 +0,0 @@
<!-- 按标签分类 -->
<%- partial('_partial/archive', { pagination: 3, index: true }) %>

View File

@ -1,83 +0,0 @@
/*!
* icon
* $CDN = hexo-config("CDN") || '//7xs305.com1.z0.glb.clouddn.com/'
*/
$CDN = (hexo-config("CDN") || './')+'fonts/'
@font-face
font-family "HomizioNova"
src url($CDN + 'homizio-nova/light.ttf') format('truetype'),
url($CDN + 'homizio-nova/light.eot') format('embedded-opentype')
font-weight normal
font-style normal
@font-face
font-family "HomizioNova"
src url($CDN + 'homizio-nova/light_italic.ttf') format('truetype'),
url($CDN + 'homizio-nova/light_italic.eot') format('embedded-opentype')
font-weight normal
font-style italic
@font-face
font-family "HomizioNova"
src url($CDN + 'homizio-nova/regular.ttf') format('truetype'),
url($CDN + 'homizio-nova/regular.eot') format('embedded-opentype')
font-weight bold
font-style normal
@font-face
font-family "HomizioNova"
src url($CDN + 'homizio-nova/italic.ttf') format('truetype'),
url($CDN + 'homizio-nova/italic.eot') format('embedded-opentype')
font-weight bold
font-style italic
@font-face
font-family 'icomoon'
src url('./fonts/icomoon/icomoon.eot') format('embedded-opentype'),
url('./fonts/icomoon/icomoon.woff') format('woff'),
url('./fonts/icomoon/icomoon.ttf') format('truetype'),
url('./fonts/icomoon/icomoon.svg') format('svg')
font-weight normal
font-style normal
[class^="icon-"],[class*=" icon-"]
font-family 'icomoon'
speak none
font-style normal
font-weight normal
font-variant normal
text-transform none
line-height 1
-webkit-font-smoothing antialiased
-moz-osx-font-smoothing grayscale
.icon-home:before {
content: "\e900";
}
.icon-drawer:before {
content: "\e95c";
}
.icon-user-tie:before {
content: "\e976";
}
.icon-search:before {
content: "\e986";
}
.icon-cogs:before {
content: "\e995";
}
.icon-lab:before {
content: "\e9aa";
}
.icon-google-plus2:before {
content: "\ea8c";
}
.icon-facebook2:before {
content: "\ea91";
}
.icon-sina-weibo:before {
content: "\ea9a";
}
.icon-rss:before {
content: "\ea9b";
}
.icon-github:before {
content: "\eab0";
}

View File

@ -1,51 +0,0 @@
/*!
*
*/
.container
max-width 1180px
min-width 1070px
background-color c-fff
margin 0 auto 10px
text-left()
.home
//margin-top 78px
background-color c-eee
.btn
background-color #ff5e52
border 0
color c-fff
opacity .8
box-sizing border-box
&:hover
opacity .75
.btn-ok
background-color #ff5e52
.btn-cancel
background-color #51cc87
.form-control
box-sizing border-box
.browsehappy
padding 8px 0
background #fbe3e4
color #8a1f11
text-align center
.loading-mask
position fixed
top 0
right 0
left 0
bottom 0
display block
width 100%
height 100%
background-color rgb(255, 255, 255)
opacity .8
.loading-icon
position relative
top 50%
left 50%
width 50px
height 50px
margin-top -25px
margin-left -25px

View File

@ -1,157 +0,0 @@
html
font-family sans-serif
-ms-text-size-adjust 100%
-webkit-text-size-adjust 100%
body
margin: 0
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary
display block
audio,
canvas,
progress,
video
display inline-block
vertical-align baseline
audio:not([controls])
display none
height 0
[hidden],
template
display none
a
background-color transparent
a:active,
a:hover
outline: 0
abbr[title]
border-bottom 1px dotted
b,
strong
font-weight bold
dfn
font-style italic
h1
font-size 2em
margin 0.67em 0
mark
background #ff0
color #000
small
font-size 80%
sub,
sup
font-size 75%
line-height 0
position relative
vertical-align baseline
sup
top -0.5em
sub
bottom -0.25em
img
border 0
svg:not(:root)
overflow hidden
figure
margin 1em 40px
hr
-moz-box-sizing content-box
box-sizing content-box
height 0
pre
overflow auto
code,
kbd,
pre,
samp
font-family 'Source Code Pro',Consola,monospace
font-size 1em
button,
input,
optgroup,
select,
textarea
color inherit /* 1 */
font inherit /* 2 */
margin 0 /* 3 */
button
overflow visible
button,
select
text-transform none
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"]
-webkit-appearance button /* 2 */
cursor pointer /* 3 */
button[disabled],
html input[disabled]
cursor default
button::-moz-focus-inner,
input::-moz-focus-inner
border 0
padding 0
input
line-height normal
input[type="checkbox"],
input[type="radio"]
box-sizing border-box /* 1 */
padding 0 /* 2 */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button
height auto
input[type="search"]
-webkit-appearance textfield /* 1 */
-moz-box-sizing content-box
-webkit-box-sizing content-box /* 2 */
box-sizing content-box
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration
-webkit-appearance none
fieldset
border 1px solid #c0c0c0
margin 0 2px
padding 0.35em 0.625em 0.75em
legend
border 0
padding 0
textarea
overflow auto
optgroup
font-weight: bold
table
border-collapse collapse
border-spacing 0
td,
th
padding 0

View File

@ -1,48 +0,0 @@
/*!
* Reset css
*/
::selection
color c-fff
background-color #f99
opacity .8
::-webkit-scrollbar
width 7px
height 4px
::-webkit-scrollbar-thumb
border-radius 4px
background rgba(0, 0, 0, .15)
::-webkit-scrollbar-track
background rgba(0, 0, 0, .06)
body
font 14px/1.5 "Microsoft Yahei", "", Arial, ""
color c-666
-webkit-overflow-scrolling touch // iOS
-webkit-font-smoothing antialiased //
-webkit-text-size-adjust 100%
-ms-text-size-adjust 100%
text-rendering optimizelegibility
a
color c-666
text-decoration none
&:link,
&:visited,
&:active
color c-666
&:hover
color #ff5e52
hr
border-top 1px solid c-eee
.fl
float left
.fr
float right
.text-center
text-center()
.clearfix
zoom 1
&:after
display block
width 100%
height 0
content " "
clear both

View File

@ -1,65 +0,0 @@
$base-style
h1
font-size: 2em
h2
font-size: 1.6em
h3
font-size: 1.4em
h4
font-size: 1.2em
h5
font-size: 1em
h6
font-size: 1em
color: #999
hr
border: 1px dashed #ddd
strong
font-weight: bold
em, cite
font-style: italic
sup, sub
font-size: 0.75em
line-height: 0
position: relative
vertical-align: baseline
sup
top: -0.5em
sub
bottom: -0.2em
small
font-size: 0.85em
acronym, abbr
border-bottom: 1px dotted
ul, ol, dl
margin: 0 20px
padding: 0
line-height: line-height
ul, ol
ul, ol
margin-top: 0
margin-bottom: 0
ul
list-style: disc
ol
list-style: decimal
dt
font-weight: bold
table
display: table;
font-size: 12px;
background-color: transparent;
border: 1px solid #ddd;
box-sizing: border-box;
word-wrap: break-word;
th, td
border-bottom: solid 1px #ddd;
border-right: solid 1px #ddd;
padding: 5px 10px;
thead tr
background-color: #f6f6f6;
blockquote
margin 1em 0
padding 5px 10px
color #666
border-left 2px solid #eee

View File

@ -1,699 +0,0 @@
@font-face {
font-family: octicons-link;
src: url("data:font/woff;charset=utf-8;base64,d09GRgABAAAAAAZwABAAAAAACFQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABEU0lHAAAGaAAAAAgAAAAIAAAAAUdTVUIAAAZcAAAACgAAAAoAAQAAT1MvMgAAAyQAAABJAAAAYFYEU3RjbWFwAAADcAAAAEUAAACAAJThvmN2dCAAAATkAAAABAAAAAQAAAAAZnBnbQAAA7gAAACyAAABCUM+8IhnYXNwAAAGTAAAABAAAAAQABoAI2dseWYAAAFsAAABPAAAAZwcEq9taGVhZAAAAsgAAAA0AAAANgh4a91oaGVhAAADCAAAABoAAAAkCA8DRGhtdHgAAAL8AAAADAAAAAwGAACfbG9jYQAAAsAAAAAIAAAACABiATBtYXhwAAACqAAAABgAAAAgAA8ASm5hbWUAAAToAAABQgAAAlXu73sOcG9zdAAABiwAAAAeAAAAME3QpOBwcmVwAAAEbAAAAHYAAAB/aFGpk3jaTY6xa8JAGMW/O62BDi0tJLYQincXEypYIiGJjSgHniQ6umTsUEyLm5BV6NDBP8Tpts6F0v+k/0an2i+itHDw3v2+9+DBKTzsJNnWJNTgHEy4BgG3EMI9DCEDOGEXzDADU5hBKMIgNPZqoD3SilVaXZCER3/I7AtxEJLtzzuZfI+VVkprxTlXShWKb3TBecG11rwoNlmmn1P2WYcJczl32etSpKnziC7lQyWe1smVPy/Lt7Kc+0vWY/gAgIIEqAN9we0pwKXreiMasxvabDQMM4riO+qxM2ogwDGOZTXxwxDiycQIcoYFBLj5K3EIaSctAq2kTYiw+ymhce7vwM9jSqO8JyVd5RH9gyTt2+J/yUmYlIR0s04n6+7Vm1ozezUeLEaUjhaDSuXHwVRgvLJn1tQ7xiuVv/ocTRF42mNgZGBgYGbwZOBiAAFGJBIMAAizAFoAAABiAGIAznjaY2BkYGAA4in8zwXi+W2+MjCzMIDApSwvXzC97Z4Ig8N/BxYGZgcgl52BCSQKAA3jCV8CAABfAAAAAAQAAEB42mNgZGBg4f3vACQZQABIMjKgAmYAKEgBXgAAeNpjYGY6wTiBgZWBg2kmUxoDA4MPhGZMYzBi1AHygVLYQUCaawqDA4PChxhmh/8ODDEsvAwHgMKMIDnGL0x7gJQCAwMAJd4MFwAAAHjaY2BgYGaA4DAGRgYQkAHyGMF8NgYrIM3JIAGVYYDT+AEjAwuDFpBmA9KMDEwMCh9i/v8H8sH0/4dQc1iAmAkALaUKLgAAAHjaTY9LDsIgEIbtgqHUPpDi3gPoBVyRTmTddOmqTXThEXqrob2gQ1FjwpDvfwCBdmdXC5AVKFu3e5MfNFJ29KTQT48Ob9/lqYwOGZxeUelN2U2R6+cArgtCJpauW7UQBqnFkUsjAY/kOU1cP+DAgvxwn1chZDwUbd6CFimGXwzwF6tPbFIcjEl+vvmM/byA48e6tWrKArm4ZJlCbdsrxksL1AwWn/yBSJKpYbq8AXaaTb8AAHja28jAwOC00ZrBeQNDQOWO//sdBBgYGRiYWYAEELEwMTE4uzo5Zzo5b2BxdnFOcALxNjA6b2ByTswC8jYwg0VlNuoCTWAMqNzMzsoK1rEhNqByEyerg5PMJlYuVueETKcd/89uBpnpvIEVomeHLoMsAAe1Id4AAAAAAAB42oWQT07CQBTGv0JBhagk7HQzKxca2sJCE1hDt4QF+9JOS0nbaaYDCQfwCJ7Au3AHj+LO13FMmm6cl7785vven0kBjHCBhfpYuNa5Ph1c0e2Xu3jEvWG7UdPDLZ4N92nOm+EBXuAbHmIMSRMs+4aUEd4Nd3CHD8NdvOLTsA2GL8M9PODbcL+hD7C1xoaHeLJSEao0FEW14ckxC+TU8TxvsY6X0eLPmRhry2WVioLpkrbp84LLQPGI7c6sOiUzpWIWS5GzlSgUzzLBSikOPFTOXqly7rqx0Z1Q5BAIoZBSFihQYQOOBEdkCOgXTOHA07HAGjGWiIjaPZNW13/+lm6S9FT7rLHFJ6fQbkATOG1j2OFMucKJJsxIVfQORl+9Jyda6Sl1dUYhSCm1dyClfoeDve4qMYdLEbfqHf3O/AdDumsjAAB42mNgYoAAZQYjBmyAGYQZmdhL8zLdDEydARfoAqIAAAABAAMABwAKABMAB///AA8AAQAAAAAAAAAAAAAAAAABAAAAAA==") format('woff');
}
$markdown-style
.markdown-body
-ms-text-size-adjust 100%;
-webkit-text-size-adjust: 100%;
line-height: 1.5;
color: #24292e;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 16px;
line-height: 1.5;
word-wrap: break-word;
.markdown-body .pl-c {
color: #6a737d;
}
.markdown-body .pl-c1,
.markdown-body .pl-s .pl-v {
color: #005cc5;
}
.markdown-body .pl-e,
.markdown-body .pl-en {
color: #6f42c1;
}
.markdown-body .pl-smi,
.markdown-body .pl-s .pl-s1 {
color: #24292e;
}
.markdown-body .pl-ent {
color: #22863a;
}
.markdown-body .pl-k {
color: #d73a49;
}
.markdown-body .pl-s,
.markdown-body .pl-pds,
.markdown-body .pl-s .pl-pse .pl-s1,
.markdown-body .pl-sr,
.markdown-body .pl-sr .pl-cce,
.markdown-body .pl-sr .pl-sre,
.markdown-body .pl-sr .pl-sra {
color: #032f62;
}
.markdown-body .pl-v,
.markdown-body .pl-smw {
color: #e36209;
}
.markdown-body .pl-bu {
color: #b31d28;
}
.markdown-body .pl-ii {
color: #fafbfc;
background-color: #b31d28;
}
.markdown-body .pl-c2 {
color: #fafbfc;
background-color: #d73a49;
}
.markdown-body .pl-c2::before {
content: "^M";
}
.markdown-body .pl-sr .pl-cce {
font-weight: bold;
color: #22863a;
}
.markdown-body .pl-ml {
color: #735c0f;
}
.markdown-body .pl-mh,
.markdown-body .pl-mh .pl-en,
.markdown-body .pl-ms {
font-weight: bold;
color: #005cc5;
}
.markdown-body .pl-mi {
font-style: italic;
color: #24292e;
}
.markdown-body .pl-mb {
font-weight: bold;
color: #24292e;
}
.markdown-body .pl-md {
color: #b31d28;
background-color: #ffeef0;
}
.markdown-body .pl-mi1 {
color: #22863a;
background-color: #f0fff4;
}
.markdown-body .pl-mc {
color: #e36209;
background-color: #ffebda;
}
.markdown-body .pl-mi2 {
color: #f6f8fa;
background-color: #005cc5;
}
.markdown-body .pl-mdr {
font-weight: bold;
color: #6f42c1;
}
.markdown-body .pl-ba {
color: #586069;
}
.markdown-body .pl-sg {
color: #959da5;
}
.markdown-body .pl-corl {
text-decoration: underline;
color: #032f62;
}
.markdown-body .octicon {
display: inline-block;
vertical-align: text-top;
fill: currentColor;
}
.markdown-body a {
background-color: transparent;
-webkit-text-decoration-skip: objects;
}
.markdown-body a:active,
.markdown-body a:hover {
outline-width: 0;
}
.markdown-body strong {
font-weight: inherit;
}
.markdown-body strong {
font-weight: bolder;
}
.markdown-body h1 {
font-size: 2em;
margin: 0.67em 0;
}
.markdown-body img {
border-style: none;
}
.markdown-body svg:not(:root) {
overflow: hidden;
}
.markdown-body code,
.markdown-body kbd,
.markdown-body pre {
font-family: 'Source Code Pro',Consola, monospace;
font-size: 1em;
}
.markdown-body hr {
box-sizing: content-box;
height: 0;
overflow: visible;
}
.markdown-body input {
font: inherit;
margin: 0;
}
.markdown-body input {
overflow: visible;
}
.markdown-body [type="checkbox"] {
box-sizing: border-box;
padding: 0;
}
.markdown-body * {
box-sizing: border-box;
}
.markdown-body input {
font-family: inherit;
font-size: inherit;
line-height: inherit;
}
.markdown-body a {
color: #0366d6;
text-decoration: none;
}
.markdown-body a:hover {
text-decoration: underline;
}
.markdown-body strong {
font-weight: 600;
}
.markdown-body hr {
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #dfe2e5;
}
.markdown-body hr::before {
display: table;
content: "";
}
.markdown-body hr::after {
display: table;
clear: both;
content: "";
}
.markdown-body table {
border-spacing: 0;
border-collapse: collapse;
}
.markdown-body td,
.markdown-body th {
padding: 0;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body h1 {
font-size: 32px;
font-weight: 600;
}
.markdown-body h2 {
font-size: 24px;
font-weight: 600;
}
.markdown-body h3 {
font-size: 20px;
font-weight: 600;
}
.markdown-body h4 {
font-size: 16px;
font-weight: 600;
}
.markdown-body h5 {
font-size: 14px;
font-weight: 600;
}
.markdown-body h6 {
font-size: 12px;
font-weight: 600;
}
.markdown-body p {
margin-top: 0;
margin-bottom: 10px;
}
.markdown-body blockquote {
margin: 0;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 0;
margin-top: 0;
margin-bottom: 0;
}
.markdown-body ol ol,
.markdown-body ul ol {
list-style-type: lower-roman;
}
.markdown-body ul ul ol,
.markdown-body ul ol ol,
.markdown-body ol ul ol,
.markdown-body ol ol ol {
list-style-type: lower-alpha;
}
.markdown-body dd {
margin-left: 0;
}
.markdown-body code {
font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 12px;
}
.markdown-body pre {
margin-top: 0;
margin-bottom: 0;
font: 12px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.markdown-body .octicon {
vertical-align: text-bottom;
}
.markdown-body .pl-0 {
padding-left: 0 !important;
}
.markdown-body .pl-1 {
padding-left: 4px !important;
}
.markdown-body .pl-2 {
padding-left: 8px !important;
}
.markdown-body .pl-3 {
padding-left: 16px !important;
}
.markdown-body .pl-4 {
padding-left: 24px !important;
}
.markdown-body .pl-5 {
padding-left: 32px !important;
}
.markdown-body .pl-6 {
padding-left: 40px !important;
}
.markdown-body::before {
display: table;
content: "";
}
.markdown-body::after {
display: table;
clear: both;
content: "";
}
.markdown-body>*:first-child {
margin-top: 0 !important;
}
.markdown-body>*:last-child {
margin-bottom: 0 !important;
}
.markdown-body a:not([href]) {
color: inherit;
text-decoration: none;
}
.markdown-body .anchor {
float: left;
padding-right: 4px;
margin-left: -20px;
line-height: 1;
}
.markdown-body .anchor:focus {
outline: none;
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body hr {
height: 0.25em;
padding: 0;
margin: 24px 0;
background-color: #e1e4e8;
border: 0;
}
.markdown-body blockquote {
padding: 0 1em;
color: #6a737d;
border-left: 0.25em solid #dfe2e5;
}
.markdown-body blockquote>:first-child {
margin-top: 0;
}
.markdown-body blockquote>:last-child {
margin-bottom: 0;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
line-height: 10px;
color: #444d56;
vertical-align: middle;
background-color: #fafbfc;
border: solid 1px #c6cbd1;
border-bottom-color: #959da5;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #959da5;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 24px;
margin-bottom: 16px;
font-weight: 600;
line-height: 1.25;
}
.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
color: #1b1f23;
vertical-align: middle;
visibility: hidden;
}
.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
text-decoration: none;
}
.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
visibility: visible;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2em;
border-bottom: 1px solid #eaecef;
}
.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.5em;
border-bottom: 1px solid #eaecef;
}
.markdown-body h3 {
font-size: 1.25em;
}
.markdown-body h4 {
font-size: 1em;
}
.markdown-body h5 {
font-size: 0.875em;
}
.markdown-body h6 {
font-size: 0.85em;
color: #6a737d;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 2em;
}
.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body li>p {
margin-top: 16px;
}
.markdown-body li+li {
margin-top: 0.25em;
}
.markdown-body dl {
padding: 0;
}
.markdown-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: 600;
}
.markdown-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
.markdown-body table {
display: block;
width: 100%;
overflow: auto;
}
.markdown-body table th {
font-weight: 600;
}
.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 1px solid #dfe2e5;
}
.markdown-body table tr {
background-color: #fff;
border-top: 1px solid #c6cbd1;
}
.markdown-body table tr:nth-child(2n) {
background-color: #f6f8fa;
}
.markdown-body img {
max-width: 100%;
box-sizing: content-box;
background-color: #fff;
}
.markdown-body code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(27,31,35,0.05);
border-radius: 3px;
}
.markdown-body code::before,
.markdown-body code::after {
letter-spacing: -0.2em;
content: "\00a0";
}
.markdown-body pre {
word-wrap: normal;
}
.markdown-body pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.markdown-body .highlight {
margin-bottom: 16px;
}
.markdown-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}
.markdown-body .highlight pre,
.markdown-body pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f6f8fa;
border-radius: 3px;
}
.markdown-body pre code {
display: inline;
max-width: auto;
padding: 0;
margin: 0;
overflow: visible;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
.markdown-body pre code::before,
.markdown-body pre code::after {
content: normal;
}
.markdown-body .full-commit .btn-outline:not(:disabled):hover {
color: #005cc5;
border-color: #005cc5;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font: 11px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #444d56;
vertical-align: middle;
background-color: #fafbfc;
border: solid 1px #d1d5da;
border-bottom-color: #c6cbd1;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #c6cbd1;
}
.markdown-body :checked+.radio-label {
position: relative;
z-index: 1;
border-color: #0366d6;
}
.markdown-body .task-list-item {
list-style-type: none;
}
.markdown-body .task-list-item+.task-list-item {
margin-top: 3px;
}
.markdown-body .task-list-item input {
margin: 0 0.2em 0.25em -1.6em;
vertical-align: middle;
}
.markdown-body hr {
border-bottom-color: #eee;
}

View File

@ -1,75 +0,0 @@
/*!
* Article
*/
.article-nav
padding-bottom 10px
color #888
.article-share
padding 0 0 15px
.share-area
height 24px
line-height 24px
margin 0 auto
padding-left 10px
text-align left
border-left 3px solid rgba(255, 153, 153, .8)
.share-txt
float left
height 24px
line-height 24px
margin-right 5px
font-size 12px
color c-999
.share-icon
float left
display inline-block
width 24px
height 24px
margin-right 10px
background url(../img/share.png) no-repeat 0 0
opacity .9
&:hover
opacity .7
&.weibo
background-position 0 0
&.wechat
background-position 0 -32px
&.qqzone
background-position 0 -65px
&.qq
background-position 0 -98px
&.douban
background-position 0 -324px
.body
box-shadow 0 1px 5px rgba(0, 0, 0, .08)
.article
padding-top 0 !important
padding-bottom 10px
border-bottom 0
.comments
margin-top 20px
.page-navigator
margin 1em 0
padding 0 20px
list-style none
.extend
.page-number
display inline-block
margin-right 10px
padding 3px 10px
background-color c-eee
opacity .8
&.current
color c-fff
background-color #ff5e52
cursor not-allowed
.extend
a.page-number
transition .5s linear
&:hover
color c-444
background-color c-ccc
.space
display inline-block
margin-right 10px
padding 3px 0

View File

@ -1,92 +0,0 @@
.banner
position: fixed
bottom: 0
left: 0
z-index: 1
font-size: 0
transition: all .3s ease-in-out
-webkit-transform: translateY(3px)
transform: translateY(3px)
.banner:hover
-webkit-transform: translateY(0)
transform: translateY(0)
@media (max-width: 768px)
.banner
display: none
.banner-tips
opacity: 0
width: 250px
height: 70px
margin: -20px 20px
padding: 5px 10px
border: 1px solid rgba(224, 186, 140, 0.62)
border-radius: 12px
background-color: rgba(236, 217, 188, 0.5)
box-shadow: 0 3px 15px 2px rgba(191, 158, 118, 0.2)
font-size: 14px
text-overflow: ellipsis
overflow: hidden
position: absolute
transition : opacity 0.3s ease-in;
animation-delay: 5s
animation-duration: 50s
animation-iteration-count: infinite
animation-name: shake
animation-timing-function: ease-in-out
.banner #live2d
position: relative
@keyframes shake
2% {transform: translate(0.5px, -1.5px) rotate(-0.5deg) }
4% {transform: translate(0.5px, 1.5px) rotate(1.5deg) }
6% {transform: translate(1.5px, 1.5px) rotate(1.5deg) }
8% {transform: translate(2.5px, 1.5px) rotate(0.5deg) }
10% {transform: translate(0.5px, 2.5px) rotate(0.5deg) }
12% {transform: translate(1.5px, 1.5px) rotate(0.5deg) }
14% {transform: translate(0.5px, 0.5px) rotate(0.5deg) }
16% {transform: translate(-1.5px, -0.5px) rotate(1.5deg) }
18% {transform: translate(0.5px, 0.5px) rotate(1.5deg) }
20% {transform: translate(2.5px, 2.5px) rotate(1.5deg) }
22% {transform: translate(0.5px, -1.5px) rotate(1.5deg) }
24% {transform: translate(-1.5px, 1.5px) rotate(-0.5deg) }
26% {transform: translate(1.5px, 0.5px) rotate(1.5deg) }
28% {transform: translate(-0.5px, -0.5px) rotate(-0.5deg) }
30% {transform: translate(1.5px, -0.5px) rotate(-0.5deg) }
32% {transform: translate(2.5px, -1.5px) rotate(1.5deg) }
34% {transform: translate(2.5px, 2.5px) rotate(-0.5deg) }
36% {transform: translate(0.5px, -1.5px) rotate(0.5deg) }
38% {transform: translate(2.5px, -0.5px) rotate(-0.5deg) }
40% {transform: translate(-0.5px, 2.5px) rotate(0.5deg) }
42% {transform: translate(-1.5px, 2.5px) rotate(0.5deg) }
44% {transform: translate(-1.5px, 1.5px) rotate(0.5deg) }
46% {transform: translate(1.5px, -0.5px) rotate(-0.5deg) }
48% {transform: translate(2.5px, -0.5px) rotate(0.5deg) }
50% {transform: translate(-1.5px, 1.5px) rotate(0.5deg) }
52% {transform: translate(-0.5px, 1.5px) rotate(0.5deg) }
54% {transform: translate(-1.5px, 1.5px) rotate(0.5deg) }
56% {transform: translate(0.5px, 2.5px) rotate(1.5deg) }
58% {transform: translate(2.5px, 2.5px) rotate(0.5deg) }
60% {transform: translate(2.5px, -1.5px) rotate(1.5deg) }
62% {transform: translate(-1.5px, 0.5px) rotate(1.5deg) }
64% {transform: translate(-1.5px, 1.5px) rotate(1.5deg) }
66% {transform: translate(0.5px, 2.5px) rotate(1.5deg) }
68% {transform: translate(2.5px, -1.5px) rotate(1.5deg) }
70% {transform: translate(2.5px, 2.5px) rotate(0.5deg) }
72% {transform: translate(-0.5px, -1.5px) rotate(1.5deg) }
74% {transform: translate(-1.5px, 2.5px) rotate(1.5deg) }
76% {transform: translate(-1.5px, 2.5px) rotate(1.5deg) }
78% {transform: translate(-1.5px, 2.5px) rotate(0.5deg) }
80% {transform: translate(-1.5px, 0.5px) rotate(-0.5deg) }
82% {transform: translate(-1.5px, 0.5px) rotate(-0.5deg) }
84% {transform: translate(-0.5px, 0.5px) rotate(1.5deg) }
86% {transform: translate(2.5px, 1.5px) rotate(0.5deg) }
88% {transform: translate(-1.5px, 0.5px) rotate(1.5deg) }
90% {transform: translate(-1.5px, -0.5px) rotate(-0.5deg) }
92% {transform: translate(-1.5px, -1.5px) rotate(1.5deg) }
94% {transform: translate(0.5px, 0.5px) rotate(-0.5deg) }
96% {transform: translate(2.5px, -0.5px) rotate(-0.5deg) }
98% {transform: translate(-1.5px, -1.5px) rotate(-0.5deg) }
0%, 100% {transform: translate(0, 0) rotate(0) }

View File

@ -1,203 +0,0 @@
.comment
margin-top 10px
box-sizing border-box
.box
position relative
width 100%
.com-avatar
position absolute
top 2px
left 0
width 40px
height 40px
img
width 100%
height 100%
border none
border-radius 50%
.com-text
position relative
margin-left 45px
height 120px
border 2px solid c-eee
box-sizing border-box
border-radius 2px
.switch
position absolute
right -2px
top -2px
width 81px
height 10px
line-height 10px
padding 5px 0
.switch-item
float left
width 40px
height @height
color c-999
text-center()
font-size 10px
cursor pointer
opacity .8
:first-child
border-right 1px solid c-ccc
.on
color #ff5e52
.main
margin 0
padding 0
.text-area-edited
display none
width 100%
height 116px
padding 10px
border none
box-sizing border-box
outline none
resize none
.text-area-preview
display none
width 100%
height 116px
padding 10px
border none
box-sizing border-box
overflow auto
@extend $base-style
p
margin 0
.show
display block
.button
position absolute
bottom -2px
right -2px
width 100px
height 30px
line-height @height
border-radius 0 0 2px 0
color c-fff
background-color #ff5e52
text-align center
opacity .8
cursor pointer
.button:hover
opacity .7
.sign-bar
height 30px
line-height @height
text-align right
font-size 12px
.sign-link
margin-left 5px
color #ff5e52
cursor pointer
border none
.sign-txt
color c-999
.tips
height 30px
line-height @height
margin-left 45px
font-size 12px
color c-999
.init
color c-999
float right
.list-wrap
margin-top 10px
.list-header
margin 0
padding 0 0 0 15px
font-size 12px
border-left 2px solid c-eee
.comments-num
color #ff5e52
font-size 14px
.list
list-style-type none
margin 0
padding 0
.item
position relative
margin 10px 0
border-bottom 1px solid c-eee
.user-avatar
position absolute
top 0
left 0
width 40px
height 40px
img
width 100%
height 100%
border none
border-radius 50%
a
border none
.user-comment
min-height 50px
margin-left 50px
.user-comment-body
margin 5px 0
color c-666
word-wrap break-word
word-break normal
@extend $base-style
p
margin 0
a
border none
color #ff5e52
.user-comment-header
color c-aaa
position relative
span
margin-right 5px
.post-name
font-size 12px
.post-time
font-size 10px
.like
font-size 10px
color #ff5e52
cursor pointer
.like.liked
color c-aaa
.like-num
font-size 10px
.reply
position absolute
display none
right 0
top 3px
font-size 10px
cursor pointer
&:hover
.user-comment-header
.reply
display block
.page-nav
margin-top 10px
text-align right
.item
display inline-block
height 10px
line-height @height
margin 0 2px
padding 8px 10px
font-size 10px
background-color c-eee
opacity .8
text-align center
border none
.item.current
color c-fff
background-color #ff5e52
cursor not-allowed
.more
height 10px
line-height @height
padding 8px 5px
font-size 10px
text-align center

View File

@ -1,31 +0,0 @@
/*!
*
*/
.footer
padding 30px
color c-aaa
background-color c-444
font-size 12px
text-center()
opacity .9
a
color c-aaa
.back-to-top {
display: none;
width: 40px;
height: 39px;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
background: #000 url(../img/scrolltoparrow.png) no-repeat center center;
position: fixed;
_position: absolute;
right: 20px;
bottom: 50px;
cursor: pointer;
opacity: .20;
filter: Alpha(opacity=20) !important;
text-indent: -9999px;
overflow: hidden;
z-index: 5
}

View File

@ -1,199 +0,0 @@
/*!
*
*/
.header
width 100%
background-color c-fff
box-shadow 1px 1px 5px rgba(0, 0, 0, .1)
margin-bottom 10px
.header-main
position relative
height 68px
display flex
.logo
width 160px
.menu
margin 0
padding 10px
list-style-type none
#search-box
padding 10px
font-size 16px
flex-grow 1
line-height 48px
position relative
.icon
position absolute
.input-box
box-sizing border-box
padding 0 3px
margin-left 20px
> #search-input
border none
border-bottom 1px solid #9e9e9e
background inherit
width 50%
transition width 0.3s ease-in
outline:none
&:focus
width 80%
> #search-result-box
position absolute
z-index 100
line-height 1.2
top 48px
width 300px
max-height 600px
overflow-y auto
background #f3f3f3
box-shadow: -2px 3px 9px 0px #939393;
border-radius 5px
word-break break-all
display none
padding 7px
ul
list-style none
padding-left 0
margin-top 0
a.search-result-title
color #3272b5
font-size 16px
p.search-result
font-size 14px
margin 0.6em 0
strong.search-keyword
color #ff776d
.logo
a
position relative
display block
height 68px
line-height @height
color c-fff
background-color #ff5e52
opacity .85
text-center()
overflow hidden
.cover
position absolute
display block
top 0
left 0
width 100%
transition top .5s
.name
height 100%
font-size 28px
font-family "HomizioNova", "Microsoft Yahei"
font-style italic
.description
line-height (@height/2)
height 100%
color c-fff
background-color #51cc87
opacity .85
&:hover .cover
top -100%
.menu
.item
float left
padding 0 20px
height 48px
line-height @height
font-size 16px
a
color c-666
&:hover
color #ff5e52
.current a
color #ff5e52
.profile
.avatar
width 50px
height 50px
margin 8px 0
border 1px solid c-ddd
border-radius 3px
> img
width 46px
height 46px
margin 2px
.feeds
height 68px
padding 0 10px
color c-666
font-size 12px
text-right()
.links
margin 5px 0 0
padding 10px 0 3px
.sns
margin 0 0 5px 0
padding 2px 0 10px
line-height 14px
a
margin-left 5px
.sinaweibo
b
color #ff5e52
font-size 14px
&:hover
color #ff5e52
.qqweibo
b
color #1faeff
font-size 14px
&:hover
color #1faeff
.wechat
position relative
b
color #4bc916
font-size 14px
.popover
position absolute
display none
top 28px
left 50%
width 120px
height @width
margin-left -60px
border 1px solid c-ddd
background-color c-fff
border-radius 5px
z-index 9
img
width 120px
height @width
border 0
border-radius 5px
.arrow
position absolute
display block
top -10px
left 50%
width 0
height 0
margin-left -10px
border-width 10px
border-color transparent
border-style solid
border-top-width 0
border-bottom-color c-ddd
&:after
position absolute
content " "
top 1px
left 50%
margin-left -9px
border-width 9px
border-color transparent
border-style solid
border-top-width 0
border-bottom-color c-fff
&:hover
color #4bc916
.popover
display block
.dropnav
display none

View File

@ -1,142 +0,0 @@
// https://github.com/chriskempson/tomorrow-theme
$code-block
background: highlight-background
margin: 20px 0
padding: 10px
overflow: auto
font-size: $code-font-size
color: highlight-foreground
line-height: $line-height-code-block
border: 2px solid #CCC
border-radius: 5px
$line-numbers
color: #666
pre, code
font-family: $code-font-family
code
word-break: break-all
background: $gainsboro
color: #c7254e
border-radius: 4px
padding: 0 0.3em
pre
@extend $code-block
code
background: none
padding: 0
.highlight
@extend $code-block
pre
border: none !important
margin: 0
padding: 1px
table
margin: 0 !important
width: auto !important
border: none !important
td
border: none !important
padding: 0 !important
figcaption
clearfix()
font-size: 0.85em
color: highlight-comment
line-height: 1em
margin-bottom: 1em
a
float: right
.gutter pre
@extend $line-numbers
text-align: right
padding-right: 20px
.line
height: 20px
.gist
margin: 20px 0
border-style: solid
border-color: $border-color
border-width: 1px 0
background: highlight-background
padding: 15px $content-desktop-padding 15px 15px
.gist-file
border: none
font-family: $font-family-monospace
margin: 0
.gist-data
background: none
border: none
.line-numbers
@extend $line-numbers
background: none
border: none
padding: 0 20px 0 0
.line-data
padding: 0 !important
.highlight
margin: 0
padding: 0
border: none
.gist-meta
background: highlight-background
color: highlight-comment
font: 13px $font-family-base
text-shadow: 0 0
padding: 0
margin-top: 1em
margin-left: $content-desktop-padding
a
color: color-link
font-weight: normal
&:hover
text-decoration: underline
pre
.comment
color: highlight-comment
.variable
.attribute
.tag
.regexp
.ruby .constant
.xml .tag .title
.xml .pi
.xml .doctype
.html .doctype
.css .id
.css .class
.css .pseudo
color: highlight-red
.number
.preprocessor
.built_in
.literal
.params
.constant
color: highlight-orange
.ruby .class .title
.css .rules .attribute
color: highlight-green
.string
.value
.inheritance
.header
.ruby .symbol
.xml .cdata
color: highlight-green
.title
.css .hexcolor
color: highlight-aqua
.function
.python .decorator
.python .title
.ruby .function .title
.ruby .title .keyword
.perl .sub
.javascript .title
.coffeescript .title
color: highlight-blue
.keyword
.javascript .function
color: highlight-purple

View File

@ -1,129 +0,0 @@
/*!
*
*/
.content
float left
width 100%
min-height 689px
.content-main
margin-right 350px
padding 20px
/*!
* Post
*/
.post
padding 25px 0
border-bottom 1px solid c-eee
overflow hidden
header
margin 0 0 10px 0
> a
position relative
display inline-block
margin-right 6px
padding 4px 7px
top -3px
color c-fff
background-color #ff5e52
font-size 12px
vertical-align baseline
opacity .85
&:after
position absolute
display block
top 9px
right -4px
width 0
height 0
content " "
border-left 4px solid #ff5e52
border-top 4px solid transparent
border-bottom 4px solid transparent
.post-title
display inline
font-size 20px
font-weight normal
a:hover
border-bottom 1px dotted #ff5e52
.post-meta
color #888
font-size 12px
.post-views,
.post-cat,
.post-comments
margin-right 15px
.post-content
position relative
color c-444
img
max-width 100%
.post-excerpt
position relative
min-height 140px
margin-right 210px
overflow hidden
.post-thumbnail
position absolute
top 0
right 0
width 200px
height 140px
overflow hidden
.thumbnail
display block
margin 0 auto
width auto
height 100%
border 0
transition .5s
a:after
content ""
position absolute
left -70px
top 0
width 140px
height 140px
background-image -moz-linear-gradient(0deg,rgba(255,255,255,0),rgba(255,255,255,.5),rgba(255,255,255,0))
background-image -webkit-linear-gradient(0deg,rgba(255,255,255,0),rgba(255,255,255,.5),rgba(255,255,255,0))
transform skewx(-25deg)
-o-transform skewx(-25deg)
-moz-transform skewx(-25deg)
-webkit-transform skewx(-25deg)
&:hover a:after
left 130px
-webkit-transition all .3s ease-in-out
-moz-transition all .3s ease-in-out
-o-transition all .3s ease-in-out
transition all .3s ease-in-out
@extend $base-style
a
border-bottom 1px dotted #ff5e52
.more a
position absolute
display inline-block
right 0
bottom 0
padding 3px 7px
border none
color c-fff
background-color #51cc87
opacity .8
&:hover
opacity .75
blockquote
margin 1em 0
padding 5px 10px
color c-666
border-left 4px solid c-eee
p
margin 0
.archive-wapper
list-style none
.archive-item > a
display block
font-size 16px
line-height 30px
.date
color #999
font-size 14px

View File

@ -1,109 +0,0 @@
/*!
*
*/
/*
@media screen and (max-width: 1440px)
.container
max-width 1140px
.content
min-height 500px
@media screen and (max-width: 1000px) and (min-width: 960px)
.container
max-width 952px
.content
min-height 500px
*/
@media screen and (max-width: 959px)
.container
margin-bottom 10px
padding 0 10px
min-width auto
.content
min-height 500px
.sidebar
display none
.content-main
margin-right 0
padding 20px 10px
.header
.header-main
height auto
.logo
float none
width 100%
.profile
display none
#search-box
display none
.menu
float none
padding 8px 10px
border 1px solid rgba(0, 0, 0, .1)
background-color #fff
border-top 0
overflow hidden
position absolute
right 10px
top 69px
.item
width 50%
height auto
line-height 1
padding 8px 0
font-size 14px
.hidden
display none
.dropnav
position absolute
display block
top 21px
right 20px
width 30px
height @width
padding 0 2px
line-height @height
font-size @height
color #efe0ce
z-index 3
cursor pointer
&:hover
opacity .8
.post
header .post-title
font-size 15px
.post-meta
text-center()
.post-content
.post-excerpt
margin-right 0
.post-thumbnail
display none
.more a
position relative
display block
padding 6px
text-center()
.page-navigator
padding-left 0
.page-number
.space
.extend
margin-right 6px
.page-navigator li
display inline-block
margin-right 7px
opacity .8
.page-navigator li a
display block
padding 2px 8px
background-color #eee
.comment
.list-wrap
.list
.user-comment
.user-comment-header
.reply
display block
.page-nav .more
display none

View File

@ -1,98 +0,0 @@
/*!
* Sidebar
*/
.sidebar
float left
width 330px
margin-left -350px
padding-top 20px
padding-bottom 20px
.widget
position relative
margin-bottom 20px
clear both
.widget
ul
margin 0
padding 0
.widget-hd, .widget-date
margin 0
padding 0
border-bottom 2px solid c-eee
strong
position relative
display inline-block
bottom -2px
color #444
border-bottom 2px solid #ff5e52
font-weight normal
.logout
position relative
bottom -2px
font-size 14px
font-weight normal
text-decoration underline
&:hover
text-decoration none
.widget-date
text-align center
border-bottom none
strong
border-bottom none
.widget-bd, .archive-list
margin 0
padding 0
list-style none
li
display block
padding 10px 0
line-height 1.5
border-bottom 1px solid c-eee
font-size 14px
overflow hidden
text-overflow ellipsis
white-space nowrap
.badge, .archive-list-count
&::before
content "("
&::after
content ")"
color #a4a4a4
padding .2em .5em
a .avatar
float left
width 36px
height 36px
margin-right 10px
border-radius 50%
transform rotate(0)
transition .5s
a:hover .avatar
transform rotate(360deg)
opacity .85
p
margin 0
padding 0
.tags-cloud > a
margin 0 3px
position relative
word-break: keep-all
&::after
content ''
display block
// 线100%
width 100%
height 2px
position absolute
bottom -3px
left: 0
background-color #ccc
background-color currentColor
transition all 0.3s ease-in-out
// transformscalex0
transform scale3d(0,1,1)
//
transform-origin 50% 0
text-decoration underline
&:hover::after
transform: scale3d(1,1,1);

View File

@ -1,74 +0,0 @@
$theme_config = hexo-config("highlight_theme")
/*!
*
*/
if $theme_config == "normal"
highlight-background = #f7f7f7
highlight-current-line = #efefef
highlight-selection = #d6d6d6
highlight-foreground = #4d4d4c
highlight-comment = #8e908c
highlight-red = #c82829
highlight-orange = #f5871f
highlight-yellow = #eab700
highlight-green = #718c00
highlight-aqua = #3e999f
highlight-blue = #4271ae
highlight-purple = #8959a8
if $theme_config == "night"
highlight-background = #1d1f21
highlight-current-line = #282a2e
highlight-selection = #373b41
highlight-foreground = #c5c8c6
highlight-comment = #969896
highlight-red = #cc6666
highlight-orange = #de935f
highlight-yellow = #f0c674
highlight-green = #b5bd68
highlight-aqua = #8abeb7
highlight-blue = #81a2be
highlight-purple = #b294bb
if $theme_config == "night eighties"
highlight-background = #2d2d2d
highlight-current-line = #393939
highlight-selection = #515151
highlight-foreground = #cccccc
highlight-comment = #999999
highlight-red = #f2777a
highlight-orange = #f99157
highlight-yellow = #ffcc66
highlight-green = #99cc99
highlight-aqua = #66cccc
highlight-blue = #6699cc
highlight-purple = #cc99cc
if $theme_config == "night blue"
highlight-background = #002451
highlight-current-line = #00346e
highlight-selection = #003f8e
highlight-foreground = #ffffff
highlight-comment = #7285b7
highlight-red = #ff9da4
highlight-orange = #ffc58f
highlight-yellow = #ffeead
highlight-green = #d1f1a9
highlight-aqua = #99ffff
highlight-blue = #bbdaff
highlight-purple = #ebbbff
if $theme_config == "night bright"
highlight-background = #000000
highlight-current-line = #2a2a2a
highlight-selection = #424242
highlight-foreground = #eaeaea
highlight-comment = #969896
highlight-red = #d54e53
highlight-orange = #e78c45
highlight-yellow = #e7c547
highlight-green = #b9ca4a
highlight-aqua = #70c0b1
highlight-blue = #7aa6da
highlight-purple = #c397d8

View File

@ -1,55 +0,0 @@
//
c-333 = #333
c-444 = #444
c-555 = #555
c-666 = #666
c-999 = #999
c-aaa = #aaa
c-ccc = #ccc
c-ddd = #ddd
c-eee = #eee
c-fff = #fff
//
text-center()
text-align center
text-left()
text-align left
text-right()
text-align right
box-sizing()
-ms-box-sizing arguments
-moz-box-sizing arguments
-webkit-box-sizing arguments
-o-box-sizing arguments
box-sizing arguments
transition()
-ms-transition: arguments
-moz-transition arguments
-webkit-transition arguments
-o-transition arguments
transition arguments
border-radius()
-ms-border-radius arguments
-moz-border-radius arguments
-webkit-border-radius arguments
-o-border-radius arguments
border-radius arguments
transform()
-ms-transform arguments
-moz-transform arguments
-webkit-transform arguments
-o-transform arguments
transform arguments
clearfix()
clear both
zoom 1
//
$code-font-size = 13px
$line-height-code-block = 1.6
$code-font-family = "Source Code Pro", Consolas, Monaco, Menlo, monospace
$gainsboro = #f5ecee
$border-color = #ccc
$content-desktop-padding = 15px
$font-family-base = Consolas, Monaco, Menlo, monospace
$font-family-monospace = monospace

View File

@ -1,21 +0,0 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="icomoon" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" horiz-adv-x="512" d="" />
<glyph unicode="&#xe900;" glyph-name="home" d="M1024 369.556l-512 397.426-512-397.428v162.038l512 397.426 512-397.428zM896 384v-384h-256v256h-256v-256h-256v384l384 288z" />
<glyph unicode="&#xe95c;" glyph-name="drawer" d="M1016.988 307.99l-256 320c-6.074 7.592-15.266 12.010-24.988 12.010h-448c-9.72 0-18.916-4.418-24.988-12.010l-256-320c-4.538-5.674-7.012-12.724-7.012-19.99v-288c0-35.346 28.654-64 64-64h896c35.348 0 64 28.654 64 64v288c0 7.266-2.472 14.316-7.012 19.99zM960 256h-224l-128-128h-192l-128 128h-224v20.776l239.38 299.224h417.24l239.38-299.224v-20.776zM736 448h-448c-17.672 0-32 14.328-32 32s14.328 32 32 32h448c17.674 0 32-14.328 32-32s-14.326-32-32-32zM800 320h-576c-17.672 0-32 14.326-32 32s14.328 32 32 32h576c17.674 0 32-14.326 32-32s-14.326-32-32-32z" />
<glyph unicode="&#xe976;" glyph-name="user-tie" d="M320 768c0 106.039 85.961 192 192 192s192-85.961 192-192c0-106.039-85.961-192-192-192s-192 85.961-192 192zM768.078 512h-35.424l-199.104-404.244 74.45 372.244-96 96-96-96 74.45-372.244-199.102 404.244h-35.424c-127.924 0-127.924-85.986-127.924-192v-320h768v320c0 106.014 0 192-127.922 192z" />
<glyph unicode="&#xe986;" glyph-name="search" d="M992.262 88.604l-242.552 206.294c-25.074 22.566-51.89 32.926-73.552 31.926 57.256 67.068 91.842 154.078 91.842 249.176 0 212.078-171.922 384-384 384-212.076 0-384-171.922-384-384s171.922-384 384-384c95.098 0 182.108 34.586 249.176 91.844-1-21.662 9.36-48.478 31.926-73.552l206.294-242.552c35.322-39.246 93.022-42.554 128.22-7.356s31.892 92.898-7.354 128.22zM384 320c-141.384 0-256 114.616-256 256s114.616 256 256 256 256-114.616 256-256-114.614-256-256-256z" />
<glyph unicode="&#xe995;" glyph-name="cogs" d="M363.722 237.948l41.298 57.816-45.254 45.256-57.818-41.296c-10.722 5.994-22.204 10.774-34.266 14.192l-11.682 70.084h-64l-11.68-70.086c-12.062-3.418-23.544-8.198-34.266-14.192l-57.818 41.298-45.256-45.256 41.298-57.816c-5.994-10.72-10.774-22.206-14.192-34.266l-70.086-11.682v-64l70.086-11.682c3.418-12.060 8.198-23.544 14.192-34.266l-41.298-57.816 45.254-45.256 57.818 41.296c10.722-5.994 22.204-10.774 34.266-14.192l11.682-70.084h64l11.68 70.086c12.062 3.418 23.544 8.198 34.266 14.192l57.818-41.296 45.254 45.256-41.298 57.816c5.994 10.72 10.774 22.206 14.192 34.266l70.088 11.68v64l-70.086 11.682c-3.418 12.060-8.198 23.544-14.192 34.266zM224 96c-35.348 0-64 28.654-64 64s28.652 64 64 64 64-28.654 64-64-28.652-64-64-64zM1024 576v64l-67.382 12.25c-1.242 8.046-2.832 15.978-4.724 23.79l57.558 37.1-24.492 59.128-66.944-14.468c-4.214 6.91-8.726 13.62-13.492 20.13l39.006 56.342-45.256 45.254-56.342-39.006c-6.512 4.766-13.22 9.276-20.13 13.494l14.468 66.944-59.128 24.494-37.1-57.558c-7.812 1.892-15.744 3.482-23.79 4.724l-12.252 67.382h-64l-12.252-67.382c-8.046-1.242-15.976-2.832-23.79-4.724l-37.098 57.558-59.128-24.492 14.468-66.944c-6.91-4.216-13.62-8.728-20.13-13.494l-56.342 39.006-45.254-45.254 39.006-56.342c-4.766-6.51-9.278-13.22-13.494-20.13l-66.944 14.468-24.492-59.128 57.558-37.1c-1.892-7.812-3.482-15.742-4.724-23.79l-67.384-12.252v-64l67.382-12.25c1.242-8.046 2.832-15.978 4.724-23.79l-57.558-37.1 24.492-59.128 66.944 14.468c4.216-6.91 8.728-13.618 13.494-20.13l-39.006-56.342 45.254-45.256 56.342 39.006c6.51-4.766 13.22-9.276 20.13-13.492l-14.468-66.944 59.128-24.492 37.102 57.558c7.81-1.892 15.742-3.482 23.788-4.724l12.252-67.384h64l12.252 67.382c8.044 1.242 15.976 2.832 23.79 4.724l37.1-57.558 59.128 24.492-14.468 66.944c6.91 4.216 13.62 8.726 20.13 13.492l56.342-39.006 45.256 45.256-39.006 56.342c4.766 6.512 9.276 13.22 13.492 20.13l66.944-14.468 24.492 59.13-57.558 37.1c1.892 7.812 3.482 15.742 4.724 23.79l67.382 12.25zM672 468.8c-76.878 0-139.2 62.322-139.2 139.2s62.32 139.2 139.2 139.2 139.2-62.322 139.2-139.2c0-76.878-62.32-139.2-139.2-139.2z" />
<glyph unicode="&#xe9aa;" glyph-name="lab" d="M956.29 155.518l-316.29 527.024v213.458h32c17.6 0 32 14.4 32 32s-14.4 32-32 32h-320c-17.6 0-32-14.4-32-32s14.4-32 32-32h32v-213.458l-316.288-527.024c-72.442-120.734-16.512-219.518 124.288-219.518h640c140.8 0 196.73 98.784 124.29 219.518zM241.038 320l206.962 344.938v231.062h128v-231.062l206.964-344.938h-541.926z" />
<glyph unicode="&#xea8c;" glyph-name="google-plus2" d="M928 960h-832c-52.8 0-96-43.2-96-96v-832c0-52.8 43.2-96 96-96h832c52.8 0 96 43.2 96 96v832c0 52.8-43.2 96-96 96zM384 192c-141.6 0-256 114.4-256 256s114.4 256 256 256c69.2 0 127-25.2 171.6-67l-69.6-66.8c-19 18.2-52.2 39.4-102 39.4-87.4 0-158.8-72.4-158.8-161.6s71.4-161.6 158.8-161.6c101.4 0 139.4 72.8 145.2 110.4h-145.2v87.8h241.8c2.2-12.8 4-25.6 4-42.4 0-146.4-98-250.2-245.8-250.2zM896 448h-64v-64h-64v64h-64v64h64v64h64v-64h64v-64z" />
<glyph unicode="&#xea91;" glyph-name="facebook2" d="M928 960h-832c-52.8 0-96-43.2-96-96v-832c0-52.8 43.2-96 96-96h416v448h-128v128h128v64c0 105.8 86.2 192 192 192h128v-128h-128c-35.2 0-64-28.8-64-64v-64h192l-32-128h-160v-448h288c52.8 0 96 43.2 96 96v832c0 52.8-43.2 96-96 96z" />
<glyph unicode="&#xea9a;" glyph-name="sina-weibo" d="M430.2 62c-169.6-16.8-316 60-327 171.2-11 111.4 117.6 215 287 231.8 169.6 16.8 316-60 326.8-171.2 11.2-111.4-117.4-215.2-286.8-231.8zM769.2 431.4c-14.4 4.4-24.4 7.2-16.8 26.2 16.4 41.2 18 76.6 0.2 102-33.2 47.4-124.2 45-228.4 1.2 0 0-32.8-14.2-24.4 11.6 16 51.6 13.6 94.6-11.4 119.6-56.6 56.6-207-2.2-336-131.2-96.4-96.2-152.4-198.8-152.4-287.4 0-169.2 217.2-272.2 429.6-272.2 278.4 0 463.8 161.8 463.8 290.2 0 77.8-65.4 121.8-124.2 140zM954.2 741.4c-67.2 74.6-166.4 103-258 83.6v0c-21.2-4.6-34.6-25.4-30-46.4 4.6-21.2 25.2-34.6 46.4-30 65.2 13.8 135.6-6.4 183.4-59.4s60.8-125.2 40.2-188.4v0c-6.6-20.6 4.6-42.6 25.2-49.4 20.6-6.6 42.6 4.6 49.4 25.2v0.2c28.8 88.4 10.6 190-56.6 264.6zM850.8 648c-32.8 36.4-81.2 50.2-125.6 40.6-18.2-3.8-29.8-22-26-40.2 4-18.2 22-29.8 40-25.8v0c21.8 4.6 45.4-2.2 61.4-19.8 16-17.8 20.4-42 13.4-63.2v0c-5.6-17.6 4-36.8 21.8-42.6 17.8-5.6 36.8 4 42.6 21.8 14 43.4 5.2 93-27.6 129.2zM439.6 263.4c-6-10.2-19-15-29.2-10.8-10.2 4-13.2 15.6-7.4 25.4 6 9.8 18.6 14.6 28.6 10.8 10-3.6 13.6-15 8-25.4zM385.4 194.2c-16.4-26.2-51.6-37.6-78-25.6-26 11.8-33.8 42.2-17.4 67.8 16.2 25.4 50.2 36.8 76.4 25.8 26.6-11.4 35.2-41.6 19-68zM447 379.4c-80.6 21-171.8-19.2-206.8-90.2-35.8-72.4-1.2-153 80.2-179.4 84.4-27.2 184 14.6 218.6 92.6 34.2 76.6-8.4 155.2-92 177z" />
<glyph unicode="&#xea9b;" glyph-name="rss" d="M136.294 209.070c-75.196 0-136.292-61.334-136.292-136.076 0-75.154 61.1-135.802 136.292-135.802 75.466 0 136.494 60.648 136.494 135.802-0.002 74.742-61.024 136.076-136.494 136.076zM0.156 612.070v-196.258c127.784 0 247.958-49.972 338.458-140.512 90.384-90.318 140.282-211.036 140.282-339.3h197.122c-0.002 372.82-303.282 676.070-675.862 676.070zM0.388 960v-196.356c455.782 0 826.756-371.334 826.756-827.644h196.856c0 564.47-459.254 1024-1023.612 1024z" />
<glyph unicode="&#xeab0;" glyph-name="github" d="M512.008 947.358c-282.738 0-512.008-229.218-512.008-511.998 0-226.214 146.704-418.132 350.136-485.836 25.586-4.738 34.992 11.11 34.992 24.632 0 12.204-0.48 52.542-0.696 95.324-142.448-30.976-172.504 60.41-172.504 60.41-23.282 59.176-56.848 74.916-56.848 74.916-46.452 31.778 3.51 31.124 3.51 31.124 51.4-3.61 78.476-52.766 78.476-52.766 45.672-78.27 119.776-55.64 149.004-42.558 4.588 33.086 17.852 55.68 32.506 68.464-113.73 12.942-233.276 56.85-233.276 253.032 0 55.898 20.004 101.574 52.76 137.428-5.316 12.9-22.854 64.972 4.952 135.5 0 0 43.006 13.752 140.84-52.49 40.836 11.348 84.636 17.036 128.154 17.234 43.502-0.198 87.336-5.886 128.256-17.234 97.734 66.244 140.656 52.49 140.656 52.49 27.872-70.528 10.35-122.6 5.036-135.5 32.82-35.856 52.694-81.532 52.694-137.428 0-196.654-119.778-239.95-233.79-252.624 18.364-15.89 34.724-47.046 34.724-94.812 0-68.508-0.596-123.644-0.596-140.508 0-13.628 9.222-29.594 35.172-24.566 203.322 67.776 349.842 259.626 349.842 485.768 0 282.78-229.234 511.998-511.992 511.998z" />
</font></defs></svg>

Before

Width:  |  Height:  |  Size: 8.0 KiB

View File

@ -1,58 +0,0 @@
@charset "UTF-8"
@import "_variables"
@import "_extend"
$comment_config = hexo-config("comment.enable")
//
//-----------------------------------------------
@import "_base/font"
// Normalize
//-----------------------------------------------
@import "_base/normalize"
// Reset
//-----------------------------------------------
@import "_base/reset"
// Global
//-----------------------------------------------
@import "_base/global"
//
//-----------------------------------------------
@import "_partial/header"
//
//-----------------------------------------------
@import "_partial/post"
//
//-----------------------------------------------
@import "_partial/theme"
@import "_partial/highlight"
//
//-----------------------------------------------
@import "_partial/sidebar"
//
//-----------------------------------------------
@import "_partial/article"
//
//-----------------------------------------------
@import "_partial/footer"
//
//-----------------------------------------------
if $comment_config
@import "_partial/comment"
//
//-----------------------------------------------
@import "_partial/responsive"
//
//-----------------------------------------------
@import "_partial/banner"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

View File

@ -1,166 +0,0 @@
define(['loadlive2d', 'axios'], function(loadlive2d, axios) {
/**
* 字符串模板替换
* 例如 template:"这是一个{text}内容", context:{text:"有趣的"}
* return "这是一个有趣的内容"
* @param {String} template 模板内容
* @param {Object} context 替换的内容
*/
function render(template, context) {
var tokenReg = /(\\)?\{([^\{\}\\]+)(\\)?\}/g;
return template.replace(tokenReg, function (word, slash1, token, slash2) {
if (slash1 || slash2) {
return word.replace('\\', '');
}
var variables = token.replace(/\s/g, '').split('.');
var currentObject = context;
var i, length, variable;
for (i = 0, length = variables.length; i < length; ++i) {
variable = variables[i];
currentObject = currentObject[variable];
if (!currentObject) return '';
}
return currentObject;
});
}
var re = /x/;
console.log(re);
re.toString = function() {
showMessage('哈哈,你打开了控制台,是想要看看我的秘密吗?', 5000);
return '';
};
document.addEventListener('copy', function(){
showMessage('你都复制了些什么呀,转载要记得加上出处哦', 5000);
})
var tips = document.querySelector('.banner-tips');
var tipTimer = undefined;
/**
* 显示消息
* @param {Object} text 消息内容(如果是数组则显示其中的随机一个元素)
* @param {Number} timeout 消失的延迟时间
*/
function showMessage(text, timeout){
if(tipTimer) {
window.clearTimeout(tipTimer);
tipTimer = undefined;
}
if(Array.isArray(text)) text = text[Math.floor(Math.random() * text.length + 1)-1];
tips.innerHTML = text;
tips.style.opacity = 1;
hideMessage(timeout);
}
/**
* 隐藏消息
* @param {Number} timeout 消失的延迟时间
*/
function hideMessage(timeout){
tipTimer = setTimeout(function(){
tips.style.opacity = 0;
}, timeout || 5000);
}
var text, productHref = [
'https://www.colorfulsweet.site/',
'https://sookie2010.coding.me/',
'https://sookie2010.github.io/'
];
if(document.referrer){
var referrer = document.createElement('a');
referrer.href = document.referrer;
text = 'Hello! 来自 <span style="color:#0099cc;">' + referrer.hostname + '</span> 的朋友';
var domain = referrer.hostname.split('.')[1];
if (domain == 'baidu') {
text = 'Hello! 来自 百度搜索 的朋友<br>你是搜索 <span style="color:#0099cc;">' + referrer.search.split('&wd=')[1].split('&')[0] + '</span> 找到的我吗?';
}else if (domain == 'so') {
text = 'Hello! 来自 360搜索 的朋友<br>你是搜索 <span style="color:#0099cc;">' + referrer.search.split('&q=')[1].split('&')[0] + '</span> 找到的我吗?';
}else if (domain == 'google') {
text = 'Hello! 来自 谷歌搜索 的朋友<br>欢迎阅读<span style="color:#0099cc;">『' + document.title.split(' - ')[0] + '』</span>';
}
}else {
if (productHref.indexOf(window.location.href) !== -1) { //如果是主页
var now = new Date().getHours();
if (now > 23 || now <= 5) {
text = '你是夜猫子呀?这么晚还不睡觉,明天起的来吗';
} else if (now > 5 && now <= 7) {
text = '早上好!一日之计在于晨,美好的一天就要开始了';
} else if (now > 7 && now <= 11) {
text = '上午好!工作顺利吗,不要久坐,多起来走动走动哦!';
} else if (now > 11 && now <= 14) {
text = '中午了,工作了一个上午,现在是午餐时间!';
} else if (now > 14 && now <= 17) {
text = '午后很容易犯困呢,今天的运动目标完成了吗?';
} else if (now > 17 && now <= 19) {
text = '傍晚了!窗外夕阳的景色很美丽呢,最美不过夕阳红~';
} else if (now > 19 && now <= 21) {
text = '晚上好,今天过得怎么样?';
} else if (now > 21 && now <= 23) {
text = '已经这么晚了呀,早点休息吧,晚安~';
} else {
text = '嗨~ 快来逗我玩吧!';
}
}else {
text = '欢迎阅读<span style="color:#0099cc;">『' + document.title.split('|')[0] + '』</span>';
}
}
/**
* 页面中元素触发的看板娘消息
*/
function createTrigger(tips) {
return function(){
var text = tips.text;
if(Array.isArray(tips.text)) text = tips.text[Math.floor(Math.random() * tips.text.length + 1)-1];
text = render(text, {text: this.textContent});
showMessage(text, 3000);
}
}
function bindElementEvent(url) {
axios.get(url).then(function(res){
for(var eventName in res.data) {
res.data[eventName].forEach(function(tips){
Array.prototype.forEach.call(document.querySelectorAll(tips.selector),function(item){
item.addEventListener(eventName, createTrigger(tips));
});
});
}
});
}
// 一言
function getHitokoto(){
axios.get('https://v1.hitokoto.cn/?encode=json&charset=utf-8&c=b&c=a&c=e').then(function(res){
showMessage(res.data.hitokoto, 5000);
setTimeout(getHitokoto, 30000);
}).catch(function(){
setTimeout(getHitokoto, 45000);
})
}
return {
/**
* 加载看板娘模型
* @param {Sting} modelUrl 模板的json描述文件路径
*/
init: function(modelUrl){
axios.get(modelUrl).then(function(res){
var randomIndex = Math.floor(Math.random() * res.data.textures.length);
//随机皮肤
if(window.location.href.startsWith('http://localhost') || ("ActiveXObject" in window)) {
//本地开发调试或者是IE浏览器
res.data.textures = ['/resource/model/skin/'+res.data.textures[randomIndex]];
} else {
//服务器部署运行(使用网易蜂巢对象存储)
res.data.textures = ['https://blog-cdn.nos-eastchina1.126.net/live2D/'+res.data.textures[randomIndex]];
}
loadlive2d('live2d', '/resource/', '', res.data);
// loadlive2d("live2d", "/resource/model.json");
});
// 定时显示"一言"
setTimeout(getHitokoto, 10000);
// 按照json当中的配置给页面元素绑定事件
bindElementEvent("/resource/banner-tips.json");
showMessage(text, 6000);
},
showMessage: showMessage
}
});

View File

@ -1,873 +0,0 @@
var JELON = window.JELON || {};
;(function (JL) {
var constants = {
ACCESS_TOKEN_KEY: 'xups-github-comments-token', // access_token key
USER_INFO_KEY: 'xups-github-user-info', // 登录用户信息 key
PER_PAGE: 10, // 每页的评论数
API_HOST: 'https://api.github.com'
};
var queryUrl = function (key, url, uncode) {
url = url || location.href;
var reg = new RegExp('(\\?|&|#|&amp;)' + key + '=([^?&#]*)');
var result = url.match(reg);
if (uncode) {
return result ? result[2] : '';
}
return result ? decodeURIComponent(result[2]) : '';
};
var $ = JL.$ || function(str) {
return /^(\[object HTML)[a-zA-Z]*(Element\])$/.test(Object.prototype.toString.call(str)) ? str : document.getElementById(str);
};
var addClass = function (elem, className) {
if (!elem) return;
var classNames;
var setClass;
var i, l, cl;
if (elem instanceof Array) {
for (i = 0, l = elem.length; i < l; i++) {
elem[i] = arguments.callee.call(this, elem[i], className);
}
} else if (typeof elem.item === 'function') {
var result = [];
for (i = 0, l = elem.length; i < l; i++) {
result.push(arguments.callee.call(this, elem.item(i), className));
}
elem = result;
} else {
elem = $(elem);
if (!elem) return;
if (className && typeof className === 'string') {
classNames = className.split(/\s+/);
if (elem.nodeType === 1) {
if (!elem.className && classNames.length === 1) {
elem.className = className;
} else {
setClass = ' ' + elem.className + ' ';
for (i = 0, cl = classNames.length; i < cl; i++) {
if (setClass.indexOf(' ' + classNames[i] + ' ') < 0) {
setClass += classNames[i] + ' ';
}
}
elem.className = setClass.trim();
}
}
}
}
return elem;
};
var removeClass = function (elem, className) {
if (!elem) return;
var classNames, i, l, c, cl;
if (elem instanceof Array) {
for (i = 0, l = elem.length; i < l; i++) {
elem[i] = arguments.callee.call(this, elem[i], className);
}
} else if (typeof elem.item === 'function') {
var result = [];
for (i = 0, l = elem.length; i < l; i++) {
result.push(arguments.callee.call(this, elem.item(i), className));
}
elem = result;
} else {
elem = $(elem);
if (!elem) return;
if ((className && typeof className === 'string') || className === undefined) {
classNames = (className || '').split(/\s+/);
if (elem.nodeType === 1 && elem.className) {
if (className) {
className = (' ' + elem.className + ' ').replace(/[\n\t\r]/g, ' ');
for (c = 0, cl = classNames.length; c < cl; c++) {
className = className.replace(' ' + classNames[c] + ' ', ' ');
}
elem.className = className.trim();
} else {
elem.className = '';
}
}
}
}
return elem;
};
/**
* 格式化日期文本 yyyy-MM-dd hh:mm:ss
*/
var formatDate = function (format, date) {
if (!date) return '';
if (typeof date == 'number') date = new Date(date * 1000);
var o = {
'M+': date.getMonth() + 1,
'd+': date.getDate(),
'h+': date.getHours(),
'm+': date.getMinutes(),
's+': date.getSeconds(),
'q+': Math.floor((date.getMonth() + 3) / 3),
'S': date.getMilliseconds(),
'w': '日一二三四五六'.charAt(date.getDay())
};
format = format.replace(/y{4}/, date.getFullYear()).replace(/y{2}/, date.getFullYear().toString().substring(2));
for (var k in o) {
var reg = new RegExp(k);
format = format.replace(reg, match);
}
function match(m) {
return m.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length);
}
return format;
};
/**
* 分享到社交平台
* @param {String} type
*/
var share = function(type) {
if(!type) return;
switch (type) {
case 'weibo' : //微博
window.open('http://service.weibo.com/share/share.php?url=' +
encodeURIComponent(location.href) + '&title=' + document.title + '&language=zh_cn');
break;
case 'qqzone' : //QQ空间
window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' +
encodeURIComponent(location.href) + '&title=' + document.title);
break;
case 'qq' : //QQ
window.open('http://connect.qq.com/widget/shareqq/index.html?url=' +
encodeURIComponent(location.href) + '&desc=Silence个人博客&title=' +
document.title + '&callback=' + encodeURIComponent(location.href));
break;
case 'douban' : //豆瓣
window.open('http://shuo.douban.com/!service/share?href=' +
encodeURIComponent(location.href) + '&name=' + document.title + '&text=' + document.title);
break;
default : console.warn('未知的分享类型', type)
}
}
/**
* 过滤字符串中的style link script标签, 防止注入
* @param {String} str 需要处理的字符串
*/
var htmlFilter = function (str) {
if (typeof str !== 'string') return;
str = str.replace(/(<style.*?<\/style>)/g, '')
.replace(/(<link.*\s+href=(?:"[^"]*"|'[^']*')[^<]*>)/g, '')
.replace(/<script.*?>.*?<\/script>/g, '');
return str;
};
/**
* 封装ajax函数
* @param {String} opt.method 连接的方式包括POST和GET两种方式
* @param {String} opt.url 发送请求的url
* @param {Boolean} opt.async 是否为异步请求true为异步的false为同步的
* @param {Object} opt.data 发送的参数格式为对象类型
* @param {Function} opt.success 发送并接收成功调用的回调函数
* @param {Function} opt.fail 失败回调
*/
var ajax = function (opt) {
opt = opt || {};
opt.method = opt.method.toUpperCase() || 'POST';
opt.url = opt.url || '';
opt.async = opt.async || true;
opt.data = opt.data || null;
opt.success = opt.success || function () {};
var xhr = null;
if (window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
} else {
xhr = new ActiveXObject('Microsoft.XMLHTTP');
}
var params = [];
var token = window.localStorage.getItem(constants.ACCESS_TOKEN_KEY);
for (var key in opt.data) {
params.push(key + '=' + opt.data[key]);
}
var postData = params.join('&');
if (opt.method.toUpperCase() === 'POST') {
xhr.open(opt.method, opt.url, opt.async);
if (window.JSON) {
postData = JSON.stringify(opt.data);
xhr.setRequestHeader('Content-Type', 'application/json;charset=utf-8');
} else {
xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded;charset=utf-8');
}
if (opt.headers && opt.headers['Accept']) {
xhr.setRequestHeader('Accept', opt.headers['Accept']);
} else {
xhr.setRequestHeader('Accept', 'application/vnd.github.squirrel-girl-preview, application/vnd.github.html+json');
}
// 登录校验
if (token) {
xhr.setRequestHeader('Authorization', 'token ' + token);
}
xhr.send(postData);
} else if (opt.method.toUpperCase() === 'GET') {
xhr.open(opt.method, opt.url + '?' + postData, opt.async);
xhr.setRequestHeader('Accept', 'application/vnd.github.squirrel-girl-preview, application/vnd.github.html+json');
// 登录校验
if (token) {
xhr.setRequestHeader('Authorization', 'token ' + token);
}
xhr.send(null);
}
xhr.onreadystatechange = function () {
if (xhr.readyState === 4) {
if (xhr.status >= 200 && xhr.status < 300) {
opt.success && opt.success(xhr.responseText);
} else {
opt.fail && opt.fail(xhr.status)
}
}
};
xhr.onerror = function () {
opt.fail && opt.fail({ message: '请求错误!' });
};
};
JL.issueComments = 0;
JL.issueNumber = 0;
JL.Utils = {
ajax: ajax,
queryUrl: queryUrl,
addClass: addClass,
removeClass: removeClass,
formatDate: formatDate,
share: share
};
JL.Renders = {
box: {
tpl: [
'<section class="box" id="JELON__commentBox">',
'<div class="com-avatar"><img id="loginAvatar" src="/img/loading.gif" alt="avatar"></div>',
'<div class="com-text">',
'<div class="main">',
'<textarea class="text-area-edited show" id="JELON__editBox" placeholder="欢迎评论!"></textarea>',
'<div class="text-area-preview" id="JELON__previewBox"></div>',
'</div>',
'<div class="switch">',
'<div class="switch-item on" id="JELON__editSwitcher" onclick="JELON.Actions.editPreviewSwitch(\'edit\')">编辑</div>',
'<div class="switch-item" id="JELON__previewSwitcher" onclick="JELON.Actions.editPreviewSwitch(\'preview\')">预览</div>',
'</div>',
'<div class="button" onclick="JELON.Actions.postComment()">提交</div>',
'</div>',
'</section>'
].join(''),
update: function () {
var userInfo = localStorage.getItem(constants.USER_INFO_KEY);
if (userInfo) {
userInfo = JSON.parse(userInfo);
} else {
userInfo = {};
}
// 默认头像路径 /img/jelon.jpg
$('loginAvatar').src = userInfo.avatar_url || '/img/github.png';
}
},
list: {
tpl: [
'<section class="list-wrap" id="JELON__commentList">',
'<div class="text-center">正在加载评论</div>',
'</section>'
].join(''),
/**
* 评论列表模块视图更新
* @param {Number} page 评论列表当前页码
* @param {Number} comments 当前文章下所有评论总数
* @param {Number} list 当前列表下评论列表数据
* @param {Function} callback 回调
* @return void(0)
*/
update: function (page, comments, list, callback) {
var perNavPageMaxSize = 10;
var html = '';
var htmlList = [];
var pageList = [];
var allPages = Math.ceil(comments / constants.PER_PAGE);
if (comments === 0) {
html = '<div class="text-center">暂无评论</div>';
} else {
var item = '';
var pageItem = '';
for (var i = 0, len = list.length; i < len; i++) {
item = [
'<li class="item">',
'<div class="user-avatar">',
'<a target="_blank" href="' + list[i].user.html_url + '">',
'<img src="' + list[i].user.avatar_url + '" alt="user-avatar">',
'</a>',
'</div>',
'<div class="user-comment">',
'<div class="user-comment-header" id="JELON__comment_' + list[i].id + '_reactions">',
'<span class="post-name">' + list[i].user.login + '</span>',
'<span class="post-time">' + formatDate('yyyy-MM-dd hh:mm', new Date(list[i].created_at)) + '</span>',
'<span class="like" onclick="JELON.Actions.like(' + list[i].id + ')">点赞</span>',
'<span class="like-num">' + list[i].reactions.heart + '</span>',
'<span class="reply" onclick="JELON.Actions.reply(\'' + list[i].user.login + '\', \'' + (list[i].body_html || list[i].body).replace(/<[^>]+>|\s|[\r\n]/g, ' ') + '\')">回复</span>',
'</div>',
'<div class="user-comment-body">' + (list[i].body_html || list[i].body) + '</div>',
'</div>',
'</li>'
].join('');
htmlList.push(item);
}
if (allPages === 1) {
pageItem = '<a href="javascript: void(0);" class="item current">' + page + '</a>';
pageList.push(pageItem);
} else if (allPages <= perNavPageMaxSize) {
for (var i = 1; i <= allPages; i++) {
if (i === page) {
pageItem = '<a href="javascript: void(0);" class="item current">' + page + '</a>';
} else {
pageItem = '<a href="javascript: JELON.Actions.pageJump(' + i + ');" class="item">' + i + '</a>';
}
pageList.push(pageItem);
}
if (page !== 1) {
pageList.unshift('<a href="javascript: JELON.Actions.pageJump(' + (page - 1) + ');" class="item">上页</a>');
}
if (page !== allPages) {
pageList.push('<a href="javascript: JELON.Actions.pageJump(' + (page + 1) + ');" class="item">下页</a>');
}
} else if (allPages > perNavPageMaxSize) {
if (page <= perNavPageMaxSize) {
for (var i = 1; i <= perNavPageMaxSize; i++) {
if (i === page) {
pageItem = '<a href="javascript: void(0);" class="item current">' + page + '</a>';
} else {
pageItem = '<a href="javascript: JELON.Actions.pageJump(' + i + ');" class="item">' + i + '</a>';
}
pageList.push(pageItem);
}
if (page !== 1) {
pageList.unshift('<a href="javascript: JELON.Actions.pageJump(' + (page - 1) + ');" class="item">上页</a>');
}
pageList.push('<span class="more">...</span>');
pageList.push('<a href="javascript: JELON.Actions.pageJump(' + (page + 1) + ');" class="item">下页</a>');
pageList.push('<a href="javascript: JELON.Actions.pageJump(' + allPages + ');" class="item">末页</a>');
} else if (page > perNavPageMaxSize && page <= allPages - perNavPageMaxSize) {
var mod = page % perNavPageMaxSize;
var start = Math.floor(page / perNavPageMaxSize) * perNavPageMaxSize + 1;
var end = Math.ceil(page / perNavPageMaxSize) * perNavPageMaxSize;
pageList.push('<a href="javascript: JELON.Actions.pageJump(1);" class="item">首页</a>');
pageList.push('<a href="javascript: JELON.Actions.pageJump(' + (page - 1) + ');" class="item">上页</a>');
for (var i = start; i <= end; i++) {
if (i === page) {
pageItem = '<a href="javascript: void(0);" class="item current">' + page + '</a>';
} else {
pageItem = '<a href="javascript: JELON.Actions.pageJump(' + i + ');" class="item">' + i + '</a>';
}
pageList.push(pageItem);
}
pageList.push('<span class="more">...</span>');
pageList.push('<a href="javascript: JELON.Actions.pageJump(' + (page + 1) + ');" class="item">下页</a>');
pageList.push('<a href="javascript: JELON.Actions.pageJump(' + allPages + ');" class="item">末页</a>');
} else if (page > perNavPageMaxSize && page > allPages - perNavPageMaxSize) {
var start = allPages - perNavPageMaxSize + 1;
var end = allPages;
pageList.push('<a href="javascript: JELON.Actions.pageJump(1);" class="item">首页</a>');
pageList.push('<a href="javascript: JELON.Actions.pageJump(' + (page - 1) + ');" class="item">上页</a>');
for (var i = start; i <= end; i++) {
if (i === page) {
pageItem = '<a href="javascript: void(0);" class="item current">' + page + '</a>';
} else {
pageItem = '<a href="javascript: JELON.Actions.pageJump(' + i + ');" class="item">' + i + '</a>';
}
pageList.push(pageItem);
}
if (page !== allPages) {
pageList.push('<a href="javascript: JELON.Actions.pageJump(' + (page + 1) + ');" class="item">下页</a>');
}
}
}
html = [
'<header class="list-header">总共 <span class="comments-num" id="JELON__commentsNum">' + JL.issueComments + '</span> 条评论</header>',
'<ul class="list">',
htmlList.join(''),
'</ul>',
'<div class="page-nav">',
pageList.join(''),
'</div>'
].join('');
}
$('JELON__commentList').innerHTML = html;
if (localStorage.getItem(constants.USER_INFO_KEY)) {
callback && callback();
}
},
reactionUpdate: function (commentId, reactions) {
var userInfo = localStorage.getItem(constants.USER_INFO_KEY);
if (userInfo) {
userInfo = JSON.parse(userInfo);
} else {
return;
}
var userId = userInfo.id;
for (var i = 0, len = reactions.length; i < len; i++) {
if (userId === reactions[i].user.id) {
addClass($('JELON__comment_' + commentId + '_reactions').getElementsByClassName('like')[0], 'liked');
$('JELON__comment_' + commentId + '_reactions').getElementsByClassName('like')[0].innerHTML = '已赞';
break;
}
}
},
addOne: function (data) {
var oLi = document.createElement('li');
oLi.className = 'item';
var item = [
'<div class="user-avatar">',
'<a target="_blank" href="' + data.user.html_url + '">',
'<img src="' + data.user.avatar_url + '" alt="user-avatar">',
'</a>',
'</div>',
'<div class="user-comment">',
'<div class="user-comment-header" id="JELON__comment_' + data.id + '_reactions">',
'<span class="post-name">' + data.user.login + '</span>',
'<span class="post-time">' + formatDate('yyyy-MM-dd hh:mm', new Date(data.created_at)) + '</span>',
'<span class="like" onclick="JELON.Actions.like(' + data.reactions.heart + ')">点赞</span>',
'<span class="like-num">' + data.reactions.heart + '</span>',
'<span class="reply" onclick="JELON.Actions.reply(\'' + data.user.login + '\', \'' + (data.body_html || data.body).replace(/<[^>]+>|\s|[\r\n]/g, ' ') + '\')">回复</span>',
'</div>',
'<div class="user-comment-body">' + (data.body_html || data.body) + '</div>',
'</div>'
].join('');
oLi.innerHTML = item;
var oUl = $('JELON__commentList').getElementsByTagName('ul')[0];
if (oUl) {
oUl.insertBefore(oLi, oUl.firstChild);
$('JELON__commentsNum').innerHTML = JL.issueComments + 1;
} else {
$('JELON__commentList').innerHTML = [
'<header class="list-header">总共 <span class="comments-num" id="JELON__commentsNum">' + (JL.issueComments + 1) + '</span> 条评论</header>',
'<ul class="list">',
'<li class="item">',
item,
'</li>',
'</ul>'
].join('');
}
}
},
signBar: {
tpl: [
'<div class="sign-bar" id="JELON__commentSignBar">',
'</div>'
].join(''),
update: function () {
var token = localStorage.getItem(constants.ACCESS_TOKEN_KEY);
var userInfo = localStorage.getItem(constants.USER_INFO_KEY);
var html = '';
if (token && userInfo) {
userInfo = JSON.parse(userInfo);
html = [
'<span class="sign-txt" title="' + userInfo.login + '">GitHub 已登录!</span>',
'<span class="sign-link" onclick="JELON.Actions.signOut()">退出</span>'
].join('');
} else {
html = [
'<span class="sign-txt">GitHub 未登录?</span>',
'<a href="https://github.com/login/oauth/authorize?scope=public_repo&redirect_uri=',
location.href.indexOf('?') !== -1 ? encodeURIComponent(location.href.substring(0, location.href.indexOf('?'))) : encodeURIComponent(location.href),
'&client_id=' + JL.options.clientId + '&client_secret=' + JL.options.clientSecret + '" class="sign-link">',
'登录',
'</a>'
].join('');
}
$('JELON__commentSignBar').innerHTML = html;
}
},
tips: {
tpl: '<section class="tips clearfix" id="JELON__comment_tips">注:评论支持 markdown 语法!</section>',
update: function () {
var userInfo = localStorage.getItem(constants.USER_INFO_KEY);
var handler = '';
// 如果文章还没关联 issue 并且登录账号是自己时
if (userInfo && JSON.parse(userInfo).login === JL.options.owner && JL.issueNumber === 0) {
handler = '<a href="javascript: JELON.Actions.createIssue();" class="init" title="文章关联 issue">初始化评论</a>';
}
$('JELON__comment_tips').innerHTML = handler + '注:评论支持 markdown 语法!';
}
},
flashTitle: function (title) {
var counter = 0;
document.title = title + '...';
var timer = setInterval(function () {
counter++;
if (counter % 3 === 0) {
document.title = title + '...';
} else if (counter % 3 === 1) {
document.title = title + '..';
} else if (counter % 3 === 2) {
document.title = title + '.';
}
}, 100);
},
loading: {
create: function (oParent) {
oParent = oParent || document.body;
var oLoading = document.createElement('div');
oLoading.className = 'loading-mask';
oLoading.id = 'JELON__loadingMask';
oLoading.innerHTML = '<div class="loading-icon"><img src="/img/loading.gif" width="50" height="50" alt="加载中" ></div>';
oParent.appendChild(oLoading);
},
remove: function () {
var oLoading = $('JELON__loadingMask');
oLoading.parentNode.removeChild(oLoading);
}
}
};
JL.Actions = {
init: function () {
var code = queryUrl('code');
JL.Renders.signBar.update();
JL.Renders.box.update();
// if code继续GitHub 授权
if (code) {
JL.Renders.loading.create();
JL.Renders.flashTitle('登录中');
JL.Requests.getAccessToken({
client_id: JL.options.clientId,
client_secret: JL.options.clientSecret,
code: code
}, function (res) {
if (res.access_token || res.data) {
if (res.data) {
res.access_token = res.data.access_token;
}
localStorage.setItem(constants.ACCESS_TOKEN_KEY, res.access_token); // 保存 access_token 至 localStorage
JL.Requests.getUserInfo({ access_token: res.access_token }, function (res) {
if (res.login) {
localStorage.setItem(constants.USER_INFO_KEY, JSON.stringify(res)); // 保存用户信息到 localStorage
location.href = location.href.substring(0, location.href.indexOf('?'));
JL.Renders.loading.remove();
}
});
} else {
// 登录失败
location.href = location.href.substring(0, location.href.indexOf('?'));
JL.Renders.loading.remove();
}
});
} else {
JL.Requests.getIssueNumberByLabel(JL.options.label, function (res) {
if (res.length > 0) {
var number = res[0].number;
var comments = res[0].comments; // 该 issue 下所有评论数
JL.issueNumber = number;
JL.issueComments = comments;
JL.Requests.getCommentListByIssueNumber(number, {
page: 1,
per_page: constants.PER_PAGE
}, function (list) {
JL.Renders.list.update(1, comments, list, function () {
for (var i = 0, len = list.length; i < len; i++) {
(function (commentId) {
JL.Requests.getReactionsByCommentId(commentId, { content: 'heart' }, function (reactions) {
JL.Renders.list.reactionUpdate(commentId, reactions);
});
}(list[i].id));
}
});
});
} else {
// 授权码失效
if (typeof res !== 'object') {
localStorage.removeItem(constants.ACCESS_TOKEN_KEY);
localStorage.removeItem(constants.USER_INFO_KEY);
JL.Renders.signBar.update();
JL.Renders.box.update();
console.warn('登录失败,请稍后刷新再试');
} else {
JL.Renders.list.update(1, 0, []);
JL.Renders.tips.update();
}
}
});
}
},
signOut: function () {
localStorage.removeItem(constants.ACCESS_TOKEN_KEY);
localStorage.removeItem(constants.USER_INFO_KEY);
JL.Renders.signBar.update();
JL.Renders.box.update();
},
pageJump: function (page) {
JL.Requests.getCommentListByIssueNumber(JL.issueNumber, {
page: Number(page),
per_page: constants.PER_PAGE
}, function (list) {
JL.Renders.list.update(page, JL.issueComments, list, function () {
for (var i = 0, len = list.length; i < len; i++) {
(function (commentId) {
JL.Requests.getReactionsByCommentId(commentId, { content: 'heart' }, function (reactions) {
JL.Renders.list.reactionUpdate(commentId, reactions);
});
}(list[i].id));
}
});
});
},
editPreviewSwitch: function (flag) {
if (flag === 'edit') {
removeClass('JELON__previewSwitcher', 'on');
addClass('JELON__editSwitcher', 'on');
removeClass('JELON__previewBox', 'show');
addClass('JELON__editBox', 'show');
} else {
removeClass('JELON__editSwitcher', 'on');
addClass('JELON__previewSwitcher', 'on');
removeClass('JELON__editBox', 'show');
addClass('JELON__previewBox', 'show');
var text = $('JELON__editBox').value.trim();
text = htmlFilter(text);
if (text) {
JL.Requests.markdown({
text: text,
mode: 'markdown',
context: 'github/gollum'
}, function (res) {
$('JELON__previewBox').innerHTML = res;
});
} else {
$('JELON__previewBox').innerHTML = '';
}
}
},
postComment: function () {
var accessToken = localStorage.getItem(constants.ACCESS_TOKEN_KEY);
var userInfo = localStorage.getItem(constants.USER_INFO_KEY);
if (!accessToken || !userInfo) {
alert('请先登录哦..!^_^');
return;
}
var body = $('JELON__editBox').value.trim();
body = htmlFilter(body);
if (body) {
JL.Renders.loading.create();
if (JL.issueNumber !== 0) {
JL.Requests.createComment(JL.issueNumber, {
body: body
}, function (res) {
if (res.id) {
JL.Renders.list.addOne(res);
JL.issueComments++;
$('JELON__editBox').value = '';
$('JELON__previewBox').innerHTML = '';
}
JL.Renders.loading.remove();
});
} else {
// 如果还没有创建 issue先创建 issue
JL.Requests.createIssue({
title: document.title,
body: location.href,
labels: [ (JL.options.label || location.href) ]
}, function (res) {
if (res.number) {
JL.issueNumber = res.number
JL.Requests.createComment(JL.issueNumber, {
body: body
}, function (json) {
if (res.id) {
JL.Renders.list.addOne(json);
JL.issueComments++;
$('JELON__editBox').value = '';
$('JELON__previewBox').innerHTML = '';
}
JL.Renders.loading.remove();
});
}
});
}
}
},
like: function (commentId) {
var oLiked = $('JELON__comment_' + commentId + '_reactions').getElementsByClassName('liked');
var oLike = $('JELON__comment_' + commentId + '_reactions').getElementsByClassName('like')[0];
var oNum = $('JELON__comment_' + commentId + '_reactions').getElementsByClassName('like-num')[0];
var accessToken = localStorage.getItem(constants.ACCESS_TOKEN_KEY);
var userInfo = localStorage.getItem(constants.USER_INFO_KEY);
if (oLiked.length) {
return false;
} else {
if (accessToken && userInfo) {
JL.Requests.createReaction(commentId, { content: 'heart' }, function (res) {
if (res.content === 'heart') {
addClass(oLike, 'liked');
oLike.innerHTML = '已赞';
oNum.innerHTML = Number(oNum.innerHTML) + 1;
}
});
}
}
},
createIssue: function () {
JL.Renders.loading.create();
JL.Requests.createIssue({
title: document.title,
body: location.href,
labels: [ (JL.options.label || location.href) ]
}, function (json) {
if (json.number) {
JL.issueNumber = json.number;
JL.Renders.tips.update();
}
JL.Renders.loading.remove();
});
},
reply: function (people, content) {
var accessToken = localStorage.getItem(constants.ACCESS_TOKEN_KEY);
var userInfo = localStorage.getItem(constants.USER_INFO_KEY);
if (!accessToken || !userInfo) {
return;
}
JL.Actions.editPreviewSwitch('edit');
$('JELON__editBox').value = '';
$('JELON__editBox').focus();
$('JELON__editBox').value = [
'@' + people + '\n',
'> ' + content + '\n',
'\n'
].join('');
$('JELON__previewBox').innerHTML = '';
}
};
var createSuccessCb = function(callback){
return function (res) {
if (typeof res === 'string') {
if (window.JSON) {
res = JSON.parse(res);
} else {
res = eval('(' + res + ')');
}
}
callback && callback(res);
}
}
JL.Requests = {
getIssueNumberByLabel: function (label, callback) {
ajax({
url: constants.API_HOST + '/repos/' + JL.options.owner + '/' + JL.options.repo + '/issues',
method: 'GET',
data: {
labels: [ label ],
rnd: Math.random()
},
success: createSuccessCb(callback),
fail: callback
});
},
createIssue: function (data, callback) {
ajax({
url: constants.API_HOST + '/repos/' + JL.options.owner + '/' + JL.options.repo + '/issues',
method: 'POST',
data: data,
success: createSuccessCb(callback),
fail: callback
});
},
getCommentListByIssueNumber: function (number, data, callback) {
ajax({
url: constants.API_HOST + '/repos/' + JL.options.owner + '/' + JL.options.repo + '/issues/' + number + '/comments',
method: 'GET',
data: data,
success: createSuccessCb(callback),
fail: callback
});
},
getReactionsByCommentId: function (id, data, callback) {
if (typeof data === 'object' && !data.rnd) {
data.rnd = Math.random();
}
ajax({
url: constants.API_HOST + '/repos/' + JL.options.owner + '/' + JL.options.repo + '/issues/comments/' + id + '/reactions',
method: 'GET',
data: data,
success: createSuccessCb(callback),
fail: callback
});
},
editIssue: function (number, data, callback) {
ajax({
url: constants.API_HOST + '/repos/' + JL.options.owner + '/' + JL.options.owner + '/issues/' + number,
method: 'POST',
data: data,
success: createSuccessCb(callback),
fail: callback
});
},
markdown: function (data, callback) {
ajax({
url: constants.API_HOST + '/markdown',
method: 'POST',
data: data,
success: callback,
fail: callback
});
},
getAccessToken: function (data, callback) {
ajax({
// url: 'https://gh-oauth.imsun.net/',
url: 'https://cors-anywhere.herokuapp.com/https://github.com/login/oauth/access_token',
method: 'POST',
headers: {
'Accept': 'application/json'
},
data: data,
success: createSuccessCb(callback),
fail: callback
});
},
getUserInfo: function (data, callback) {
ajax({
url: constants.API_HOST + '/user',
method: 'GET',
data: data,
success: createSuccessCb(callback),
fail: callback
});
},
createComment: function (number, data, callback) {
ajax({
url: constants.API_HOST + '/repos/' + JL.options.owner + '/' + JL.options.repo + '/issues/' + number + '/comments',
method: 'POST',
data: data,
success: createSuccessCb(callback),
fail: callback
});
},
createReaction: function (commentId, data, callback) {
ajax({
url: constants.API_HOST + '/repos/' + JL.options.owner + '/' + JL.options.repo + '/issues/comments/' + commentId + '/reactions',
method: 'POST',
data: data,
success: createSuccessCb(callback),
fail: callback
});
}
};
JL.Comment = function (options) {
JL.options = options || {};
var $container = $('comments');
if (options.container) {
if (typeof options.container === 'object') {
$container = options.container;
} else if (typeof options.container === 'string') {
if (/^#/.test(options.container)) {
$container = $(options.container.replace(/^#/, ''));
} else {
$container = $(options.container);
}
} else {
$container = $('comments');
}
}
$container.innerHTML = [
this.Renders.signBar.tpl,
this.Renders.box.tpl,
this.Renders.tips.tpl,
this.Renders.list.tpl
].join('');
JL.Actions.init();
};
})(JELON);

View File

@ -1 +0,0 @@
(function(a,b){function h(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function i(){var a=l.elements;return typeof a=="string"?a.split(" "):a}function j(a){var b={},c=a.createElement,f=a.createDocumentFragment,g=f();a.createElement=function(a){if(!l.shivMethods)return c(a);var f;return b[a]?f=b[a].cloneNode():e.test(a)?f=(b[a]=c(a)).cloneNode():f=c(a),f.canHaveChildren&&!d.test(a)?g.appendChild(f):f},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+i().join().replace(/\w+/g,function(a){return c(a),g.createElement(a),'c("'+a+'")'})+");return n}")(l,g)}function k(a){var b;return a.documentShived?a:(l.shivCSS&&!f&&(b=!!h(a,"article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio{display:none}canvas,video{display:inline-block;*display:inline;*zoom:1}[hidden]{display:none}audio[controls]{display:inline-block;*display:inline;*zoom:1}mark{background:#FF0;color:#000}")),g||(b=!j(a)),b&&(a.documentShived=b),a)}var c=a.html5||{},d=/^<|^(?:button|form|map|select|textarea|object|iframe|option|optgroup)$/i,e=/^<|^(?:a|b|button|code|div|fieldset|form|h1|h2|h3|h4|h5|h6|i|iframe|img|input|label|li|link|ol|option|p|param|q|script|select|span|strong|style|table|tbody|td|textarea|tfoot|th|thead|tr|ul)$/i,f,g;(function(){var c=b.createElement("a");c.innerHTML="<xyz></xyz>",f="hidden"in c,f&&typeof injectElementWithStyles=="function"&&injectElementWithStyles("#modernizr{}",function(b){b.hidden=!0,f=(a.getComputedStyle?getComputedStyle(b,null):b.currentStyle).display=="none"}),g=c.childNodes.length==1||function(){try{b.createElement("a")}catch(a){return!0}var c=b.createDocumentFragment();return typeof c.cloneNode=="undefined"||typeof c.createDocumentFragment=="undefined"||typeof c.createElement=="undefined"}()})();var l={elements:c.elements||"abbr article aside audio bdi canvas data datalist details figcaption figure footer header hgroup mark meter nav output progress section summary time video",shivCSS:c.shivCSS!==!1,shivMethods:c.shivMethods!==!1,type:"default",shivDocument:k};a.html5=l,k(b)})(this,document)

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,135 +0,0 @@
/*! echo-js v1.7.3 | (c) 2016 @toddmotto | https://github.com/toddmotto/echo */
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(function() {
return factory(root);
});
} else if (typeof exports === 'object') {
module.exports = factory;
} else {
root.echo = factory(root);
}
})(this, function (root) {
'use strict';
var echo = {};
var callback = function () {};
var offset, poll, delay, useDebounce, unload;
var isHidden = function (element) {
return (element.offsetParent === null);
};
var inView = function (element, view) {
if (isHidden(element)) {
return false;
}
var box = element.getBoundingClientRect();
return (box.right >= view.l && box.bottom >= view.t && box.left <= view.r && box.top <= view.b);
};
var debounceOrThrottle = function () {
if(!useDebounce && !!poll) {
return;
}
clearTimeout(poll);
poll = setTimeout(function(){
echo.render();
poll = null;
}, delay);
};
echo.init = function (opts) {
opts = opts || {};
var offsetAll = opts.offset || 0;
var offsetVertical = opts.offsetVertical || offsetAll;
var offsetHorizontal = opts.offsetHorizontal || offsetAll;
var optionToInt = function (opt, fallback) {
return parseInt(opt || fallback, 10);
};
offset = {
t: optionToInt(opts.offsetTop, offsetVertical),
b: optionToInt(opts.offsetBottom, offsetVertical),
l: optionToInt(opts.offsetLeft, offsetHorizontal),
r: optionToInt(opts.offsetRight, offsetHorizontal)
};
delay = optionToInt(opts.throttle, 250);
useDebounce = opts.debounce !== false;
unload = !!opts.unload;
callback = opts.callback || callback;
echo.render();
if (document.addEventListener) {
root.addEventListener('scroll', debounceOrThrottle, false);
root.addEventListener('load', debounceOrThrottle, false);
} else {
root.attachEvent('onscroll', debounceOrThrottle);
root.attachEvent('onload', debounceOrThrottle);
}
};
echo.render = function () {
var nodes = document.querySelectorAll('img[data-echo], [data-echo-background]');
var length = nodes.length;
var src, elem;
var view = {
l: 0 - offset.l,
t: 0 - offset.t,
b: (root.innerHeight || document.documentElement.clientHeight) + offset.b,
r: (root.innerWidth || document.documentElement.clientWidth) + offset.r
};
for (var i = 0; i < length; i++) {
elem = nodes[i];
if (inView(elem, view)) {
if (unload) {
elem.setAttribute('data-echo-placeholder', elem.src);
}
if (elem.getAttribute('data-echo-background') !== null) {
elem.style.backgroundImage = "url(" + elem.getAttribute('data-echo-background') + ")";
}
else {
elem.src = elem.getAttribute('data-echo');
}
if (!unload) {
elem.removeAttribute('data-echo');
elem.removeAttribute('data-echo-background');
}
callback(elem, 'load');
}
else if (unload && !!(src = elem.getAttribute('data-echo-placeholder'))) {
if (elem.getAttribute('data-echo-background') !== null) {
elem.style.backgroundImage = "url(" + src + ")";
}
else {
elem.src = src;
}
elem.removeAttribute('data-echo-placeholder');
callback(elem, 'unload');
}
}
if (!length) {
echo.detach();
}
};
echo.detach = function () {
if (document.removeEventListener) {
root.removeEventListener('scroll', debounceOrThrottle);
} else {
root.detachEvent('onscroll', debounceOrThrottle);
}
clearTimeout(poll);
};
return echo;
});

View File

@ -1,2 +0,0 @@
/*! echo-js v1.7.3 | (c) 2016 @toddmotto | https://github.com/toddmotto/echo */
!function(t,e){"function"==typeof define&&define.amd?define(function(){return e(t)}):"object"==typeof exports?module.exports=e:t.echo=e(t)}(this,function(t){"use strict";var e,n,o,r,c,a={},u=function(){},d=function(t){return null===t.offsetParent},i=function(t,e){if(d(t))return!1;var n=t.getBoundingClientRect();return n.right>=e.l&&n.bottom>=e.t&&n.left<=e.r&&n.top<=e.b},l=function(){(r||!n)&&(clearTimeout(n),n=setTimeout(function(){a.render(),n=null},o))};return a.init=function(n){n=n||{};var d=n.offset||0,i=n.offsetVertical||d,f=n.offsetHorizontal||d,s=function(t,e){return parseInt(t||e,10)};e={t:s(n.offsetTop,i),b:s(n.offsetBottom,i),l:s(n.offsetLeft,f),r:s(n.offsetRight,f)},o=s(n.throttle,250),r=n.debounce!==!1,c=!!n.unload,u=n.callback||u,a.render(),document.addEventListener?(t.addEventListener("scroll",l,!1),t.addEventListener("load",l,!1)):(t.attachEvent("onscroll",l),t.attachEvent("onload",l))},a.render=function(){for(var n,o,r=document.querySelectorAll("img[data-echo], [data-echo-background]"),d=r.length,l={l:0-e.l,t:0-e.t,b:(t.innerHeight||document.documentElement.clientHeight)+e.b,r:(t.innerWidth||document.documentElement.clientWidth)+e.r},f=0;d>f;f++)o=r[f],i(o,l)?(c&&o.setAttribute("data-echo-placeholder",o.src),null!==o.getAttribute("data-echo-background")?o.style.backgroundImage="url("+o.getAttribute("data-echo-background")+")":o.src=o.getAttribute("data-echo"),c||(o.removeAttribute("data-echo"),o.removeAttribute("data-echo-background")),u(o,"load")):c&&(n=o.getAttribute("data-echo-placeholder"))&&(null!==o.getAttribute("data-echo-background")?o.style.backgroundImage="url("+n+")":o.src=n,o.removeAttribute("data-echo-placeholder"),u(o,"unload"));d||a.detach()},a.detach=function(){document.removeEventListener?t.removeEventListener("scroll",l):t.detachEvent("onscroll",l),clearTimeout(n)},a});

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -1,118 +0,0 @@
define(['axios', 'vue'],function(axios, Vue){
var articleDatas = null,
resultDiv = null,
initCallback = function(){};
function executeSearch(keywords) {
var _this = this;
articleDatas.forEach(function(article){
var isMatch = true,
title = article.title.trim().toLowerCase(),
index_title = -1, index_content = -1,
first_occur = -1; //关键字在正文当中第一次出现的位置
keywords.forEach(function(keyword, i) {
index_title = title ? title.indexOf(keyword) : -1;
index_content = article.content ? article.content.indexOf(keyword) : -1;
if( index_title < 0 && index_content < 0 ){
isMatch = false;
} else {
if (index_content < 0) {
index_content = 0;
}
if (i == 0) {
first_occur = index_content;
}
}
});
if (isMatch) {
var resultItem = {};
resultItem.url = article.url;
resultItem.title = article.title;
if (first_occur >= 0) {
// 截取出关键字所在的前后若干字符
var start = first_occur - 10;
var end = first_occur + 15;
if(start <= 0){
start = 0;
end = 25;
}
if(end > article.content.length){
end = article.content.length;
}
var matchContent = article.content.substring(start, end);
// 高亮关键字
keywords.forEach(function(keyword){
var keywordReg = new RegExp(keyword, "gi");
matchContent = matchContent.replace(keywordReg, "<strong class=\"search-keyword\">"+keyword+"</strong>");
})
resultItem.matchContent = matchContent
}
_this.searchResult.push(resultItem)
}
});
}
new Vue({
el: "#search-box",
data: {
queryText: null,
searchResult: [],
searchIniting: false // 搜索是否正在初始化(search.xml文件很大, 异步ajax以及xml解析需要时间)
},
mounted: function() {
resultDiv = document.getElementById("search-result-box");
},
methods : {
searchInit: function() {
if(articleDatas || this.searchIniting) return;
this.searchIniting = true;
var _this = this;
axios({
url: "/search.xml"
}).then(function(response){
var xmlDoms = null
if(window.DOMParser) {
var parser = new DOMParser()
xmlDoms = parser.parseFromString(response.data, "application/xml")
} else {
xmlDoms = new ActiveXObject("Microsoft.XMLDOM");
xmlDoms.async = false;
xmlDoms.loadXML(response.data);
}
//找出所有文章的标题 正文 URL
articleDatas = Array.prototype.map.call(xmlDoms.getElementsByTagName("entry"), function(item){
return {
title: item.getElementsByTagName("title")[0].textContent,
content: item.getElementsByTagName("content")[0].textContent.trim().replace(/<[^>]+>/g,"").toLowerCase(),
url: item.getElementsByTagName("url")[0].textContent,
}
});
_this.searchIniting = false;
initCallback.call(_this);
}).catch(function(){
_this.searchIniting = false;
_this.searchInit();
});
}
},
watch: {
queryText: function(newVal, oldVal) {
this.searchResult.length = 0;
if(!resultDiv) return;
if(newVal && newVal.trim()) {
resultDiv.style.display = "block";
} else {
resultDiv.style.display = "none";
return
}
var keywords = newVal.trim().toLowerCase().split(/[\s\-]+/);
var _this = this;
if(this.searchIniting) {
initCallback = function(){
executeSearch.call(this, keywords);
}
} else {
executeSearch.call(this, keywords);
}
}
}
})
})

View File

@ -1,97 +0,0 @@
require.config({
baseUrl: '/js/',
paths: {
echo: 'lib/echo.min',
loadlive2d: 'lib/live2d',
axios: 'lib/axios.min',
bannerGirl: 'banner-girl',
vue: 'lib/vue.min',
polyfill: 'lib/polyfill.min'
},
shim: {
loadlive2d: {
exports: 'loadlive2d'
}
}
});
require(['polyfill', 'local-search']);
require(['echo'],function(echo, bannerGirl){
function deepCopy(c, p) {
 var c = c || {};
 for (var i in p) {
  if (typeof p[i] === 'object') {
   c[i] = (p[i].constructor === Array) ? [] : {};
   deepCopy(p[i], c[i]);
  } else {
   c[i] = p[i];
  }
 }
 return c;
}
var JELON = window.JELON || {};
JELON = deepCopy(JELON, {
name: 'JELON',
version: '0.0.2',
init: function() {
this.toggleMenu();
this.backToTop();
echo.init({
offset: 50,
throttle: 250,
unload: false,
callback: function(element, op) {
//console.log(element, 'has been', op + 'ed')
}
});
},
$: function(str) {
return /^(\[object HTML)[a-zA-Z]*(Element\])$/.test(Object.prototype.toString.call(str)) ? str : document.getElementById(str);
},
toggleMenu: function() {
var _this = this,
$menu = _this.$(_this.name + '__menu');
_this.$(_this.name + '__btnDropNav').onclick = function() {
if ($menu.className.indexOf('hidden') === -1) {
$menu.className += ' hidden';
} else {
$menu.className = $menu.className.replace(/\s*hidden\s*/, '');
}
};
},
backToTop: function() {
var _this = this;
if (typeof _this.$(_this.name + '__backToTop') === 'undefined') return;
window.onscroll = window.onresize = function() {
if (document.documentElement.scrollTop + document.body.scrollTop > 0) {
_this.$(_this.name + '__backToTop').style.display = 'block';
} else {
_this.$(_this.name + '__backToTop').style.display = 'none';
}
};
_this.$(_this.name + '__backToTop').onclick = function() {
var Timer = setInterval(GoTop, 10);
function GoTop() {
if (document.documentElement.scrollTop + document.body.scrollTop < 1) {
clearInterval(Timer)
} else {
document.documentElement.scrollTop /= 1.1;
document.body.scrollTop /= 1.1
}
}
};
}
});
/**
* 布局初始化
*/
JELON.init();
window.JELON = JELON;
});
if(!/Android|webOS|iPhone|iPad|BlackBerry/i.test(navigator.userAgent)) {
// 只在PC端加载看板娘
require(['bannerGirl'], function(bannerGirl){
bannerGirl.init('/resource/model.json');
});
}

View File

@ -1,82 +0,0 @@
{
"mouseenter": [
{
"selector": ".content-main a[href^='http']",
"text": ["要看看 <span style=\"color:#0099cc;\">{text}</span> 么?"]
},
{
"selector": ".logo",
"text": ["点击前往首页,想回到上一页可以使用浏览器的后退功能哦"]
},
{
"selector": "#tor_show",
"text": ["翻页比较麻烦吗,点击可以显示这篇文章的目录呢"]
},
{
"selector": "#night_mode",
"text": ["深夜时要爱护眼睛呀"]
},
{
"selector": "#qrcode",
"text": ["手机扫一下就能继续看,很方便呢"]
},
{
"selector": ".com-text",
"text": ["要吐槽些什么呢"]
},
{
"selector": ".back-to-top",
"text": ["回到开始的地方吧"]
},
{
"selector": "#author",
"text": ["该怎么称呼你呢"]
},
{
"selector": "#mail",
"text": ["留下你的邮箱,不然就是无头像人士了"]
},
{
"selector": "#url",
"text": ["你的家在哪里呢,好让我去参观参观"]
},
{
"selector": "#textarea",
"text": ["认真填写哦,垃圾评论是禁止事项"]
},
{
"selector": ".OwO-logo",
"text": ["要插入一个表情吗"]
},
{
"selector": "#csubmit",
"text": ["要提交了吗,首次评论需要审核,请耐心等待~"]
},
{
"selector": ".ImageBox",
"text": ["点击图片可以放大呢"]
},
{
"selector": "#search-box",
"text": ["找不到想看的内容?搜索看看吧"]
},
{
"selector": ".page-navigator > a.prev",
"text": ["去上一页看看吧"]
},
{
"selector": ".page-navigator > a.next",
"text": ["去下一页看看吧"]
},
{
"selector": ".banner #live2d",
"text": ["干嘛呢你,快把手拿开", "鼠…鼠标放错地方了!"]
}
],
"click": [
{
"selector": ".banner #live2d",
"text": ["是…是不小心碰到了吧", "萝莉控是什么呀", "你看到我的小熊了吗", "再摸的话我可要报警了!⌇●﹏●⌇", "110吗这里有个变态一直在摸我(ó﹏ò。)"]
}
]
}

Some files were not shown because too many files have changed in this diff Show More