2
0
Fork 0

Added basic theme

This commit is contained in:
Willem Cazander 2020-01-03 18:07:50 +01:00
parent a085ca6867
commit 8b9afa66ce
42 changed files with 5633 additions and 0 deletions

7
.gitignore vendored Normal file
View File

@ -0,0 +1,7 @@
.DS_Store
Thumbs.db
db.json
*.log
node_modules/
public/
.deploy*/

11
.project Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>ff-website</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

108
_config.yml Normal file
View File

@ -0,0 +1,108 @@
# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/
# Site
title: ForwardFire
subtitle: ''
description: ''
keywords: pulsefire,java,vasc,x4o
author: Willem
language: en
timezone: Europe/Amsterdam
# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: http://www.forwardfire.net
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:
pretty_urls:
trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
trailing_html: true # Set to false to remove trailing '.html' from permalinks
# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:
# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link:
enable: true # Open external links in new tab
field: site # Apply to the whole site
exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
enable: true
line_number: true
auto_detect: false
tab_replace: ''
wrap: true
hljs: false
# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
path: ''
per_page: 10
order_by: -date
# Category & Tag
default_category: uncategorized
category_map:
tag_map:
# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: true
# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## Use post's date for updated date unless set in front-matter
use_date_for_updated: false
# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page
# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include:
exclude:
ignore:
# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: custom
# Deployment
## Docs: https://hexo.io/docs/deployment.html
deploy:
type: ''
# searchdb
search:
path: ff-search.xml
field: post
format: html
limit: 10000

3996
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

27
package.json Normal file
View File

@ -0,0 +1,27 @@
{
"name": "hexo-site",
"version": "0.0.0",
"private": true,
"scripts": {
"build": "hexo generate",
"clean": "hexo clean",
"deploy": "hexo deploy",
"server": "hexo server"
},
"hexo": {
"version": "4.2.0"
},
"dependencies": {
"hexo": "^4.0.0",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-category": "^1.0.0",
"hexo-generator-index": "^1.0.0",
"hexo-generator-searchdb": "^1.2.0",
"hexo-generator-tag": "^1.0.0",
"hexo-renderer-ejs": "^1.0.0",
"hexo-renderer-less": "^1.0.0",
"hexo-renderer-marked": "^2.0.0",
"hexo-renderer-stylus": "^1.1.0",
"hexo-server": "^1.0.0"
}
}

4
scaffolds/draft.md Normal file
View File

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

4
scaffolds/page.md Normal file
View File

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

5
scaffolds/post.md Normal file
View File

@ -0,0 +1,5 @@
---
title: {{ title }}
date: {{ date }}
tags:
---

27
themes/custom/_config.yml Normal file
View File

@ -0,0 +1,27 @@
Menu:
Home:
url: /
text: Home
# Tag:
# url: /tags
# text: Tags
Archive:
url: /archives
text: Archives
# Search:
# url: /search
# text: Search
Pulsefire:
url: /pulsefire
text: Pulsefire
Icon:
Favicon: /images/favicon.ico
Aside:
Avatar: /images/avatar.jpg
Author: Willem Cazander
Description:
Github: https://github.com/immetoo
Email: w.cazander@gmail.com
Footer:
counter: false

View File

@ -0,0 +1,2 @@
<pointer href="javascript:void(0);" class="arrow fa fa-arrow-up"></pointer>
<pointer href="javascript:void(0);" class="arrow fa fa-arrow-down"></pointer>

View File

@ -0,0 +1,12 @@
<aside class="aside">
<div class="aside-content">
<div class="aside-avatar"><img src="<%= theme.Aside.Avatar %>" alt="<%= theme.Aside.Author %>"></div>
<div class="aside-author"><%= theme.Aside.Author %></div>
<div class="aside-description"><%= theme.Aside.Description %></div>
<ul class="aside-contact clearFix">
<li><span class="fa fa-github"></span><a href="<%= theme.Aside.Github %>">Github</a></li>
<li><span class="fa fa-envelope"></span><a href="javascript:void(0);"><%= theme.Aside.Email %></a></li>
<li><span class="fa fa-envelope"></span><a href="javascript:void(0);"><%= theme.Aside.Email %></a></li>
</ul>
</div>
</aside>

View File

@ -0,0 +1,11 @@
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title><%=config.title %></title>
<%- favicon_tag(theme.Icon.Favicon) %>
<%- css("https://cdn.jsdelivr.net/gh/meethigher/cdn@9.0/css/meethigher-font.css") %>
<%- css("https://cdn.jsdelivr.net/gh/meethigher/cdn@9.0/css/animate.css") %>
<%- css('css/index.css') %>
</head>

View File

