chore(init): init
1
.eslintignore
Normal file
@ -0,0 +1 @@
|
|||||||
|
source/
|
23
.eslintrc.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
module.exports = {
|
||||||
|
'env': {
|
||||||
|
'browser': true,
|
||||||
|
'es2021': true
|
||||||
|
},
|
||||||
|
'extends': 'eslint:recommended',
|
||||||
|
'overrides': [],
|
||||||
|
'parserOptions': {
|
||||||
|
'ecmaVersion': 'latest',
|
||||||
|
'sourceType': 'module'
|
||||||
|
},
|
||||||
|
'rules': {
|
||||||
|
'indent': ['error', 2],
|
||||||
|
'linebreak-style': ['error', 'unix'],
|
||||||
|
'quotes': ['error', 'single'],
|
||||||
|
'semi': ['error', 'never'],
|
||||||
|
'no-undef': ['off'],
|
||||||
|
'no-unused-vars': ['off'],
|
||||||
|
'no-useless-escape': ['off'],
|
||||||
|
'no-mixed-spaces-and-tabs': ['off'],
|
||||||
|
'no-inner-declarations': ['off']
|
||||||
|
}
|
||||||
|
}
|
58
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
name: BUG 提交
|
||||||
|
description: 提交 Bug 反馈
|
||||||
|
title: 'bug:'
|
||||||
|
labels: [bug]
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
id: preface
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
感谢你花时间填写此错误报告!在开始之前,我们非常推荐阅读一遍[《开源最佳实践》](https://github.com/LinuxSuRen/open-source-best-practice),这会在很大程度上提高我们彼此的效率。
|
||||||
|
- type: markdown
|
||||||
|
id: environment
|
||||||
|
attributes:
|
||||||
|
value: "## 环境信息"
|
||||||
|
- type: input
|
||||||
|
id: halo-version
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
attributes:
|
||||||
|
label: "是什么 Halo 版本出现了此问题?"
|
||||||
|
description: "可以在管理后台的关于页面中找到。"
|
||||||
|
- type: input
|
||||||
|
id: dream-version
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
attributes:
|
||||||
|
label: "使用的 Dream 版本是多少?"
|
||||||
|
description: "可以在主题 `theme.yaml` 文件中找到。"
|
||||||
|
- type: input
|
||||||
|
id: site-url
|
||||||
|
attributes:
|
||||||
|
label: "在线博客地址"
|
||||||
|
description: "如果可以的话,请提供你的博客地址。这可能会帮助我们更好的定位问题。"
|
||||||
|
placeholder: "ex. https://blog.nineya.com"
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
- type: markdown
|
||||||
|
id: details
|
||||||
|
attributes:
|
||||||
|
value: "## 详细信息"
|
||||||
|
- type: textarea
|
||||||
|
id: what-happened
|
||||||
|
attributes:
|
||||||
|
label: "BUG 内容"
|
||||||
|
description: "较详细的描述 BUG 导致了什么问题。"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: logs
|
||||||
|
attributes:
|
||||||
|
label: "相关 Console 日志输出"
|
||||||
|
description: "浏览器界面按 `F12` 进入开发者工具,请复制并粘贴任何相关的控制台日志输出。 这将自动格式化为代码,因此无需反引号。"
|
||||||
|
render: shell
|
||||||
|
- type: textarea
|
||||||
|
id: additional-information
|
||||||
|
attributes:
|
||||||
|
label: "附加信息"
|
||||||
|
description: "如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。"
|
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
blank_issues_enabled: true
|
||||||
|
contact_links:
|
||||||
|
- name: 加入主题交流群
|
||||||
|
url: https://qm.qq.com/cgi-bin/qm/qr?k=X7p7Bs21cgtkQ0dRfzmBsuWqNNQc10hn&jump_from=webapi
|
||||||
|
about: 如果问题描述起来较于复杂,欢迎加入 Dream 主题交流群进行提问。
|
41
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
name: 新特性建议
|
||||||
|
description: 提交新特性建议
|
||||||
|
title: 'feat:'
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
id: preface
|
||||||
|
attributes:
|
||||||
|
value: "你好!感谢你为 Dream 提交新特性建议。在开始之前,我们非常推荐阅读一遍[《开源最佳实践》](https://github.com/LinuxSuRen/open-source-best-practice),这会在很大程度上提高我们彼此的效率。"
|
||||||
|
- type: markdown
|
||||||
|
id: environment
|
||||||
|
attributes:
|
||||||
|
value: "## 环境信息"
|
||||||
|
- type: input
|
||||||
|
id: halo-version
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
attributes:
|
||||||
|
label: "你当前使用的 Halo 版本"
|
||||||
|
description: "可以在管理后台的关于页面中找到。"
|
||||||
|
- type: input
|
||||||
|
id: dream-version
|
||||||
|
validations:
|
||||||
|
required: false
|
||||||
|
attributes:
|
||||||
|
label: "你当前使用的 Dream 版本"
|
||||||
|
description: "可以在主题 `theme.yaml` 文件中找到。"
|
||||||
|
- type: markdown
|
||||||
|
id: details
|
||||||
|
attributes:
|
||||||
|
value: "## 详细信息"
|
||||||
|
- type: textarea
|
||||||
|
id: description
|
||||||
|
attributes:
|
||||||
|
label: "描述一下此特性"
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: textarea
|
||||||
|
id: additional-information
|
||||||
|
attributes:
|
||||||
|
label: "附加信息"
|
||||||
|
description: "如果你还有其他需要提供的信息,可以在这里填写(可以提供截图、视频等)。"
|
5
.gitignore
vendored
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
*.iml
|
||||||
|
.idea/
|
||||||
|
node_modules/
|
||||||
|
dist/
|
||||||
|
package-lock.json
|
5
.npmignore
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
/node_modules/*
|
||||||
|
/.idea/*
|
||||||
|
/.git/*
|
||||||
|
/.github/*
|
||||||
|
/dist
|
2
.npmrc
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
shamefully-hoist=true
|
||||||
|
registry=https://registry.npmjs.org
|
2
404.ftl
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<#include "template/errorpage.ftl">
|
||||||
|
<@errorpage "找不到网页","无法找到该文章或分类,可能已被删除,去<a href='${blog_url}'>首页</a>看看吧。","${status!}","${error!}","${message!}" />
|
2
500.ftl
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
<#include "template/errorpage.ftl">
|
||||||
|
<@errorpage "服务器繁忙","围观群众太过热情,服务器繁忙,请稍后访问。","${status!}","${error!}","${message!}" />
|
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2021 Nineya
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
117
README.md
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<p align="center">
|
||||||
|
<img src="https://cdn.jsdelivr.net/gh/nineya/halo-theme-dream/screenshot.png" alt="halo-theme-dream" width="180">
|
||||||
|
</p>
|
||||||
|
<h1 align="center">halo-theme-dream</h1>
|
||||||
|
|
||||||
|
<p align="center">
|
||||||
|
<a href="https://github.com/nineya/halo-theme-dream/releases"><img alt="releases" src="https://img.shields.io/github/release/nineya/halo-theme-dream.svg?style=flat-square"/></a>
|
||||||
|
<a href="https://github.com/nineya/halo-theme-dream/blob/master/LICENSE"><img alt="license" src="https://img.shields.io/github/license/nineya/halo-theme-dream?style=flat-square"/></a>
|
||||||
|
<a href="https://github.com/nineya/halo-theme-dream/releases"><img alt="downloads" src="https://img.shields.io/github/downloads/nineya/halo-theme-dream/total.svg?style=flat-square"/></a>
|
||||||
|
<a href="https://github.com/nineya/halo-theme-dream/releases"><img alt="size" src="https://img.shields.io/github/languages/code-size/nineya/halo-theme-dream?style=flat-square"/></a>
|
||||||
|
<a href="https://github.com/nineya/halo-theme-dream/commits"><img alt="commits" src="https://img.shields.io/github/last-commit/nineya/halo-theme-dream.svg?style=flat-square"/></a>
|
||||||
|
<a href="https://github.com/nineya/halo-theme-dream#donate"><img alt="donate" src="https://img.shields.io/badge/$-donate-ff69b4.svg?style=flat-square"/></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
|
|
||||||
|
## 一、预览
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
预览:[主题预览](https://github.com/nineya/halo-theme-dream/discussions/72)
|
||||||
|
> 如果你有计划长期使用 `Dream` 主题,也来[这里](https://github.com/nineya/halo-theme-dream/discussions/72)留下你的博客链接吧。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 二、说明
|
||||||
|
|
||||||
|
梦之城,童话梦境,动漫类型博客主题。
|
||||||
|
|
||||||
|
关于主题使用上的一些问题可以参见 [主题使用手册-基础篇](https://blog.nineya.com/archives/94.html)
|
||||||
|
|
||||||
|
如果还有疑问,欢迎加入 <a target="_blank" href="https://qm.qq.com/cgi-bin/qm/qr?k=X7p7Bs21cgtkQ0dRfzmBsuWqNNQc10hn&jump_from=webapi">Dream 主题交流群:638168592</a>
|
||||||
|
|
||||||
|
欢迎参与主题开发的一些<a href="https://github.com/nineya/halo-theme-dream/discussions">问题探讨</a>
|
||||||
|
|
||||||
|
## 三、版本适配关系
|
||||||
|
|
||||||
|
| 主题版本 | 适配Halo版本 | 测试用Halo版本 |
|
||||||
|
| ----------- | --------------------------- | -------------- |
|
||||||
|
| 1.x | 1.4.x及以下(不保证适配性) | 1.4.8 |
|
||||||
|
| 2.0.0-2.0.1 | 1.4.x | 1.4.8 |
|
||||||
|
| 2.0.2+ | 1.5.x | 1.5.3 |
|
||||||
|
|
||||||
|
> 主题未在配置要求中对 Halo 最低版本限制得太死,但 Halo 不同版本开发接口略有不同,在不适配的版本中无法保证完全兼容。
|
||||||
|
>
|
||||||
|
> 相对来说,测试用的 Halo 版本具有最好的适配性,是主题推荐的 `Halo` 版本。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## 四、安装 & 更新
|
||||||
|
|
||||||
|
### 4.1 安装包安装 & 更新
|
||||||
|
|
||||||
|
1. 进入主题 `Release` 界面:https://github.com/nineya/halo-theme-dream/releases 下载主题压缩包 `halo-theme-dream.zip` 压缩包文件;
|
||||||
|
2. 进入博客后台管理 `外观->主题->安装->本地上传`,选择下载的 `halo-theme-dream.zip` 安装包进行上传;
|
||||||
|
3. 等待安装完成;
|
||||||
|
4. 更新主题时同样前往主题 `Release` 界面下载主题安装包,然后通过 `外观->主题->Dream->更多->从主题包更新` 方法上传安装包进行更新。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 4.2 在线安装 & 更新
|
||||||
|
|
||||||
|
1. 复制主题仓库地址 `https://github.com/nineya/halo-theme-dream.git`
|
||||||
|
|
||||||
|
2. 进入博客后台管理 `外观->主题->安装->远程下载`,黏贴仓库地址进行安装;
|
||||||
|
3. 等待安装完成;
|
||||||
|
4. 在线更新主题时,通过 ``外观->主题->Dream->更多->在线更新` 方法进行更新。
|
||||||
|
|
||||||
|
> 在线安装 & 更新的方式不推荐:
|
||||||
|
>
|
||||||
|
> 1. 因为由于 `GitHub` 的网络问题,很大几率会安装& 更新失败;
|
||||||
|
> 2. 主题是经过源码编译的,直接从仓库下载包含了主题的源码以及开发所需的相关文件,这些文件并不是安装主题所需要的。
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### 4.3 安装配置邮件模板
|
||||||
|
|
||||||
|
配置邮件模板需要登录服务器添加模板文件,并重启 `Halo`。
|
||||||
|
|
||||||
|
1. 登录服务器,按步骤执行如下命令:
|
||||||
|
```bash
|
||||||
|
# 创建邮件模板目录
|
||||||
|
mkdir -r ~/.halo/templates/common/mail_template/
|
||||||
|
cd ~/.halo/templates/common/mail_template/
|
||||||
|
|
||||||
|
# 创建mail_notice.ftl文件
|
||||||
|
vi mail_notice.ftl
|
||||||
|
## 文件内容如下(只需这一行即可):
|
||||||
|
<#include "../../themes/dream/mail_template/mail_notice.ftl">
|
||||||
|
|
||||||
|
# 创建mail_reply.ftl文件
|
||||||
|
vi mail_reply.ftl
|
||||||
|
## 文件内容如下(只需这一行即可):
|
||||||
|
<#include "../../themes/dream/mail_template/mail_reply.ftl"
|
||||||
|
```
|
||||||
|
|
||||||
|
2. 重启 `Halo`
|
||||||
|
|
||||||
|
## 五、参与主题开发
|
||||||
|
|
||||||
|
> 推荐使用 IDEA 进行主题开发,能够比较好的支持 FreeMarker。
|
||||||
|
|
||||||
|
1. 开发环境准备
|
||||||
|
- 安装 `nodejs` 版本需要在 `15+`;
|
||||||
|
- 主题目录下执行 `npm i` 安装依赖;
|
||||||
|
|
||||||
|
2. npm 命令
|
||||||
|
- `npm run build` 执行主题打包操作,主题将被打包为压缩包文件存放在 `dist/` 目录下,同时 `source` 目录下的文件也将被更新。
|
||||||
|
- `npm run build --devel` 开发模式进行主题打包,`js` 和 `css` 不会被做压缩和混淆处理,方便排查问题。
|
||||||
|
- `npm run cdn --tag=$version` 创建 `FreeCDN` 清单文件,必须指定 `tag` 参数,值为本地代码将发布到 `GitHub` 仓库的版本标签。
|
||||||
|
- `npm run release --tag=$version` 发布模式执行主题打包操作,将自动更新主题中的版本号,并使用这个版本标签重新创建 `FreeCDN` 清单文件。
|
||||||
|
|
||||||
|
|
||||||
|
## 六、打赏项目
|
||||||
|
|
||||||
|
感谢您对本项目的喜爱,您的打赏是对本项目最好的支持!本项目所有打赏收益将全部投入到支付宝公益项目,捐赠记录在[关于我的](https://blog.nineya.com/about)中可见,一起为公益事业加油。
|
||||||
|
|
||||||
|

|
40
archives.ftl
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<#include "template/layout.ftl">
|
||||||
|
<@layout title="归档 - ${blog_title!}" canonical="${archives_url!}">
|
||||||
|
<#if (archives)?? && archives?size gt 0>
|
||||||
|
<#list archives as archive>
|
||||||
|
<div class="card card-content">
|
||||||
|
<div class="timeline-title">${archive.year?c}</div>
|
||||||
|
<div class="timeline">
|
||||||
|
<#list archive.posts as post>
|
||||||
|
<article class="media">
|
||||||
|
<#if post.thumbnail?? && post.thumbnail!=''>
|
||||||
|
<a href="${post.fullPath}" class="media-left">
|
||||||
|
<img class="not-gallery" src="${post.thumbnail!}" alt="${post.title!}">
|
||||||
|
</a>
|
||||||
|
</#if>
|
||||||
|
<div class="media-content">
|
||||||
|
<time datetime="${post.createTime!}">${post.createTime?string('yyyy-MM-dd')}</time>
|
||||||
|
<a href="${post.fullPath!}" class="title has-link-grey">${post.title!}</a>
|
||||||
|
<#if post.categories?? && post.categories?size gt 0>
|
||||||
|
<p>
|
||||||
|
<#list post.categories as category>
|
||||||
|
<a class="has-link-grey"
|
||||||
|
href="${category.fullPath!}">${category.name!}</a>
|
||||||
|
</#list>
|
||||||
|
</p>
|
||||||
|
</#if>
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
</#list>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</#list>
|
||||||
|
<#include "template/main/pagination.ftl">
|
||||||
|
<@pagination method="archives" datas=posts display="${settings.page_number!5}" />
|
||||||
|
<#else>
|
||||||
|
<div class="card card-empty">
|
||||||
|
<i class="fa fa-inbox"></i>
|
||||||
|
还没有发表过文章,回<a href="${context!}">主页</a>看看吧
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
|
</@layout>
|
39
categories.ftl
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
<#include "template/layout.ftl">
|
||||||
|
<#macro categoriesTree categories>
|
||||||
|
<#list categories as category>
|
||||||
|
<li>
|
||||||
|
<a class="level is-marginless" href="${category.fullPath!}">
|
||||||
|
<span class="level-item">${category.name}</span>
|
||||||
|
<span class="level-item tag">${postCounts[category.id?c]!}</span>
|
||||||
|
</a>
|
||||||
|
<#if category.children?? && category.children?size gt 0>
|
||||||
|
<ul>
|
||||||
|
<@categoriesTree category.children/>
|
||||||
|
</ul>
|
||||||
|
</#if>
|
||||||
|
</li>
|
||||||
|
</#list>
|
||||||
|
</#macro>
|
||||||
|
<@layout title="分类 - ${blog_title!}" canonical="${categories_url!}">
|
||||||
|
<#assign postCounts = {}>
|
||||||
|
<@categoryTag method="list">
|
||||||
|
<#list categories as category>
|
||||||
|
<#assign postCounts += {category.id: category.postCount}>
|
||||||
|
</#list>
|
||||||
|
</@categoryTag>
|
||||||
|
<@categoryTag method="tree">
|
||||||
|
<#if categories?? && categories?size gt 0>
|
||||||
|
<div class="card card-content">
|
||||||
|
<div class="card-tab"><div>文章分类</div></div>
|
||||||
|
<ul class="menu-list">
|
||||||
|
<@categoriesTree categories/>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<#else>
|
||||||
|
<div class="card card-empty">
|
||||||
|
<i class="fa fa-inbox"></i>
|
||||||
|
还没有创建过分类,回<a href="${context!}">主页</a>看看吧
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
|
</@categoryTag>
|
||||||
|
</@layout>
|
20
category.ftl
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
<#include "template/layout.ftl">
|
||||||
|
<@layout title="分类:${category.name!} - ${blog_title!}" canonical="${category.fullPath!}">
|
||||||
|
<#if (posts.content)?? && posts.content?size gt 0>
|
||||||
|
<div class="card card-content main-title">
|
||||||
|
<ul class="breadcrumb">
|
||||||
|
<li><a href="${categories_url!}"><i class="fa fa-th-large"></i>分类</a></li>
|
||||||
|
<li>${category.name}</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<#include "template/main/article_list.ftl">
|
||||||
|
<@article_list posts.content/>
|
||||||
|
<#include "template/main/pagination.ftl">
|
||||||
|
<@pagination method="categoryPosts" datas=posts slug="${category.slug!}" display="${settings.page_number!5}" />
|
||||||
|
<#else>
|
||||||
|
<div class="card card-empty">
|
||||||
|
<i class="fa fa-inbox"></i>
|
||||||
|
该分类下没有文章,回<a href="${context!}">主页</a>看看吧
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
|
</@layout>
|
149
gulpfile.js
Normal file
@ -0,0 +1,149 @@
|
|||||||
|
const {src, dest, task, series, parallel} = require('gulp')
|
||||||
|
const webpack = require('webpack-stream')
|
||||||
|
const less = require('gulp-less')
|
||||||
|
const autoprefix = require('gulp-autoprefixer')
|
||||||
|
const uglify = require('gulp-uglify')
|
||||||
|
const minifyCSS = require('gulp-csso')
|
||||||
|
const zip = require('gulp-zip')
|
||||||
|
const rename = require('gulp-rename')
|
||||||
|
const clean = require('gulp-clean')
|
||||||
|
const path = require('path')
|
||||||
|
const execSync = require('child_process').execSync
|
||||||
|
const fs = require('fs')
|
||||||
|
const resolve = (name) => path.resolve(__dirname, name)
|
||||||
|
const cssPath = './source/css'
|
||||||
|
const jsPath = './source/js'
|
||||||
|
const distPath = './dist'
|
||||||
|
const devModel = process.env.npm_config_devel
|
||||||
|
const version = process.env.npm_config_tag
|
||||||
|
|
||||||
|
if (devModel) {
|
||||||
|
console.log('> 开发模式')
|
||||||
|
}
|
||||||
|
version && console.log(`> 发布版本:${version}`)
|
||||||
|
|
||||||
|
task('clean', () => {
|
||||||
|
return src([cssPath, jsPath, distPath], {
|
||||||
|
read: false,
|
||||||
|
allowEmpty: true,
|
||||||
|
}).pipe(
|
||||||
|
clean({
|
||||||
|
force: true,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
})
|
||||||
|
|
||||||
|
task('version', (done) => {
|
||||||
|
if (version == null) {
|
||||||
|
console.log('[Version] No \'--tag\' parameters are specified')
|
||||||
|
done()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const themePath = 'theme.yaml'
|
||||||
|
const layoutPath = 'template/layout.ftl'
|
||||||
|
const packagePath = 'package.json'
|
||||||
|
const themeData = fs.readFileSync(themePath, 'utf8')
|
||||||
|
.replace(/^version:\s+[^\s]+$/m, 'version: ' + version)
|
||||||
|
fs.writeFileSync(themePath, themeData)
|
||||||
|
fs.writeFileSync(layoutPath, fs.readFileSync(layoutPath, 'utf8')
|
||||||
|
.replace(/#global\s+theme_version\s*="[^\s]+"/, `#global theme_version="${version}"`))
|
||||||
|
let packageData = fs.readFileSync(packagePath, 'utf8')
|
||||||
|
.replace(/"version":\s*"[^"]+"/, `"version": "${version}"`)
|
||||||
|
fs.writeFileSync(packagePath, packageData)
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
|
||||||
|
task('css', () => {
|
||||||
|
const ignoreFiles = [].map((file) => `./src/css/${file}.less`)
|
||||||
|
|
||||||
|
let gw = src('./src/css/**/*.less', {
|
||||||
|
ignore: ignoreFiles,
|
||||||
|
})
|
||||||
|
.pipe(less())
|
||||||
|
.pipe(
|
||||||
|
autoprefix({
|
||||||
|
overrideBrowserslist: ['> 2%', 'last 2 versions', 'not ie 6-9'],
|
||||||
|
cascade: false,
|
||||||
|
})
|
||||||
|
)
|
||||||
|
if (!devModel) {
|
||||||
|
gw = gw.pipe(minifyCSS())
|
||||||
|
}
|
||||||
|
|
||||||
|
return gw.pipe(
|
||||||
|
rename({
|
||||||
|
suffix: '.min',
|
||||||
|
})
|
||||||
|
).pipe(dest(cssPath))
|
||||||
|
})
|
||||||
|
|
||||||
|
task('js', () => {
|
||||||
|
const readFile = (prefix, dir, ignoreFiles) => {
|
||||||
|
let result = {}
|
||||||
|
let files = fs.readdirSync(dir, 'utf-8')
|
||||||
|
files.forEach((file) => {
|
||||||
|
let filePath = path.join(dir, file)
|
||||||
|
let states = fs.statSync(filePath)
|
||||||
|
if (states.isDirectory()) {
|
||||||
|
Object.assign(result, readFile(path.join(prefix, file), filePath, ignoreFiles))
|
||||||
|
} else if (ignoreFiles.length
|
||||||
|
? /\.js$/.test(file) && !ignoreFiles.includes(path.join(prefix, file))
|
||||||
|
: /\.js$/.test(file)) {
|
||||||
|
const fileName = file.replace(/.js$/, '')
|
||||||
|
result[path.join(prefix, fileName)] = resolve(filePath)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
return result
|
||||||
|
}
|
||||||
|
const getEntryData = () => {
|
||||||
|
return readFile('', './src/js', [])
|
||||||
|
}
|
||||||
|
|
||||||
|
return webpack({
|
||||||
|
mode: devModel ? 'development' : 'production',
|
||||||
|
entry: getEntryData(),
|
||||||
|
module: {
|
||||||
|
rules: [
|
||||||
|
{
|
||||||
|
test: /\.js$/,
|
||||||
|
loader: 'babel-loader',
|
||||||
|
include: resolve('source'),
|
||||||
|
exclude: resolve('node_modules'),
|
||||||
|
options: {
|
||||||
|
presets: ['@babel/preset-env'],
|
||||||
|
plugins: ['@babel/plugin-transform-runtime'],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
stats: 'errors-only',
|
||||||
|
output: {
|
||||||
|
filename: '[name].min.js',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
.pipe(uglify())
|
||||||
|
.pipe(dest(jsPath))
|
||||||
|
})
|
||||||
|
|
||||||
|
task('zip', () => {
|
||||||
|
const target = ['./source/**', './template/**', './mail_template/**', './*.ftl', './*.yaml', 'README.md', 'screenshot.png', 'LICENSE']
|
||||||
|
return src(target, {base: '.'})
|
||||||
|
.pipe(zip('halo-theme-dream.zip'))
|
||||||
|
.pipe(dest(distPath))
|
||||||
|
})
|
||||||
|
|
||||||
|
task('publish', (done) => {
|
||||||
|
// 需要将tag标签内容置为 latest
|
||||||
|
process.env.npm_config_tag = 'latest'
|
||||||
|
console.log(execSync('npm publish').toString())
|
||||||
|
done()
|
||||||
|
})
|
||||||
|
|
||||||
|
// 默认模式
|
||||||
|
task('default', series('clean', parallel('css', 'js'), 'zip'))
|
||||||
|
|
||||||
|
// release模式,需要使用--tag参数指定版本号
|
||||||
|
task('release', series('clean', 'version', parallel('css', 'js'), 'zip'))
|
||||||
|
|
||||||
|
// push模式,需要使用--tag参数指定版本号
|
||||||
|
task('push', series('clean', 'version', parallel('css', 'js'), 'zip', 'publish'))
|
15
index.ftl
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<#include "template/layout.ftl">
|
||||||
|
<#global is_first_index=(posts.number == 0) >
|
||||||
|
<@layout title="${blog_title!}" canonical="${blog_url!}">
|
||||||
|
<#if posts.content?? && posts.content?size gt 0>
|
||||||
|
<#include "template/main/article_list.ftl">
|
||||||
|
<@article_list posts.content/>
|
||||||
|
<#include "template/main/pagination.ftl">
|
||||||
|
<@pagination method="index" datas=posts display="${settings.page_number!5}" />
|
||||||
|
<#else>
|
||||||
|
<div class="card card-empty">
|
||||||
|
<i class="fa fa-inbox"></i>
|
||||||
|
还没有发表过文章
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
|
</@layout>
|
47
journals.ftl
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<#include "template/layout.ftl">
|
||||||
|
<@layout title="动态 - ${blog_title!}" canonical="${journals_url!}">
|
||||||
|
<#if journals.content?? && journals.content?size gt 0>
|
||||||
|
<#list journals.content as journal>
|
||||||
|
<div class="card card-content journal">
|
||||||
|
<p class="journal-date">
|
||||||
|
<i class="fa fa-paper-plane-o"></i>
|
||||||
|
<em>${journal.createTime?string('yyyy年MM月dd日 HH:mm:ss')}</em>
|
||||||
|
</p>
|
||||||
|
<div class="journal-content fold">
|
||||||
|
<div data-id="${journal.id?c}" data-target="journals" class="main-content not-toc">${journal.content}</div>
|
||||||
|
</div>
|
||||||
|
<div class="journal-operation">
|
||||||
|
<span class="journal-operation-item">
|
||||||
|
<a class="like" data-id="${journal.id?c}" data-likes="${(journal.likes!0)?c}"><i
|
||||||
|
class="fa fa-heart-o"></i><em>${(journal.likes != 0)?string(journal.likes?c,'喜欢')}</em></a>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<#if settings.enable_journals_comment!true>
|
||||||
|
<span class="journal-operation-item">
|
||||||
|
<a class="comment"><i
|
||||||
|
class="fa fa-commenting-o"></i><em><#if journal.commentCount==0>评论<#else>${journal.commentCount}</#if></em></a>
|
||||||
|
</span>
|
||||||
|
</#if>
|
||||||
|
<#if enable_share>
|
||||||
|
<span class="journal-operation-item">
|
||||||
|
<a class="share"><i class="fa fa-share"></i><em>分享</em></a>
|
||||||
|
</span>
|
||||||
|
</#if>
|
||||||
|
</div>
|
||||||
|
<#if settings.enable_journals_comment!true>
|
||||||
|
<div class="journal-comment">
|
||||||
|
<#include "template/main/comment.ftl">
|
||||||
|
<@comment journal.id?c, "journal" />
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
|
</div>
|
||||||
|
</#list>
|
||||||
|
<#include "template/main/pagination.ftl">
|
||||||
|
<@pagination method="journals" datas=journals display="${settings.page_number!5}" />
|
||||||
|
<#else>
|
||||||
|
<div class="card card-empty">
|
||||||
|
<i class="fa fa-inbox"></i>
|
||||||
|
还没有发表过动态,回<a href="${context!}">主页</a>看看吧
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
|
</@layout>
|
71
links.ftl
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
<#include "template/layout.ftl">
|
||||||
|
<@layout title="友链 - ${blog_title!}" canonical="${links_url!}">
|
||||||
|
<div class="card">
|
||||||
|
<#if settings.links_thumbnail?? && settings.links_thumbnail!=''>
|
||||||
|
<div class="card-image cover-image" style="background-image: url(${settings.links_thumbnail!})">
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
|
<div class="card-content main">
|
||||||
|
<h1 class="title">友情链接 - ${user.nickname!}的小伙伴们</h1>
|
||||||
|
<div class="main-content">
|
||||||
|
<@linkTag method="listTeams">
|
||||||
|
<#assign defaultAvatar= (settings.links_default_avatar?? && settings.links_default_avatar!='')?string(settings.links_default_avatar!, static + "/source/img/avatar.svg") />
|
||||||
|
<#list teams as item>
|
||||||
|
<div class="links">
|
||||||
|
<#if item.team?? && item.team!=''>
|
||||||
|
<h3 class="link-title" id="toc${item_index}">${item.team}</h3>
|
||||||
|
<#else>
|
||||||
|
<h3 class="link-title" id="toc${item_index}">小伙伴们</h3>
|
||||||
|
</#if>
|
||||||
|
<ul class="link-items">
|
||||||
|
<#list item.links?sort_by('priority')?reverse as link>
|
||||||
|
<li>
|
||||||
|
<a class="links-item" href="${link.url!}" rel="noopener noreferrer" target="_blank"
|
||||||
|
title="${link.description!}">
|
||||||
|
<#if link.logo?? && link.logo!=''>
|
||||||
|
<img class="not-gallery" title="${link.name!}" src="${defaultAvatar!}"
|
||||||
|
onload="if(!this.finish){this.finish=true;this.src='${link.logo!}'}"
|
||||||
|
onerror="this.onerror='';if (this.finish) {this.src='${defaultAvatar!}'} else {this.finish=true;this.src='${link.logo!}'}"
|
||||||
|
alt="${link.name!}">
|
||||||
|
<#else>
|
||||||
|
<img class="not-gallery" title="${link.name!}" src="${defaultAvatar!}" alt="${link.name!}">
|
||||||
|
</#if>
|
||||||
|
|
||||||
|
<span class="link-name">${link.name!}</span>
|
||||||
|
<#if link.description?? && link.description!=''>
|
||||||
|
<div class="link-desc">${link.description!}</div>
|
||||||
|
<#else>
|
||||||
|
<div class="link-desc">他还没有自我介绍呢</div>
|
||||||
|
</#if>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
</#list>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</#list>
|
||||||
|
</@linkTag>
|
||||||
|
<#if (settings.show_exchange_info!true) || (settings.links_info?? && settings.links_info != '')>
|
||||||
|
<hr/>
|
||||||
|
</#if>
|
||||||
|
<#if settings.show_exchange_info!true>
|
||||||
|
申请友链的方法:
|
||||||
|
<#assign bloggerAvatar= (settings.links_blogger_avatar?? && settings.links_blogger_avatar!='')?string(settings.links_blogger_avatar!, user.avatar!) />
|
||||||
|
<ul>
|
||||||
|
<li>名称:${blog_title!}</li>
|
||||||
|
<li>地址:<a href="${blog_url!}">${blog_url!}</a></li>
|
||||||
|
<li>图标:<a href="${bloggerAvatar!}">${bloggerAvatar!}</a></li>
|
||||||
|
<li>描述:${user.description!}</li>
|
||||||
|
</ul>
|
||||||
|
</#if>
|
||||||
|
<div>${settings.links_info!}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<#if settings.link_comment_id?? && settings.link_comment_id!='' && settings.enable_comment!true>
|
||||||
|
<div class="card card-content" id="comment-wrapper">
|
||||||
|
<h3 class="comment-title">评论</h3>
|
||||||
|
<#include "template/main/comment.ftl">
|
||||||
|
<@comment settings.link_comment_id, "sheet" />
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
|
</@layout>
|
59
mail_template/mail_notice.ftl
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
<#assign emojis={'呵呵':'hehe','哈哈':'haha','吐舌':'tushe','啊':'a','酷':'ku','怒':'nu','开心':'kaixin','汗':'han','泪':'lei','黑线':'heixian','鄙视':'bishi','不高兴':'bugaoxing','真棒':'zhenbang','钱':'qian','疑问':'yiwen','阴险':'yingxiang','吐':'tu','咦':'yi','委屈':'weiqu','花心':'huaxin','呼~':'hu','笑眼':'xiaoyan','冷':'len','太开心':'taikaixin','滑稽':'huaji','勉强':'mianqiang','狂汗':'kuanhan','乖':'guai','睡觉':'shuijiao','惊哭':'jingku','生气':'shengqi','惊讶':'jingya','喷':'pen','突然兴奋':'turanxingfen','挖鼻':'wabi','摊手':'tanshou','捂嘴笑':'wuzuixiao','喝酒':'hejiu','犀利':'xili','懒得理':'landeli','炸药':'zhayao','吃瓜':'chigua','小乖':'xiaoguai','你懂的':'nidongde','嘿嘿嘿':'heiheihei','欢呼':'huanhu','笑尿':'xiaoniao','酸爽':'suanshuang','紧张':'jinzhang','暗中观察':'anzhongguancha','小红脸':'xiaohonglian','呀咩爹':'yamiedie','微微一笑':'weiweiyixiao','what':'what','托腮':'tuosai','噗':'pu','困成狗':'kunchenggou','柯基暗中观察':'kejianzhongguancha','菜狗':'caigou','老虎':'laohu','嗷呜':'aowu','奥特曼':'aoteman','黑头高兴':'heitougaoxing','黑头瞪眼':'heitoudengyan','望远镜':'wangyuanjing','不听':'butin','干饭':'ganfan','大拇指':'damuzhi','胜利':'shengli','haha':'haha2','OK':'ok','红领巾':'honglingjin','爱心':'aixin','心碎':'xinsui','玫瑰':'meigui','礼物':'liwu','烟花':'yanhua','彩虹':'caihong','太阳':'taiyang','星星月亮':'xingxingyueliang','蛋糕':'dangao','茶杯':'chabei','香蕉':'xiangjiao','便便':'bianbian','药丸':'yaowan','钱币':'qianbi','蜡烛':'lazhu','沙发':'shafa','音乐':'yinyue','灯泡':'dengpao','手纸':'shouzhi'}>
|
||||||
|
<#list emojis?keys as key>
|
||||||
|
<#assign content=content?replace('\\[/${key}\\]','<img src="${blog_url!}/themes/dream/source/lib/halo-comment@1.1.2/assets/emoji/${emojis[key]}.png" style="width: 1.6em;height: 1.6em;margin: auto 2px;vertical-align: middle;"/>','ri')>
|
||||||
|
</#list>
|
||||||
|
<div class="email-page" style="background:#fff;">
|
||||||
|
<style>@media screen and (max-width: 400px) {
|
||||||
|
.email-content {
|
||||||
|
width: 96% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-title {
|
||||||
|
padding: 12px 14px !important;
|
||||||
|
font-size: 15px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-title .icon {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-text {
|
||||||
|
padding: 20px 20px 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-text pre {
|
||||||
|
margin: 10px 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-footer {
|
||||||
|
padding: 10px !important;
|
||||||
|
}
|
||||||
|
}</style>
|
||||||
|
<div class="email-content"
|
||||||
|
style="width:90%;max-width:660px;margin:20px auto 30px;line-height:1.5;text-align:left;overflow:hidden;border-radius:8px;box-shadow:0 2px 12px 0 rgba(0,0,0,0.1);">
|
||||||
|
<div style="overflow:hidden;">
|
||||||
|
<h1 class="email-title"
|
||||||
|
style="position:relative;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;padding:14px 52px 14px 20px;line-height:1.6;font-size:16px;font-weight:normal;color:#fff;background:webkit-linear-gradient(-45deg,rgba(255,68,229,0.7),rgba(80,191,255,0.86),rgba(80,182,255,0.86));background:linear-gradient(-45deg,rgba(255,68,229,0.7),rgba(80,191,255,0.86),rgba(80,182,255,0.86));background-size:400% 400%;background-position:50% 100%;">
|
||||||
|
您的博客有新的评论啦!
|
||||||
|
<img class="icon" style="position:absolute;right:16px;top:10px;width:32px;"
|
||||||
|
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAABGdBTUEAALGPC/xhBQAAAFdQTFRF////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA////LEkQMAAAABx0Uk5TX69vz4+wT3Cf0N+g7+C/UH+QIDAQ8GA/wECAAMYhZPgAAAHzSURBVFjD7ZfZuoIgEIDNcilckC1B3/85T6xSoiLdna+5qmB+ZoUpm76U7Af41wBUQnjplFwgLNE5QFk/5g951GUsgMCVtmFAEgPIm3lTmvwQgK9mbwsEdyJAa36+4n0A08e3YhU0JDSjYXuAm1Zn4YAzjbhtA2q1QZCtlBGhNtRbgEGuUr5XNpyqI8IAJtfuZL/w0F3uYiEAbiL0X25IQoMDgE7aj46LH0kvujVAOcBj2oe/OeEA0oEhrgFlsB+fAGkAJXEAQj0TLED2TxV7BwjPBAPAJwwwJuA3gHQLxF9DYAmYAVxjU7Ak4uoDiPTgzE0oM0k8gCSOdrGq69yGo4cdtFWH4OVmYz46izOXRFsEqtgb4sI9z/1SP3bX4BKZuY2mxSp98wjrmctYob/gD4UVQB+qHeLmHlMLVH/mmwB+BsC2AWztQhvnAveDSA+CuAeYqgFUNo1cFMKlURRDv5FGca4QdSGhLwC9i0wiACy9lwTg82c7nwR0XuukACr//k0AyAjOxZQM6Ju3B+Q0IPeKMwHAuzn4NkYCSv3++/prAHoG5TX0dWZ4ov20A2DzkYxoCgP6KP17HxyyhOn0A30K+MaYp2oDPtWMRceQFEIwvDOptsspOGnYxjRR3z3vWNvQntX3ZiQGRsB+f3l+gDT5A4U2phC6e4RTAAAAAElFTkSuQmCC"></img>
|
||||||
|
</h1>
|
||||||
|
<div class="email-text" style="padding:20px 28px 10px;background:#fff;">
|
||||||
|
<p style="margin:0 0 5px;padding:0;line-height:24px;font-size:14px;color:#6e6e6e;"><span
|
||||||
|
style="font-weight:bold;color:#50bfff;">${user.nickname!'博主'}</span> ,您好!</p>
|
||||||
|
<p style="margin:0;padding:0;line-height:24px;font-size:14px;color:#6e6e6e;">访客<span
|
||||||
|
style="color:#50bfff;"> ${author!'匿名用户'} </span>在<a href="${pageFullPath!'匿名用户'}" target="_blank"
|
||||||
|
style="color:#50bfff;text-decoration:none;">《${pageTitle!}》</a>发表评论:
|
||||||
|
<div style="margin:12px 0;padding:14px 20px 18px 20px;white-space:pre-line;word-break:break-all;color:#6e6e6e;font-size:14px;background: repeating-linear-gradient(135deg, #f3f9ff, #f3f9ff 18px, #fff 0, #fff 30px);border-radius: 8px;border: 1px solid #f3f9ff; box-shadow: 0 2px 15px rgba(73,146,161,0.15);">${content!}</div>
|
||||||
|
<p style="margin:0 0 16px;padding:0;line-height:24px;font-size:13px;color:#6e6e6e;">
|
||||||
|
<a href="${pageFullPath!}" target="_blank" style="color:#5caaef;text-decoration:none;">点击查看完整评论</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="email-footer" style="padding:10px 20px;border-top:1px solid #eee;">
|
||||||
|
<p style="margin:0;padding:0;line-height:24px;font-size:13px;color:#999;">* 注意:此邮件由 <a
|
||||||
|
href="${blog_url!}" target="_blank" style="color:#50bfff;text-decoration:none;">${blog_title!}</a>
|
||||||
|
自动发出,请勿回复。</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
60
mail_template/mail_reply.ftl
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<#assign emojis={'呵呵':'hehe','哈哈':'haha','吐舌':'tushe','啊':'a','酷':'ku','怒':'nu','开心':'kaixin','汗':'han','泪':'lei','黑线':'heixian','鄙视':'bishi','不高兴':'bugaoxing','真棒':'zhenbang','钱':'qian','疑问':'yiwen','阴险':'yingxiang','吐':'tu','咦':'yi','委屈':'weiqu','花心':'huaxin','呼~':'hu','笑眼':'xiaoyan','冷':'len','太开心':'taikaixin','滑稽':'huaji','勉强':'mianqiang','狂汗':'kuanhan','乖':'guai','睡觉':'shuijiao','惊哭':'jingku','生气':'shengqi','惊讶':'jingya','喷':'pen','突然兴奋':'turanxingfen','挖鼻':'wabi','摊手':'tanshou','捂嘴笑':'wuzuixiao','喝酒':'hejiu','犀利':'xili','懒得理':'landeli','炸药':'zhayao','吃瓜':'chigua','小乖':'xiaoguai','你懂的':'nidongde','嘿嘿嘿':'heiheihei','欢呼':'huanhu','笑尿':'xiaoniao','酸爽':'suanshuang','紧张':'jinzhang','暗中观察':'anzhongguancha','小红脸':'xiaohonglian','呀咩爹':'yamiedie','微微一笑':'weiweiyixiao','what':'what','托腮':'tuosai','噗':'pu','困成狗':'kunchenggou','柯基暗中观察':'kejianzhongguancha','菜狗':'caigou','老虎':'laohu','嗷呜':'aowu','奥特曼':'aoteman','黑头高兴':'heitougaoxing','黑头瞪眼':'heitoudengyan','望远镜':'wangyuanjing','不听':'butin','干饭':'ganfan','大拇指':'damuzhi','胜利':'shengli','haha':'haha2','OK':'ok','红领巾':'honglingjin','爱心':'aixin','心碎':'xinsui','玫瑰':'meigui','礼物':'liwu','烟花':'yanhua','彩虹':'caihong','太阳':'taiyang','星星月亮':'xingxingyueliang','蛋糕':'dangao','茶杯':'chabei','香蕉':'xiangjiao','便便':'bianbian','药丸':'yaowan','钱币':'qianbi','蜡烛':'lazhu','沙发':'shafa','音乐':'yinyue','灯泡':'dengpao','手纸':'shouzhi'}>
|
||||||
|
<#list emojis?keys as key>
|
||||||
|
<#assign baseContent=baseContent?replace('\\[/${key}\\]','<img src="${blog_url!}/themes/dream/source/lib/halo-comment@1.1.2/assets/emoji/${emojis[key]}.png" style="width: 1.6em;height: 1.6em;margin: auto 2px;vertical-align: middle;"/>','ri')>
|
||||||
|
<#assign replyContent=replyContent?replace('\\[/${key}\\]','<img src="${blog_url!}/themes/dream/source/lib/halo-comment@1.1.2/assets/emoji/${emojis[key]}.png" style="width: 1.6em;height: 1.6em;margin: auto 2px;vertical-align: middle;"/>','ri')>
|
||||||
|
</#list>
|
||||||
|
<div class="email-page" style="background:#fff;">
|
||||||
|
<style>@media screen and (max-width: 400px) {
|
||||||
|
.email-content {
|
||||||
|
width: 96% !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-title {
|
||||||
|
padding: 12px 14px !important;
|
||||||
|
font-size: 15px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-title .icon {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-text {
|
||||||
|
padding: 20px 20px 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-text pre {
|
||||||
|
margin: 10px 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.email-footer {
|
||||||
|
padding: 10px !important;
|
||||||
|
}
|
||||||
|
}</style>
|
||||||
|
<div class="email-content"
|
||||||
|
style="width:90%;max-width:660px;margin:20px auto 30px;line-height:1.5;text-align:left;overflow:hidden;border-radius:8px;box-shadow:0 2px 12px 0 rgba(0,0,0,0.1);">
|
||||||
|
<div style="overflow:hidden;">
|
||||||
|
<h1 class="email-title"
|
||||||
|
style="position:relative;margin:0;-webkit-box-sizing:border-box;box-sizing:border-box;padding:14px 52px 14px 20px;line-height:1.6;font-size:16px;font-weight:normal;color:#fff;background:webkit-linear-gradient(-45deg,rgba(255,68,229,0.7),rgba(80,191,255,0.86),rgba(80,182,255,0.86));background:linear-gradient(-45deg,rgba(255,68,229,0.7),rgba(80,191,255,0.86),rgba(80,182,255,0.86));background-size:400% 400%;background-position:50% 100%;">
|
||||||
|
Dear, 您在 ${blog_title!} 上的评论有新的回复啦!
|
||||||
|
<img class="icon" style="position:absolute;right:16px;top:10px;width:32px;"
|
||||||
|
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAMAAACdt4HsAAAABGdBTUEAALGPC/xhBQAAAFdQTFRF////////////////////////////////////////////////////////////////////////////////////////////////////////////AAAA////LEkQMAAAABx0Uk5TX69vz4+wT3Cf0N+g7+C/UH+QIDAQ8GA/wECAAMYhZPgAAAHzSURBVFjD7ZfZuoIgEIDNcilckC1B3/85T6xSoiLdna+5qmB+ZoUpm76U7Af41wBUQnjplFwgLNE5QFk/5g951GUsgMCVtmFAEgPIm3lTmvwQgK9mbwsEdyJAa36+4n0A08e3YhU0JDSjYXuAm1Zn4YAzjbhtA2q1QZCtlBGhNtRbgEGuUr5XNpyqI8IAJtfuZL/w0F3uYiEAbiL0X25IQoMDgE7aj46LH0kvujVAOcBj2oe/OeEA0oEhrgFlsB+fAGkAJXEAQj0TLED2TxV7BwjPBAPAJwwwJuA3gHQLxF9DYAmYAVxjU7Ak4uoDiPTgzE0oM0k8gCSOdrGq69yGo4cdtFWH4OVmYz46izOXRFsEqtgb4sI9z/1SP3bX4BKZuY2mxSp98wjrmctYob/gD4UVQB+qHeLmHlMLVH/mmwB+BsC2AWztQhvnAveDSA+CuAeYqgFUNo1cFMKlURRDv5FGca4QdSGhLwC9i0wiACy9lwTg82c7nwR0XuukACr//k0AyAjOxZQM6Ju3B+Q0IPeKMwHAuzn4NkYCSv3++/prAHoG5TX0dWZ4ov20A2DzkYxoCgP6KP17HxyyhOn0A30K+MaYp2oDPtWMRceQFEIwvDOptsspOGnYxjRR3z3vWNvQntX3ZiQGRsB+f3l+gDT5A4U2phC6e4RTAAAAAElFTkSuQmCC"></img>
|
||||||
|
</h1>
|
||||||
|
<div class="email-text" style="padding:20px 28px 10px;background:#fff;">
|
||||||
|
<p style="margin:5px 0 5px;padding:0;line-height:24px;font-size:14px;color:#6e6e6e;"><span
|
||||||
|
style="font-weight:bold;color:#50bfff">${baseAuthor!'Dear'}</span> ,您好!</p>
|
||||||
|
<p style="padding:0;line-height:24px;font-size:14px;color:#6e6e6e;">您在《<span style="color:#50bfff;">${pageTitle!}</span>》的评论:</p>
|
||||||
|
<div style="margin:12px 0 18px;padding:14px 20px 18px 20px;white-space:pre-line;word-break:break-all;color:#6e6e6e;font-size:14px;background: repeating-linear-gradient(135deg, #f3f9ff, #f3f9ff 18px, #fff 0, #fff 30px);border-radius: 8px;border: 1px solid #f3f9ff; box-shadow: 0 2px 15px rgba(73,146,161,0.15);">${baseContent!}</div>
|
||||||
|
<p style="padding:0;line-height:24px;font-size:14px;color:#6e6e6e;"><span style="color:#50bfff;">${replyAuthor!'匿名用户'}</span> 给您的回复:</p>
|
||||||
|
<div style="margin:12px 0;padding:14px 20px 18px 20px;white-space:pre-line;word-break:break-all;color:#6e6e6e;font-size:14px;background: repeating-linear-gradient(135deg, #f3f9ff, #f3f9ff 18px, #fff 0, #fff 30px);border-radius: 8px;border: 1px solid #f3f9ff; box-shadow: 0 2px 15px rgba(73,146,161,0.15);">${replyContent!}</div>
|
||||||
|
<p style="margin:0 0 16px;padding:0;line-height:24px;font-size:13px;color:#6e6e6e;">
|
||||||
|
<a href="${pageFullPath!}" target="_blank" style="color:#5c8fef;text-decoration:none;">点击查看完整回复</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="email-footer" style="padding:10px 20px;border-top:1px solid #eee;">
|
||||||
|
<p style="margin:0;padding:0;line-height:24px;font-size:13px;color:#999;">* 注意:此邮件由 <a
|
||||||
|
href="${blog_url!}" target="_blank" style="color:#50bfff;text-decoration:none;">${blog_title!}</a>
|
||||||
|
自动发出,请勿回复,如有打扰,请见谅。</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
54
package.json
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
{
|
||||||
|
"name": "halo-theme-dream2.0",
|
||||||
|
"version": "0.0.1",
|
||||||
|
"description": "梦之城,童话梦境,动漫类型博客主题。",
|
||||||
|
"main": "index.js",
|
||||||
|
"author": "nineya",
|
||||||
|
"scripts": {
|
||||||
|
"test": "echo \"Error: no test specified\" && exit 1",
|
||||||
|
"release": "eslint **/*.js && gulp release",
|
||||||
|
"push": "eslint **/*.js && gulp push",
|
||||||
|
"build": "eslint **/*.js && gulp",
|
||||||
|
"lint": "eslint **/*.js"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/nineya/halo-theme-dream.git"
|
||||||
|
},
|
||||||
|
"keywords": [
|
||||||
|
"halo",
|
||||||
|
"dream",
|
||||||
|
"nineya",
|
||||||
|
"halo-theme",
|
||||||
|
"halo-theme-dream"
|
||||||
|
],
|
||||||
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/nineya/halo-theme-dream/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/nineya/halo-theme-dream#readme",
|
||||||
|
"devDependencies": {
|
||||||
|
"@babel/core": "^7.15.5",
|
||||||
|
"@babel/plugin-transform-runtime": "^7.15.0",
|
||||||
|
"@babel/preset-env": "^7.15.6",
|
||||||
|
"babel-eslint": "^10.1.0",
|
||||||
|
"babel-loader": "^8.2.3",
|
||||||
|
"eslint": "^7.32.0",
|
||||||
|
"gulp": "^4.0.2",
|
||||||
|
"gulp-autoprefixer": "^8.0.0",
|
||||||
|
"gulp-babel": "^8.0.0",
|
||||||
|
"gulp-clean": "^0.4.0",
|
||||||
|
"gulp-csso": "^4.0.1",
|
||||||
|
"gulp-gzip": "^1.4.2",
|
||||||
|
"gulp-less": "^5.0.0",
|
||||||
|
"gulp-rename": "^2.0.0",
|
||||||
|
"gulp-uglify": "^3.0.2",
|
||||||
|
"gulp-zip": "^5.1.0",
|
||||||
|
"webpack": "^5.68.0",
|
||||||
|
"webpack-stream": "^7.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"html2canvas": "^1.4.1",
|
||||||
|
"qrcode": "^1.5.1"
|
||||||
|
}
|
||||||
|
}
|
22
photos.ftl
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<#include "template/layout.ftl">
|
||||||
|
<@layout title="相册 - ${blog_title!}" canonical="${photos_url!}">
|
||||||
|
<#if (photos.content)?? && photos.content?size gt 0>
|
||||||
|
<div class="card card-content photos">
|
||||||
|
<div class="card-tab"><div>我的相册</div></div>
|
||||||
|
<ul class="photos-teams">
|
||||||
|
<li class="item">全部</li>
|
||||||
|
<@photoTag method="listTeams">
|
||||||
|
<#list teams as item>
|
||||||
|
<li class="item" data-team="p-${item.team}">${((item.team)?length>0)?then(item.team?trim,'默认图库')}</li>
|
||||||
|
</#list>
|
||||||
|
</@photoTag>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="photos-gallery load-block"></div>
|
||||||
|
<#else>
|
||||||
|
<div class="card card-empty">
|
||||||
|
<i class="fa fa-inbox"></i>
|
||||||
|
还没有上传过相册,回<a href="${context!}">主页</a>看看吧
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
|
</@layout>
|
5
post.ftl
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<#include "template/layout.ftl">
|
||||||
|
<#include "template/main/article.ftl">
|
||||||
|
<@layout title="${post.title!} - ${blog_title!}" canonical="${post.fullPath!}">
|
||||||
|
<@article post,"post" />
|
||||||
|
</@layout>
|
5
post_literature.ftl
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<#include "template/layout.ftl">
|
||||||
|
<#include "template/main/article_literature.ftl">
|
||||||
|
<@layout title="${post.title!} - ${blog_title!}" canonical="${post.fullPath!}">
|
||||||
|
<@articleLiterature post,"post" />
|
||||||
|
</@layout>
|
BIN
preview.png
Normal file
After Width: | Height: | Size: 2.6 MiB |
BIN
screenshot.png
Normal file
After Width: | Height: | Size: 17 KiB |
14
search.ftl
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<#include "template/layout.ftl">
|
||||||
|
<@layout title="搜索:${keyword} - ${blog_title!}" canonical="${blog_url!}/search?keyword=${keyword}">
|
||||||
|
<#if (posts.content)?? && posts.content?size gt 0>
|
||||||
|
<#include "template/main/article_list.ftl">
|
||||||
|
<@article_list posts.content/>
|
||||||
|
<#include "template/main/pagination.ftl">
|
||||||
|
<@pagination method="search" datas=posts keyword="${keyword!}" display="${settings.page_number!5}" />
|
||||||
|
<#else>
|
||||||
|
<div class="card card-empty">
|
||||||
|
<i class="fa fa-inbox"></i>
|
||||||
|
搜索结果为空,回<a href="${context!}">主页</a>看看吧
|
||||||
|
</div>
|
||||||
|
</#if>
|
||||||
|
</@layout>
|
1885
settings.yaml
Normal file
5
sheet.ftl
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<#include "template/layout.ftl">
|
||||||
|
<#include "template/main/article.ftl">
|
||||||
|
<@layout title="${sheet.title} - ${blog_title!}" canonical="${sheet.fullPath!}">
|
||||||
|
<@article sheet,"sheet" />
|
||||||
|
</@layout>
|
5
sheet_literature.ftl
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<#include "template/layout.ftl">
|
||||||
|
<#include "template/main/article_literature.ftl">
|
||||||
|
<@layout title="${sheet.title} - ${blog_title!}" canonical="${sheet.fullPath!}">
|
||||||
|
<@articleLiterature sheet,"sheet" />
|
||||||
|
</@layout>
|
1
source/css/cursor/breeze.min.css
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
.main-content img,body{cursor:url(../../cursor/breeze/Arrow.cur),auto}.actions>div,.expand-done,.main-content figure>figcaption div,.navbar-above .navbar-nav .item,.navbar-searchicon,.navbar-slideicon,.photos .picture-details,.widget .ad-tag .click-close,a,button{cursor:url(../../cursor/breeze/Hand.cur),auto}blockquote,code,h1,h2,h3,h4,h5,h6,hr,input[type=text],li,p,td,textarea,th{cursor:url(../../cursor/breeze/IBeam.cur),auto}
|
1
source/css/dshare.min.css
vendored
Normal file
1
source/css/mew-custom.min.css
vendored
Normal file
1
source/css/post.min.css
vendored
Normal file
1
source/css/style.min.css
vendored
Normal file
1
source/css/theme.min.css
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
@charset "utf-8";html{--theme:#50bfff;--main:#606266;--background:rgba(255, 255, 255, 0.94);--background-hover:#fff;--style-a:#fff;--light-a:#ffffff;--light-b:#ebeef5;--light-c:#dcdcdc;--light-d:#c0c4cc;--dark-a:#4a4a4a;--dark-b:#909399;--dark-c:#333;--dark-d:#9a9a9a;--dark-e:#7a7a7a;--color-a:#409eff;--bg-a:rgba(242, 246, 252, 0.8);--bg-b:#f2f6fc;--bg-c:#f5f5f5;--bg-d:rgba(255, 255, 255, 0.8);--bg-e:var(--theme);--bg-f:#f7f7f7;--bg-g:#e8f3ff;--bg-h:rgba(237, 244, 253, 0.75);--bg-i:#50bfff;--bg-j:rgba(243, 244, 245, 0.25);--bg-k:rgba(250, 250, 250, 0.8);--bg-l:rgba(243, 243, 243, 0.8);--radius-wrap:8px;--radius-inner:4px;--radius-img:5px;--box-shadow:0 0px 10px -5px #949494}html.night{--theme:#5d93db;--main:#999;--background:rgba(40, 44, 52, 0.6);--background-hover:rgba(40, 44, 52, 0.8);--style-a:#080c28;--light-a:#232323;--light-b:#414243;--light-c:#303030;--light-d:#666;--dark-a:#888;--dark-b:#777;--dark-c:silver;--dark-d:#aaa;--dark-e:#c0c0c0;--color-a:#cbba7d;--bg-a:rgba(65, 66, 67, 0.8);--bg-b:#303030;--bg-c:#373d48;--bg-d:rgba(40, 44, 52, 0.8);--bg-e:#434a56;--bg-f:#080c28;--bg-g:rgba(210, 210, 210, 0.2);--bg-h:rgba(65, 68, 74, 0.6);--bg-i:#276b92;--bg-j:rgba(36, 36, 36, 0.15);--bg-k:rgba(30, 33, 41, 0.8);--bg-l:rgba(63, 65, 75, 0.8);--box-shadow:1px 1px 3px 1px #1b1b1b}html.night body::before{-webkit-filter:brightness(.3);filter:brightness(.3)}html.night .logo-img{display:none}html.night .logo-img-dark{display:inline-block}html.night .aplayer-pic,html.night .brightness,html.night .cover-image,html.night .small-image,html.night .thumbnail-image,html.night .waifu,html.night iframe,html.night img,html.night svg,html.night video{-webkit-filter:brightness(.8);filter:brightness(.8)}html.night .canvas_effects.night{display:block}html.night .canvas_effects.day{display:none}html.night .main-content figure{color:var(--main);background:var(--bg-k)}html.night .main-content figure pre code{color:var(--color-a);background:0 0}
|
BIN
source/cursor/breeze/Arrow.cur
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
source/cursor/breeze/Cross.cur
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
source/cursor/breeze/Hand.cur
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
source/cursor/breeze/Handwriting.cur
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
source/cursor/breeze/Help.cur
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
source/cursor/breeze/IBeam.cur
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
source/cursor/breeze/NO.cur
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
source/cursor/breeze/SizeAll.cur
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
source/cursor/breeze/SizeNESW.cur
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
source/cursor/breeze/SizeNS.cur
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
source/cursor/breeze/SizeNWSE.cur
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
source/cursor/breeze/SizeWE.cur
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
source/cursor/breeze/UpArrow.cur
Normal file
After Width: | Height: | Size: 4.2 KiB |
BIN
source/font/WenCang.woff2
Normal file
BIN
source/font/dshare.woff2
Normal file
2
source/img/avatar.svg
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
source/img/wordline.webp
Normal file
After Width: | Height: | Size: 106 B |
1
source/js/autoload.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
try{$("<link>").attr({href:"/themes/dream/source/lib/live2d@1.0.1/waifu.min.css",rel:"stylesheet",type:"text/css"}).appendTo("head"),$("body").append('<div class="waifu"><div class="waifu-tips"></div><canvas id="live2d" class="live2d"></canvas><div class="waifu-tool"><span class="fui-home"></span> <span class="fui-chat"></span> <span class="fui-eye"></span> <span class="fui-user"></span> <span class="fui-photo"></span> <span class="fui-info-circle"></span> <span class="fui-cross"></span></div></div>'),$.ajax({url:"/themes/dream/source/lib/live2d@1.0.1/waifu-tips.min.js",dataType:"script",cache:!0,success:function(){$.ajax({url:"/themes/dream/source/lib/live2d@1.0.1/live2d.min.js",dataType:"script",cache:!0,success:function(){live2d_settings.hitokotoAPI="hitokoto.cn",live2d_settings.modelId=DreamConfig.live2d_model_id,live2d_settings.modelTexturesId=DreamConfig.live2d_model_textures_id,live2d_settings.waifuSize=DreamConfig.live2d_waifu_size,live2d_settings.waifuTipsSize="230x75",live2d_settings.waifuFontSize="16px",live2d_settings.waifuToolFont="16px",live2d_settings.waifuToolLine="26px",live2d_settings.waifuEdgeSide=DreamConfig.live2d_edge_side,live2d_settings.homePageUrl="/",live2d_settings.modelCdnUrl=DreamConfig.live2d_model_url,live2d_settings.showToolMenu=DreamConfig.live2d_show_tool_menu,live2d_settings.canTurnToHomePage=DreamConfig.live2d_can_turn_to_home_page,live2d_settings.canSwitchHitokoto=DreamConfig.live2d_can_switch_hitokoto,live2d_settings.canSwitchModel=DreamConfig.live2d_can_switch_model,live2d_settings.canSwitchTextures=DreamConfig.live2d_can_switch_textures,live2d_settings.canTakeScreenshot=DreamConfig.live2d_can_take_screenshot,DreamConfig.live2d_about_page?(live2d_settings.canTurnToAboutPage=DreamConfig.live2d_can_turn_to_about_page,live2d_settings.aboutPageUrl=DreamConfig.live2d_about_page):live2d_settings.canTurnToAboutPage=!1,live2d_settings.canCloseLive2d=DreamConfig.live2d_can_close_live2d,live2d_settings.modelRandMode=DreamConfig.live2d_model_rand_mode,live2d_settings.modelTexturesRandMode=DreamConfig.live2d_model_textures_rand_mode,initModel(DreamConfig.live2d_tips_url)}})}})}catch(e){console.log("[Error] JQuery is not defined.")}
|
1
source/js/btoc.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
(()=>{function s(t,e){this.tocList=t,this.elementList=function t(e,n){if(null==e)return null;var i=e.children;if(0===i.length)return null;for(var s=[],o=0;o<i.length;o++){var l=i[o];-1!==n.indexOf(l.tagName)&&s.push(l),s.push.apply(s,t(l,n))}return s}(e,this.tocList),this.eIndex=0,this.build=function(){return null==this.elementList||0===this.elementList.length?"":this.analysis(-1,this.tocList.indexOf(this.elementList[this.eIndex].tagName))},this.analysis=function(t,e){for(var n="<ul class='menu-list'>";this.eIndex<this.elementList.length;){var i=this.elementList[this.eIndex],s=this.tocList.indexOf(i.tagName);if(t<s&&s<=e){e=s;var o=i.id,l=i.innerText;if(null!=o&&""!==o||(o=l+"_"+this.eIndex,i.setAttribute("id",o)),n+=`<li><a data-id="#${o}"><i class="fa fa-paperclip"></i>${l}</a>`,this.eIndex++,this.eIndex>=this.elementList.length){n+="</li>";break}(s=this.tocList.indexOf(this.elementList[this.eIndex].tagName))>e&&(n+=this.analysis(e,s)),n+="</li>"}else if(s<=t)break}return n+"</ul>"}}const r=[];function t(t){const i=new Set,s=new Map,o=Array.from(t.querySelectorAll(".menu-list > li > a"));for(const t of o){const r=t.getAttribute("data-id").trim().slice(1),i=document.getElementById(r);i&&s.set(i,t)}const l=Array.from(s.keys()),e=new IntersectionObserver(e=>{for(const n of e)n.isIntersecting?i.add(n.target):i.delete(n.target);let n;if(i.size?n=[...i].sort((t,e)=>t.offsetTop-e.offsetTop)[0]:l.length&&(n=l.filter(t=>t.offsetTop<window.scrollY).sort((t,e)=>e.offsetTop-t.offsetTop)[0]),n&&s.has(n)){o.forEach(t=>t.classList.remove("is-active"));const e=s.get(n);e.classList.add("is-active");let t=e.parentElement.parentElement;for(;t.classList.contains("menu-list")&&"li"===t.parentElement.tagName.toLowerCase();)t.parentElement.children[0].classList.add("is-active"),t=t.parentElement.parentElement}},{threshold:0});for(const t of l){if(e.observe(t),s.has(t)){const r=s.get(t);r.addEventListener("click",()=>{let n,t=document.getElementById(r.getAttribute("data-id").substring(1)).getBoundingClientRect(),i=window.pageYOffset,s=i+t.top-50,o=(s-i)/20,l=i>s?-1:1;window.requestAnimationFrame(function t(e){(i+=o)*l<s*l?(window.scrollTo(0,i),n=window.requestAnimationFrame(t)):(window.scrollTo(0,s),window.cancelAnimationFrame(n))})})}s.has(t)&&(t.style.scrollMargin="1em")}r.push(e)}s.init=function(t){var e=t.tocList,n=t.contentElement,t=t.tocElement;if(null==e||0===e.length||null==n)return $(t).children().remove(),!1;for(var i=0;i<e.length;i++)e[i]=e[i].toUpperCase();n=new s(e,n).build();$(t).html(n)},window.tocPjax=function(){r.forEach(t=>{t.disconnect()}),r.splice(0),s.init({tocList:["h1","h2","h3","h4","h5"],contentElement:$(".main-content:not(.not-toc)")[0],tocElement:".toc-content"}),void 0!==window.IntersectionObserver&&document.querySelectorAll(".toc-content").forEach(t)}})();
|
1
source/js/common.min.js
vendored
Normal file
1
source/js/cursor/click/firework.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
(()=>{class e{constructor({origin:t,speed:i,color:e,angle:n,context:s}){this.origin=t,this.position={...this.origin},this.color=e,this.speed=i,this.angle=n,this.context=s,this.renderCount=0}draw(){this.context.fillStyle=this.color,this.context.beginPath(),this.context.arc(this.position.x,this.position.y,2,0,2*Math.PI),this.context.fill()}move(){this.position.x=Math.sin(this.angle)*this.speed+this.position.x,this.position.y=Math.cos(this.angle)*this.speed+this.position.y+.3*this.renderCount,this.renderCount++}}class i{constructor({origin:t,context:i,circleCount:e=10,area:n}){this.origin=t,this.context=i,this.circleCount=e,this.area=n,this.stop=!1,this.circles=[]}randomArray(t){var i=t.length;return t[Math.floor(i*Math.random())]}randomColor(){var t=["8","9","A","B","C","D","E","F"];return"#"+this.randomArray(t)+this.randomArray(t)+this.randomArray(t)+this.randomArray(t)+this.randomArray(t)+this.randomArray(t)}randomRange(t,i){return(i-t)*Math.random()+t}init(){for(let t=0;t<this.circleCount;t++){var i=new e({context:this.context,origin:this.origin,color:this.randomColor(),angle:this.randomRange(Math.PI-1,Math.PI+1),speed:this.randomRange(1,6)});this.circles.push(i)}}move(){this.circles.forEach((t,i)=>{if(t.position.x>this.area.width||t.position.y>this.area.height)return this.circles.splice(i,1);t.move()}),0==this.circles.length&&(this.stop=!0)}draw(){this.circles.forEach(t=>t.draw())}}(new class{constructor(){this.computerCanvas=document.createElement("canvas"),this.renderCanvas=document.createElement("canvas"),this.computerContext=this.computerCanvas.getContext("2d"),this.renderContext=this.renderCanvas.getContext("2d"),this.globalWidth=window.innerWidth,this.globalHeight=window.innerHeight,this.booms=[],this.running=!1}handleMouseDown(t){t=new i({origin:{x:t.clientX,y:t.clientY},context:this.computerContext,area:{width:this.globalWidth,height:this.globalHeight}});t.init(),this.booms.push(t),this.running||this.run()}handlePageHide(){this.booms=[],this.running=!1}init(){var t=this.renderCanvas.style;t.position="fixed",t.top=t.left=0,t.zIndex="999999999999999999999999999999999999999999",t.pointerEvents="none",t.width=this.renderCanvas.width=this.computerCanvas.width=this.globalWidth,t.height=this.renderCanvas.height=this.computerCanvas.height=this.globalHeight,document.body.append(this.renderCanvas),window.addEventListener("mousedown",this.handleMouseDown.bind(this)),window.addEventListener("pagehide",this.handlePageHide.bind(this))}run(){if(this.running=!0,0==this.booms.length)return this.running=!1;requestAnimationFrame(this.run.bind(this)),this.computerContext.clearRect(0,0,this.globalWidth,this.globalHeight),this.renderContext.clearRect(0,0,this.globalWidth,this.globalHeight),this.booms.forEach((t,i)=>{if(t.stop)return this.booms.splice(i,1);t.move(),t.draw()}),this.renderContext.drawImage(this.computerCanvas,0,0,this.globalWidth,this.globalHeight)}}).init()})();
|
1
source/js/cursor/click/granule.min.js
vendored
Normal file
1
source/js/cursor/move/bubbleCursor.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(){let i,e,n=void 0,t=(n,document.body),o=window.innerWidth,s=window.innerHeight,h={x:o/2,y:o/2},a=[],l=[];function d(i){if(0<i.touches.length)for(let t=0;t<i.touches.length;t++)c(i.touches[t].clientX,i.touches[t].clientY,l[Math.floor(Math.random()*l.length)])}function c(t,i,e){a.push(new r(t,i,e))}function r(t,i,e){var n=Math.floor(60*Math.random()+60);this.initialLifeSpan=n,this.lifeSpan=n,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/10),y:-1*Math.random()-.4},this.position={x:t,y:i},this.canv=e,this.baseDimension=4,this.update=function(t){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.velocity.x+=2*(Math.random()<.5?-1:1)/75,this.velocity.y-=Math.random()/600,this.lifeSpan--;var i=.2+(this.initialLifeSpan-this.lifeSpan)/this.initialLifeSpan;t.fillStyle="#e6f1f7",t.strokeStyle="#3a92c5",t.beginPath(),t.arc(this.position.x-this.baseDimension/2*i,this.position.y-this.baseDimension/2,this.baseDimension*i,0,2*Math.PI),t.stroke(),t.fill(),t.closePath()}}i=document.createElement("canvas"),e=i.getContext("2d"),i.style.top="0px",i.style.left="0px",i.style.pointerEvents="none",n,i.style.position="fixed",document.body.appendChild(i),i.width=o,i.height=s,t.addEventListener("mousemove",function(t){n,h.x=t.clientX,h.y=t.clientY,c(h.x,h.y)}),t.addEventListener("touchmove",d,{passive:!0}),t.addEventListener("touchstart",d,{passive:!0}),window.addEventListener("resize",function(t){o=window.innerWidth,s=window.innerHeight,n,i.width=o,i.height=s}),function t(){e.clearRect(0,0,o,s);for(let t=0;t<a.length;t++)a[t].update(e);for(let t=a.length-1;0<=t;t--)a[t].lifeSpan<0&&a.splice(t,1);requestAnimationFrame(t)}()}();
|
1
source/js/cursor/move/emojiCursor.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(){const e=["😀","😂","😆","😊"];let i=void 0,t=(i,document.body),n=window.innerWidth,o=window.innerHeight;const h={x:n/2,y:n/2},a={x:n/2,y:n/2};let s=0;const d=[],c=[];let l,r;function p(e){if(0<e.touches.length)for(let t=0;t<e.touches.length;t++)u(e.touches[t].clientX,e.touches[t].clientY,c[Math.floor(Math.random()*c.length)])}function u(t,e,i){d.push(new f(t,e,i))}function f(t,e,i){var n=Math.floor(60*Math.random()+80);this.initialLifeSpan=n,this.lifeSpan=n,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/2),y:.4*Math.random()+.8},this.position={x:t,y:e},this.canv=i,this.update=function(t){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.lifeSpan--,this.velocity.y+=.05;var e=Math.max(this.lifeSpan/this.initialLifeSpan,0);t.drawImage(this.canv,this.position.x-this.canv.width/2*e,this.position.y-this.canv.height/2,this.canv.width*e,this.canv.height*e)}}l=document.createElement("canvas"),r=l.getContext("2d"),l.style.top="0px",l.style.left="0px",l.style.pointerEvents="none",i,l.style.position="fixed",document.body.appendChild(l),l.width=n,l.height=o,r.font="21px serif",r.textBaseline="middle",r.textAlign="center",e.forEach(t=>{var e=r.measureText(t),i=document.createElement("canvas"),n=i.getContext("2d");i.width=e.width,i.height=2*e.actualBoundingBoxAscent,n.textAlign="center",n.font="21px serif",n.textBaseline="middle",n.fillText(t,i.width/2,e.actualBoundingBoxAscent),c.push(i)}),t.addEventListener("mousemove",function(t){t.timeStamp-s<16||window.requestAnimationFrame(()=>{i;{const e=void 0}h.x=t.clientX,h.y=t.clientY,1<Math.hypot(h.x-a.x,h.y-a.y)&&(u(h.x,h.y,c[Math.floor(Math.random()*e.length)]),a.x=h.x,a.y=h.y,s=t.timeStamp)})},{passive:!0}),t.addEventListener("touchmove",p,{passive:!0}),t.addEventListener("touchstart",p,{passive:!0}),window.addEventListener("resize",function(t){n=window.innerWidth,o=window.innerHeight,i,l.width=n,l.height=o}),function t(){r.clearRect(0,0,n,o);for(let t=0;t<d.length;t++)d[t].update(r);for(let t=d.length-1;0<=t;t--)d[t].lifeSpan<0&&d.splice(t,1);requestAnimationFrame(t)}()}();
|
1
source/js/cursor/move/fairyDustCursor.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(){let e=["#D61C59","#E7D84B","#1B8798"],i=void 0,t=(i,document.body),n=window.innerWidth,o=window.innerHeight;const h={x:n/2,y:n/2},a={x:n/2,y:n/2},s=[],l=[];let d,c;function r(e){if(0<e.touches.length)for(let t=0;t<e.touches.length;t++)u(e.touches[t].clientX,e.touches[t].clientY,l[Math.floor(Math.random()*l.length)])}function u(t,e,i){s.push(new f(t,e,i))}function f(t,e,i){var n=Math.floor(30*Math.random()+60);this.initialLifeSpan=n,this.lifeSpan=n,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/2),y:.7*Math.random()+.9},this.position={x:t,y:e},this.canv=i,this.update=function(t){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.lifeSpan--,this.velocity.y+=.02;var e=Math.max(this.lifeSpan/this.initialLifeSpan,0);t.drawImage(this.canv,this.position.x-this.canv.width/2*e,this.position.y-this.canv.height/2,this.canv.width*e,this.canv.height*e)}}d=document.createElement("canvas"),c=d.getContext("2d"),d.style.top="0px",d.style.left="0px",d.style.pointerEvents="none",i,d.style.position="fixed",t.appendChild(d),d.width=n,d.height=o,c.font="21px serif",c.textBaseline="middle",c.textAlign="center",e.forEach(t=>{var e=c.measureText("*"),i=document.createElement("canvas"),n=i.getContext("2d");i.width=e.width,i.height=e.actualBoundingBoxAscent+e.actualBoundingBoxDescent,n.fillStyle=t,n.textAlign="center",n.font="21px serif",n.textBaseline="middle",n.fillText("*",i.width/2,e.actualBoundingBoxAscent),l.push(i)}),t.addEventListener("mousemove",function(t){window.requestAnimationFrame(()=>{i;{const e=void 0}h.x=t.clientX,h.y=t.clientY,1.5<Math.hypot(h.x-a.x,h.y-a.y)&&(u(h.x,h.y,l[Math.floor(Math.random()*e.length)]),a.x=h.x,a.y=h.y)})}),t.addEventListener("touchmove",r,{passive:!0}),t.addEventListener("touchstart",r,{passive:!0}),window.addEventListener("resize",function(t){n=window.innerWidth,o=window.innerHeight,i,d.width=n,d.height=o}),function t(){c.clearRect(0,0,n,o);for(let t=0;t<s.length;t++)s[t].update(c);for(let t=s.length-1;0<=t;t--)s[t].lifeSpan<0&&s.splice(t,1);requestAnimationFrame(t)}()}();
|
1
source/js/cursor/move/followingDotCursor.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(){let t,n,e=void 0,i=(e,document.body),o=window.innerWidth,s=window.innerHeight,h={x:o/2,y:o/2},d=new function(i,t,n,e){this.position={x:i,y:t},this.width=10,this.lag=10,this.moveTowards=function(i,t,n){this.position.x+=(i-this.position.x)/this.lag,this.position.y+=(t-this.position.y)/this.lag,n.fillStyle="rgba(50, 50, 50, 0.65)",n.beginPath(),n.arc(this.position.x,this.position.y,this.width,0,2*Math.PI),n.fill(),n.closePath()}}(o/2,s/2);t=document.createElement("canvas"),n=t.getContext("2d"),t.style.top="0px",t.style.left="0px",t.style.pointerEvents="none",e,t.style.position="fixed",document.body.appendChild(t),t.width=o,t.height=s,i.addEventListener("mousemove",function(i){e,h.x=i.clientX,h.y=i.clientY}),window.addEventListener("resize",function(i){o=window.innerWidth,s=window.innerHeight,e,t.width=o,t.height=s}),function i(){n.clearRect(0,0,o,s),d.moveTowards(h.x,h.y,n),requestAnimationFrame(i)}()}();
|
1
source/js/cursor/move/ghostCursor.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(){let e,i,t=void 0,A=(t,document.body),n=window.innerWidth,g=window.innerHeight,o={x:n/2,y:n/2},h=[],a=new Image;function s(e){if(0<e.touches.length)for(let A=0;A<e.touches.length;A++)d(e.touches[A].clientX,e.touches[A].clientY,a)}function d(A,e,i){h.push(new l(A,e,i))}function l(A,e,i){this.initialLifeSpan=40,this.lifeSpan=40,this.position={x:A,y:e},this.image=i,this.update=function(A){this.lifeSpan--;var e=Math.max(this.lifeSpan/this.initialLifeSpan,0);A.globalAlpha=e,A.drawImage(this.image,this.position.x,this.position.y)}}a.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAATCAYAAACk9eypAAAAAXNSR0IArs4c6QAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAhGVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABKARsABQAAAAEAAABSASgAAwAAAAEAAgAAh2kABAAAAAEAAABaAAAAAAAAAEgAAAABAAAASAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAADKADAAQAAAABAAAAEwAAAAAChpcNAAAACXBIWXMAAAsTAAALEwEAmpwYAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAABqElEQVQoFY3SPUvDQBgH8BREpRHExYiDgmLFl6WC+AYmWeyLg4i7buJX8DMpOujgyxGvUYeCgzhUQUSKKLUS0+ZyptXh8Z5Ti621ekPyJHl+uftfomhaf9Ei5JyxXKfynyEA6EYcLHpwyflT958GAQ7DTABNHd8EbtDbEH2BD5QEQmi2mM8P/Iq+A0SzszEg+3sPjDnDdVEtQKQbMUidHD3xVzf6A9UDEmEm+8h9KTqTVUjT+vB53aHrCbAPiceYq1dQI1Aqv4EhMll0jzv+Y0yiRgCnLRSYyDQHVoqUXe4uKL9l+L7GXC4vkMhE6eW/AOJs9k583ORDUyXMZ8F5SVHVVnllmPNKSFagAJ5DofaqGXw/gHBYg51dIldkmknY3tguv3jOtHR4+MqAzaraJXbEhqHhcQlwGSOi5pytVQHZLN5s0WNe8HPrLYlFsO20RPHkImxsbmHdLJFI76th7Z4SeuF53hTeFLvhRCJRCTKZKxgdnRDbW+iozFJbBMw14/ElwGYc0egMBMFzT21f5Rog33Z7dX02GBm7WV5ZfT5Nn5bE3zuCDe9UxdTpNvK+5AAAAABJRU5ErkJggg==",e=document.createElement("canvas"),i=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",t,e.style.position="fixed",document.body.appendChild(e),e.width=n,e.height=g,A.addEventListener("mousemove",function(A){t,o.x=A.clientX,o.y=A.clientY,d(o.x,o.y,a)}),A.addEventListener("touchmove",s,{passive:!0}),A.addEventListener("touchstart",s,{passive:!0}),window.addEventListener("resize",function(A){n=window.innerWidth,g=window.innerHeight,t,e.width=n,e.height=g}),function A(){i.clearRect(0,0,n,g);for(let A=0;A<h.length;A++)h[A].update(i);for(let A=h.length-1;0<=A;A--)h[A].lifeSpan<0&&h.splice(A,1);requestAnimationFrame(A)}()}();
|
1
source/js/cursor/move/snowflakeCursor.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(){let e,o,i=void 0,t=(i,document.body),n=["❄️"],a=window.innerWidth,h=window.innerHeight,s={x:a/2,y:a/2},d=[],l=[];function c(e){if(0<e.touches.length)for(let t=0;t<e.touches.length;t++)r(e.touches[t].clientX,e.touches[t].clientY,l[Math.floor(Math.random()*l.length)])}function r(t,e,i){d.push(new f(t,e,i))}function f(t,e,i){var n=Math.floor(60*Math.random()+80);this.initialLifeSpan=n,this.lifeSpan=n,this.velocity={x:(Math.random()<.5?-1:1)*(Math.random()/2),y:1+Math.random()},this.position={x:t,y:e},this.canv=i,this.update=function(t){this.position.x+=this.velocity.x,this.position.y+=this.velocity.y,this.lifeSpan--,this.velocity.x+=2*(Math.random()<.5?-1:1)/75,this.velocity.y-=Math.random()/300;var e=Math.max(this.lifeSpan/this.initialLifeSpan,0),i=2*this.lifeSpan*.0174533;t.translate(this.position.x,this.position.y),t.rotate(i),t.drawImage(this.canv,-this.canv.width/2*e,-this.canv.height/2,this.canv.width*e,this.canv.height*e),t.rotate(-i),t.translate(-this.position.x,-this.position.y)}}e=document.createElement("canvas"),o=e.getContext("2d"),e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",i,e.style.position="fixed",document.body.appendChild(e),e.width=a,e.height=h,o.font="12px serif",o.textBaseline="middle",o.textAlign="center",n.forEach(t=>{var e=o.measureText(t),i=document.createElement("canvas"),n=i.getContext("2d");i.width=e.width,i.height=2*e.actualBoundingBoxAscent,n.textAlign="center",n.font="12px serif",n.textBaseline="middle",n.fillText(t,i.width/2,e.actualBoundingBoxAscent),l.push(i)}),t.addEventListener("mousemove",function(t){i,s.x=t.clientX,s.y=t.clientY,r(s.x,s.y,l[Math.floor(Math.random()*n.length)])}),t.addEventListener("touchmove",c,{passive:!0}),t.addEventListener("touchstart",c,{passive:!0}),window.addEventListener("resize",function(t){a=window.innerWidth,h=window.innerHeight,i,e.width=a,e.height=h}),function t(){o.clearRect(0,0,a,h);for(let t=0;t<d.length;t++)d[t].update(o);for(let t=d.length-1;0<=t;t--)d[t].lifeSpan<0&&d.splice(t,1);requestAnimationFrame(t)}()}();
|
1
source/js/cursor/move/springyEmojiCursor.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(){let n,o,t,e=void 0,s=(e,document.body),c=10,h=10,y=window.innerWidth,l=window.innerHeight,a={x:y/2,y:y/2},d=[];function v(i){y=window.innerWidth,l=window.innerHeight,e,n.width=y,n.height=l}function x(i){0<i.touches.length&&(e,a.x=i.touches[0].clientX,a.y=i.touches[0].clientY)}function r(i){e,a.x=i.clientX,a.y=i.clientY}function p(){for(n.width=n.width,d[0].position.x=a.x,d[0].position.y=a.y,i=1;i<7;i++){var t=new w(0,0);0<i&&u(i-1,i,t),i<6&&u(i+1,i,t);var e=new w(10*-d[i].velocity.x,10*-d[i].velocity.y),t=new w(+(t.X+e.X),+(t.Y+e.Y)+50);d[i].velocity.x+=.01*t.X,d[i].velocity.y+=.01*t.Y,Math.abs(d[i].velocity.x)<.1&&Math.abs(d[i].velocity.y)<.1&&Math.abs(t.X)<.1&&Math.abs(t.Y)<.1&&(d[i].velocity.x=0,d[i].velocity.y=0),d[i].position.x+=d[i].velocity.x,d[i].position.y+=d[i].velocity.y,e=n.clientHeight,t=n.clientWidth,d[i].position.y>=e-11-1&&(0<d[i].velocity.y&&(d[i].velocity.y=.7*-d[i].velocity.y),d[i].position.y=e-11-1),d[i].position.x>=t-11&&(0<d[i].velocity.x&&(d[i].velocity.x=.7*-d[i].velocity.x),d[i].position.x=t-11-1),d[i].position.x<0&&(d[i].velocity.x<0&&(d[i].velocity.x=.7*-d[i].velocity.x),d[i].position.x=0),d[i].draw(o)}requestAnimationFrame(p)}function w(i,t){this.X=i,this.Y=t}function u(i,t,e){var n,o=d[i].position.x-d[t].position.x,i=d[i].position.y-d[t].position.y,t=Math.sqrt(o*o+i*i);t>c&&(n=h*(t-c),e.X+=o/t*n,e.Y+=i/t*n)}function f(i){this.position={x:a.x,y:a.y},this.velocity={x:0,y:0},this.canv=i,this.draw=function(i){i.drawImage(this.canv,this.position.x-this.canv.width/2,this.position.y-this.canv.height/2,this.canv.width,this.canv.height)}}{n=document.createElement("canvas"),o=n.getContext("2d"),n.style.top="0px",n.style.left="0px",n.style.pointerEvents="none",e,n.style.position="fixed",document.body.appendChild(n),n.width=y,n.height=l,o.font="16px serif",o.textBaseline="middle",o.textAlign="center";var g=o.measureText("🤪"),m=document.createElement("canvas"),X=m.getContext("2d");m.width=g.width,m.height=2*g.actualBoundingBoxAscent,X.textAlign="center",X.font="16px serif",X.textBaseline="middle",X.fillText("🤪",m.width/2,g.actualBoundingBoxAscent),t=m;let i=0;for(i=0;i<7;i++)d[i]=new f(t);s.addEventListener("mousemove",r),s.addEventListener("touchmove",x,{passive:!0}),s.addEventListener("touchstart",x,{passive:!0}),window.addEventListener("resize",v),p()}}();
|
1
source/js/cursor/move/trailingCursor.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(A){let i,o,n=A,t=(n,document.body),g=window.innerWidth,m=window.innerHeight,E={x:g/2,y:g/2},d=[];const p=A.particles||15;let c=!1,s=new Image;function h(A,i,t){this.position={x:A,y:i},this.image=t,this.move=function(A){A.drawImage(this.image,this.position.x,this.position.y)}}s.src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAATCAYAAACk9eypAAAAAXNSR0IArs4c6QAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAhGVYSWZNTQAqAAAACAAFARIAAwAAAAEAAQAAARoABQAAAAEAAABKARsABQAAAAEAAABSASgAAwAAAAEAAgAAh2kABAAAAAEAAABaAAAAAAAAAEgAAAABAAAASAAAAAEAA6ABAAMAAAABAAEAAKACAAQAAAABAAAADKADAAQAAAABAAAAEwAAAAAChpcNAAAACXBIWXMAAAsTAAALEwEAmpwYAAABWWlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS40LjAiPgogICA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogICAgICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgICAgICAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyI+CiAgICAgICAgIDx0aWZmOk9yaWVudGF0aW9uPjE8L3RpZmY6T3JpZW50YXRpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgpMwidZAAABqElEQVQoFY3SPUvDQBgH8BREpRHExYiDgmLFl6WC+AYmWeyLg4i7buJX8DMpOujgyxGvUYeCgzhUQUSKKLUS0+ZyptXh8Z5Ti621ekPyJHl+uftfomhaf9Ei5JyxXKfynyEA6EYcLHpwyflT958GAQ7DTABNHd8EbtDbEH2BD5QEQmi2mM8P/Iq+A0SzszEg+3sPjDnDdVEtQKQbMUidHD3xVzf6A9UDEmEm+8h9KTqTVUjT+vB53aHrCbAPiceYq1dQI1Aqv4EhMll0jzv+Y0yiRgCnLRSYyDQHVoqUXe4uKL9l+L7GXC4vkMhE6eW/AOJs9k583ORDUyXMZ8F5SVHVVnllmPNKSFagAJ5DofaqGXw/gHBYg51dIldkmknY3tguv3jOtHR4+MqAzaraJXbEhqHhcQlwGSOi5pytVQHZLN5s0WNe8HPrLYlFsO20RPHkImxsbmHdLJFI76th7Z4SeuF53hTeFLvhRCJRCTKZKxgdnRDbW+iozFJbBMw14/ElwGYc0egMBMFzT21f5Rog33Z7dX02GBm7WV5ZfT5Nn5bE3zuCDe9UxdTpNvK+5AAAAABJRU5ErkJggg==",i=document.createElement("canvas"),o=i.getContext("2d"),i.style.top="0px",i.style.left="0px",i.style.pointerEvents="none",n,i.style.position="fixed",document.body.appendChild(i),i.width=g,i.height=m,t.addEventListener("mousemove",function(A){n;{const i=void 0}if(E.x=A.clientX,E.y=A.clientY,!1===c){c=!0;for(let A=0;A<p;A++)i=E.x,t=E.y,e=s,d.push(new h(i,t,e))}var i,t,e}),window.addEventListener("resize",function(A){g=window.innerWidth,m=window.innerHeight,n,i.width=g,i.height=m}),function A(){{o.clearRect(0,0,g,m);let e=E.x,n=E.y;d.forEach(function(A,i,t){i=t[i+1]||t[0];A.position.x=e,A.position.y=n,A.move(o),e+=.4*(i.position.x-A.position.x),n+=.4*(i.position.y-A.position.y)})}requestAnimationFrame(A)}()}();
|
1
source/js/dprogress.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(){var n={},s=n.settings={minimum:.08,easing:"linear",speed:400,trickle:!0,trickleSpeed:200,parent:"body",template:'<div class="bar"></div>'};function i(t,e,r){return t<e?e:r<t?r:t}n.configure=function(t){var e,r;for(e in t)void 0!==(r=t[e])&&t.hasOwnProperty(e)&&(s[e]=r);return this},n.status=null,n.start=function(){n.status||n.set(0),$("#dprogress").show();var t=function(){setTimeout(function(){n.status&&1!==n.status&&(n.trickle(),t())},s.trickleSpeed)};return s.trickle&&t(),this},n.trickle=function(){return n.inc()},n.inc=function(t){var e=n.status;return e?1<=e?void 0:(e=i(e+(t="number"!=typeof t?0<=e&&e<.2?.1:.2<=e&&e<.5?.04:.5<=e&&e<.8?.02:.8<=e&&e<.98?.005:0:t),0,.98),n.set(e)):n.start()},n.set=function(t){n.status=i(t,s.minimum,1);var e,r=document.getElementById("dprogress");return r||((r=document.createElement("div")).id="dprogress",r.innerHTML=s.template,(e=$(r.querySelector(".bar"))).css("transition",`all ${s.speed}ms `+s.easing),"center"===DreamConfig.load_progress&&e.css("margin","auto"),$(s.parent).prepend(r)),r.querySelector(".bar").style.width=100*t+"%",this},n.isStarted=function(){return"number"==typeof n.status},n.done=function(){return n.inc(.3+.5*Math.random()).set(1),setTimeout(function(){$("#dprogress").hide(),n.status=void 0},s.speed),this},n.isRendered=function(){return!!document.getElementById("dprogress")},window.DProgress=n}();
|
1
source/js/dshare.min.js
vendored
Normal file
0
source/js/dshare.min.js.LICENSE.txt
Normal file
1
source/js/effects/circleMagic.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
(()=>{var f;(f=jQuery).fn.circleMagic=function(e){let t,n,o,a,r=!0;const i=[],d=f.extend({color:"rgba(255,255,255,.5)",radius:10,density:.3,clearOffset:.2,mode:"all"},e);var c,e=this[0];function s(){const e=document.documentElement.classList.contains("night");if(("all"===d.mode||"day"===d.mode&&!e||"night"===d.mode&&e)&&r){a.clearRect(0,0,t,n);for(const e in i)i[e].draw()}requestAnimationFrame(s)}function l(){var e=this;function o(){e.pos.x=Math.random()*t,e.pos.y=n+100*Math.random(),e.alpha=.1+Math.random()*d.clearOffset,e.scale=.1+.3*Math.random(),e.speed=Math.random(),"random"===d.color?e.color="rgba("+Math.floor(255*Math.random())+", "+Math.floor(255*Math.random())+", "+Math.floor(255*Math.random())+", "+Math.random().toPrecision(2)+")":e.color=d.color}e.pos={},o(),this.draw=function(){e.alpha<=0&&o(),e.pos.y-=e.speed,e.alpha-=5e-4,a.beginPath(),a.arc(e.pos.x,e.pos.y,e.scale*d.radius,0,2*Math.PI,!1),a.fillStyle=e.color,a.fill(),a.closePath()}}t=window.innerWidth,n=window.innerHeight,(o=((c=document.createElement("canvas")).setAttribute("class","canvas_effects "+d.mode),e.prepend(c),c)).width=t,o.height=n,a=o.getContext("2d");for(let e=0;e<t*d.density;e++){var h=new l;i.push(h)}s(),window.addEventListener("scroll",function(){r=!(document.body.scrollTop>n)},!1),window.addEventListener("resize",function(){t=window.innerWidth,n=window.innerHeight,o.width=t,o.height=n},!1)},f("body").circleMagic({radius:35,density:.3,color:"rgba(255,255,255, .4)",clearOffset:.3,mode:DreamConfig.effects_circle_magic_mode})})();
|
1
source/js/effects/sakura.min.js
vendored
Normal file
1
source/js/effects/universe.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(){window.requestAnimationFrame=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;const t=.05,i=DreamConfig.effects_universe_mode,s=document.createElement("canvas");let e,n,h,a=!0;const o="226,225,224",c=[];let r;function d(){e=window.innerWidth,n=window.innerHeight,h=.216*e,s.setAttribute("width",e),s.setAttribute("height",n),s.setAttribute("class","canvas_effects "+i),document.body.insertBefore(s,document.body.firstChild)}function f(){r.clearRect(0,0,e,n);for(var t=c.length,i=0;i<t;i++){var s=c[i];s.move(),s.fadeIn(),s.fadeOut(),s.draw()}}function u(){this.reset=function(){this.giant=l(3),this.comet=!this.giant&&!a&&l(10),this.x=m(0,e-10),this.y=m(0,n),this.r=m(1.1,2.6),this.dx=m(t,6*t)+(this.comet+1-1)*t*m(50,120)+.1,this.dy=-m(t,6*t)-(this.comet+1-1)*t*m(50,120),this.fadingOut=null,this.fadingIn=!0,this.opacity=0,this.opacityTresh=m(.2,1-.4*(this.comet+1-1)),this.do=m(5e-4,.002)+.001*(this.comet+1-1)},this.fadeIn=function(){this.fadingIn&&(this.fadingIn=!(this.opacity>this.opacityTresh),this.opacity+=this.do)},this.fadeOut=function(){this.fadingOut&&(this.fadingOut=!(this.opacity<0),this.opacity-=this.do/2,this.x>e||this.y<0)&&(this.fadingOut=!1,this.reset())},this.draw=function(){if(r.beginPath(),this.giant)r.fillStyle="rgba(180,184,240,"+this.opacity+")",r.arc(this.x,this.y,2,0,2*Math.PI,!1);else if(this.comet){r.fillStyle="rgba("+o+","+this.opacity+")",r.arc(this.x,this.y,1.5,0,2*Math.PI,!1);for(var t=0;t<30;t++)r.fillStyle="rgba("+o+","+(this.opacity-this.opacity/20*t)+")",r.rect(this.x-this.dx/4*t,this.y-this.dy/4*t-2,2,2),r.fill()}else r.fillStyle="rgba(226,225,142,"+this.opacity+")",r.rect(this.x,this.y,this.r,this.r);r.closePath(),r.fill()},this.move=function(){this.x+=this.dx,this.y+=this.dy,!1===this.fadingOut&&this.reset(),(this.x>e-e/4||this.y<0)&&(this.fadingOut=!0)},setTimeout(function(){a=!1},50)}function l(t){return Math.floor(1e3*Math.random())+1<10*t}function m(t,i){return Math.random()*(i-t)+t}d(),window.addEventListener("resize",d,!1),r=s.getContext("2d");for(var y=0;y<h;y++)c[y]=new u,c[y].reset();f(),function t(){var i=document.documentElement.classList.contains("night");(s.classList.contains("all")||s.classList.contains("day")&&!i||s.classList.contains("night")&&i)&&f(),window.requestAnimationFrame(t)}()}();
|
1
source/js/journals.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
(()=>{let e=!1;const i={initEvent(){var n;e||((n=$("body")).on("click",".journal .comment",function(){$(this).parent().parent().siblings(".journal-comment").stop().slideToggle(200)}),n.on("click",".journal-content>.expand-done",function(){Utils.foldBlock($(this).parent())}),n.on("click",".journal-operation-item>.share",function(){var n=$(this).parents(".journal"),e="动态: "+n.find(".journal-date>em").text(),n=n.children(".journal-content").children(".main-content").text();DShare.sharePoster({image:DreamConfig.journals_share_image,title:e,description:220<n.length?n.substring(0,220)+"...":n})}),Utils.initLikeEvent(".journal .like","journals",n=>n.next()),e=!0)},initLike(){Utils.initLikeButton(".journal .like","journals")},foldJournals(){$(".journal .journal-content").each(function(){var n=$(this);this.scrollHeight>=DreamConfig.journals_fold_height?n.append('<div class="expand-done"><i class="fa fa-angle-double-up"></i></div>'):n.removeClass("fold")})}};window.journalPjax=function(e){0!==$(".card.journal").length&&Object.keys(i).forEach(n=>window.pjaxSerialNumber===e&&i[n]())},window.pjaxSerialNumber||i.initEvent(),window.pjaxSerialNumber||i.initLike(),document.addEventListener("DOMContentLoaded",function(){window.pjaxSerialNumber||i.foldJournals()})})();
|
15
source/js/mew-custom.min.js
vendored
Normal file
1
source/js/photos.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
(()=>{let t=!1,s={},e=!1,n=!1,c={page:0,size:15,sort:"createTime,desc"};const i=(i,t)=>{e=!0,i.addClass("loading"),t&&t.team&&(t.team=t.team.substring(2));const o={...c,...t||{}};s.promise=new Promise((a,e)=>{s.abort=e,Utils.request({url:"/api/content/photos",method:"GET",data:o}).then(t=>a(t)).catch(t=>e(t))}).then(t=>{var a,e=t.content||[];n=0===e.length||(a=i,e=e.reduce((t,a,e)=>`${t}<div href="${a.url}" data-fancybox="gallery" data-caption="${a.description||a.name||""}"><img width="100%" height="100%" src="${a.thumbnail}" alt="${a.name||""}"/><div class="info"><div><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M834.9 913.6H189.7c-69.2 0-125.5-56.3-125.5-125.5V381.5c0-69.2 56.3-125.5 125.5-125.5h14.7c14.4 0 27.3-8.6 32.9-21.8l19.2-45.1c19.7-46.3 65-76.3 115.4-76.3h280.6c50.4 0 95.7 30 115.4 76.3l19.2 45c5.7 13.2 18.6 21.8 33 21.8h14.7c69.2 0 125.5 56.3 125.5 125.5V788c0.1 69.3-56.2 125.6-125.4 125.6z m-645.2-568c-19.8 0-35.8 16.1-35.8 35.8V788c0 19.8 16.1 35.8 35.8 35.8h645.2c19.8 0 35.8-16.1 35.8-35.8V381.5c0-19.8-16.1-35.8-35.8-35.8h-14.7c-50.4 0-95.7-30-115.4-76.3l-19.2-45c-5.6-13.2-18.6-21.8-33-21.8H372c-14.4 0-27.3 8.6-33 21.8l-19.2 45c-19.7 46.3-65 76.3-115.4 76.3h-14.7z"></path><path d="M512.3 742.8c-97.4 0-176.6-79.2-176.6-176.6s79.2-176.6 176.6-176.6 176.6 79.2 176.6 176.6-79.2 176.6-176.6 176.6z m0-263.6c-48 0-87 39-87 87s39 87 87 87 87-39 87-87-39-87-87-87z"></path></svg><p>${a.name}</p></div>${a.location?`<div><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M511.3 960.8c-9.3 0-18.6-2.9-26.5-8.7-14.1-10.4-345.6-256.4-345.6-516.1 0-205.2 166.9-372.1 372.1-372.1S883.4 230.8 883.4 436c0 259.7-331.5 505.8-345.6 516.1-7.8 5.8-17.2 8.7-26.5 8.7z m0-807.2c-155.7 0-282.4 126.7-282.4 282.4 0 176.5 207.5 361.8 282.4 422.9 74.9-61.1 282.4-246.4 282.4-422.9 0-155.8-126.7-282.4-282.4-282.4z"></path><path d="M511.3 611.7c-96.9 0-175.7-78.8-175.7-175.7s78.8-175.7 175.7-175.7S687.1 339.1 687.1 436s-78.9 175.7-175.8 175.7z m0-261.8c-47.5 0-86.1 38.6-86.1 86.1s38.6 86.1 86.1 86.1 86.1-38.6 86.1-86.1-38.6-86.1-86.1-86.1z"></path></svg><p>${a.location}</p></div>`:""}<div><svg viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path d="M512.7 959.8c-247 0-448-201-448-448s201-448 448-448 448 201 448 448-200.9 448-448 448z m0-806.4c-197.6 0-358.4 160.8-358.4 358.4s160.8 358.4 358.4 358.4 358.4-160.8 358.4-358.4-160.7-358.4-358.4-358.4z"></path><path d="M700 576.8H512.7c-24.6 0-44.6-19.9-44.8-44.5L466 254.5c-0.2-24.7 19.8-44.9 44.5-45.1h0.3c24.6 0 44.6 19.9 44.8 44.5l1.6 233.3H700c24.7 0 44.8 20.1 44.8 44.8 0 24.7-20.1 44.8-44.8 44.8z"></path></svg><p>${Utils.formatDate(a.takeTime)}</p></div>${a.description?`<p>${a.description}</p>`:""}</div></div>`,""),a.append(e),a.justifiedGallery({rowHeight:200,maxRowHeight:!1,maxRowsCount:0,sizeRangeSuffixes:{},lastRow:"nojustify",captions:!1,waitThumbnailsLoad:!0,margins:10,extension:/\.(jpe?g|png|gif|bmp|webp)$/,cssAnimation:!1}),t.isLast)}).catch(t=>console.log(t)).finally(()=>{i.removeClass("loading"),s={},e=!1})},o={initEvent(){t||($("body").on("click",".photos-teams .item",function(t){t.stopPropagation();t=$(this);t.hasClass("active")||(t.addClass("active").siblings("li").removeClass("active"),(async(t,a)=>{s&&(s.abort&&s.abort("abort"),await s.promise),t.empty(),n=!1,e=!1,c.page=0,location.hash=a.team,i(t,a)})($(".photos-gallery"),{team:t.attr("data-team")}))}),window.addEventListener("scroll",function(){var t=$(".photos-gallery");0!==t.length&&$(window).scrollTop()+$(window).height()>=t.height()&&(e||n||(c.page++,i(t,{team:$(".photos-teams li.active").attr("data-team")})))}),t=!0)},initPhotos(){var t,a=$(".photos-gallery");s={},e=!1,n=!1,c={page:0,size:15,sort:"createTime,desc"},location.hash?(t=decodeURI(location.hash.substring(1)),0<(t=$(".photos-teams li[data-team="+t+"]")).length?t.click():$(".photos-teams li:not([data-team])").addClass("active")&&i(a)):($(".photos-teams li:not([data-team])").addClass("active"),i(a))}};window.photoPjax=function(a){0!==$(".photos-gallery").length&&Object.keys(o).forEach(t=>window.pjaxSerialNumber===a&&o[t]())},window.pjaxSerialNumber||o.initEvent(),window.pjaxSerialNumber||o.initPhotos()})();
|
1
source/js/pjax.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
(()=>{const r=new Set($('link[href*=".css"]').map((o,e)=>$(e).attr("href")).get()),c=new Set($('script[src*=".js"]').map((o,e)=>$(e).attr("src")).get()),e=()=>{var o=(new Date).getTime();return window.pjaxSerialNumber=o,console.log("sn = "+o),o},o=$(".actions>.bullet-screen"),i=()=>{0===$("halo-comment[bullet-screen]").length?o.addClass("is-hidden-all"):o.removeClass("is-hidden-all")},m=(e,n,t)=>{if(n>=e.length)t&&t();else{let o=$(e[n]).attr("src");c.has(o)?m(e,n+1,t):(console.log((t?"同步":"异步")+"顺序加载js "+o),Utils.cachedScript(o).done(function(){console.log((t?"同步":"异步")+"顺序加载js完成 "+o),c.add(o),window.DProgress&&DProgress.inc(),m(e,n+1,t)}).fail(function(){console.log((t?"同步":"异步")+"顺序加载js失败 "+o),m(e,n+1,t)}))}};$(document).on("click","a[target!=_blank][href]:not(data-not-pjax)",o=>{$.pjax.click(o,".column-main",{scrollTo:"/"!==o.currentTarget.pathname&&0!==$(".banner").length?window.innerHeight/4:0,fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("submit","form[data-pjax]",function(o){$.pjax.submit(o,".column-main",{scrollTo:0,fragment:".column-main",serialNumber:e(),timeout:8e3})}),$(document).on("pjax:click",function(o,e){console.log("------------------------"),console.log("pjax:click sn = "+e.serialNumber)}),$(document).on("pjax:beforeSend",function(o,e,n){console.log("pjax:beforeSend sn = "+n.serialNumber),$("html").addClass("pjax-loading")}),$(document).on("pjax:start",function(o,e,n){console.log("pjax:start sn = "+n.serialNumber),window.DProgress&&DProgress.start(),$(".pjax-close").remove()}),$(document).on("pjax:send",function(o,e,n){console.log("pjax:send sn = "+n.serialNumber)}),$(document).on("pjax:clicked",function(o,e){console.log("pjax:clicked sn = "+e.serialNumber)}),$(document).on("pjax:beforeReplace",function(o,e,n){console.log("pjax:beforeReplace sn = "+n.serialNumber),$(".navbar-nav .current,.panel-side-menu .current").removeClass("current"),commonContext.initNavbar(),0<$("html.disable-scroll").length&&$(".navbar-mask").trigger("click")}),$(document).on("pjax:success",async function(o,e,n,t,a){a=a.serialNumber;if(console.log("pjax:success sn = "+a),window.pjaxSerialNumber===a){commonContext.initGallery(),commonContext.initTocAndNotice(),i(),$("html").removeClass("pjax-loading");const s=$($.parseHTML(e,document,!0)),l=$("head");l.find("meta").remove(),l.append(s.filter("meta")),s.filter("link[data-pjax]").each(function(){let o=$(this).attr("href");r.has(o)||(l.append($(this)),console.log("加载css "+$(this).attr("href")),this.onload=function(){r.add(o),window.DProgress&&DProgress.inc(),console.log("加载css完成 "+$(this).attr("href"))})});let o=s.filter("script[data-pjax]");if(0<o.length){o.filter("[async]").each(function(){let o=$(this).attr("src");c.has(o)||(console.log("异步无序加载js "+o),Utils.cachedScript(o).done(function(){console.log("异步无序js完成 "+o),window.DProgress&&DProgress.inc(),c.add(o)}).fail(function(){console.log("异步无序js失败 "+o)}))}),new Promise(()=>{m(o.filter("[defer]"),0)});let e=o.filter(":not([async]):not([defer])");0<e.length&&await new Promise(o=>{m(e,0,o)})}console.log("全部处理完成"),window.pjaxSerialNumber===a&&(window.journalPjax&&window.journalPjax(a),window.postPjax&&window.postPjax(a),window.photoPjax&&window.photoPjax(a),commonContext.initCarousel(),commonContext.loadMaintain(),window.DProgress)&&DProgress.done()}}),$(document).on("pjax:timeout",function(o,e,n){console.log("pjax:timeout sn = "+n.serialNumber)}),$(document).on("pjax:error",function(o,e,n,t,a){console.log(`pjax:error sn = ${a.serialNumber} error `+t)}),$(document).on("pjax:complete",function(o,e,n,t){console.log("pjax:complete sn = "+t.serialNumber)}),$(document).on("pjax:end",function(o,e,n){console.log("pjax:end sn = "+n.serialNumber),null==e&&(commonContext.initTocAndNotice(),i(),commonContext.initCarousel(),window.DProgress&&DProgress.done(),$("html").removeClass("pjax-loading"))}),$(document).on("pjax:popstate",function(){console.log("pjax:popstate")})})();
|
1
source/js/post.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
(()=>{let i=!1;const a={initEvent(){var e;i||((e=$("body")).on("click","figure>figcaption .fa-angle-down",function(){var e=$(this);e.is(".close")?($(e.attr("data-code")).parent().slideDown(200),e.removeClass("close")):($(e.attr("data-code")).parent().slideUp(200),e.addClass("close"))}),e.on("click","figure > pre > .expand-done",function(){Utils.foldBlock($(this).parent().parent())}),e.on("click",".gallery-item .expand-done",function(e){e.stopPropagation(),Utils.foldBlock($(this).parent())}),Utils.initLikeEvent(".admire .agree.like","posts",e=>e.find("span").find("span")),window.onCommentSuccessEvent=(e,i)=>{var t=encrypt("mew-hide-"+i),n=(n=localStorage.getItem(t))?JSON.parse(decrypt(n)):[],e=String(e.postId);n.includes(e)||(n.push(e),$(`.main-content[data-target='${i}'][data-id='${e}'] mew-hide[hide]`).each(function(){$(this).before(decrypt(this.getAttribute("hide"))),$(this).remove(),commonContext.initGallery(),a.initCodeBlock(),a.initLiterature(),a.initHighlighting(),"true"===this.getAttribute("toc")&&commonContext.initTocAndNotice()}),localStorage.setItem(t,encrypt(JSON.stringify(n))))},i=!0)},initCodeBlock(){var e=$("*:not(figure) > pre > code");0!==e.length&&e.each(function(e){var i=$(this).parent();let t=$(this).attr("class"),n="",a=!1;if(null!=t){let e=t.indexOf("|"),i=t.indexOf("<");n=-1!==e||-1!==i?((-1===e||-1!==i&&i<e)&&(a=!0,e=i),$(this).attr("class",t.substring(0,e)),e===t.length-1?t.substring(9,e):t.substring(e+1)):t.substring(9)}let o=$(this).text().split("\n").length-1||1,l=String(o).length,s=(1===l&&(l=2),"");for(var r=0;r<o;r++)s+=`<li>${String(r+1).padStart(l,0)}</li>`;let d=`codeBlock${e}-`+(new Date).getTime(),c="";a&&(c=" close",$(this).hide());e=`<div><i class="fa fa-angle-down${c}" data-code='#${d}'></i><i class="fa fa-clone btn-clipboard" title="复制代码" data-clipboard-target='#${d}'></i></div>`;$(this).attr("id",d),i.prepend(`<ul>${s}</ul>`),o>DreamConfig.code_fold_line?i.wrap('<figure class="fold hljs"></figure>').append('<div class="expand-done"><i class="fa fa-angle-double-up"></i></div>'):i.wrap('<figure class="hljs"></figure>'),i.parent().prepend(`<figcaption>${n}${e}</figcaption>`)})},initLiterature(){$(".literature-content>p:not([class]),.literature-content>mew-hide>p:not([class])").each(function(){0===$(this).children(":not(code,a,strong,em,ins,b,s,br,span.pwd)").length&&$(this).addClass("note")})},initLike(){Utils.initLikeButton(".admire .agree.like","posts")},initHighlighting(){hljs.initHighlightingOnLoad()},initShare(){if(window.DShare){let e=$(".cover-image").css("background-image");e=e&&e.substring(5,e.length-2),DShare.create(".dshare",{image:e,imageSelector:".main-content"})}},initClipboard(){window.clipboard||(window.clipboard=new ClipboardJS(".btn-clipboard"),clipboard.on("error",function(e){e.clearSelection(),Qmsg.error("您的浏览器不支持复制")}),clipboard.on("success",function(){Qmsg.success("复制成功")}))},foldImage(){var e;DreamConfig.img_fold_height&&((e=$(".article .gallery-item>[data-fancybox]>img")).parent().addClass("fold"),e.each(function(){const e=$(this).parent();this.complete?this.scrollHeight>=DreamConfig.img_fold_height?e.append('<div class="expand-done"><i class="fa fa-angle-double-up"></i></div>'):e.removeClass("fold"):this.onload=function(){this.scrollHeight>=DreamConfig.img_fold_height?e.append('<div class="expand-done"><i class="fa fa-angle-double-up"></i></div>'):e.removeClass("fold")}}))}};window.postPjax=function(i){0!==$(".main-content").length&&Object.keys(a).forEach(e=>window.pjaxSerialNumber===i&&a[e]())};{const t=["initEvent","initCodeBlock","initLiterature","initLike","foldImage"];Object.keys(a).forEach(e=>!window.pjaxSerialNumber&&t.includes(e)&&a[e]()),document.addEventListener("DOMContentLoaded",function(){Object.keys(a).forEach(e=>!window.pjaxSerialNumber&&!t.includes(e)&&a[e]())})}})();
|
1
source/js/settings.min.js
vendored
Normal file
1
source/js/spark-input.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
window.sparkInput=function(e,r){var l=r.map(function(r){return r+""}),n=["rgb(110,64,170)","rgb(150,61,179)","rgb(191,60,175)","rgb(228,65,157)","rgb(254,75,131)","rgb(255,94,99)","rgb(255,120,71)","rgb(251,150,51)","rgb(226,183,47)","rgb(198,214,60)","rgb(175,240,91)","rgb(127,246,88)","rgb(82,246,103)","rgb(48,239,130)","rgb(29,223,163)","rgb(26,199,194)","rgb(35,171,216)","rgb(54,140,225)","rgb(76,110,219)","rgb(96,84,200)"],i={text:"",prefixP:-5,skillI:0,skillP:0,direction:"forward",delay:2,step:1};!function r(){var t=l[i.skillI];i.step?i.step--:(i.step=1,i.prefixP<"".length?(0<=i.prefixP&&(i.text+=""[i.prefixP]),i.prefixP++):"forward"===i.direction?i.skillP<t.length?(i.text+=t[i.skillP],i.skillP++):i.delay?i.delay--:(i.direction="backward",i.delay=2):0<i.skillP?(i.text=i.text.slice(0,-1),i.skillP--):(i.skillI=(i.skillI+1)%l.length,i.direction="forward")),e.textContent=i.text,e.appendChild(function(r){for(var t=document.createDocumentFragment(),e=0;e<r;e++){var l=document.createElement("span");l.textContent=String.fromCharCode(94*Math.random()+33),l.style.color=n[Math.floor(Math.random()*n.length)],t.appendChild(l)}return t}(i.prefixP<"".length?Math.min(5,5+i.prefixP):Math.min(5,t.length-i.skillP))),setTimeout(r,75)}()};
|
1
source/js/sw.min.js
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
!function(){if(self.document){var e=document.currentScript.src;new URLSearchParams(e.split("?")[1]).get("install")?navigator.serviceWorker.register(document.currentScript.src).catch(function(e){console.log("cache failed with "+e)}):(console.log("uninstall service worker."),navigator.serviceWorker.getRegistrations().then(function(e){for(var t of e)t.active&&t.active.scriptURL&&-1!==t.active.scriptURL.indexOf("/sw.min.js")&&t.unregister()}),window.caches&&caches.keys&&caches.keys().then(function(e){e.forEach(function(e){console.log("delete cache",e),caches.delete(e)})}))}else{const i="Dream-1.0.0",c=new URLSearchParams(location.href.split("?")[1]).get("offLine"),o=[new RegExp(location.origin+"/themes","i"),/\/\/(unpkg\.com|npm\.elemecdn\.com|cdn\.jsdelivr\.net\/npm)\//i],a=[new RegExp(location.origin+"/upload","i"),/\/\/cdn.jsdelivr.net\//i],l=[new RegExp(location.origin+"/(admin|api)","i")],u={theme:{originUrl:location.origin+"/themes/dream",handleRequest:e=>{if(0===e.indexOf(u.theme.originUrl)){const t=e.substring(u.theme.originUrl.length),n=new URLSearchParams(e.split("?")[1]).get("mew")||"latest";return[e,...u.npm.urlTemplates.map(e=>e+"/halo-theme-dream@"+n+t)]}}},npm:{urlTemplates:["https://unpkg.com","https://cdn.jsdelivr.net/npm","https://npm.elemecdn.com"],handleRequest:e=>{var t,n=u.npm.urlTemplates,r=e;for(t in n)if(0===r.indexOf(n[t])){const s=r.substring(n[t].length);return n.map(e=>e+s)}}}};function n(e,t){return e.some(function(e){return e.test(t)})}function s(e,t){var n=new Set(["mew","v","version","t","time","ts","timestamp"]),e=e.split("?"),t=t.split("?");if(e[0]===t[0]){var r=new URLSearchParams("?"+e[1]),s=new URLSearchParams("?"+t[1]);for(const e of r.keys())if(!n.has(e)&&r.get(e)!==s.get(e))return;return 1}}self.addEventListener("install",function(e){console.log("install service worker."),e.waitUntil(self.skipWaiting())}),self.addEventListener("activate",function(e){console.log("service worker activate.");const t=[i];return e.waitUntil(caches.keys().then(function(e){return Promise.all(e.map(function(e){if(-1===t.indexOf(e))return console.info("version changed, clean the cache, SW: deleting "+e),caches.delete(e)}))})),self.clients.claim()}),self.addEventListener("fetch",function(r){if("GET"!==r.request.method)return!1;const t=n(o,r.request.url);if(!t&&!n(a,r.request.url)||n(l,r.request.url))return!!c&&(r.respondWith(caches.open(i).then(t=>fetch(r.request).then(e=>(200===e.status&&t.put(r.request,e.clone()),e)).catch(()=>t.match(r.request)))),!0);r.respondWith(caches.open(i).then(function(n){return n.match(r.request).then(function(e){return e||function(e,t){if(t){var n=e.url;for(const e in u){const t=u[e].handleRequest(n);if(t){var r=n;var s=t;const i=new AbortController,c=i.signal,o=s.map(e=>new Promise(async(t,n)=>{fetch(e,{signal:c}).then(async e=>{var t=new Headers(e.headers);return t.set("service-worker-origin",r),new Response(await e.arrayBuffer(),{status:e.status,headers:t})}).then(e=>{200!==e.status&&n(null),i.abort(),t(e)}).catch(()=>n(null))}));return Promise.any||(Promise.any=function(e){return new Promise((t,n)=>{let r=(e=Array.isArray(e)?e:[]).length,s=[];if(0===r)return n(new AggregateError("All promises were rejected"));e.forEach(e=>{if(!(e instanceof Promise))return n(e);e.then(e=>t(e),e=>{r--,s.push(e),0===r&&n(new AggregateError(s))})})})}),Promise.any(o).catch(()=>null);return}}}return fetch(e)}(r.request,t).then(e=>{const t=e.clone();return n.matchAll(r.request,{ignoreSearch:!0}).then(function(e){if(e)for(const t of e){const e=t.url||t.headers.get("service-worker-origin");s(e,r.request.url)&&n.delete(e)}n.put(r.request,t)}),e}).catch(e=>(console.error(e),n.matchAll(r.request,{ignoreSearch:!0}).then(function(e){if(e)for(const t of e)if(s(t.url||t.headers.get("service-worker-origin"),r.request.url))return t})))})}))})}}();
|
1
source/js/utils.min.js
vendored
Normal file
3
source/lib/aplayer@1.10.1/APlayer.min.css
vendored
Normal file
1
source/lib/aplayer@1.10.1/APlayer.min.css.map
Normal file
2
source/lib/aplayer@1.10.1/APlayer.min.js
vendored
Normal file
1
source/lib/aplayer@1.10.1/APlayer.min.js.map
Normal file
7
source/lib/clipboard@2.0.10/clipboard.min.js
vendored
Normal file
1
source/lib/fancybox@5.3.7/jquery.fancybox.min.css
vendored
Normal file
4
source/lib/fancybox@5.3.7/jquery.fancybox.min.js
vendored
Normal file
BIN
source/lib/font-awesome@4.7.0/HELP-US-OUT.txt
Normal file
2337
source/lib/font-awesome@4.7.0/css/font-awesome.css
vendored
Normal file
4
source/lib/font-awesome@4.7.0/css/font-awesome.min.css
vendored
Normal file
BIN
source/lib/font-awesome@4.7.0/fonts/FontAwesome.otf
Normal file
BIN
source/lib/font-awesome@4.7.0/fonts/fontawesome-webfont.eot
Normal file
2671
source/lib/font-awesome@4.7.0/fonts/fontawesome-webfont.svg
Normal file
After Width: | Height: | Size: 434 KiB |
BIN
source/lib/font-awesome@4.7.0/fonts/fontawesome-webfont.ttf
Normal file
BIN
source/lib/font-awesome@4.7.0/fonts/fontawesome-webfont.woff
Normal file
BIN
source/lib/font-awesome@4.7.0/fonts/fontawesome-webfont.woff2
Normal file
34
source/lib/font-awesome@4.7.0/less/animated.less
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
// Animated Icons
|
||||||
|
// --------------------------
|
||||||
|
|
||||||
|
.@{fa-css-prefix}-spin {
|
||||||
|
-webkit-animation: fa-spin 2s infinite linear;
|
||||||
|
animation: fa-spin 2s infinite linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{fa-css-prefix}-pulse {
|
||||||
|
-webkit-animation: fa-spin 1s infinite steps(8);
|
||||||
|
animation: fa-spin 1s infinite steps(8);
|
||||||
|
}
|
||||||
|
|
||||||
|
@-webkit-keyframes fa-spin {
|
||||||
|
0% {
|
||||||
|
-webkit-transform: rotate(0deg);
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
-webkit-transform: rotate(359deg);
|
||||||
|
transform: rotate(359deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes fa-spin {
|
||||||
|
0% {
|
||||||
|
-webkit-transform: rotate(0deg);
|
||||||
|
transform: rotate(0deg);
|
||||||
|
}
|
||||||
|
100% {
|
||||||
|
-webkit-transform: rotate(359deg);
|
||||||
|
transform: rotate(359deg);
|
||||||
|
}
|
||||||
|
}
|
25
source/lib/font-awesome@4.7.0/less/bordered-pulled.less
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
// Bordered & Pulled
|
||||||
|
// -------------------------
|
||||||
|
|
||||||
|
.@{fa-css-prefix}-border {
|
||||||
|
padding: .2em .25em .15em;
|
||||||
|
border: solid .08em @fa-border-color;
|
||||||
|
border-radius: .1em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.@{fa-css-prefix}-pull-left { float: left; }
|
||||||
|
.@{fa-css-prefix}-pull-right { float: right; }
|
||||||
|
|
||||||
|
.@{fa-css-prefix} {
|
||||||
|
&.@{fa-css-prefix}-pull-left { margin-right: .3em; }
|
||||||
|
&.@{fa-css-prefix}-pull-right { margin-left: .3em; }
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Deprecated as of 4.4.0 */
|
||||||
|
.pull-right { float: right; }
|
||||||
|
.pull-left { float: left; }
|
||||||
|
|
||||||
|
.@{fa-css-prefix} {
|
||||||
|
&.pull-left { margin-right: .3em; }
|
||||||
|
&.pull-right { margin-left: .3em; }
|
||||||
|
}
|