@ -0,0 +1,10 @@
<header class="header">
<div class="header-menu"><span class="fa fa-bars"></span></div>
<div class="header-search"><span class="fa fa-search"></span></div>
<div class="header-title"><a href="/"><%=config.title%> | <span class="header-subtitle"><%=config.subtitle%></span></a></div>
<ul class="header-navbar clearFix">
<% for(name in theme.Menu) { %>
<li><a href="<%- url_for(theme.Menu[name].url) %>"><%=theme.Menu[name].text%></a></li>
<% } %>
</ul>
</header>

View File

@ -0,0 +1,10 @@
<div class="post-nav">
<% if(page.total > 1) { %>
<div class="page-nav">
<%- paginator({
prev_text: "&laquo;",
next_text: "&raquo;"
}) %>
</div>
<% } %>
</div>

View File

@ -0,0 +1 @@
<div id="particles-js"></div>

View File

@ -0,0 +1 @@
<div class="search"><span class="fa fa-search"></span></div>

View File

@ -0,0 +1 @@
<div class="toolbar"><span class="fa fa-th"></span></div>

View File

@ -0,0 +1,27 @@
<div class="main-content meethigher-scroll">
<% let postsArr = [];
site.posts.forEach(function (post) {
postsArr.push(post);
});
let compare = function (obj1, obj2) {
var val1 = obj1.date;
var val2 = obj2.date;
if (val1 > val2) {
return -1;
} else if (val1 < val2) {
return 1;
} else {
return 0;
}
}
postsArr = postsArr.sort(compare);
%>
<div class="tag-tags">
<span class="tags-title">Archive&nbsp;-&nbsp;Total of <%= postsArr.length %> posts.</span>
<ul class="posts-all">
<% postsArr.forEach(function(post){ %>
<li><span><%= time(post.date, "YYYY-MM-DD") %></span><a href="<%- url_for("/") %><%= post.path %>"><%= post.title %></a></li>
<% }) %>
</ul>
</div>
</div>

View File

@ -0,0 +1,27 @@
<div class="main-content meethigher-scroll">
<div class="main-content-post">
<% page.posts.each(function (post) { %>
<article class="post">
<div class="post-title">
<a href="<%- url_for(post.path) %>"><%= post.title %></a>
</div>
<div class="post-excerpt">
<%- post.excerpt %>
</div>
<div class="post-content">
<a href="<%- url_for(post.path) %>">Read</a>
<% if (post.tags && post.tags.length){ %>
<%- list_tags(post.tags, {
show_count: false,
class: 'article-tag'
}) %>
<% } %>
</div>
<div class="post-media">
<span class="post-time">posted&nbsp;@&nbsp;<%- date(post.date, "YYYY-MM-DD HH:mm:ss") %>&nbsp;<%- config.author %></span>
</div>
</article>
<% }) %>
<%- partial("_partial/paginator") %>
</div>
</div>

View File

@ -0,0 +1,21 @@
<!doctype html>
<html lang="en">
<%- partial("_partial/head") %>
<body>
<%- partial("_partial/header") %>
<main class="main">
<%- body %>
<%- partial("_partial/arrow") %>
</main>
<%- partial("_partial/aside") %>
<%- partial("_partial/toolbar") %>
<!-- partial("_partial/search") -->
<%- partial("_partial/particles") %>
<%- js("https://cdn.jsdelivr.net/gh/meethigher/cdn@9.0/js/jquery.min.js") %>
<%- js("https://cdn.jsdelivr.net/gh/meethigher/cdn@9.0/js/particles.min.js") %>
<%- js("https://cdn.jsdelivr.net/gh/meethigher/cdn@9.0/js/app.js") %>
<%- js("https://cdn.jsdelivr.net/gh/meethigher/cdn@11/js/layer/layer.js") %>
<%- js("js/meethigher.js") %>
<%- js("js/toolbar.js") %>
</body>
</html>

View File

@ -0,0 +1,20 @@
<div class="main-content meethigher-scroll">
<article class="post">
<div class="post-title">
<h2 class="title"><%= page.title %></h2>
</div>
<div class="post-media2">
<span class="post-time"><%- date(page.date, "YYYY-MM-DD") %></span>
<% if (page.tags && page.tags.length){ %>
<%- list_tags(page.tags, {
show_count: false,
class: 'article-tag'
}) %>
<% } %>
</div>
<div class="post-content blog-markdown">
<%- page.more %>
</div>
</article>
<div class="outline"><span class="fa fa-list"></span></div>
</div>

View File

@ -0,0 +1,23 @@
<div class="main-content meethigher-scroll">
<div class="tag-tags">
<% if(!is_tag()) { %>
<span class="tags-title">No tag found&nbsp;-&nbsp;Total <%= site.tags.length %> tags.</span>
<ul class="tags-all clearFix">
<% for(let key in site.tags.data) { %>
<li><a href="<%- url_for("/tags/") %><%= site.tags.data[key].name %>/"><%= site.tags.data[key].name %></a></li>
<% } %>
</ul>
<% } else { %>
<% let tagNum = 0;site.tags.each(function (tag) {
if (tag.name == page.tag.trim()) tagNum = tag.length;
})%>
<span class="tags-title">Searched Tag&nbsp;-&nbsp;<%= page.tag %>&nbsp;-&nbsp;Found <%= tagNum %> Result</span>
<ul class="posts-all">
<% page.posts.each(function(post){ %>
<li><span><%= time(post.date, "YYYY-MM-DD") %></span><a href="<%- url_for("/") %><%= post.path %>"><%= post.title %></a></li>
<% }) %>
</ul>
<% } %>
</div>
<%- partial("_partial/paginator") %>
</div>

View File

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="generator" content="Hexo 3.9.0">
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Page not found</title>
<link rel="stylesheet" href="/css/index.css">
<style>
error {
font-size: 20px;
}
error span {
padding: 0 10px;
}
div {
margin: 0 auto;
text-align: center;
}
</style>
</head>
<body>
<error>
<div>Page not found</div>
</error>
<div id="particles-js"></div>
<script
src="https://cdn.jsdelivr.net/gh/meethigher/cdn@9.0/js/jquery.min.js"></script>
<script
src="https://cdn.jsdelivr.net/gh/meethigher/cdn@9.0/js/particles.min.js"></script>
<script src="https://cdn.jsdelivr.net/gh/meethigher/cdn@9.0/js/app.js"></script>
<script>
$span = $("span");
let i = $span.text();
let interval = setInterval(function() {
if (i <= 0) {
clearInterval(interval);
window.location.href = "https://meethigher.top/";
} else {
i--;
$span.text(i);
}
}, 1000);
</script>
</body>
</html>

View File

@ -0,0 +1 @@
.adapterMixin(@len);

View File

@ -0,0 +1,93 @@
.aside {
display:none;
position:absolute;
top:0;
right:0;
width:100%;
height:100%;
overflow:hidden;
background-color: rgba(0,0,0,0.3);
.aside-content {
position:absolute;
top:0;
right:0;
width:750rem/@baseFontSize;
transform:translateX(750rem/@baseFontSize);
transition:transform .75s;
height:100%;
background-color: rgba(0,0,0,.9);
padding:40rem/@baseFontSize 15rem/@baseFontSize;
.aside-avatar {
width:128rem/@baseFontSize;
height:128rem/@baseFontSize;
display:block;
border-radius:50%;
margin:0 auto;
overflow:hidden;
img {
width:128rem/@baseFontSize;
height:128rem/@baseFontSize;
}
}
.aside-author {
text-align:center;
font-family:"华文行楷",sans-serif;
font-size:40rem/@baseFontSize;
margin-top:20rem/@baseFontSize;
}
.aside-description {
text-align:center;
font-family:"华文行楷",sans-serif;
font-size:30rem/@baseFontSize;
margin-top:20rem/@baseFontSize;
}
.aside-contact {
margin-top:20rem/@baseFontSize;
li {
float:left;
width:220rem/@baseFontSize;
height:220rem/@baseFontSize;
margin:0 10rem/@baseFontSize;
border-radius:10rem/@baseFontSize;
background-color: rgba(255,255,255,.1);
text-align:center;
overflow:hidden;
position:relative;
span {
display:block;
width:100%;
height:100%;
line-height:220rem/@baseFontSize;
text-align:center;
}
span.fa {
font-size:30rem/@baseFontSize;
}
a {
position:absolute;
top:0;
left:0;
color: @colorFont;
display:block;
background-color: #CEBB3B;
width:100%;
height:100%;
line-height:220rem/@baseFontSize;
text-align:center;
transform:translateY(220rem/@baseFontSize);
overflow:hidden;
transition:transform .3s;
}
a.in {
transform:translateY(0);
}
img {
width:220rem/@baseFontSize;
}
}
}
}
.in {
transform:translateX(0);
}
}

View File

@ -0,0 +1,13 @@
/*
.footer {
width:100%;
height:80rem/@baseFontSize;
background-color: @colorBar;
font-size: 20rem/@baseFontSize;
position:fixed;
bottom:0;
left:0;
text-align:center;
line-height:80rem/@baseFontSize;
border-top:2px solid #fff;
}*/

View File

@ -0,0 +1,102 @@
.header {
width:100%;
height:80rem/@baseFontSize;
background-color: @colorBar;
font-size:20rem/@baseFontSize;
padding:0 80rem/@baseFontSize;
position:fixed;
top:0;
left:0;
line-height:80rem/@baseFontSize;
border-bottom:2px solid #fff;
a {
transition: all 0.3s ease !important;
&:hover {
color: @colorFontHover !important;
text-decoration: none !important;
}
}
.header-menu,.header-search {
cursor:pointer;
display:none;
position:absolute;
top:0;
span {
font-size:30rem/@baseFontSize;
}
}
.header-menu {
left:20rem/@baseFontSize;
}
.header-search {
right:20rem/@baseFontSize;
}
.header-title {
a {
font-size:25rem/@baseFontSize;
.header-subtitle {
font-size:20rem/@baseFontSize;
transition: all .3s ease;
}
&:hover .header-subtitle {
color:@colorFontHover;
}
}
}
@media screen and (min-width:750px) {
.header-title {
display:inline-block;
float:left;
a {
color:#fff;
.header-subtitle {
color:#fff;
}
}
}
.header-navbar {
float:right;
li {
float:left;
a {
padding:0 10rem/@baseFontSize;
color:#fff;
}
//a:hover {
// color:@colorFontHover;
//}
}
}
}
@media screen and (max-width:750px) {
.header-menu,.header-search {
display:block;
}
.header-title {
text-align:center;
a {
color:#fff;
.header-subtitle {
color:#fff;
}
}
}
.header-navbar {
display:none;
line-height:40rem/@baseFontSize;
position:absolute;
top:80rem/@baseFontSize;
left:0;
li {
padding:0 20rem/@baseFontSize;
a {
color:#fff;
}
//a:hover {
// color:@colorFontHover;
//}
}
}
}
}

View File

@ -0,0 +1,120 @@
.main {
width:100%;
height:100%;
padding:80rem/@baseFontSize 0 0 0;
overflow:hidden;
a {
transition: all 0.3s ease !important;
&:hover {
color: @colorFontHover !important;
text-decoration: none !important;
}
}
.arrow {
display:none;
padding:5rem/@baseFontSize 15rem/@baseFontSize;
border-radius:10rem/@baseFontSize;
background-color:rgba(255,255,255,.2) ;
color:@colorFont;
position:absolute;
left:0;
&.fa-arrow-down {
bottom:20rem/@baseFontSize;
}
&.fa-arrow-up {
top:100rem/@baseFontSize;
}
}
.main-content {
width:100%;
height:100%;
background-color: @colorBg;
padding:50rem/@baseFontSize 50rem/@baseFontSize;
overflow:auto;
.post {
border-radius:20rem/@baseFontSize;
padding:40rem/@baseFontSize 20rem/@baseFontSize;
min-width:100%;
background-color: rgba(255,255,255,.1);
margin-bottom:50rem/@baseFontSize;
overflow:hidden;
.post-title {
a {
font-size:25rem/@baseFontSize;
color:@colorFont;
}
h2 {
margin:10rem/@baseFontSize 0;
}
}
.post-excerpt {
margin-top:40rem/@baseFontSize;
}
.post-content {
margin-top:40rem/@baseFontSize;
a {
padding:5rem/@baseFontSize 15rem/@baseFontSize;
border-radius:10rem/@baseFontSize;
background-color:rgba(255,255,255,.2) ;
color:@colorFont;
}
.article-tag-list {
float:right;
.article-tag-list-item {
float:left;
margin:0 5rem/@baseFontSize;
}
}
}
.post-media {
margin-top:40rem/@baseFontSize;
text-align:right;
.post-time {
font-size:15rem/@baseFontSize;
}
a {
padding:5rem/@baseFontSize 15rem/@baseFontSize;
border-radius:10rem/@baseFontSize;
background-color:rgba(255,255,255,.2) ;
color:@colorFont;
}
.article-tag-list {
float:left;
.article-tag-list-item {
float:left;
margin:0 5rem/@baseFontSize;
}
}
}
}
.post-nav {
text-align:center;
.page-nav {
display:inline-block;
vertical-align: middle;
.page-number,.extend.prev,.extend.next {
padding:5rem/@baseFontSize 15rem/@baseFontSize;
border-radius:10rem/@baseFontSize;
margin:0 5rem/@baseFontSize;
background-color:rgba(255,255,255,.2) ;
color:@colorFont;
}
span.page-number {
color:@colorFontHover;
}
a.page-number {
}
}
}
}
}
#particles-js {
position:fixed;
top:0;
left:0;
width:100%;
height:100%;
background-color: @colorDiy;
z-index:-1;
}

View File

@ -0,0 +1,14 @@
.meethigher-scroll::-webkit-scrollbar {/*滚动条整体样式*/
width: 5rem/@baseFontSize; /*高宽分别对应横竖滚动条的尺寸*/
height: 10rem/@baseFontSize;
}
.meethigher-scroll::-webkit-scrollbar-thumb {/*滚动条里面小方块*/
border-radius: 10px;
background-color: @colorDiy;
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);
}
.meethigher-scroll::-webkit-scrollbar-track {/*滚动条里面轨道*/
-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
border-radius: 10px;
background: #EDEDED;
}

View File

@ -0,0 +1,8 @@
.adapterMixin(@index) when (@index>=1) {
@media(min-width:extract(@adapterDeviceList,@index)){
html {
font-size: @baseFontSize/ @psdWidth*extract(@adapterDeviceList,@index);
}
.adapterMixin(@index - 1);
}
}

View File

@ -0,0 +1,400 @@
.busuanzi {
margin-top: 30rem/@baseFontSize;
text-align: center;
}
//下面是目录样式
.outline {
padding: 5rem/@baseFontSize 15rem/@baseFontSize;
background-color: rgba(255, 255, 255, .2);
color: @colorFont;
cursor: pointer;
position: absolute;
top: 200px;
right: 0;
border-radius: 10rem/@baseFontSize;
}
.layui-layer-page {
background-color: #13172f !important;
border: 1px solid #fff !important;
border-radius: 10px !important;
}
.layui-layer-title {
border-top-left-radius: 10px !important;
border-top-right-radius:10px !important;
}
.layui-layer-content ul {
list-style:none;
}
.layui-layer-dialog {
background-color: #13172F !important;
border: 1px solid #fff !important;
border-radius: 10px !important;
}
.catalog-container {
padding:5px 10px;
font-size:16px;
}
.catalog-container ul li a {
text-decoration: underline;
}
//上面是目录样式
.post-media2 {
margin-top: 20rem/@baseFontSize;
.post-time {
padding: 5rem/@baseFontSize 15rem/@baseFontSize;
border-radius: 10rem/@baseFontSize;
background-color: rgba(255, 255, 255, .2);
color: @colorFont;
}
.article-tag-list {
float: left;
.article-tag-list-item {
float: left;
margin: 0 5rem/@baseFontSize;
a {
padding: 5rem/@baseFontSize 15rem/@baseFontSize;
border-radius: 10rem/@baseFontSize;
background-color: rgba(255, 255, 255, .2);
color: @colorFont;
}
}
}
}
.blog-markdown {
font-size: 18rem/@baseFontSize !important;
/*设置h标签*/
.postSize(@fontSize) {
font-size: @fontSize/@baseFontSize !important;
margin: 10rem/@baseFontSize 0;
}
h6 {
.postSize(18rem);
}
h5 {
.postSize(20rem);
}
h4 {
.postSize(22rem);
}
h3 {
.postSize(24rem);
}
h2 {
.postSize(26rem);
}
h1 {
.postSize(28rem);
}
/*设置无序有序标签*/
ul, ol {
margin-left: 30rem/@baseFontSize;
li {
margin: 3rem/@baseFontSize 0;
}
}
ul {
list-style-type: disc;
}
ol {
list-style-type: decimal;
}
/*设置引用标签*/
blockquote {
border: none;
color: @colorFont;
margin: 20rem/@baseFontSize 0;
padding: 0 0 0 10rem/@baseFontSize;
min-height: 20rem/@baseFontSize;
background-color: transparent;
line-height: inherit;
border-left: 4px solid @post-blockquote-border-color;
}
/*设置加粗倾斜*/
strong {
margin: 0 3rem/@baseFontSize;
}
em {
padding-right: 3rem/@baseFontSize;
}
/*设置图片*/
@media screen and (min-width: 767px) {
img {
max-width: 930rem/@baseFontSize;
display: block;
margin: 15rem/@baseFontSize auto 30rem/@baseFontSize auto;
border-radius: 3rem/@baseFontSize;
}
}
@media screen and (max-width: 767px) {
img {
width: 100%;
display: block;
margin: 15rem/@baseFontSize auto 30rem/@baseFontSize auto;
border-radius: 3rem/@baseFontSize;
}
}
/*设置表格*/
> table {
font-size: 16rem/@baseFontSize;
border-collapse: collapse;
border-spacing: 0;
empty-cells: show;
border: 1px solid @post-table-border-color;
width: 100%;
margin-bottom: 24rem/@baseFontSize;
border-radius: 3rem/@baseFontSize;
th {
font-family: inherit;
font-size: inherit;
background-color: @post-table-thead-bg-color !important;
white-space: nowrap;
font-weight: 600;
border: 1px solid @post-table-border-color !important;
padding: 8rem/@baseFontSize 16rem/baseFontSize !important;
}
td {
border: 1px solid @post-table-border-color !important;
padding: 8rem/@baseFontSize 16rem/@baseFontSize !important;
}
}
/*设置超链接*/
a {
padding: 0 !important;
border-radius: 0 !important;
color: @colorFontHover !important;
background-color: transparent !important;
}
/*设置段落格式*/
p {
margin: 10rem/@baseFontSize auto;
text-indent: 0;
}
/*设置关键字*/
code {
color: @colorFont;
line-height: 1;
padding: 3rem/@baseFontSize 4rem/@baseFontSize;
margin: 0 3rem/@baseFontSize;
border-radius: 3rem/@baseFontSize !important;
border: 1px solid @post-table-border-color;
background-color: @post-table-thead-bg-color;
}
/*设置代码块*/
figure.highlight {
background-color: @post-table-thead-bg-color;
padding: 30rem/@baseFontSize 0 10rem/@baseFontSize 0;
border: 1px solid @post-table-border-color;
border-radius: 3rem/@baseFontSize;
position: relative;
overflow-x: auto;
width: 100%;
span.language {
position: absolute;
top: 0;
left: 0;
padding: 5rem/@baseFontSize 6rem/@baseFontSize 6rem/@baseFontSize 6rem/@baseFontSize;
border-radius: 10rem/@baseFontSize;
}
table {
width: 100%;
position: relative;
.line {
font-family: "Comic Sans MS", Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace !important;
line-height: 12rem/@baseFontSize;
.comment,
.quote {
color: #5c6370;
font-style: italic;
}
.doctag,
.keyword,
.formula {
color: #c678dd;
}
.section,
.name,
.selector-tag,
.deletion,
.subst {
color: #e06c75;
}
.literal {
color: #56b6c2;
}
.string,
.regexp,
.addition,
.attribute,
.meta-string {
color: #98c379;
}
.built_in,
.class .title {
color: #e6c07b;
}
.attr,
.variable,
.template-variable,
.type,
.selector-class,
.selector-attr,
.selector-pseudo,
.number {
color: #d19a66;
}
.symbol,
.bullet,
.link,
.meta,
.selector-id,
.title {
color: #61aeee;
}
.emphasis {
font-style: italic;
}
.strong {
font-weight: bold;
}
.link {
text-decoration: underline;
}
}
.gutter {
width: 30rem/@baseFontSize;
pre {
padding-left: 8rem/@baseFontSize;
text-align: right;
color: @post-table-border-color;
}
}
.code {
pre {
padding-right: 8rem/@baseFontSize;
padding-left: 8rem/@baseFontSize;
width: 100%;
}
}
&::before {
position: absolute;
top: -30rem/@baseFontSize;
left: 0;
min-width: 100%;
display: block;
height: 30rem/@baseFontSize;
background-color: @post-table-border-color;
content: ""
}
tbody {
pointer-events: none;
&::after {
position: absolute;
top: -30rem/@baseFontSize;
right: 0;
content: "copy";
padding: 5rem/@baseFontSize 6rem/@baseFontSize 6rem/@baseFontSize 6rem/@baseFontSize;
border-radius: 10rem/@baseFontSize;
background-color: skyblue;
cursor: pointer;
pointer-events: all;
}
.before {
opacity: 0;
position: absolute;
top: -30rem/@baseFontSize;
right: 50rem/@baseFontSize;
padding: 5rem/@baseFontSize 6rem/@baseFontSize 6rem/@baseFontSize 6rem/@baseFontSize;
background-color: skyblue;
content: "success";
border-radius: 10rem/@baseFontSize;
animation: copy 1.5s;
}
@keyframes copy {
0% {
opacity: 0
}
50% {
opacity: 1
}
100% {
opacity: 0
}
}
}
}
&::-webkit-scrollbar { /*滚动条整体样式*/
width: 5rem/@baseFontSize; /*高宽分别对应横竖滚动条的尺寸*/
height: 5rem/@baseFontSize;
}
&::-webkit-scrollbar-thumb { /*滚动条里面小方块*/
border-radius: 10px;
background-color: @colorDiy;
background-image: -webkit-linear-gradient(45deg, rgba(255, 255, 255, .2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .2) 50%, rgba(255, 255, 255, .2) 75%, transparent 75%, transparent);
}
&::-webkit-scrollbar-track { /*滚动条里面轨道*/
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
border-radius: 10px;
background: #EDEDED;
}
}
}

View File

@ -0,0 +1,55 @@
/*========reset css===============*/
*,
*::before,
*::after {
/*所有的标签和伪元素都选中*/
margin: 0;
padding: 0;
/*移动端常用布局是非固定像素布局*/
box-sizing: border-box;
-webkit-box-sizing: border-box;
/*点击高亮效果清除*/
tap-highlight-color: transparent;
-webkit-tap-highlight-color: transparent;
}
html, body {
width: 100%;
height: 100%;
}
body {
font-size: 20rem/@baseFontSize;
font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', sans-serif;
color: @colorFont;
}
ul, ol {
list-style: none;
}
a {
text-decoration: none;
color: @colorFont;
}
input, textarea {
border: none;
outline: none;
/*不允许改变尺寸*/
resize: none;
/*元素的外观 none没有任何样式*/
-webkit-appearance: none;
}
/*===============common css===========*/
/*清除浮动*/
.clearFix::before,
.clearFix::after {
content: "";
display: block;
visibility: hidden;
height: 0;
line-height: 0;
clear: both;
}

View File

@ -0,0 +1,40 @@
.search {
padding: 5rem/@baseFontSize 15rem/@baseFontSize;
background-color: rgba(255, 255, 255, .2);
color: @colorFont;
cursor: pointer;
position: absolute;
top: 150px;
right: 0;
border-radius: 10rem/@baseFontSize;
}
@media screen and (max-width: 750px) {
.search {
display: none;
}
}
.search-container {
margin:0 auto;
text-align:center;
padding:5px 10px;
font-size:16px;
#input {
outline: none;
border: 1px solid orange;
padding: 5px 10px;
vertical-align: middle;
border-radius: 10px;
}
.btn-search {
cursor:pointer;
display:inline-block;
padding:5px 10px;
}
.result {
list-style:none;
}
.result li {
border-bottom: 1px solid rgba(255,255,255,.1);
}
}

View File

@ -0,0 +1,45 @@
.tag-tags {
.tags-title {
font-size:26rem/@baseFontSize;
display:block;
margin:0 auto;
text-align:center;
}
.tags-all {
margin-top:10rem/@baseFontSize;
li {
float:left;
margin:10rem/@baseFontSize 5rem/@baseFontSize;
a {
padding:5rem/@baseFontSize 15rem/@baseFontSize;
border-radius:10rem/@baseFontSize;
background-color:rgba(255,255,255,.2) ;
color:@colorFont;
}
}
}
.posts-all {
margin:10rem/@baseFontSize 0;
text-align:left;
li {
padding:5rem/@baseFontSize 15rem/@baseFontSize;
border-radius:10rem/@baseFontSize;
background-color:rgba(255,255,255,.2) ;
color:@colorFont;
margin-top:10rem/@baseFontSize;
width:100%;
span {
width:50%;
display:inline-block;
text-align:right;
padding-right:50rem/@baseFontSize;
}
a {
width:50%;
display:inline-block;
padding-left:50rem/@baseFontSize;
//padding-left:100rem/@baseFontSize;
}
}
}
}

View File

@ -0,0 +1,15 @@
.toolbar {
padding:5rem/@baseFontSize 15rem/@baseFontSize;
background-color:rgba(255,255,255,.2) ;
color:@colorFont;
cursor:pointer;
position:absolute;
top:100px;
right:0;
border-radius:10rem/@baseFontSize;
}
@media screen and (max-width:750px) {
.toolbar {
display:none;
}
}

View File

@ -0,0 +1,37 @@
@charset "UTF-8";
@adapterDeviceList:750px,720px,640px,540px,480px,424px,414px,400px,384px,375px,360px,320px;
@psdWidth:750px;
@baseFontSize:100px;
@len:length(@adapterDeviceList);
@colorDiy:#13172F;
@colorBar:transparent;
@colorBg:transparent;
@colorFont:#fff;
@colorFontHover:gold;
@blog-bg-color: #2B2A32;
@blog-theme-color: #FF787F;
@blog-border-color: #3e4c42;
@blog-font-color: #25AD87;
@blog-title-color: #25AD87;
@blog-github-fill-color: #25AD87;
@post-catalog-bg-color: #2b2a32;
@post-catalog-font-color: #288EAD;
@post-table-thead-bg-color: #30303a;
@post-table-border-color: #3e4c42;
@post-inline-code-bg-color: #282c34;
@post-inline-code-border-color: #3e4c42;
@post-cnblogs-code-bg-color: #282c34;
@post-cnblogs-code-font-color: #abb2bf;
@post-signature-bg-color: #30303a;
@post-blockquote-border-color: #479680;
@comment-font-color: #C8B735;
@comment-bg-color: #30303a;

View File

@ -0,0 +1,28 @@
@import "_partial/var";
@import "_partial/mixins";
@import "_partial/adapter";
@import "_partial/reset";
/*===============diy css===========*/
@import "_partial/meethigher-scroll";
@import "_partial/header";
@import "_partial/aside";
@import "_partial/layout";
@import "_partial/post";
@import "_partial/tag";
@import "_partial/archive";
@import "_partial/footer";
@import "_partial/toolbar";
@import "_partial/search";

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -0,0 +1,212 @@
$(function () {
let $menu = $(".header-menu");
let $headerNavbar = $(".header-navbar");
let $arrowUp = $(".arrow.fa-arrow-up");
let $arrowDown = $(".arrow.fa-arrow-down");
let $mainContent = $(".main-content");
let $copy = $("figure.highlight tbody");
let flag = false;
let isClick = true;
$menu.on("click", function () {
if (!isClick) return;
isClick = false;
if (!flag) {
$headerNavbar.fadeIn(function () {
flag = true;
isClick = true;
});
return;
}
$headerNavbar.fadeOut(function () {
flag = false;
isClick = true;
});
});
$arrowUp.on("click", function () {
$mainContent.animate({
scrollTop: 0
});
});
$arrowDown.on("click", function () {
let scrollHeight = $mainContent[0].scrollHeight - $mainContent[0].offsetHeight;
$mainContent.animate({
scrollTop: scrollHeight
});
});
$mainContent.scroll(function () {
$arrowUp.fadeIn();
$arrowDown.fadeIn();
});
$copy.on("click", function () {
let $pre = $(this).find(".code pre");
let text = $pre.text();
let $input = $("<input>");
let $copySuccess = $("<span>success</span>");
$copySuccess.addClass("before");
$input.val(text);
$(this).append($copySuccess);
$pre.append($input);
$input.select();
document.execCommand("Copy");
$input.remove();
setTimeout(function () {
$copySuccess.remove();
}, 1500);
});
let getLanguage = function () {
$("figure.highlight").each(function () {
let str = $(this).attr("class");
str = str.substr(10);
let $span = $("<span class='language'>" + str + "</span>");
$(this).append($span);
});
};
getLanguage();
});
//生成文章的目录
$(function () {
let $outline = $(".outline");
let $catalog = $("<ul></ul>");
let $headerlink = $(".headerlink");
$headerlink.each(function () {
let spaceNum = "";
switch ($(this).parent()[0].tagName) {
case "H1":
spaceNum = 0;
break;
case "H2":
spaceNum = 1;
break;
case "H3":
spaceNum = 2;
break;
case "H4":
spaceNum = 3;
break;
case "H5":
spaceNum = 4;
break;
case "H6":
spaceNum = 5;
break;
}
let content = $(this).attr("title");
let $li = $("<li></li>");
let $a = $("<a href='" + $(this).attr("href") + "'>" + content + "</a>");
$li.append($a);
$li.css("margin-left",spaceNum*10+"px");
$catalog.append($li);
});
$outline.on("click", function () {
layer.open({
title: "Index",
type: 1,
skin: 'layui-layer-rim', //加上边框
area: ['320px', '240px'], //宽高
content: "<div class='catalog-container'><ul>" + $catalog.html() + "</ul></div>"
});
});
});
//搜索功能
$(function (){
$(".header-search").on("click",function (){
$(".search").click();
});
//=============================================
let url = [];
let title = [];
let content = [];
let ajaxing = false;
function ajaxSearch() {
url=[];
title=[];
content=[];
ajaxing = true;
$.ajax({
url: "meethigher.xml",//此处需要修改成你的路径
dataType: "xml",
type: "GET",
error: function () {
layer.msg("Error while searching, sorry ❤");
},
success: function (data) {
$(data).find("entry").each(function () {
url.push($(this).find("url").text());
title.push($(this).find("title").text());
content.push($(this).find("content").text());
});
},
complete: function () {
ajaxing = false;
}
});
}
function searchResult($result,value) {
let count = 0;
let index= layer.load(1, {shade: [0.1, '#fff']});
let timeId = setInterval(function () {
count++;
if (!ajaxing) {
render($result,value);
clearInterval(timeId);
layer.close(index);
}
if (count >= 15) {
layer.close(index);
layer.msg("Search did not return in time");
clearInterval(timeId);
}
}, 1000);
}
function render($result,value) {
let isContains=false;
content.forEach(function (ele,index){
if(ele.indexOf(value)>-1){
let $li=$("<li><a href='"+url[index]+"'>"+title[index]+"</a></li>");
$result.append($li);
isContains=true;
}
});
if(!isContains)
layer.msg("Nothing you want, dear");
}
//================================================
$(".search").on("click",function (){
layer.open({
title: "Search",
type: 1,
skin: 'layui-layer-rim', //加上边框
area: ['320px', '240px'], //宽高
content: "<div class=\"search-container\">\n" +
" <input type=\"search\" placeholder=\"Search\" id=\"input\" autocomplete='off'>\n" +
" <div class=\"btn-search\"><span class=\"fa fa-search\"></span></div>\n" +
" <ul class=\"result\"></ul>\n" +
"</div>"
});
let $input=$("#input");
let $button=$(".btn-search");
let $result=$(".result");
$input.on("keydown",function (e){
if(e.which===13){
$button.click();
}
});
$button.on("click",function (){
$result.empty();
ajaxSearch();
let value = $input.val();
if(value===""||value===null){
layer.msg("Search had no results.");
return;
}
searchResult($result,value);
});
});
});

View File

@ -0,0 +1,46 @@
$(function () {
let $toolbar = $(".toolbar");
let $aside = $(".aside");
let $asideContent = $(".aside-content");
let $divs = $(".aside-content div");
let flag = false;
let isClick = true;
let isRotate = false;
let $lis = $(".aside-contact li");
//toolbar点击事件
$toolbar.on("click", function () {
if (!isClick) return;
isClick = false;
if (flag) {
$asideContent.removeClass("in");
flag = false;
return;
}
$aside.fadeIn();
$asideContent.addClass("in");
flag = true;
$asideContent.on("transitionend", function () {
if (!$asideContent.hasClass("in")) {
$aside.hide();
}
isClick = true;
});
});
//contact经过事件
$lis.on("mouseover", function () {
$(this).children("a").addClass("in");
}).on("mouseleave", function () {
$(this).children("a").removeClass("in");
});
//鼠标经过动态事件
$divs.on("mouseover",function (){
$(this).addClass("heartBeat").addClass("animated");
}).on("mouseleave",function (){
$(this).removeClass("heartBeat");
});
});