diff --git a/17618.html b/17618.html deleted file mode 100644 index 86a06f1..0000000 --- a/17618.html +++ /dev/null @@ -1,239 +0,0 @@ -利用GitHub自动化部署Blog | Bluecode - - - - - - - - - - - - - -

利用GitHub自动化部署Blog

前言

最近由于工作需要所以研究了一下GitLab的CI/CD的功能,事后想起荒废了很久的博客,所以萌生了使用GitHub的Actions重新部署一下的想法,这里记录一下安装的过程。

-

环境说明

    -
  1. 博客框架: Hexo
  2. -
  3. 博客主题: Butterfly
  4. -
  5. 托管环境: GitHub Pages
  6. -
  7. 源程序仓库: 可以设置成私有仓库,用来保存原始文件
  8. -
  9. 页面文件仓库: 用来存放编译后的页面文件
  10. -
  11. 更新流程: 编写文章PUSH到源程序仓库,源程序仓库Actions触发预先定义的任务,编译后PUSH到页面文件仓库,页面文件仓库Actions触发默认的github-pages任务部署网页服务。
  12. -
-

安装hexo并初始化项目

Hexo依赖于Node.js环境,所以需要先安装Node.js,对于Mac来说,可以去Node.js官网下载安装包也可以通过brew命令安装。还需要安装GIT环境,Mac OS默认已安装。

-
    -
  1. 全局安装hexo-cli npm install -g hexo-cli
  2. -
  3. 初始化一个名为blog的hexo工程 hexo init blog
  4. -
  5. 安装依赖 cd blog && npm install
  6. -
  7. 启动hexo服务 hexo server
  8. -
-

安装主题

推荐通过git clone主题仓库到hexo的themes文件夹下,这样比较容易管理
执行命令git clone -b master https://github.com/jerryc127/hexo-theme-butterfly.git themes/butterfly将主题butterfly安装到hexo的themes文件夹下。

-

建立源程序仓库

在GitHub建立源程序仓库,名称随意,可以设置成私有仓库,我这里取名为blog。

-

建立页面文件仓库

在GitHub建立页面文件仓库,如果想通过githubname.github.io访问,需要将仓库命名为githubname.github.io,如果没有这个需求,可以任意取名。

-

设置秘钥

需要在GitHub设置三个秘钥文件

-

SSH keys

添加Authentication Keys到GitHub的SSH keys,成功设置后可以免密执行git命令。

-
    -
  1. ssh-keygen -t rsa -C "your.email@example.com" -b 4096,按提示生成秘钥,也可以一路无脑回车
  2. -
  3. pbcopy < ~/.ssh/id_rsa.pub,拷贝公钥到SSH keys
  4. -
  5. ssh -T git@github.com,测试是否可以通过认证。
  6. -
-

源程序仓库的Actions secrets

添加私钥blog-deploy-key到源程序仓库的Actions secrets

-
    -
  1. ssh-keygen -f blog-deploy-key,生成公私钥对
  2. -
  3. pbcopy < ~/.ssh/blog-deploy-key,拷贝私钥到Actions secrets,命名为BLOG_DEPLOY_PRI
  4. -
-

页面文件仓库的Deploy keys

添加公钥blog-deploy-key.pub到页面文件仓库的Deploy keys,切记勾选Allow write access ,设置成功后源程序仓库的Actions任务可以PUSH代码到页面文件仓库

-
    -
  1. pbcopy < ~/.ssh/blog-deploy-key.pub,拷贝公钥粘贴到Deploy keys,命名为BLOG_DEPLOY_PUB
  2. -
-

编写blog仓库的Actions文件

新建文件.github/workflows/deploy.yml,编写Actions任务。

-
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: CI

on:
push:
branches:
- main

env:
GIT_USER: xxx
GIT_EMAIL: xxx@xx.com
THEME_REPO: jerryc127/hexo-theme-butterfly
THEME_BRANCH: master
THEME: butterfly

jobs:
build:
name: Build on node ${{ matrix.node_version }} and ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
matrix:
os: [ubuntu-latest]
node_version: [18.x]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Checkout theme repo
uses: actions/checkout@v2
with:
repository: ${{ env.THEME_REPO }}
ref: ${{ env.THEME_BRANCH }}
path: themes/${{ env.THEME }}

- name: Use Node.js ${{ matrix.node_version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node_version }}

- name: Configuration environment
env:
BLOG_DEPLOY_PRI: ${{secrets.BLOG_DEPLOY_PRI}}
run: |
sudo timedatectl set-timezone "Asia/Shanghai"
mkdir -p ~/.ssh/
echo "$BLOG_DEPLOY_PRI" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
ssh-keyscan github.com >> ~/.ssh/known_hosts
git config --global user.name $GIT_USER
git config --global user.email $GIT_EMAIL

- name: Install dependencies
run: |
npm install

- name: Deploy hexo
run: |
npm run deploy
-

自定义主题配置

可以遵照官方建议操作

-

在 hexo 的根目錄創建一個文件 _config.butterfly.yml,並把主題目錄的 _config.yml 內容複製到 _config.butterfly.yml 去。( 注意: 複製的是主題的 _config.yml ,而不是 hexo 的 _config.yml)

-
- -

如果某些主题不支持读取根目录下的配置文件,可以考虑使用根目录下的配置文件覆盖主题目录下的配置文件,只需要在Configuration environment任务最后添加cp _config.${{ env.THEME }}.yml themes/${{ env.THEME }}/_config.yml

-

当然主题可能出现破坏性升级,可以考虑不追踪最新的主题,自己手动更新主题文件,去掉上面的Checkout theme repo任务,并且将themes文件夹添加到git版本追踪中

-
- -

设置hexo部署路径

在hexo的配置文件_config.yml中,补全设置deploy子参数

-
1
2
3
4
deploy:
type: git
repo: git@github.com:githubname/githubname.github.io.git
branch: main
-

以上涉及到的所有branch参数都需要一一对应,源程序仓库和页面文件仓库我都是使用的main分支,主题使用的master分支,按需修改即可,页面文件仓库的Pages也需要设置成对应的分支

-
-

参考链接

使用GitHub Actions部署Hexo博客
利用 Github Actions 自动部署 Hexo 博客

-
Author: Bluecode
Link: http://example.com/17618.html
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.

Comment
\ No newline at end of file diff --git a/2022/11/11/test/index.html b/2022/11/11/test/index.html new file mode 100644 index 0000000..9b324c5 --- /dev/null +++ b/2022/11/11/test/index.html @@ -0,0 +1,327 @@ + + + + + + + + + + + + + test | Bluecode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + Bluecode + + + + + +
+ +
+ +
+
+ +
+

test

+

2022-11-11

+
+ +
+
+
+ +
+
+ + + + + + + + + + + + + + +
+ + + +
+ + + + + + +
+ + + + + + + + + +
+ +
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/404.html b/404.html deleted file mode 100644 index 2e896c9..0000000 --- a/404.html +++ /dev/null @@ -1,158 +0,0 @@ -Page not found | Bluecode - - - - - - - -
Page not found

404

Page Not Found
\ No newline at end of file diff --git a/5586.html b/5586.html deleted file mode 100644 index 77cabaa..0000000 --- a/5586.html +++ /dev/null @@ -1,193 +0,0 @@ -私人密码库Bitwarden部署 | Bluecode - - - - - - - - - - - -

私人密码库Bitwarden部署

说明

Bitwarden官方不支持ARM指令集的设备,所以这里使用的是基于Rust编写的兼容Bitwarden Server API的第三方实现版本,并且官方部署案例资源占用很多,试过Oracle的1CPU1G服务器无法启动,所以这种情况也可以尝试这个版本。

-

基于docker服务

基于docker服务可以快速部署,减少不必要的环境依赖问题

-

编写docker-comporse文件

1
2
3
4
5
6
7
8
9
version: '3'
services:
vaultwarden:
image: vaultwarden/server:latest
volumes:
- ./vw-data:/data
ports:
- "127.0.0.1:8010:80"
restart: always
- -

nginx反向代理

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
server {
listen 80;
listen [::]:80;
server_name domain.com;
# Enforce HTTPS
return 301 https://$server_name;
}


server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name domain.com;

ssl_certificate /path/domain.com.cer;
ssl_certificate_key /path/domain.com.key;
location / {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8010;
}
}
-

服务启动

docker-compose up -d

-
Author: Bluecode
Link: http://example.com/5586.html
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.

Comment
\ No newline at end of file diff --git a/5586/cover.png b/5586/cover.png deleted file mode 100644 index 63fb972..0000000 Binary files a/5586/cover.png and /dev/null differ diff --git a/5586/top.png b/5586/top.png deleted file mode 100644 index 9de9f52..0000000 Binary files a/5586/top.png and /dev/null differ diff --git a/CNAME b/CNAME deleted file mode 100644 index f702c9b..0000000 --- a/CNAME +++ /dev/null @@ -1,2 +0,0 @@ -blog.404996.xyz - diff --git a/about/index.html b/about/index.html new file mode 100644 index 0000000..260efc7 --- /dev/null +++ b/about/index.html @@ -0,0 +1,261 @@ + + + + + + + + + + + + + About | Bluecode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ +
+
+ + + Bluecode + + + + + +
+ +
+ +
+
+ +
+
+
+ +
+

Bluecode

+ +

The end is always near.

+ +
+ + + + + + + + + + + + + +
+
+ + + +
+ +
+ + + + + + + + + + + + + + \ No newline at end of file diff --git a/archives/2022/11/index.html b/archives/2022/11/index.html index 4a40c64..5323e3d 100644 --- a/archives/2022/11/index.html +++ b/archives/2022/11/index.html @@ -1,158 +1,253 @@ -November 2022 | Bluecode - - - - - - - - + + + + + + + + - get: function getWithExpiry(key) { - const itemStr = localStorage.getItem(key) - - if (!itemStr) { - return undefined + + + + + - if (now.getTime() > item.expiry) { - localStorage.removeItem(key) - return undefined - } - return item.value - } - } - win.getScript = url => new Promise((resolve, reject) => { - const script = document.createElement('script') - script.src = url - script.async = true - script.onerror = reject - script.onload = script.onreadystatechange = function() { - const loadState = this.readyState - if (loadState && loadState !== 'loaded' && loadState !== 'complete') return - script.onload = script.onreadystatechange = null - resolve() - } - document.head.appendChild(script) - }) - win.activateDarkMode = function () { - document.documentElement.setAttribute('data-theme', 'dark') - if (document.querySelector('meta[name="theme-color"]') !== null) { - document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d') - } - } - win.activateLightMode = function () { - document.documentElement.setAttribute('data-theme', 'light') - if (document.querySelector('meta[name="theme-color"]') !== null) { - document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff') - } - } - const t = saveToLocal.get('theme') - if (t === 'dark') activateDarkMode() - else if (t === 'light') activateLightMode() + + + + +
+ +
+ +
+
+ + + Bluecode + + + + - const detectApple = () => { - if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){ - document.documentElement.classList.add('apple') - } - } - detectApple() - })(window)
Announcement
还没想好说什么
Recent Post
Info
Article :
2
Run time :
Total Count :
1.4k
UV :
PV :
Last Push :
访客地图
+
+ +
+
+ +
-function panguInit () { - if (false){ - GLOBAL_CONFIG_SITE.isPost && panguFn() - } else { - panguFn() + + + + + + + + + -document.addEventListener('DOMContentLoaded', panguInit)
\ No newline at end of file + + \ No newline at end of file diff --git a/archives/2022/index.html b/archives/2022/index.html index 842b119..016087e 100644 --- a/archives/2022/index.html +++ b/archives/2022/index.html @@ -1,158 +1,253 @@ -2022 | Bluecode - - - - - - - - + + + + + + + + - get: function getWithExpiry(key) { - const itemStr = localStorage.getItem(key) - - if (!itemStr) { - return undefined + + + + + - if (now.getTime() > item.expiry) { - localStorage.removeItem(key) - return undefined - } - return item.value - } - } - win.getScript = url => new Promise((resolve, reject) => { - const script = document.createElement('script') - script.src = url - script.async = true - script.onerror = reject - script.onload = script.onreadystatechange = function() { - const loadState = this.readyState - if (loadState && loadState !== 'loaded' && loadState !== 'complete') return - script.onload = script.onreadystatechange = null - resolve() - } - document.head.appendChild(script) - }) - win.activateDarkMode = function () { - document.documentElement.setAttribute('data-theme', 'dark') - if (document.querySelector('meta[name="theme-color"]') !== null) { - document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d') - } - } - win.activateLightMode = function () { - document.documentElement.setAttribute('data-theme', 'light') - if (document.querySelector('meta[name="theme-color"]') !== null) { - document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff') - } - } - const t = saveToLocal.get('theme') - if (t === 'dark') activateDarkMode() - else if (t === 'light') activateLightMode() + + + + +
+ +
+ +
+
+ + + Bluecode + + + + - const detectApple = () => { - if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){ - document.documentElement.classList.add('apple') - } - } - detectApple() - })(window)
Announcement
还没想好说什么
Recent Post
Info
Article :
2
Run time :
Total Count :
1.4k
UV :
PV :
Last Push :
访客地图
+
+ +
+
+ +
-function panguInit () { - if (false){ - GLOBAL_CONFIG_SITE.isPost && panguFn() - } else { - panguFn() + + + + + + + + + -document.addEventListener('DOMContentLoaded', panguInit)
\ No newline at end of file + + \ No newline at end of file diff --git a/archives/index.html b/archives/index.html index 4ec6bf4..6a1fd11 100644 --- a/archives/index.html +++ b/archives/index.html @@ -1,158 +1,253 @@ -归档 | Bluecode - - - - - - - - + + + + + + + + - get: function getWithExpiry(key) { - const itemStr = localStorage.getItem(key) - - if (!itemStr) { - return undefined + + + + + - if (now.getTime() > item.expiry) { - localStorage.removeItem(key) - return undefined - } - return item.value - } - } - win.getScript = url => new Promise((resolve, reject) => { - const script = document.createElement('script') - script.src = url - script.async = true - script.onerror = reject - script.onload = script.onreadystatechange = function() { - const loadState = this.readyState - if (loadState && loadState !== 'loaded' && loadState !== 'complete') return - script.onload = script.onreadystatechange = null - resolve() - } - document.head.appendChild(script) - }) - win.activateDarkMode = function () { - document.documentElement.setAttribute('data-theme', 'dark') - if (document.querySelector('meta[name="theme-color"]') !== null) { - document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d') - } - } - win.activateLightMode = function () { - document.documentElement.setAttribute('data-theme', 'light') - if (document.querySelector('meta[name="theme-color"]') !== null) { - document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff') - } - } - const t = saveToLocal.get('theme') - if (t === 'dark') activateDarkMode() - else if (t === 'light') activateLightMode() + + + + +
+ +
+ +
+
+ + + Bluecode + + + + - const detectApple = () => { - if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){ - document.documentElement.classList.add('apple') - } - } - detectApple() - })(window)
Announcement
还没想好说什么
Recent Post
Info
Article :
2
Run time :
Total Count :
1.4k
UV :
PV :
Last Push :
访客地图
+
+ +
+
+ +
-function panguInit () { - if (false){ - GLOBAL_CONFIG_SITE.isPost && panguFn() - } else { - panguFn() + + + + + + + + + -document.addEventListener('DOMContentLoaded', panguInit)
\ No newline at end of file + + \ No newline at end of file diff --git a/categories/index.html b/categories/index.html deleted file mode 100644 index a23e3db..0000000 --- a/categories/index.html +++ /dev/null @@ -1,185 +0,0 @@ -categories | Bluecode - - - - - - - - - -

Comment
Announcement
还没想好说什么
Recent Post
Info
Article :
2
Run time :
Total Count :
1.4k
UV :
PV :
Last Push :
访客地图
\ No newline at end of file diff --git a/css/images/alipay.jpg b/css/images/alipay.jpg new file mode 100644 index 0000000..1228a75 Binary files /dev/null and b/css/images/alipay.jpg differ diff --git a/css/images/catalog.png b/css/images/catalog.png new file mode 100644 index 0000000..10b8793 Binary files /dev/null and b/css/images/catalog.png differ diff --git a/css/images/error_icon.png b/css/images/error_icon.png new file mode 100644 index 0000000..325f112 Binary files /dev/null and b/css/images/error_icon.png differ diff --git a/css/images/escheres.png b/css/images/escheres.png new file mode 100644 index 0000000..9238d80 Binary files /dev/null and b/css/images/escheres.png differ diff --git a/css/images/ga.png b/css/images/ga.png new file mode 100644 index 0000000..9f76394 Binary files /dev/null and b/css/images/ga.png differ diff --git a/css/images/icp.png b/css/images/icp.png new file mode 100644 index 0000000..725ba95 Binary files /dev/null and b/css/images/icp.png differ diff --git a/css/images/logo.png b/css/images/logo.png new file mode 100644 index 0000000..74389d8 Binary files /dev/null and b/css/images/logo.png differ diff --git a/css/images/menu.png b/css/images/menu.png new file mode 100644 index 0000000..656353d Binary files /dev/null and b/css/images/menu.png differ diff --git a/css/images/top.png b/css/images/top.png new file mode 100644 index 0000000..eb974fd Binary files /dev/null and b/css/images/top.png differ diff --git a/css/images/wechat.jpg b/css/images/wechat.jpg new file mode 100644 index 0000000..6aad47d Binary files /dev/null and b/css/images/wechat.jpg differ diff --git a/css/index.css b/css/index.css deleted file mode 100644 index 0213a55..0000000 --- a/css/index.css +++ /dev/null @@ -1,5806 +0,0 @@ -/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ -html { - line-height: 1.15; - -webkit-text-size-adjust: 100% -} - -body { - margin: 0 -} - -main { - display: block -} - -h1 { - font-size: 2em; - margin: .67em 0 -} - -hr { - box-sizing: content-box; - height: 0; - overflow: visible -} - -pre { - font-family: monospace, monospace; - font-size: 1em -} - -a { - background-color: transparent -} - -abbr[title] { - border-bottom: none; - text-decoration: underline; - text-decoration: underline dotted -} - -b, -strong { - font-weight: bolder -} - -code, -kbd, -samp { - font-family: monospace, monospace; - font-size: 1em -} - -small { - font-size: 80% -} - -sub, -sup { - font-size: 75%; - line-height: 0; - position: relative; - vertical-align: baseline -} - -sub { - bottom: -.25em -} - -sup { - top: -.5em -} - -img { - border-style: none -} - -button, -input, -optgroup, -select, -textarea { - font-family: inherit; - font-size: 100%; - line-height: 1.15; - margin: 0 -} - -button, -input { - overflow: visible -} - -button, -select { - text-transform: none -} - -[type=button], -[type=reset], -[type=submit], -button { - -webkit-appearance: button -} - -[type=button]::-moz-focus-inner, -[type=reset]::-moz-focus-inner, -[type=submit]::-moz-focus-inner, -button::-moz-focus-inner { - border-style: none; - padding: 0 -} - -[type=button]:-moz-focusring, -[type=reset]:-moz-focusring, -[type=submit]:-moz-focusring, -button:-moz-focusring { - outline: 1px dotted ButtonText -} - -fieldset { - padding: .35em .75em .625em -} - -legend { - box-sizing: border-box; - color: inherit; - display: table; - max-width: 100%; - padding: 0; - white-space: normal -} - -progress { - vertical-align: baseline -} - -textarea { - overflow: auto -} - -[type=checkbox], -[type=radio] { - box-sizing: border-box; - padding: 0 -} - -[type=number]::-webkit-inner-spin-button, -[type=number]::-webkit-outer-spin-button { - height: auto -} - -[type=search] { - -webkit-appearance: textfield; - outline-offset: -2px -} - -[type=search]::-webkit-search-decoration { - -webkit-appearance: none -} - -::-webkit-file-upload-button { - -webkit-appearance: button; - font: inherit -} - -details { - display: block -} - -summary { - display: list-item -} - -template { - display: none -} - -[hidden] { - display: none -} -.limit-one-line, -#article-container .flink .flink-item-name, -#article-container .flink .flink-item-desc, -#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a span, -#aside-content .card-categories ul.card-category-list > .card-category-list-item a span, -.site-data > a .headline, -#pagination .prev_info, -#pagination .next_info, -#sidebar #sidebar-menus .menus_items .site-page { - overflow: hidden; - -o-text-overflow: ellipsis; - text-overflow: ellipsis; - white-space: nowrap; -} -.limit-more-line, -.error404 #error-wrap .error-content .error-info .error_subtitle, -.article-sort-item-title, -#recent-posts > .recent-post-item >.recent-post-info > .article-title, -#recent-posts > .recent-post-item >.recent-post-info > .content, -#aside-content .aside-list > .aside-list-item .content > .name, -#aside-content .aside-list > .aside-list-item .content > .title, -#aside-content .aside-list > .aside-list-item .content > .comment, -#post-info .post-title, -.relatedPosts > .relatedPosts-list .content .title, -#article-container figure.gallery-group p, -#article-container figure.gallery-group .gallery-group-name { - display: -webkit-box; - overflow: hidden; - -webkit-box-orient: vertical; -} -.fontawesomeIcon, -hr:before, -#article-container h1:before, -#article-container h2:before, -#article-container h3:before, -#article-container h4:before, -#article-container h5:before, -#article-container h6:before, -#post .post-copyright:before, -#post .post-outdate-notice:before, -.note:not(.no-icon)::before { - display: inline-block; - font-weight: 600; - font-family: 'Font Awesome 6 Free'; - text-rendering: auto; - -webkit-font-smoothing: antialiased; -} -.cardHover, -.error404 #error-wrap .error-content, -.layout > div:first-child:not(.recent-posts), -#recent-posts > .recent-post-item, -#aside-content .card-widget, -.layout > .recent-posts .pagination > *:not(.space) { - border-radius: 8px; - background: var(--card-bg); - -webkit-box-shadow: var(--card-box-shadow); - box-shadow: var(--card-box-shadow); - -webkit-transition: all 0.3s; - -moz-transition: all 0.3s; - -o-transition: all 0.3s; - -ms-transition: all 0.3s; - transition: all 0.3s; -} -.cardHover:hover, -.error404 #error-wrap .error-content:hover, -.layout > div:first-child:not(.recent-posts):hover, -#recent-posts > .recent-post-item:hover, -#aside-content .card-widget:hover, -.layout > .recent-posts .pagination > *:not(.space):hover { - -webkit-box-shadow: var(--card-hover-box-shadow); - box-shadow: var(--card-hover-box-shadow); -} -.imgHover, -.error404 #error-wrap .error-content .error-img img, -.article-sort-item-img img, -#recent-posts > .recent-post-item .post_cover img.post_bg, -#aside-content .aside-list > .aside-list-item .thumbnail > img { - width: 100%; - height: 100%; - -webkit-transition: filter 375ms ease-in 0.2s, -webkit-transform 0.6s; - -moz-transition: filter 375ms ease-in 0.2s, -moz-transform 0.6s; - -o-transition: filter 375ms ease-in 0.2s, -o-transform 0.6s; - -ms-transition: filter 375ms ease-in 0.2s, -ms-transform 0.6s; - transition: filter 375ms ease-in 0.2s, transform 0.6s; - object-fit: cover; -} -.imgHover:hover, -.error404 #error-wrap .error-content .error-img img:hover, -.article-sort-item-img img:hover, -#recent-posts > .recent-post-item .post_cover img.post_bg:hover, -#aside-content .aside-list > .aside-list-item .thumbnail > img:hover { - -webkit-transform: scale(1.1); - -moz-transform: scale(1.1); - -o-transform: scale(1.1); - -ms-transform: scale(1.1); - transform: scale(1.1); -} -.postImgHover:hover img, -#pagination .prev-post:hover img, -#pagination .next-post:hover img, -.relatedPosts > .relatedPosts-list > div:hover img { - opacity: 0.8; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; - filter: alpha(opacity=80); - -webkit-transform: scale(1.1); - -moz-transform: scale(1.1); - -o-transform: scale(1.1); - -ms-transform: scale(1.1); - transform: scale(1.1); -} -.postImgHover img, -#pagination .prev-post img, -#pagination .next-post img, -.relatedPosts > .relatedPosts-list > div img { - position: absolute; - width: 100%; - height: 100%; - opacity: 0.4; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; - filter: alpha(opacity=40); - -webkit-transition: all 0.6s, filter 375ms ease-in 0.2s; - -moz-transition: all 0.6s, filter 375ms ease-in 0.2s; - -o-transition: all 0.6s, filter 375ms ease-in 0.2s; - -ms-transition: all 0.6s, filter 375ms ease-in 0.2s; - transition: all 0.6s, filter 375ms ease-in 0.2s; - object-fit: cover; -} -.list-beauty, -.category-lists ul { - list-style: none; -} -.list-beauty li, -.category-lists ul li { - position: relative; - padding: 0.12em 0.4em 0.12em 1.4em; -} -.list-beauty li:hover:before, -.category-lists ul li:hover:before { - border-color: var(--pseudo-hover); -} -.list-beauty li:before, -.category-lists ul li:before { - position: absolute; - top: 0.67em; - left: 0; - width: 0.43em; - height: 0.43em; - border: 0.215em solid #49b1f5; - border-radius: 0.43em; - background: transparent; - content: ''; - cursor: pointer; - -webkit-transition: all 0.3s ease-out; - -moz-transition: all 0.3s ease-out; - -o-transition: all 0.3s ease-out; - -ms-transition: all 0.3s ease-out; - transition: all 0.3s ease-out; -} -#content-inner, -#footer { - -webkit-animation: bottom-top 1s; - -moz-animation: bottom-top 1s; - -o-animation: bottom-top 1s; - -ms-animation: bottom-top 1s; - animation: bottom-top 1s; -} -#page-header { - -webkit-animation: header-effect 1s; - -moz-animation: header-effect 1s; - -o-animation: header-effect 1s; - -ms-animation: header-effect 1s; - animation: header-effect 1s; -} -#site-title, -#site-subtitle { - -webkit-animation: titleScale 1s; - -moz-animation: titleScale 1s; - -o-animation: titleScale 1s; - -ms-animation: titleScale 1s; - animation: titleScale 1s; -} -#nav.show { - -webkit-animation: headerNoOpacity 1s; - -moz-animation: headerNoOpacity 1s; - -o-animation: headerNoOpacity 1s; - -ms-animation: headerNoOpacity 1s; - animation: headerNoOpacity 1s; -} -canvas:not(#ribbon-canvas), -#web_bg { - -webkit-animation: to_show 4s; - -moz-animation: to_show 4s; - -o-animation: to_show 4s; - -ms-animation: to_show 4s; - animation: to_show 4s; -} -#ribbon-canvas { - -webkit-animation: ribbon_to_show 4s; - -moz-animation: ribbon_to_show 4s; - -o-animation: ribbon_to_show 4s; - -ms-animation: ribbon_to_show 4s; - animation: ribbon_to_show 4s; -} -#sidebar-menus.open > :nth-child(1) { - -webkit-animation: sidebarItem 0.2s; - -moz-animation: sidebarItem 0.2s; - -o-animation: sidebarItem 0.2s; - -ms-animation: sidebarItem 0.2s; - animation: sidebarItem 0.2s; -} -#sidebar-menus.open > :nth-child(2) { - -webkit-animation: sidebarItem 0.4s; - -moz-animation: sidebarItem 0.4s; - -o-animation: sidebarItem 0.4s; - -ms-animation: sidebarItem 0.4s; - animation: sidebarItem 0.4s; -} -#sidebar-menus.open > :nth-child(3) { - -webkit-animation: sidebarItem 0.6s; - -moz-animation: sidebarItem 0.6s; - -o-animation: sidebarItem 0.6s; - -ms-animation: sidebarItem 0.6s; - animation: sidebarItem 0.6s; -} -#sidebar-menus.open > :nth-child(4) { - -webkit-animation: sidebarItem 0.8s; - -moz-animation: sidebarItem 0.8s; - -o-animation: sidebarItem 0.8s; - -ms-animation: sidebarItem 0.8s; - animation: sidebarItem 0.8s; -} -.scroll-down-effects { - -webkit-animation: scroll-down-effect 1.5s infinite; - -moz-animation: scroll-down-effect 1.5s infinite; - -o-animation: scroll-down-effect 1.5s infinite; - -ms-animation: scroll-down-effect 1.5s infinite; - animation: scroll-down-effect 1.5s infinite; -} -.reward-main { - -webkit-animation: donate_effcet 0.3s 0.1s ease both; - -moz-animation: donate_effcet 0.3s 0.1s ease both; - -o-animation: donate_effcet 0.3s 0.1s ease both; - -ms-animation: donate_effcet 0.3s 0.1s ease both; - animation: donate_effcet 0.3s 0.1s ease both; -} -@-moz-keyframes scroll-down-effect { - 0% { - top: 0; - opacity: 0.4; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; - filter: alpha(opacity=40); - } - 50% { - top: -16px; - opacity: 1; - -ms-filter: none; - filter: none; - } - 100% { - top: 0; - opacity: 0.4; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; - filter: alpha(opacity=40); - } -} -@-webkit-keyframes scroll-down-effect { - 0% { - top: 0; - opacity: 0.4; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; - filter: alpha(opacity=40); - } - 50% { - top: -16px; - opacity: 1; - -ms-filter: none; - filter: none; - } - 100% { - top: 0; - opacity: 0.4; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; - filter: alpha(opacity=40); - } -} -@-o-keyframes scroll-down-effect { - 0% { - top: 0; - opacity: 0.4; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; - filter: alpha(opacity=40); - } - 50% { - top: -16px; - opacity: 1; - -ms-filter: none; - filter: none; - } - 100% { - top: 0; - opacity: 0.4; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; - filter: alpha(opacity=40); - } -} -@keyframes scroll-down-effect { - 0% { - top: 0; - opacity: 0.4; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; - filter: alpha(opacity=40); - } - 50% { - top: -16px; - opacity: 1; - -ms-filter: none; - filter: none; - } - 100% { - top: 0; - opacity: 0.4; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; - filter: alpha(opacity=40); - } -} -@-moz-keyframes header-effect { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: translateY(-50px); - -moz-transform: translateY(-50px); - -o-transform: translateY(-50px); - -ms-transform: translateY(-50px); - transform: translateY(-50px); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-webkit-keyframes header-effect { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: translateY(-50px); - -moz-transform: translateY(-50px); - -o-transform: translateY(-50px); - -ms-transform: translateY(-50px); - transform: translateY(-50px); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-o-keyframes header-effect { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: translateY(-50px); - -moz-transform: translateY(-50px); - -o-transform: translateY(-50px); - -ms-transform: translateY(-50px); - transform: translateY(-50px); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@keyframes header-effect { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: translateY(-50px); - -moz-transform: translateY(-50px); - -o-transform: translateY(-50px); - -ms-transform: translateY(-50px); - transform: translateY(-50px); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-moz-keyframes headerNoOpacity { - 0% { - -webkit-transform: translateY(-50px); - -moz-transform: translateY(-50px); - -o-transform: translateY(-50px); - -ms-transform: translateY(-50px); - transform: translateY(-50px); - } - 100% { - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-webkit-keyframes headerNoOpacity { - 0% { - -webkit-transform: translateY(-50px); - -moz-transform: translateY(-50px); - -o-transform: translateY(-50px); - -ms-transform: translateY(-50px); - transform: translateY(-50px); - } - 100% { - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-o-keyframes headerNoOpacity { - 0% { - -webkit-transform: translateY(-50px); - -moz-transform: translateY(-50px); - -o-transform: translateY(-50px); - -ms-transform: translateY(-50px); - transform: translateY(-50px); - } - 100% { - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@keyframes headerNoOpacity { - 0% { - -webkit-transform: translateY(-50px); - -moz-transform: translateY(-50px); - -o-transform: translateY(-50px); - -ms-transform: translateY(-50px); - transform: translateY(-50px); - } - 100% { - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-moz-keyframes bottom-top { - 0% { - margin-top: 50px; - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } - 100% { - margin-top: 0; - opacity: 1; - -ms-filter: none; - filter: none; - } -} -@-webkit-keyframes bottom-top { - 0% { - margin-top: 50px; - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } - 100% { - margin-top: 0; - opacity: 1; - -ms-filter: none; - filter: none; - } -} -@-o-keyframes bottom-top { - 0% { - margin-top: 50px; - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } - 100% { - margin-top: 0; - opacity: 1; - -ms-filter: none; - filter: none; - } -} -@keyframes bottom-top { - 0% { - margin-top: 50px; - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } - 100% { - margin-top: 0; - opacity: 1; - -ms-filter: none; - filter: none; - } -} -@-moz-keyframes titleScale { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } -} -@-webkit-keyframes titleScale { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } -} -@-o-keyframes titleScale { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } -} -@keyframes titleScale { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } -} -@-moz-keyframes search_close { - 0% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } - 100% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } -} -@-webkit-keyframes search_close { - 0% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } - 100% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } -} -@-o-keyframes search_close { - 0% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } - 100% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } -} -@keyframes search_close { - 0% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } - 100% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } -} -@-moz-keyframes to_show { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - } -} -@-webkit-keyframes to_show { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - } -} -@-o-keyframes to_show { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - } -} -@keyframes to_show { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - } -} -@-moz-keyframes to_hide { - 0% { - opacity: 1; - -ms-filter: none; - filter: none; - } - 100% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } -} -@-webkit-keyframes to_hide { - 0% { - opacity: 1; - -ms-filter: none; - filter: none; - } - 100% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } -} -@-o-keyframes to_hide { - 0% { - opacity: 1; - -ms-filter: none; - filter: none; - } - 100% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } -} -@keyframes to_hide { - 0% { - opacity: 1; - -ms-filter: none; - filter: none; - } - 100% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } -} -@-moz-keyframes ribbon_to_show { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } - 100% { - opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); - } -} -@-webkit-keyframes ribbon_to_show { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } - 100% { - opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); - } -} -@-o-keyframes ribbon_to_show { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } - 100% { - opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); - } -} -@keyframes ribbon_to_show { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - } - 100% { - opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); - } -} -@-moz-keyframes avatar_turn_around { - from { - -webkit-transform: rotate(0); - -moz-transform: rotate(0); - -o-transform: rotate(0); - -ms-transform: rotate(0); - transform: rotate(0); - } - to { - -webkit-transform: rotate(360deg); - -moz-transform: rotate(360deg); - -o-transform: rotate(360deg); - -ms-transform: rotate(360deg); - transform: rotate(360deg); - } -} -@-webkit-keyframes avatar_turn_around { - from { - -webkit-transform: rotate(0); - -moz-transform: rotate(0); - -o-transform: rotate(0); - -ms-transform: rotate(0); - transform: rotate(0); - } - to { - -webkit-transform: rotate(360deg); - -moz-transform: rotate(360deg); - -o-transform: rotate(360deg); - -ms-transform: rotate(360deg); - transform: rotate(360deg); - } -} -@-o-keyframes avatar_turn_around { - from { - -webkit-transform: rotate(0); - -moz-transform: rotate(0); - -o-transform: rotate(0); - -ms-transform: rotate(0); - transform: rotate(0); - } - to { - -webkit-transform: rotate(360deg); - -moz-transform: rotate(360deg); - -o-transform: rotate(360deg); - -ms-transform: rotate(360deg); - transform: rotate(360deg); - } -} -@keyframes avatar_turn_around { - from { - -webkit-transform: rotate(0); - -moz-transform: rotate(0); - -o-transform: rotate(0); - -ms-transform: rotate(0); - transform: rotate(0); - } - to { - -webkit-transform: rotate(360deg); - -moz-transform: rotate(360deg); - -o-transform: rotate(360deg); - -ms-transform: rotate(360deg); - transform: rotate(360deg); - } -} -@-moz-keyframes sub_menus { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: translateY(10px); - -moz-transform: translateY(10px); - -o-transform: translateY(10px); - -ms-transform: translateY(10px); - transform: translateY(10px); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-webkit-keyframes sub_menus { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: translateY(10px); - -moz-transform: translateY(10px); - -o-transform: translateY(10px); - -ms-transform: translateY(10px); - transform: translateY(10px); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-o-keyframes sub_menus { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: translateY(10px); - -moz-transform: translateY(10px); - -o-transform: translateY(10px); - -ms-transform: translateY(10px); - transform: translateY(10px); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@keyframes sub_menus { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: translateY(10px); - -moz-transform: translateY(10px); - -o-transform: translateY(10px); - -ms-transform: translateY(10px); - transform: translateY(10px); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-moz-keyframes donate_effcet { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: translateY(-20px); - -moz-transform: translateY(-20px); - -o-transform: translateY(-20px); - -ms-transform: translateY(-20px); - transform: translateY(-20px); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-webkit-keyframes donate_effcet { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: translateY(-20px); - -moz-transform: translateY(-20px); - -o-transform: translateY(-20px); - -ms-transform: translateY(-20px); - transform: translateY(-20px); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-o-keyframes donate_effcet { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: translateY(-20px); - -moz-transform: translateY(-20px); - -o-transform: translateY(-20px); - -ms-transform: translateY(-20px); - transform: translateY(-20px); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@keyframes donate_effcet { - 0% { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transform: translateY(-20px); - -moz-transform: translateY(-20px); - -o-transform: translateY(-20px); - -ms-transform: translateY(-20px); - transform: translateY(-20px); - } - 100% { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-moz-keyframes sidebarItem { - 0% { - -webkit-transform: translateX(200px); - -moz-transform: translateX(200px); - -o-transform: translateX(200px); - -ms-transform: translateX(200px); - transform: translateX(200px); - } - 100% { - -webkit-transform: translateX(0); - -moz-transform: translateX(0); - -o-transform: translateX(0); - -ms-transform: translateX(0); - transform: translateX(0); - } -} -@-webkit-keyframes sidebarItem { - 0% { - -webkit-transform: translateX(200px); - -moz-transform: translateX(200px); - -o-transform: translateX(200px); - -ms-transform: translateX(200px); - transform: translateX(200px); - } - 100% { - -webkit-transform: translateX(0); - -moz-transform: translateX(0); - -o-transform: translateX(0); - -ms-transform: translateX(0); - transform: translateX(0); - } -} -@-o-keyframes sidebarItem { - 0% { - -webkit-transform: translateX(200px); - -moz-transform: translateX(200px); - -o-transform: translateX(200px); - -ms-transform: translateX(200px); - transform: translateX(200px); - } - 100% { - -webkit-transform: translateX(0); - -moz-transform: translateX(0); - -o-transform: translateX(0); - -ms-transform: translateX(0); - transform: translateX(0); - } -} -@keyframes sidebarItem { - 0% { - -webkit-transform: translateX(200px); - -moz-transform: translateX(200px); - -o-transform: translateX(200px); - -ms-transform: translateX(200px); - transform: translateX(200px); - } - 100% { - -webkit-transform: translateX(0); - -moz-transform: translateX(0); - -o-transform: translateX(0); - -ms-transform: translateX(0); - transform: translateX(0); - } -} -:root { - --global-font-size: 14px; - --global-bg: #fff; - --font-color: #4c4948; - --hr-border: #a4d8fa; - --hr-before-color: #80c8f8; - --search-bg: #f6f8fa; - --search-input-color: #4c4948; - --search-result-title: #4c4948; - --preloader-bg: #37474f; - --preloader-color: #fff; - --tab-border-color: #f0f0f0; - --tab-botton-bg: #f0f0f0; - --tab-botton-color: #1f2d3d; - --tab-button-hover-bg: #dcdcdc; - --tab-button-active-bg: #fff; - --card-bg: #fff; - --sidebar-bg: #f6f8fa; - --btn-hover-color: #ff7242; - --btn-color: #fff; - --btn-bg: #49b1f5; - --text-bg-hover: rgba(73,177,245,0.7); - --light-grey: #eee; - --dark-grey: #cacaca; - --white: #fff; - --text-highlight-color: #1f2d3d; - --blockquote-color: #6a737d; - --blockquote-bg: rgba(73,177,245,0.1); - --reward-pop: #f5f5f5; - --toc-link-color: #666261; - --card-box-shadow: 0 3px 8px 6px rgba(7,17,27,0.05); - --card-hover-box-shadow: 0 3px 8px 6px rgba(7,17,27,0.09); - --pseudo-hover: #ff7242; - --headline-presudo: #a0a0a0; - --scrollbar-color: #49b1f5; -} -body { - position: relative; - min-height: 100%; - background: var(--global-bg); - color: var(--font-color); - font-size: var(--global-font-size); - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Lato, Roboto, 'PingFang SC', 'Microsoft YaHei', sans-serif; - line-height: 2; - -webkit-tap-highlight-color: rgba(0,0,0,0); -} -*::-webkit-scrollbar { - width: 8px; - height: 8px; -} -*::-webkit-scrollbar-thumb { - background: var(--scrollbar-color); -} -*::-webkit-scrollbar-track { - background-color: transparent; -} -* { - scrollbar-width: thin; - scrollbar-color: var(--scrollbar-color) transparent; -} -input::placeholder { - color: var(--font-color); -} -h1, -h2, -h3, -h4, -h5, -h6 { - position: relative; - margin: 20px 0 14px; - color: var(--text-highlight-color); - font-weight: bold; -} -h1 code, -h2 code, -h3 code, -h4 code, -h5 code, -h6 code { - font-size: inherit !important; -} -* { - -webkit-box-sizing: border-box; - -moz-box-sizing: border-box; - box-sizing: border-box; -} -hr { - position: relative; - margin: 40px auto; - border: 2px dashed var(--hr-border); - width: calc(100% - 4px); -} -hr:hover:before { - left: calc(95% - 20px); -} -hr:before { - position: absolute; - top: -10px; - left: 5%; - z-index: 1; - color: var(--hr-before-color); - content: '\f0c4'; - font-size: 20px; - line-height: 1; - -webkit-transition: all 1s ease-in-out; - -moz-transition: all 1s ease-in-out; - -o-transition: all 1s ease-in-out; - -ms-transition: all 1s ease-in-out; - transition: all 1s ease-in-out; -} -.table-wrap { - overflow-x: scroll; - margin: 0 0 20px; -} -table { - display: table; - width: 100%; - border-spacing: 0; - border-collapse: collapse; - empty-cells: show; -} -table thead { - background: rgba(153,169,191,0.1); -} -table th, -table td { - padding: 6px 12px; - border: 1px solid var(--light-grey); - vertical-align: middle; -} -*::selection { - background: #00c4b6; - color: #f7f7f7; -} -button { - padding: 0; - outline: 0; - border: none; - background: none; - cursor: pointer; - touch-action: manipulation; -} -a { - color: #99a9bf; - text-decoration: none; - word-wrap: break-word; - -webkit-transition: all 0.2s; - -moz-transition: all 0.2s; - -o-transition: all 0.2s; - -ms-transition: all 0.2s; - transition: all 0.2s; - overflow-wrap: break-word; -} -a:hover { - color: #49b1f5; -} -.is-center { - text-align: center; -} -.copy-true { - -webkit-user-select: all; - -moz-user-select: all; - -ms-user-select: all; - user-select: all; -} -.pull-left { - float: left; -} -.pull-right { - float: right; -} -img[src=''], -img:not([src]) { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); -} -.img-alt { - margin: -10px 0 10px; - color: #858585; -} -.img-alt:hover { - text-decoration: none !important; -} -blockquote { - margin: 0 0 20px; - padding: 12px 15px; - border-left: 3px solid #49b1f5; - background-color: var(--blockquote-bg); - color: var(--blockquote-color); -} -blockquote footer cite:before { - padding: 0 5px; - content: '—'; -} -blockquote > :last-child { - margin-bottom: 0 !important; -} -:root { - --hl-color: #eff; - --hl-bg: #212121; - --hltools-bg: #1c1c1c; - --hltools-color: rgba(238,255,255,0.8); - --hlnumber-bg: #212121; - --hlnumber-color: rgba(238,255,255,0.5); - --hlscrollbar-bg: #353535; - --hlexpand-bg: linear-gradient(180deg, rgba(33,33,33,0.6), rgba(33,33,33,0.9)); -} -figure.highlight table { - scrollbar-color: var(--hlscrollbar-bg) transparent; -} -figure.highlight table::-webkit-scrollbar-thumb { - background: var(--hlscrollbar-bg); -} -figure.highlight pre .deletion { - color: #bf42bf; -} -figure.highlight pre .addition { - color: #105ede; -} -figure.highlight pre .meta { - color: #c792ea; -} -figure.highlight pre .comment { - color: #969896; -} -figure.highlight pre .variable, -figure.highlight pre .attribute, -figure.highlight pre .regexp, -figure.highlight pre .ruby .constant, -figure.highlight pre .xml .tag .title, -figure.highlight pre .xml .pi, -figure.highlight pre .xml .doctype, -figure.highlight pre .html .doctype, -figure.highlight pre .css .id, -figure.highlight pre .tag .name, -figure.highlight pre .css .class, -figure.highlight pre .css .pseudo { - color: #ff5370; -} -figure.highlight pre .tag { - color: #89ddff; -} -figure.highlight pre .number, -figure.highlight pre .preprocessor, -figure.highlight pre .literal, -figure.highlight pre .params, -figure.highlight pre .constant, -figure.highlight pre .command { - color: #f78c6c; -} -figure.highlight pre .built_in { - color: #ffcb6b; -} -figure.highlight pre .ruby .class .title, -figure.highlight pre .css .rules .attribute, -figure.highlight pre .string, -figure.highlight pre .value, -figure.highlight pre .inheritance, -figure.highlight pre .header, -figure.highlight pre .ruby .symbol, -figure.highlight pre .xml .cdata, -figure.highlight pre .special, -figure.highlight pre .number, -figure.highlight pre .formula { - color: #c3e88d; -} -figure.highlight pre .keyword, -figure.highlight pre .title, -figure.highlight pre .css .hexcolor { - color: #89ddff; -} -figure.highlight pre .function, -figure.highlight pre .python .decorator, -figure.highlight pre .python .title, -figure.highlight pre .ruby .function .title, -figure.highlight pre .ruby .title .keyword, -figure.highlight pre .perl .sub, -figure.highlight pre .javascript .title, -figure.highlight pre .coffeescript .title { - color: #82aaff; -} -figure.highlight pre .tag .attr, -figure.highlight pre .javascript .function { - color: #c792ea; -} -#article-container figure.highlight .line.marked { - background-color: rgba(97,97,97,0.314); -} -#article-container figure.highlight table { - display: block; - overflow: auto; - border: none; -} -#article-container figure.highlight table td { - padding: 0; - border: none; -} -#article-container figure.highlight .gutter pre { - padding-right: 10px; - padding-left: 10px; - background-color: var(--hlnumber-bg); - color: var(--hlnumber-color); - text-align: right; -} -#article-container figure.highlight .code pre { - padding-right: 10px; - padding-left: 10px; - width: 100%; -} -#article-container pre, -#article-container figure.highlight { - overflow: auto; - margin: 0 0 20px; - padding: 0; - background: var(--hl-bg); - color: var(--hl-color); - line-height: 1.6; -} -#article-container pre, -#article-container code { - font-size: var(--global-font-size); - font-family: consolas, Menlo, 'PingFang SC', 'Microsoft YaHei', sans-serif !important; -} -#article-container code { - padding: 2px 4px; - background: rgba(27,31,35,0.05); - color: #f47466; -} -#article-container pre { - padding: 10px 20px; -} -#article-container pre code { - padding: 0; - background: none; - color: var(--hl-color); - text-shadow: none; -} -#article-container figure.highlight { - position: relative; -} -#article-container figure.highlight pre { - margin: 0; - padding: 8px 0; - border: none; -} -#article-container figure.highlight figcaption, -#article-container figure.highlight .caption { - padding: 6px 0 2px 14px; - font-size: var(--global-font-size); - line-height: 1em; -} -#article-container figure.highlight figcaption a, -#article-container figure.highlight .caption a { - float: right; - padding-right: 10px; - color: var(--hl-color); -} -#article-container figure.highlight figcaption a:hover, -#article-container figure.highlight .caption a:hover { - border-bottom-color: var(--hl-color); -} -#article-container .highlight-tools { - position: relative; - display: -webkit-box; - display: -moz-box; - display: -webkit-flex; - display: -ms-flexbox; - display: box; - display: flex; - -webkit-box-align: center; - -moz-box-align: center; - -o-box-align: center; - -ms-flex-align: center; - -webkit-align-items: center; - align-items: center; - overflow: hidden; - min-height: 24px; - height: 2.15em; - background: var(--hltools-bg); - color: var(--hltools-color); - font-size: var(--global-font-size); -} -#article-container .highlight-tools.closed ~ * { - display: none; -} -#article-container .highlight-tools .expand { - position: absolute; - padding: 0.57em 0.7em; - cursor: pointer; - -webkit-transition: -webkit-transform 0.3s; - -moz-transition: -moz-transform 0.3s; - -o-transition: -o-transform 0.3s; - -ms-transition: -ms-transform 0.3s; - transition: transform 0.3s; -} -#article-container .highlight-tools .expand + .code-lang { - left: 1.7em; -} -#article-container .highlight-tools .expand.closed { - -webkit-transition: all 0.3s; - -moz-transition: all 0.3s; - -o-transition: all 0.3s; - -ms-transition: all 0.3s; - transition: all 0.3s; - -webkit-transform: rotate(-90deg) !important; - -moz-transform: rotate(-90deg) !important; - -o-transform: rotate(-90deg) !important; - -ms-transform: rotate(-90deg) !important; - transform: rotate(-90deg) !important; -} -#article-container .highlight-tools .code-lang { - position: absolute; - left: 14px; - text-transform: uppercase; - font-weight: bold; - font-size: 1.15em; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -#article-container .highlight-tools .copy-notice { - position: absolute; - right: 2.4em; - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transition: opacity 0.4s; - -moz-transition: opacity 0.4s; - -o-transition: opacity 0.4s; - -ms-transition: opacity 0.4s; - transition: opacity 0.4s; -} -#article-container .highlight-tools .copy-button { - position: absolute; - right: 14px; - cursor: pointer; - -webkit-transition: color 0.2s; - -moz-transition: color 0.2s; - -o-transition: color 0.2s; - -ms-transition: color 0.2s; - transition: color 0.2s; -} -#article-container .highlight-tools .copy-button:hover { - color: #49b1f5; -} -#article-container .gutter { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; -} -#article-container .gist table { - width: auto; -} -#article-container .gist table td { - border: none; -} -#article-container figure.highlight { - margin: 0 0 24px; - border-radius: 7px; - -webkit-box-shadow: 0 5px 10px 0 rgba(0,0,0,0.4); - box-shadow: 0 5px 10px 0 rgba(0,0,0,0.4); - -webkit-transform: translateZ(0); -} -#article-container figure.highlight .highlight-tools:after { - position: absolute; - left: 14px; - width: 12px; - height: 12px; - border-radius: 50%; - background: #fc625d; - -webkit-box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b; - box-shadow: 20px 0 #fdbc40, 40px 0 #35cd4b; - content: ' '; -} -#article-container figure.highlight .highlight-tools .expand { - right: 0; -} -#article-container figure.highlight .highlight-tools .expand.closed { - -webkit-transition: all 0.3s; - -moz-transition: all 0.3s; - -o-transition: all 0.3s; - -ms-transition: all 0.3s; - transition: all 0.3s; - -webkit-transform: rotate(90deg) !important; - -moz-transform: rotate(90deg) !important; - -o-transform: rotate(90deg) !important; - -ms-transform: rotate(90deg) !important; - transform: rotate(90deg) !important; -} -#article-container figure.highlight .highlight-tools .expand ~ .copy-notice { - right: 3.45em; -} -#article-container figure.highlight .highlight-tools .expand ~ .copy-button { - right: 2.1em; -} -#article-container figure.highlight .highlight-tools .code-lang { - left: 75px; -} -#article-container .code-expand-btn { - position: absolute; - bottom: 0; - z-index: 10; - width: 100%; - background: var(--hlexpand-bg); - text-align: center; - font-size: var(--global-font-size); - cursor: pointer; -} -#article-container .code-expand-btn i { - padding: 6px 0; - color: var(--hlnumber-color); - -webkit-animation: code-expand-key 1.2s infinite; - -moz-animation: code-expand-key 1.2s infinite; - -o-animation: code-expand-key 1.2s infinite; - -ms-animation: code-expand-key 1.2s infinite; - animation: code-expand-key 1.2s infinite; -} -#article-container .code-expand-btn.expand-done > i { - -webkit-transform: rotate(180deg); - -moz-transform: rotate(180deg); - -o-transform: rotate(180deg); - -ms-transform: rotate(180deg); - transform: rotate(180deg); -} -#article-container .code-expand-btn.expand-done + table, -#article-container .code-expand-btn.expand-done + pre { - margin-bottom: 1.8em; -} -#article-container .code-expand-btn:not(.expand-done) ~ table, -#article-container .code-expand-btn:not(.expand-done) ~ pre { - overflow: hidden; - height: 300px; -} -@-moz-keyframes code-expand-key { - 0% { - opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); - } - 50% { - opacity: 0.1; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=10)"; - filter: alpha(opacity=10); - } - 100% { - opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); - } -} -@-webkit-keyframes code-expand-key { - 0% { - opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); - } - 50% { - opacity: 0.1; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=10)"; - filter: alpha(opacity=10); - } - 100% { - opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); - } -} -@-o-keyframes code-expand-key { - 0% { - opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); - } - 50% { - opacity: 0.1; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=10)"; - filter: alpha(opacity=10); - } - 100% { - opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); - } -} -@keyframes code-expand-key { - 0% { - opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); - } - 50% { - opacity: 0.1; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=10)"; - filter: alpha(opacity=10); - } - 100% { - opacity: 0.6; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; - filter: alpha(opacity=60); - } -} -.error404 #error-wrap { - position: absolute; - top: 50%; - right: 0; - left: 0; - margin: 0 auto; - padding: 60px 20px 0; - max-width: 1000px; - -webkit-transform: translate(0, -50%); - -moz-transform: translate(0, -50%); - -o-transform: translate(0, -50%); - -ms-transform: translate(0, -50%); - transform: translate(0, -50%); -} -.error404 #error-wrap .error-content { - overflow: hidden; - margin: 0 20px; - height: 360px; -} -@media screen and (max-width: 768px) { - .error404 #error-wrap .error-content { - margin: 0; - height: 500px; - } -} -.error404 #error-wrap .error-content .error-img { - display: inline-block; - overflow: hidden; - width: 50%; - height: 100%; -} -@media screen and (max-width: 768px) { - .error404 #error-wrap .error-content .error-img { - width: 100%; - height: 45%; - } -} -.error404 #error-wrap .error-content .error-img img { - background-color: #49b1f5; -} -.error404 #error-wrap .error-content .error-info { - display: -webkit-inline-box; - display: -moz-inline-box; - display: -webkit-inline-flex; - display: -ms-inline-flexbox; - display: inline-box; - display: inline-flex; - -webkit-box-orient: vertical; - -moz-box-orient: vertical; - -o-box-orient: vertical; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - -webkit-box-pack: center; - -moz-box-pack: center; - -o-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - -ms-flex-line-pack: center; - -webkit-align-content: center; - align-content: center; - width: 50%; - height: 100%; - vertical-align: top; - text-align: center; -} -@media screen and (max-width: 768px) { - .error404 #error-wrap .error-content .error-info { - width: 100%; - height: 55%; - } -} -.error404 #error-wrap .error-content .error-info .error_title { - margin-top: -0.6em; - font-size: 9em; -} -@media screen and (max-width: 768px) { - .error404 #error-wrap .error-content .error-info .error_title { - font-size: 8em; - } -} -.error404 #error-wrap .error-content .error-info .error_subtitle { - margin-top: -3em; - word-break: break-word; - font-size: 1.6em; - -webkit-line-clamp: 2; -} -.error404 + #rightside { - display: none; -} -.article-sort { - margin-left: 10px; - padding-left: 20px; - border-left: 2px solid #aadafa; -} -.article-sort-title { - position: relative; - margin-left: 10px; - padding-bottom: 20px; - padding-left: 20px; - font-size: 1.72em; -} -.article-sort-title:hover:before { - border-color: var(--pseudo-hover); -} -.article-sort-title:before { - position: absolute; - top: calc(((100% - 36px) / 2)); - left: -9px; - z-index: 1; - width: 10px; - height: 10px; - border: 5px solid #49b1f5; - border-radius: 10px; - background: var(--card-bg); - content: ''; - line-height: 10px; - -webkit-transition: all 0.2s ease-in-out; - -moz-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - -ms-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; -} -.article-sort-title:after { - position: absolute; - bottom: 0; - left: 0; - z-index: 0; - width: 2px; - height: 1.5em; - background: #aadafa; - content: ''; -} -.article-sort-item { - position: relative; - display: -webkit-box; - display: -moz-box; - display: -webkit-flex; - display: -ms-flexbox; - display: box; - display: flex; - -webkit-box-align: center; - -moz-box-align: center; - -o-box-align: center; - -ms-flex-align: center; - -webkit-align-items: center; - align-items: center; - margin: 0 0 20px 10px; - -webkit-transition: all 0.2s ease-in-out; - -moz-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - -ms-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; -} -.article-sort-item:hover:before { - border-color: var(--pseudo-hover); -} -.article-sort-item:before { - position: absolute; - left: calc(-20px - 17px); - width: 6px; - height: 6px; - border: 3px solid #49b1f5; - border-radius: 6px; - background: var(--card-bg); - content: ''; - -webkit-transition: all 0.2s ease-in-out; - -moz-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - -ms-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; -} -.article-sort-item.no-article-cover { - height: 80px; -} -.article-sort-item.no-article-cover .article-sort-item-info { - padding: 0; -} -.article-sort-item.year { - font-size: 1.43em; -} -.article-sort-item.year:hover:before { - border-color: #49b1f5; -} -.article-sort-item.year:before { - border-color: var(--pseudo-hover); -} -.article-sort-item-time { - color: #858585; - font-size: 95%; -} -.article-sort-item-time time { - padding-left: 6px; - cursor: default; -} -.article-sort-item-title { - color: var(--font-color); - font-size: 1.1em; - -webkit-transition: all 0.3s; - -moz-transition: all 0.3s; - -o-transition: all 0.3s; - -ms-transition: all 0.3s; - transition: all 0.3s; - -webkit-line-clamp: 2; -} -.article-sort-item-title:hover { - color: #49b1f5; - -webkit-transform: translateX(10px); - -moz-transform: translateX(10px); - -o-transform: translateX(10px); - -ms-transform: translateX(10px); - transform: translateX(10px); -} -.article-sort-item-img { - overflow: hidden; - width: 80px; - height: 80px; -} -.article-sort-item-info { - -webkit-box-flex: 1; - -moz-box-flex: 1; - -o-box-flex: 1; - box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - padding: 0 16px; -} -.category-lists .category-title { - font-size: 2.57em; -} -@media screen and (max-width: 768px) { - .category-lists .category-title { - font-size: 2em; - } -} -.category-lists .category-list { - margin-bottom: 0; -} -.category-lists .category-list a { - color: var(--font-color); -} -.category-lists .category-list a:hover { - color: #49b1f5; -} -.category-lists .category-list .category-list-count { - margin-left: 8px; - color: #858585; -} -.category-lists .category-list .category-list-count:before { - content: '('; -} -.category-lists .category-list .category-list-count:after { - content: ')'; -} -.category-lists ul { - padding: 0 0 0 20px; -} -.category-lists ul ul { - padding-left: 4px; -} -.category-lists ul li { - position: relative; - margin: 6px 0; - padding: 0.12em 0.4em 0.12em 1.4em; -} -#body-wrap { - display: -webkit-box; - display: -moz-box; - display: -webkit-flex; - display: -ms-flexbox; - display: box; - display: flex; - -webkit-box-orient: vertical; - -moz-box-orient: vertical; - -o-box-orient: vertical; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - min-height: 100vh; -} -.layout { - display: -webkit-box; - display: -moz-box; - display: -webkit-flex; - display: -ms-flexbox; - display: box; - display: flex; - -webkit-box-flex: 1; - -moz-box-flex: 1; - -o-box-flex: 1; - box-flex: 1; - -webkit-flex: 1 auto; - -ms-flex: 1 auto; - flex: 1 auto; - margin: 0 auto; - padding: 40px 15px; - max-width: 1200px; - width: 100%; -} -@media screen and (max-width: 900px) { - .layout { - -webkit-box-orient: vertical; - -moz-box-orient: vertical; - -o-box-orient: vertical; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - } -} -@media screen and (max-width: 768px) { - .layout { - padding: 20px 5px; - } -} -@media screen and (min-width: 2000px) { - .layout { - max-width: 1500px; - } -} -.layout > div:first-child:not(.recent-posts) { - -webkit-align-self: flex-start; - align-self: flex-start; - -ms-flex-item-align: start; - padding: 50px 40px; -} -@media screen and (max-width: 768px) { - .layout > div:first-child:not(.recent-posts) { - padding: 36px 14px; - } -} -.layout > div:first-child { - width: 74%; - -webkit-transition: all 0.3s; - -moz-transition: all 0.3s; - -o-transition: all 0.3s; - -ms-transition: all 0.3s; - transition: all 0.3s; -} -@media screen and (max-width: 900px) { - .layout > div:first-child { - width: 100% !important; - } -} -@media screen and (min-width: 900px) { - .layout > div:first-child { - -webkit-box-ordinal-group: 2; - -moz-box-ordinal-group: 2; - -o-box-ordinal-group: 2; - -ms-flex-order: 2; - -webkit-order: 2; - order: 2; - } -} -.layout.hide-aside { - max-width: 1000px; -} -@media screen and (min-width: 2000px) { - .layout.hide-aside { - max-width: 1300px; - } -} -.layout.hide-aside > div { - width: 100% !important; -} -.apple #page-header.full_page { - background-attachment: scroll !important; -} -.apple .recent-post-item, -.apple .avatar-img, -.apple .flink-item-icon { - -webkit-transform: translateZ(0); - -moz-transform: translateZ(0); - -o-transform: translateZ(0); - -ms-transform: translateZ(0); - transform: translateZ(0); -} -#article-container .flink { - margin-bottom: 20px; -} -#article-container .flink .flink-list { - overflow: auto; - padding: 10px 10px 0; - text-align: center; -} -#article-container .flink .flink-list > .flink-list-item { - position: relative; - float: left; - overflow: hidden; - margin: 15px 7px; - width: calc(100% / 3 - 15px); - height: 90px; - border-radius: 8px; - line-height: 17px; - -webkit-transform: translateZ(0); -} -@media screen and (max-width: 1024px) { - #article-container .flink .flink-list > .flink-list-item { - width: calc(50% - 15px) !important; - } -} -@media screen and (max-width: 600px) { - #article-container .flink .flink-list > .flink-list-item { - width: calc(100% - 15px) !important; - } -} -#article-container .flink .flink-list > .flink-list-item:hover .flink-item-icon { - margin-left: -10px; - width: 0; -} -#article-container .flink .flink-list > .flink-list-item:before { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: -1; - background: var(--text-bg-hover); - content: ''; - -webkit-transition: -webkit-transform 0.3s ease-out; - -moz-transition: -moz-transform 0.3s ease-out; - -o-transition: -o-transform 0.3s ease-out; - -ms-transition: -ms-transform 0.3s ease-out; - transition: transform 0.3s ease-out; - -webkit-transform: scale(0); - -moz-transform: scale(0); - -o-transform: scale(0); - -ms-transform: scale(0); - transform: scale(0); -} -#article-container .flink .flink-list > .flink-list-item:hover:before, -#article-container .flink .flink-list > .flink-list-item:focus:before, -#article-container .flink .flink-list > .flink-list-item:active:before { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); -} -#article-container .flink .flink-list > .flink-list-item a { - color: var(--font-color); - text-decoration: none; -} -#article-container .flink .flink-list > .flink-list-item a .flink-item-icon { - float: left; - overflow: hidden; - margin: 15px 10px; - width: 60px; - height: 60px; - border-radius: 35px; - -webkit-transition: width 0.3s ease-out; - -moz-transition: width 0.3s ease-out; - -o-transition: width 0.3s ease-out; - -ms-transition: width 0.3s ease-out; - transition: width 0.3s ease-out; -} -#article-container .flink .flink-list > .flink-list-item a .flink-item-icon img { - width: 100%; - height: 100%; - -webkit-transition: filter 375ms ease-in 0.2s, -webkit-transform 0.3s; - -moz-transition: filter 375ms ease-in 0.2s, -moz-transform 0.3s; - -o-transition: filter 375ms ease-in 0.2s, -o-transform 0.3s; - -ms-transition: filter 375ms ease-in 0.2s, -ms-transform 0.3s; - transition: filter 375ms ease-in 0.2s, transform 0.3s; - object-fit: cover; -} -#article-container .flink .flink-list > .flink-list-item a .img-alt { - display: none; -} -#article-container .flink .flink-item-name { - padding: 16px 10px 0 0; - height: 40px; - font-weight: bold; - font-size: 1.43em; -} -#article-container .flink .flink-item-desc { - padding: 16px 10px 16px 0; - height: 50px; - font-size: 0.93em; -} -#article-container .flink .flink-name { - margin-bottom: 5px; - font-weight: bold; - font-size: 1.5em; -} -#recent-posts > .recent-post-item:not(:first-child) { - margin-top: 20px; -} -#recent-posts > .recent-post-item { - display: -webkit-box; - display: -moz-box; - display: -webkit-flex; - display: -ms-flexbox; - display: box; - display: flex; - -webkit-box-orient: horizontal; - -moz-box-orient: horizontal; - -o-box-orient: horizontal; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - -webkit-box-align: center; - -moz-box-align: center; - -o-box-align: center; - -ms-flex-align: center; - -webkit-align-items: center; - align-items: center; - overflow: hidden; - height: 18em; -} -@media screen and (max-width: 768px) { - #recent-posts > .recent-post-item { - -webkit-box-orient: vertical; - -moz-box-orient: vertical; - -o-box-orient: vertical; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; - height: auto; - } -} -#recent-posts > .recent-post-item:hover img.post_bg { - -webkit-transform: scale(1.1); - -moz-transform: scale(1.1); - -o-transform: scale(1.1); - -ms-transform: scale(1.1); - transform: scale(1.1); -} -#recent-posts > .recent-post-item.ads-wrap { - display: block !important; - height: auto !important; -} -#recent-posts > .recent-post-item .post_cover { - overflow: hidden; - width: 44%; - height: 100%; -} -@media screen and (max-width: 768px) { - #recent-posts > .recent-post-item .post_cover { - width: 100%; - height: 230px; - } -} -#recent-posts > .recent-post-item .post_cover.right { - -webkit-box-ordinal-group: 1; - -moz-box-ordinal-group: 1; - -o-box-ordinal-group: 1; - -ms-flex-order: 1; - -webkit-order: 1; - order: 1; -} -@media screen and (max-width: 768px) { - #recent-posts > .recent-post-item .post_cover.right { - -webkit-box-ordinal-group: 0; - -moz-box-ordinal-group: 0; - -o-box-ordinal-group: 0; - -ms-flex-order: 0; - -webkit-order: 0; - order: 0; - } -} -#recent-posts > .recent-post-item >.recent-post-info { - padding: 0 40px; - width: 57%; -} -@media screen and (max-width: 768px) { - #recent-posts > .recent-post-item >.recent-post-info { - padding: 20px 20px 30px; - width: 100%; - } -} -#recent-posts > .recent-post-item >.recent-post-info.no-cover { - width: 100%; -} -@media screen and (max-width: 768px) { - #recent-posts > .recent-post-item >.recent-post-info.no-cover { - padding: 30px 20px; - } -} -#recent-posts > .recent-post-item >.recent-post-info > .article-title { - color: var(--text-highlight-color); - font-size: 1.72em; - line-height: 1.4; - -webkit-transition: all 0.2s ease-in-out; - -moz-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - -ms-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; - -webkit-line-clamp: 2; -} -@media screen and (max-width: 768px) { - #recent-posts > .recent-post-item >.recent-post-info > .article-title { - font-size: 1.43em; - } -} -#recent-posts > .recent-post-item >.recent-post-info > .article-title:hover { - color: #49b1f5; -} -#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap { - margin: 6px 0; - color: #858585; - font-size: 90%; -} -#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap > .post-meta-date { - cursor: default; -} -#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap .sticky { - color: #ff7242; -} -#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap i { - margin: 0 4px 0 0; -} -#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap .fa-spinner { - margin: 0; -} -#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap .article-meta-label { - padding-right: 4px; -} -#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap .article-meta-separator { - margin: 0 6px; -} -#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap .article-meta-link { - margin: 0 4px; -} -#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap a { - color: #858585; -} -#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap a:hover { - color: #49b1f5; - text-decoration: underline; -} -#recent-posts > .recent-post-item >.recent-post-info > .content { - -webkit-line-clamp: 2; -} -.tag-cloud-list a { - display: inline-block; - padding: 0 8px; - -webkit-transition: all 0.3s; - -moz-transition: all 0.3s; - -o-transition: all 0.3s; - -ms-transition: all 0.3s; - transition: all 0.3s; -} -.tag-cloud-list a:hover { - color: #49b1f5 !important; - -webkit-transform: scale(1.1); - -moz-transform: scale(1.1); - -o-transform: scale(1.1); - -ms-transform: scale(1.1); - transform: scale(1.1); -} -@media screen and (max-width: 768px) { - .tag-cloud-list a { - zoom: 0.85; - } -} -.tag-cloud-title { - font-size: 2.57em; -} -@media screen and (max-width: 768px) { - .tag-cloud-title { - font-size: 2em; - } -} -h1.page-title + .tag-cloud-list { - text-align: left; -} -#aside-content { - width: 26%; -} -@media screen and (min-width: 900px) { - #aside-content { - padding-right: 15px; - } -} -@media screen and (max-width: 900px) { - #aside-content { - width: 100%; - } -} -#aside-content > .card-widget:first-child { - margin-top: 0; -} -@media screen and (max-width: 900px) { - #aside-content > .card-widget:first-child { - margin-top: 20px; - } -} -#aside-content .card-widget { - position: relative; - overflow: hidden; - margin-top: 20px; - padding: 20px 24px; -} -#aside-content .card-info .author-info__name { - font-weight: 500; - font-size: 1.57em; -} -#aside-content .card-info .author-info__description { - margin-top: -0.42em; -} -#aside-content .card-info .card-info-data { - margin: 14px 0 4px; -} -#aside-content .card-info .card-info-social-icons { - margin: 6px 0 -6px; -} -#aside-content .card-info .card-info-social-icons .social-icon { - margin: 0 10px; - color: var(--font-color); - font-size: 1.4em; -} -#aside-content .card-info .card-info-social-icons i { - -webkit-transition: all 0.3s; - -moz-transition: all 0.3s; - -o-transition: all 0.3s; - -ms-transition: all 0.3s; - transition: all 0.3s; -} -#aside-content .card-info .card-info-social-icons i:hover { - -webkit-transform: rotate(540deg); - -moz-transform: rotate(540deg); - -o-transform: rotate(540deg); - -ms-transform: rotate(540deg); - transform: rotate(540deg); -} -#aside-content .card-info #card-info-btn { - display: block; - margin-top: 14px; - background-color: var(--btn-bg); - color: var(--btn-color); - text-align: center; - line-height: 2.4; -} -#aside-content .card-info #card-info-btn:hover { - background-color: var(--btn-hover-color); -} -#aside-content .card-info #card-info-btn span { - padding-left: 10px; -} -#aside-content .item-headline { - padding-bottom: 6px; - font-size: 1.2em; -} -#aside-content .item-headline span { - margin-left: 6px; -} -@media screen and (min-width: 900px) { - #aside-content .sticky_layout { - position: sticky; - position: -webkit-sticky; - top: 20px; - -webkit-transition: top 0.3s; - -moz-transition: top 0.3s; - -o-transition: top 0.3s; - -ms-transition: top 0.3s; - transition: top 0.3s; - } -} -#aside-content .card-tag-cloud a { - display: inline-block; - padding: 0 4px; -} -#aside-content .card-tag-cloud a:hover { - color: #49b1f5 !important; -} -#aside-content .aside-list > span { - display: block; - margin-bottom: 10px; - text-align: center; -} -#aside-content .aside-list > .aside-list-item { - display: -webkit-box; - display: -moz-box; - display: -webkit-flex; - display: -ms-flexbox; - display: box; - display: flex; - -webkit-box-align: center; - -moz-box-align: center; - -o-box-align: center; - -ms-flex-align: center; - -webkit-align-items: center; - align-items: center; - padding: 6px 0; -} -#aside-content .aside-list > .aside-list-item:first-child { - padding-top: 0; -} -#aside-content .aside-list > .aside-list-item:not(:last-child) { - border-bottom: 1px dashed #f5f5f5; -} -#aside-content .aside-list > .aside-list-item:last-child { - padding-bottom: 0; -} -#aside-content .aside-list > .aside-list-item .thumbnail { - overflow: hidden; - width: 4.2em; - height: 4.2em; -} -#aside-content .aside-list > .aside-list-item .content { - -webkit-box-flex: 1; - -moz-box-flex: 1; - -o-box-flex: 1; - box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - padding-left: 10px; - word-break: break-all; -} -#aside-content .aside-list > .aside-list-item .content > .name { - -webkit-line-clamp: 1; -} -#aside-content .aside-list > .aside-list-item .content > time, -#aside-content .aside-list > .aside-list-item .content > .name { - display: block; - color: #858585; - font-size: 85%; -} -#aside-content .aside-list > .aside-list-item .content > .title, -#aside-content .aside-list > .aside-list-item .content > .comment { - color: var(--font-color); - font-size: 95%; - line-height: 1.5; - -webkit-line-clamp: 2; -} -#aside-content .aside-list > .aside-list-item .content > .title:hover, -#aside-content .aside-list > .aside-list-item .content > .comment:hover { - color: #49b1f5; -} -#aside-content .aside-list > .aside-list-item.no-cover { - min-height: 4.4em; -} -#aside-content .card-archives ul.card-archive-list, -#aside-content .card-categories ul.card-category-list { - margin: 0; - padding: 0; - list-style: none; -} -#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a, -#aside-content .card-categories ul.card-category-list > .card-category-list-item a { - display: -webkit-box; - display: -moz-box; - display: -webkit-flex; - display: -ms-flexbox; - display: box; - display: flex; - -webkit-box-orient: horizontal; - -moz-box-orient: horizontal; - -o-box-orient: horizontal; - -webkit-flex-direction: row; - -ms-flex-direction: row; - flex-direction: row; - padding: 3px 10px; - color: var(--font-color); - -webkit-transition: all 0.4s; - -moz-transition: all 0.4s; - -o-transition: all 0.4s; - -ms-transition: all 0.4s; - transition: all 0.4s; -} -#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a:hover, -#aside-content .card-categories ul.card-category-list > .card-category-list-item a:hover { - padding: 3px 17px; - background-color: var(--text-bg-hover); -} -#aside-content .card-archives ul.card-archive-list > .card-archive-list-item a span:first-child, -#aside-content .card-categories ul.card-category-list > .card-category-list-item a span:first-child { - -webkit-box-flex: 1; - -moz-box-flex: 1; - -o-box-flex: 1; - box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -#aside-content .card-categories .card-category-list.child { - padding: 0 0 0 16px; -} -#aside-content .card-categories .card-category-list > .parent > a .card-category-list-name { - width: 70% !important; -} -#aside-content .card-categories .card-category-list > .parent > a .card-category-list-count { - width: calc(100% - 70% - 20px); - text-align: right; -} -#aside-content .card-categories .card-category-list > .parent i { - float: right; - margin-right: -0.5em; - padding: 0.5em; - -webkit-transition: -webkit-transform 0.3s; - -moz-transition: -moz-transform 0.3s; - -o-transition: -o-transform 0.3s; - -ms-transition: -ms-transform 0.3s; - transition: transform 0.3s; - -webkit-transform: rotate(0); - -moz-transform: rotate(0); - -o-transform: rotate(0); - -ms-transform: rotate(0); - transform: rotate(0); -} -#aside-content .card-categories .card-category-list > .parent i.expand { - -webkit-transform: rotate(-90deg); - -moz-transform: rotate(-90deg); - -o-transform: rotate(-90deg); - -ms-transform: rotate(-90deg); - transform: rotate(-90deg); -} -#aside-content .card-webinfo .webinfo .webinfo-item { - display: -webkit-box; - display: -moz-box; - display: -webkit-flex; - display: -ms-flexbox; - display: box; - display: flex; - -webkit-box-align: center; - -moz-box-align: center; - -o-box-align: center; - -ms-flex-align: center; - -webkit-align-items: center; - align-items: center; - padding: 2px 10px 0; -} -#aside-content .card-webinfo .webinfo .webinfo-item div:first-child { - -webkit-box-flex: 1; - -moz-box-flex: 1; - -o-box-flex: 1; - box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; - padding-right: 20px; -} -@media screen and (min-width: 901px) { - #aside-content #card-toc { - right: 0 !important; - } -} -@media screen and (max-width: 900px) { - #aside-content #card-toc { - position: fixed; - right: -100%; - bottom: 30px; - z-index: 100; - max-width: 380px; - max-height: calc(100% - 60px); - width: calc(100% - 80px); - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transition: initial; - -moz-transition: initial; - -o-transition: initial; - -ms-transition: initial; - transition: initial; - -webkit-transform-origin: right bottom; - -moz-transform-origin: right bottom; - -o-transform-origin: right bottom; - -ms-transform-origin: right bottom; - transform-origin: right bottom; - } -} -#aside-content #card-toc .toc-percentage { - float: right; - margin-top: -9px; - color: #a9a9a9; - font-style: italic; - font-size: 140%; -} -#aside-content #card-toc .toc-content { - overflow-y: scroll; - overflow-y: overlay; - margin: 0 -24px; - max-height: calc(100vh - 120px); -} -@media screen and (max-width: 900px) { - #aside-content #card-toc .toc-content { - max-height: calc(100vh - 140px); - } -} -#aside-content #card-toc .toc-content > * { - margin: 0 20px !important; -} -#aside-content #card-toc .toc-content > * > .toc-item > .toc-child { - margin-left: 10px; - padding-left: 10px; - border-left: 1px solid var(--dark-grey); -} -#aside-content #card-toc .toc-content:not(.is-expand) .toc-child { - display: none; -} -@media screen and (max-width: 900px) { - #aside-content #card-toc .toc-content:not(.is-expand) .toc-child { - display: block !important; - } -} -#aside-content #card-toc .toc-content:not(.is-expand) .toc-item.active .toc-child { - display: block; -} -#aside-content #card-toc .toc-content ol, -#aside-content #card-toc .toc-content li { - list-style: none; -} -#aside-content #card-toc .toc-content > ol { - padding: 0 !important; -} -#aside-content #card-toc .toc-content ol { - margin: 0; - padding-left: 18px; -} -#aside-content #card-toc .toc-content .toc-link { - display: block; - margin: 4px 0; - padding: 1px 6px; - color: var(--toc-link-color); - -webkit-transition: all 0.2s ease-in-out; - -moz-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - -ms-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; -} -#aside-content #card-toc .toc-content .toc-link:hover { - color: #49b1f5; -} -#aside-content #card-toc .toc-content .toc-link.active { - background: #00c4b6; - color: #fff; -} -#aside-content :only-child > .card-widget { - margin-top: 0; -} -#aside-content .card-more-btn { - float: right; - color: inherit; -} -#aside-content .card-more-btn:hover { - -webkit-animation: more-btn-move 1s infinite; - -moz-animation: more-btn-move 1s infinite; - -o-animation: more-btn-move 1s infinite; - -ms-animation: more-btn-move 1s infinite; - animation: more-btn-move 1s infinite; -} -#aside-content .card-announcement .item-headline i { - color: #f00; -} -.avatar-img { - overflow: hidden; - margin: 0 auto; - width: 110px; - height: 110px; - border-radius: 70px; -} -.avatar-img img { - width: 100%; - height: 100%; - -webkit-transition: filter 375ms ease-in 0.2s, -webkit-transform 0.3s; - -moz-transition: filter 375ms ease-in 0.2s, -moz-transform 0.3s; - -o-transition: filter 375ms ease-in 0.2s, -o-transform 0.3s; - -ms-transition: filter 375ms ease-in 0.2s, -ms-transform 0.3s; - transition: filter 375ms ease-in 0.2s, transform 0.3s; - object-fit: cover; -} -.avatar-img img:hover { - -webkit-transform: rotate(360deg); - -moz-transform: rotate(360deg); - -o-transform: rotate(360deg); - -ms-transform: rotate(360deg); - transform: rotate(360deg); -} -.site-data { - display: table; - width: 100%; - table-layout: fixed; -} -.site-data > a { - display: table-cell; -} -.site-data > a div { - -webkit-transition: all 0.3s; - -moz-transition: all 0.3s; - -o-transition: all 0.3s; - -ms-transition: all 0.3s; - transition: all 0.3s; -} -.site-data > a:hover div { - color: #49b1f5 !important; -} -.site-data > a .headline { - color: var(--font-color); -} -.site-data > a .length-num { - margin-top: -0.32em; - color: var(--text-highlight-color); - font-size: 1.4em; -} -@media screen and (min-width: 900px) { - html.hide-aside .layout { - -webkit-box-pack: center; - -moz-box-pack: center; - -o-box-pack: center; - -ms-flex-pack: center; - -webkit-justify-content: center; - justify-content: center; - } - html.hide-aside .layout > .aside-content { - display: none; - } - html.hide-aside .layout > div:first-child { - width: 80%; - } -} -.page .sticky_layout { - display: -webkit-box; - display: -moz-box; - display: -webkit-flex; - display: -ms-flexbox; - display: box; - display: flex; - -webkit-box-orient: vertical; - -moz-box-orient: vertical; - -o-box-orient: vertical; - -webkit-flex-direction: column; - -ms-flex-direction: column; - flex-direction: column; -} -@-moz-keyframes more-btn-move { - 0%, 100% { - -webkit-transform: translateX(0); - -moz-transform: translateX(0); - -o-transform: translateX(0); - -ms-transform: translateX(0); - transform: translateX(0); - } - 50% { - -webkit-transform: translateX(3px); - -moz-transform: translateX(3px); - -o-transform: translateX(3px); - -ms-transform: translateX(3px); - transform: translateX(3px); - } -} -@-webkit-keyframes more-btn-move { - 0%, 100% { - -webkit-transform: translateX(0); - -moz-transform: translateX(0); - -o-transform: translateX(0); - -ms-transform: translateX(0); - transform: translateX(0); - } - 50% { - -webkit-transform: translateX(3px); - -moz-transform: translateX(3px); - -o-transform: translateX(3px); - -ms-transform: translateX(3px); - transform: translateX(3px); - } -} -@-o-keyframes more-btn-move { - 0%, 100% { - -webkit-transform: translateX(0); - -moz-transform: translateX(0); - -o-transform: translateX(0); - -ms-transform: translateX(0); - transform: translateX(0); - } - 50% { - -webkit-transform: translateX(3px); - -moz-transform: translateX(3px); - -o-transform: translateX(3px); - -ms-transform: translateX(3px); - transform: translateX(3px); - } -} -@keyframes more-btn-move { - 0%, 100% { - -webkit-transform: translateX(0); - -moz-transform: translateX(0); - -o-transform: translateX(0); - -ms-transform: translateX(0); - transform: translateX(0); - } - 50% { - -webkit-transform: translateX(3px); - -moz-transform: translateX(3px); - -o-transform: translateX(3px); - -ms-transform: translateX(3px); - transform: translateX(3px); - } -} -@-moz-keyframes toc-open { - 0% { - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } - 100% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } -} -@-webkit-keyframes toc-open { - 0% { - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } - 100% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } -} -@-o-keyframes toc-open { - 0% { - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } - 100% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } -} -@keyframes toc-open { - 0% { - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } - 100% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } -} -@-moz-keyframes toc-close { - 0% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } - 100% { - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } -} -@-webkit-keyframes toc-close { - 0% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } - 100% { - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } -} -@-o-keyframes toc-close { - 0% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } - 100% { - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } -} -@keyframes toc-close { - 0% { - -webkit-transform: scale(1); - -moz-transform: scale(1); - -o-transform: scale(1); - -ms-transform: scale(1); - transform: scale(1); - } - 100% { - -webkit-transform: scale(0.7); - -moz-transform: scale(0.7); - -o-transform: scale(0.7); - -ms-transform: scale(0.7); - transform: scale(0.7); - } -} -#post-comment .comment-head { - margin-bottom: 20px; -} -#post-comment .comment-head .comment-headline { - display: inline-block; - vertical-align: middle; - font-weight: 700; - font-size: 1.43em; -} -#post-comment .comment-head #comment-switch { - display: inline-block; - float: right; - margin: 2px auto 0; - padding: 4px 16px; - width: max-content; - border-radius: 8px; - background: #f6f8fa; -} -#post-comment .comment-head #comment-switch .first-comment { - color: #49b1f5; -} -#post-comment .comment-head #comment-switch .second-comment { - color: #ff7242; -} -#post-comment .comment-head #comment-switch .switch-btn { - position: relative; - display: inline-block; - margin: -4px 8px 0; - width: 42px; - height: 22px; - border-radius: 34px; - background-color: #49b1f5; - vertical-align: middle; - cursor: pointer; - -webkit-transition: 0.4s; - -moz-transition: 0.4s; - -o-transition: 0.4s; - -ms-transition: 0.4s; - transition: 0.4s; -} -#post-comment .comment-head #comment-switch .switch-btn:before { - position: absolute; - bottom: 4px; - left: 4px; - width: 14px; - height: 14px; - border-radius: 50%; - background-color: #fff; - content: ''; - -webkit-transition: 0.4s; - -moz-transition: 0.4s; - -o-transition: 0.4s; - -ms-transition: 0.4s; - transition: 0.4s; -} -#post-comment .comment-head #comment-switch .switch-btn.move { - background-color: #ff7242; -} -#post-comment .comment-head #comment-switch .switch-btn.move:before { - -webkit-transform: translateX(20px); - -moz-transform: translateX(20px); - -o-transform: translateX(20px); - -ms-transform: translateX(20px); - transform: translateX(20px); -} -#post-comment .comment-wrap > div:nth-child(2) { - display: none; -} -#footer { - position: relative; - background: #49b1f5; - background-attachment: scroll; - background-position: bottom; - background-size: cover; -} -#footer:before { - position: absolute; - width: 100%; - height: 100%; - background-color: rgba(0,0,0,0.5); - content: ''; -} -#footer-wrap { - position: relative; - padding: 40px 20px; - color: var(--light-grey); - text-align: center; -} -#footer-wrap a { - color: var(--light-grey); -} -#footer-wrap a:hover { - text-decoration: underline; -} -#footer-wrap .footer-separator { - margin: 0 4px; -} -#footer-wrap .icp-icon { - padding: 0 4px; - max-height: 1.4em; - width: auto; - vertical-align: text-bottom; -} -#page-header { - position: relative; - width: 100%; - background-color: #49b1f5; - background-position: center center; - background-size: cover; - background-repeat: no-repeat; - -webkit-transition: all 0.5s; - -moz-transition: all 0.5s; - -o-transition: all 0.5s; - -ms-transition: all 0.5s; - transition: all 0.5s; -} -#page-header:not(.not-top-img):before { - position: absolute; - width: 100%; - height: 100%; - background-color: rgba(0,0,0,0.3); - content: ''; -} -#page-header.full_page { - height: 100vh; - background-attachment: fixed; -} -#page-header.full_page #site-info { - position: absolute; - top: 43%; - padding: 0 10px; - width: 100%; -} -#page-header #site-title, -#page-header #site-subtitle, -#page-header #scroll-down .scroll-down-effects { - text-align: center; - text-shadow: 2px 2px 4px rgba(0,0,0,0.15); - line-height: 1.5; -} -#page-header #site-title { - margin: 0; - color: var(--white); - font-size: 1.85em; -} -@media screen and (min-width: 768px) { - #page-header #site-title { - font-size: 2.85em; - } -} -#page-header #site-subtitle { - color: var(--light-grey); - font-size: 1.15em; -} -@media screen and (min-width: 768px) { - #page-header #site-subtitle { - font-size: 1.72em; - } -} -#page-header #site_social_icons { - display: none; - margin: 0 auto; - width: 300px; - text-align: center; -} -@media screen and (max-width: 768px) { - #page-header #site_social_icons { - display: block; - } -} -#page-header #site_social_icons .social-icon { - margin: 0 10px; - color: var(--light-grey); - text-shadow: 2px 2px 4px rgba(0,0,0,0.15); - font-size: 1.43em; -} -#page-header #scroll-down { - position: absolute; - bottom: 0; - width: 100%; - cursor: pointer; -} -#page-header #scroll-down .scroll-down-effects { - position: relative; - width: 100%; - color: var(--light-grey); - font-size: 30px; -} -#page-header.not-home-page { - height: 400px; -} -@media screen and (max-width: 768px) { - #page-header.not-home-page { - height: 280px; - } -} -#page-header #page-site-info { - position: absolute; - top: 200px; - padding: 0 10px; - width: 100%; -} -@media screen and (max-width: 768px) { - #page-header #page-site-info { - top: 140px; - } -} -#page-header.post-bg { - height: 400px; -} -@media screen and (max-width: 768px) { - #page-header.post-bg { - height: 360px; - } -} -#page-header.post-bg:before { - background-color: rgba(0,0,0,0.5); -} -#page-header #post-info { - position: absolute; - bottom: 100px; - padding: 0 8%; - width: 100%; - text-align: center; -} -@media screen and (max-width: 900px) { - #page-header #post-info { - bottom: 30px; - text-align: left; - } -} -@media screen and (max-width: 768px) { - #page-header #post-info { - bottom: 22px; - padding: 0 22px; - } -} -#page-header.not-top-img { - margin-bottom: 10px; - height: 60px; - background: 0; -} -#page-header.not-top-img #nav { - background: rgba(255,255,255,0.8); - -webkit-box-shadow: 0 5px 6px -5px rgba(133,133,133,0.6); - box-shadow: 0 5px 6px -5px rgba(133,133,133,0.6); -} -#page-header.not-top-img #nav a { - color: var(--font-color); - text-shadow: none; -} -#page-header.nav-fixed #nav { - position: fixed; - top: -60px; - z-index: 91; - background: rgba(255,255,255,0.8); - -webkit-box-shadow: 0 5px 6px -5px rgba(133,133,133,0.6); - box-shadow: 0 5px 6px -5px rgba(133,133,133,0.6); - -webkit-transition: -webkit-transform 0.2s ease-in-out, opacity 0.2s ease-in-out; - -moz-transition: -moz-transform 0.2s ease-in-out, opacity 0.2s ease-in-out; - -o-transition: -o-transform 0.2s ease-in-out, opacity 0.2s ease-in-out; - -ms-transition: -ms-transform 0.2s ease-in-out, opacity 0.2s ease-in-out; - transition: transform 0.2s ease-in-out, opacity 0.2s ease-in-out; -} -#page-header.nav-fixed #nav a, -#page-header.nav-fixed #nav #site-name, -#page-header.nav-fixed #nav #toggle-menu { - color: var(--font-color); - text-shadow: none; -} -#page-header.nav-fixed #nav a:hover, -#page-header.nav-fixed #nav #site-name:hover, -#page-header.nav-fixed #nav #toggle-menu:hover { - color: #49b1f5; -} -#page-header.nav-visible #nav { - -webkit-transition: all 0.5s; - -moz-transition: all 0.5s; - -o-transition: all 0.5s; - -ms-transition: all 0.5s; - transition: all 0.5s; - -webkit-transform: translate3d(0, 100%, 0); - -moz-transform: translate3d(0, 100%, 0); - -o-transform: translate3d(0, 100%, 0); - -ms-transform: translate3d(0, 100%, 0); - transform: translate3d(0, 100%, 0); -} -#page-header.nav-visible + .layout > .aside-content > .sticky_layout { - top: 70px; - -webkit-transition: top 0.5s; - -moz-transition: top 0.5s; - -o-transition: top 0.5s; - -ms-transition: top 0.5s; - transition: top 0.5s; -} -#page h1.page-title { - margin: 8px 0 20px; -} -#post > #post-info { - margin-bottom: 30px; -} -#post > #post-info .post-title { - padding-bottom: 4px; - border-bottom: 1px solid var(--light-grey); - color: var(--text-highlight-color); -} -#post > #post-info .post-title .post-edit-link { - float: right; -} -#post > #post-info #post-meta, -#post > #post-info #post-meta a { - color: #78818a; -} -#post-info .post-title { - margin-bottom: 8px; - color: var(--white); - font-weight: normal; - font-size: 2.5em; - line-height: 1.5; - -webkit-line-clamp: 3; -} -@media screen and (max-width: 768px) { - #post-info .post-title { - font-size: 2.1em; - } -} -#post-info .post-title .post-edit-link { - padding-left: 10px; -} -#post-info #post-meta { - color: var(--light-grey); - font-size: 95%; -} -@media screen and (min-width: 768px) { - #post-info #post-meta > .meta-secondline > span:first-child { - display: none; - } -} -@media screen and (max-width: 768px) { - #post-info #post-meta { - font-size: 90%; - } - #post-info #post-meta > .meta-firstline, - #post-info #post-meta > .meta-secondline { - display: inline; - } -} -#post-info #post-meta .post-meta-separator { - margin: 0 5px; -} -#post-info #post-meta .post-meta-icon { - margin-right: 4px; -} -#post-info #post-meta .post-meta-label { - margin-right: 4px; -} -#post-info #post-meta a { - color: var(--light-grey); - -webkit-transition: all 0.3s ease-out; - -moz-transition: all 0.3s ease-out; - -o-transition: all 0.3s ease-out; - -ms-transition: all 0.3s ease-out; - transition: all 0.3s ease-out; -} -#post-info #post-meta a:hover { - color: #49b1f5; - text-decoration: underline; -} -#nav { - position: absolute; - top: 0; - z-index: 90; - display: -webkit-box; - display: -moz-box; - display: -webkit-flex; - display: -ms-flexbox; - display: box; - display: flex; - -webkit-box-align: center; - -moz-box-align: center; - -o-box-align: center; - -ms-flex-align: center; - -webkit-align-items: center; - align-items: center; - padding: 0 36px; - width: 100%; - height: 60px; - font-size: 1.3em; - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transition: all 0.5s; - -moz-transition: all 0.5s; - -o-transition: all 0.5s; - -ms-transition: all 0.5s; - transition: all 0.5s; -} -@media screen and (max-width: 768px) { - #nav { - padding: 0 16px; - } -} -#nav.show { - opacity: 1; - -ms-filter: none; - filter: none; -} -#nav #blog_name { - -webkit-box-flex: 1; - -moz-box-flex: 1; - -o-box-flex: 1; - box-flex: 1; - -webkit-flex: 1; - -ms-flex: 1; - flex: 1; -} -#nav #toggle-menu { - display: none; - padding: 2px 0 0 6px; - vertical-align: top; -} -#nav #toggle-menu:hover { - color: var(--white); -} -#nav a { - color: var(--light-grey); -} -#nav a:hover { - color: var(--white); -} -#nav #site-name { - text-shadow: 2px 2px 4px rgba(0,0,0,0.15); - font-weight: bold; - cursor: pointer; -} -#nav .menus_items { - display: inline; -} -#nav .menus_items .menus_item { - position: relative; - display: inline-block; - padding: 0 0 0 14px; -} -#nav .menus_items .menus_item:hover .menus_item_child { - display: block; -} -#nav .menus_items .menus_item:hover > a > i:last-child { - -webkit-transform: rotate(180deg); - -moz-transform: rotate(180deg); - -o-transform: rotate(180deg); - -ms-transform: rotate(180deg); - transform: rotate(180deg); -} -#nav .menus_items .menus_item > a > i:last-child { - padding: 4px; - -webkit-transition: -webkit-transform 0.3s; - -moz-transition: -moz-transform 0.3s; - -o-transition: -o-transform 0.3s; - -ms-transition: -ms-transform 0.3s; - transition: transform 0.3s; -} -#nav .menus_items .menus_item .menus_item_child { - position: absolute; - right: 0; - display: none; - margin-top: 8px; - padding: 0; - width: max-content; - border-radius: 5px; - background-color: var(--sidebar-bg); - -webkit-box-shadow: 0 5px 20px -4px rgba(0,0,0,0.5); - box-shadow: 0 5px 20px -4px rgba(0,0,0,0.5); - -webkit-animation: sub_menus 0.3s 0.1s ease both; - -moz-animation: sub_menus 0.3s 0.1s ease both; - -o-animation: sub_menus 0.3s 0.1s ease both; - -ms-animation: sub_menus 0.3s 0.1s ease both; - animation: sub_menus 0.3s 0.1s ease both; -} -#nav .menus_items .menus_item .menus_item_child:before { - position: absolute; - top: -8px; - left: 0; - width: 100%; - height: 20px; - content: ''; -} -#nav .menus_items .menus_item .menus_item_child li { - list-style: none; -} -#nav .menus_items .menus_item .menus_item_child li:hover { - background: var(--text-bg-hover); -} -#nav .menus_items .menus_item .menus_item_child li:first-child { - border-top-left-radius: 5px; - border-top-right-radius: 5px; -} -#nav .menus_items .menus_item .menus_item_child li:last-child { - border-bottom-right-radius: 5px; - border-bottom-left-radius: 5px; -} -#nav .menus_items .menus_item .menus_item_child li a { - display: inline-block; - padding: 8px 16px; - width: 100%; - color: var(--font-color) !important; - text-shadow: none !important; -} -#nav.hide-menu #toggle-menu { - display: inline-block !important; -} -#nav.hide-menu #toggle-menu .site-page { - font-size: inherit; -} -#nav.hide-menu .menus_items { - display: none; -} -#nav.hide-menu #search-button span { - display: none; -} -#nav #search-button { - display: inline; - padding: 0 0 0 14px; -} -#nav .site-page { - position: relative; - padding-bottom: 6px; - text-shadow: 1px 1px 2px rgba(0,0,0,0.3); - font-size: 0.78em; - cursor: pointer; -} -#nav .site-page:not(.child):after { - position: absolute; - bottom: 0; - left: 0; - z-index: -1; - width: 0; - height: 3px; - background-color: #80c8f8; - content: ''; - -webkit-transition: all 0.3s ease-in-out; - -moz-transition: all 0.3s ease-in-out; - -o-transition: all 0.3s ease-in-out; - -ms-transition: all 0.3s ease-in-out; - transition: all 0.3s ease-in-out; -} -#nav .site-page:not(.child):hover:after { - width: 100%; -} -#pagination .pagination { - margin-top: 20px; - text-align: center; -} -#pagination .page-number.current { - background: #00c4b6; - color: var(--white); -} -#pagination .pagination-info { - position: absolute; - top: 50%; - padding: 20px 40px; - width: 100%; - -webkit-transform: translate(0, -50%); - -moz-transform: translate(0, -50%); - -o-transform: translate(0, -50%); - -ms-transform: translate(0, -50%); - transform: translate(0, -50%); -} -#pagination .prev_info, -#pagination .next_info { - color: var(--white); - font-weight: 500; -} -#pagination .next-post .pagination-info { - text-align: right; -} -#pagination .pull-full { - width: 100% !important; -} -#pagination .prev-post .label, -#pagination .next-post .label { - color: var(--light-grey); - text-transform: uppercase; - font-size: 90%; -} -#pagination .prev-post, -#pagination .next-post { - width: 50%; -} -@media screen and (max-width: 768px) { - #pagination .prev-post, - #pagination .next-post { - width: 100%; - } -} -#pagination .prev-post a, -#pagination .next-post a { - position: relative; - display: block; - overflow: hidden; - height: 150px; -} -#pagination.pagination-post { - overflow: hidden; - margin-top: 40px; - width: 100%; - background: #000; -} -.layout > .recent-posts .pagination > * { - display: inline-block; - margin: 0 6px; - width: 2.5em; - height: 2.5em; - line-height: 2.5em; -} -.layout > .recent-posts .pagination > *:not(.space):hover { - background: var(--btn-hover-color); - color: var(--btn-color); -} -.layout > div:not(.recent-posts) .pagination .page-number { - display: inline-block; - margin: 0 4px; - min-width: 24px; - height: 24px; - text-align: center; - line-height: 24px; - cursor: pointer; -} -#article-container { - word-wrap: break-word; - overflow-wrap: break-word; -} -#article-container a { - color: #49b1f5; -} -#article-container a:hover { - text-decoration: underline; -} -#article-container img { - display: block; - margin: 0 auto 20px; - max-width: 100%; - -webkit-transition: filter 375ms ease-in 0.2s; - -moz-transition: filter 375ms ease-in 0.2s; - -o-transition: filter 375ms ease-in 0.2s; - -ms-transition: filter 375ms ease-in 0.2s; - transition: filter 375ms ease-in 0.2s; -} -#article-container p { - margin: 0 0 16px; -} -#article-container iframe { - margin: 0 0 20px; -} -#article-container kbd { - margin: 0 3px; - padding: 3px 5px; - border: 1px solid #b4b4b4; - border-radius: 3px; - background-color: #f8f8f8; - -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.25), 0 2px 1px 0 rgba(255,255,255,0.6) inset; - box-shadow: 0 1px 3px rgba(0,0,0,0.25), 0 2px 1px 0 rgba(255,255,255,0.6) inset; - color: #34495e; - white-space: nowrap; - font-weight: 600; - font-size: 0.9em; - font-family: Monaco, 'Ubuntu Mono', monospace; - line-height: 1em; -} -#article-container ol ol, -#article-container ul ol, -#article-container ol ul, -#article-container ul ul { - padding-left: 20px; -} -#article-container ol li, -#article-container ul li { - margin: 4px 0; -} -#article-container ol p, -#article-container ul p { - margin: 0 0 8px; -} -#article-container h1, -#article-container h2, -#article-container h3, -#article-container h4, -#article-container h5, -#article-container h6 { - -webkit-transition: all 0.2s ease-out; - -moz-transition: all 0.2s ease-out; - -o-transition: all 0.2s ease-out; - -ms-transition: all 0.2s ease-out; - transition: all 0.2s ease-out; -} -#article-container h1:before, -#article-container h2:before, -#article-container h3:before, -#article-container h4:before, -#article-container h5:before, -#article-container h6:before { - position: absolute; - top: calc(50% - 7px); - color: #f47466; - content: '\f0c1'; - line-height: 1; - -webkit-transition: all 0.2s ease-out; - -moz-transition: all 0.2s ease-out; - -o-transition: all 0.2s ease-out; - -ms-transition: all 0.2s ease-out; - transition: all 0.2s ease-out; -} -#article-container h1:hover:before, -#article-container h2:hover:before, -#article-container h3:hover:before, -#article-container h4:hover:before, -#article-container h5:hover:before, -#article-container h6:hover:before { - color: #49b1f5; -} -#article-container h1 { - padding-left: 32px; -} -#article-container h1:before { - margin-left: -26px; - font-size: 20px; -} -#article-container h1:hover { - padding-left: 38px; -} -#article-container h2 { - padding-left: 30px; -} -#article-container h2:before { - margin-left: -24px; - font-size: 18px; -} -#article-container h2:hover { - padding-left: 36px; -} -#article-container h3 { - padding-left: 28px; -} -#article-container h3:before { - margin-left: -22px; - font-size: 16px; -} -#article-container h3:hover { - padding-left: 34px; -} -#article-container h4 { - padding-left: 26px; -} -#article-container h4:before { - margin-left: -20px; - font-size: 14px; -} -#article-container h4:hover { - padding-left: 32px; -} -#article-container h5 { - padding-left: 24px; -} -#article-container h5:before { - margin-left: -18px; - font-size: 12px; -} -#article-container h5:hover { - padding-left: 30px; -} -#article-container h6 { - padding-left: 24px; -} -#article-container h6:before { - margin-left: -18px; - font-size: 12px; -} -#article-container h6:hover { - padding-left: 30px; -} -#article-container ol p, -#article-container ul p { - margin: 0 0 8px; -} -#article-container li::marker { - color: #49b1f5; - font-weight: 600; - font-size: 1.05em; -} -#article-container li:hover::marker { - color: var(--pseudo-hover); -} -#article-container ul > li { - list-style-type: circle; -} -#article-container > :last-child { - margin-bottom: 0 !important; -} -#post .tag_share:after { - display: block; - clear: both; - content: ''; -} -#post .tag_share .post-meta__tag-list { - display: inline-block; -} -#post .tag_share .post-meta__tags { - display: inline-block; - margin: 8px 8px 8px 0; - padding: 0 12px; - width: fit-content; - border: 1px solid #49b1f5; - border-radius: 12px; - color: #49b1f5; - font-size: 0.85em; - -webkit-transition: all 0.2s ease-in-out; - -moz-transition: all 0.2s ease-in-out; - -o-transition: all 0.2s ease-in-out; - -ms-transition: all 0.2s ease-in-out; - transition: all 0.2s ease-in-out; -} -#post .tag_share .post-meta__tags:hover { - background: #49b1f5; - color: var(--white); -} -#post .tag_share .post_share { - display: inline-block; - float: right; - margin: 8px 0 0; - width: fit-content; -} -#post .tag_share .post_share .social-share { - font-size: 0.85em; -} -#post .tag_share .post_share .social-share .social-share-icon { - margin: 0 4px; - width: 1.85em; - height: 1.85em; - font-size: 1.2em; - line-height: 1.85em; -} -#post .post-copyright { - position: relative; - margin: 40px 0 10px; - padding: 10px 16px; - border: 1px solid var(--light-grey); - -webkit-transition: box-shadow 0.3s ease-in-out; - -moz-transition: box-shadow 0.3s ease-in-out; - -o-transition: box-shadow 0.3s ease-in-out; - -ms-transition: box-shadow 0.3s ease-in-out; - transition: box-shadow 0.3s ease-in-out; -} -#post .post-copyright:before { - position: absolute; - top: 2px; - right: 12px; - color: #49b1f5; - content: '\f1f9'; - font-size: 1.3em; -} -#post .post-copyright:hover { - -webkit-box-shadow: 0 0 8px 0 rgba(232,237,250,0.6), 0 2px 4px 0 rgba(232,237,250,0.5); - box-shadow: 0 0 8px 0 rgba(232,237,250,0.6), 0 2px 4px 0 rgba(232,237,250,0.5); -} -#post .post-copyright .post-copyright-meta { - color: #49b1f5; - font-weight: bold; -} -#post .post-copyright .post-copyright-info { - padding-left: 6px; -} -#post .post-copyright .post-copyright-info a { - text-decoration: underline; - word-break: break-word; -} -#post .post-copyright .post-copyright-info a:hover { - text-decoration: none; -} -#post .post-outdate-notice { - position: relative; - margin: 0 0 20px; - padding: 0.5em 1.2em; - border-radius: 3px; - background-color: #ffe6e6; - color: #f66; - padding: 0.5em 1em 0.5em 2.6em; - border-left: 5px solid #ff8080; -} -#post .post-outdate-notice:before { - position: absolute; - top: 50%; - left: 0.9em; - color: #ff8080; - content: '\f071'; - -webkit-transform: translateY(-50%); - -moz-transform: translateY(-50%); - -o-transform: translateY(-50%); - -ms-transform: translateY(-50%); - transform: translateY(-50%); -} -#post .ads-wrap { - margin: 40px 0; -} -.relatedPosts { - margin-top: 40px; -} -.relatedPosts > .headline { - margin-bottom: 5px; - font-weight: 700; - font-size: 1.43em; -} -.relatedPosts > .relatedPosts-list > div { - position: relative; - display: inline-block; - overflow: hidden; - margin: 3px; - width: calc(33.333% - 6px); - height: 200px; - background: #000; - vertical-align: bottom; -} -@media screen and (max-width: 768px) { - .relatedPosts > .relatedPosts-list > div { - margin: 2px; - width: calc(50% - 4px); - height: 150px; - } -} -@media screen and (max-width: 600px) { - .relatedPosts > .relatedPosts-list > div { - width: calc(100% - 4px); - } -} -.relatedPosts > .relatedPosts-list .content { - position: absolute; - top: 50%; - padding: 0 20px; - width: 100%; - -webkit-transform: translate(0, -50%); - -moz-transform: translate(0, -50%); - -o-transform: translate(0, -50%); - -ms-transform: translate(0, -50%); - transform: translate(0, -50%); -} -.relatedPosts > .relatedPosts-list .content .date { - color: var(--light-grey); - font-size: 90%; -} -.relatedPosts > .relatedPosts-list .content .title { - color: var(--white); - -webkit-line-clamp: 2; -} -.post-reward { - position: relative; - margin-top: 80px; - width: 100%; - text-align: center; - pointer-events: none; -} -.post-reward > * { - pointer-events: auto; -} -.post-reward .reward-button { - display: inline-block; - padding: 4px 24px; - background: var(--btn-bg); - color: var(--btn-color); - cursor: pointer; -} -.post-reward:hover .reward-button { - background: var(--btn-hover-color); -} -.post-reward:hover > .reward-main { - display: block; -} -.post-reward .reward-main { - position: absolute; - bottom: 40px; - left: 0; - z-index: 100; - display: none; - padding: 0 0 15px; - width: 100%; -} -.post-reward .reward-main .reward-all { - display: inline-block; - margin: 0; - padding: 20px 10px; - border-radius: 4px; - background: var(--reward-pop); -} -.post-reward .reward-main .reward-all:before { - position: absolute; - bottom: -10px; - left: 0; - width: 100%; - height: 20px; - content: ''; -} -.post-reward .reward-main .reward-all:after { - position: absolute; - right: 0; - bottom: 2px; - left: 0; - margin: 0 auto; - width: 0; - height: 0; - border-top: 13px solid var(--reward-pop); - border-right: 13px solid transparent; - border-left: 13px solid transparent; - content: ''; -} -.post-reward .reward-main .reward-all .reward-item { - display: inline-block; - padding: 0 8px; - list-style-type: none; - vertical-align: top; -} -.post-reward .reward-main .reward-all .reward-item img { - width: 130px; - height: 130px; -} -.post-reward .reward-main .reward-all .reward-item .post-qr-code-desc { - width: 130px; - color: #858585; -} -#rightside { - position: fixed; - right: -48px; - bottom: 40px; - z-index: 100; - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transition: all 0.5s; - -moz-transition: all 0.5s; - -o-transition: all 0.5s; - -ms-transition: all 0.5s; - transition: all 0.5s; -} -#rightside #rightside-config-hide { - height: 0; - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transition: -webkit-transform 0.4s; - -moz-transition: -moz-transform 0.4s; - -o-transition: -o-transform 0.4s; - -ms-transition: -ms-transform 0.4s; - transition: transform 0.4s; - -webkit-transform: translate(45px, 0); - -moz-transform: translate(45px, 0); - -o-transform: translate(45px, 0); - -ms-transform: translate(45px, 0); - transform: translate(45px, 0); -} -#rightside #rightside-config-hide.show { - height: auto; - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translate(0, 0); - -moz-transform: translate(0, 0); - -o-transform: translate(0, 0); - -ms-transform: translate(0, 0); - transform: translate(0, 0); -} -#rightside #rightside-config-hide.status { - height: auto; - opacity: 1; - -ms-filter: none; - filter: none; -} -#rightside > div > button, -#rightside > div > a { - display: block; - margin-bottom: 5px; - width: 35px; - height: 35px; - border-radius: 5px; - background-color: var(--btn-bg); - color: var(--btn-color); - text-align: center; - font-size: 16px; - line-height: 35px; -} -#rightside > div > button:hover, -#rightside > div > a:hover { - background-color: var(--btn-hover-color); -} -#rightside #mobile-toc-button { - display: none; -} -@media screen and (max-width: 900px) { - #rightside #mobile-toc-button { - display: block; - } -} -@media screen and (max-width: 900px) { - #rightside #hide-aside-btn { - display: none; - } -} -#sidebar #menu-mask { - position: fixed; - z-index: 102; - display: none; - width: 100%; - height: 100%; - background: rgba(0,0,0,0.8); -} -#sidebar #sidebar-menus { - position: fixed; - top: 0; - right: -300px; - z-index: 103; - overflow-x: hidden; - overflow-y: auto; - width: 300px; - height: 100%; - background: var(--sidebar-bg); - -webkit-transition: all 0.5s; - -moz-transition: all 0.5s; - -o-transition: all 0.5s; - -ms-transition: all 0.5s; - transition: all 0.5s; -} -#sidebar #sidebar-menus.open { - -webkit-transform: translate3d(-100%, 0, 0); - -moz-transform: translate3d(-100%, 0, 0); - -o-transform: translate3d(-100%, 0, 0); - -ms-transform: translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0); -} -#sidebar #sidebar-menus > .avatar-img { - margin: 20px auto; -} -#sidebar #sidebar-menus .sidebar-site-data { - padding: 0 10px; -} -#sidebar #sidebar-menus hr { - margin: 20px auto; -} -#sidebar #sidebar-menus .menus_items { - padding: 0 10px 40px; -} -#sidebar #sidebar-menus .menus_items .site-page { - position: relative; - display: block; - padding: 6px 30px 6px 22px; - color: var(--font-color); - font-size: 1.15em; -} -#sidebar #sidebar-menus .menus_items .site-page:hover { - background: var(--text-bg-hover); -} -#sidebar #sidebar-menus .menus_items .site-page i:first-child { - width: 15%; - text-align: left; -} -#sidebar #sidebar-menus .menus_items .site-page.group > i:last-child { - position: absolute; - top: 0.78em; - right: 18px; - -webkit-transition: -webkit-transform 0.3s; - -moz-transition: -moz-transform 0.3s; - -o-transition: -o-transform 0.3s; - -ms-transition: -ms-transform 0.3s; - transition: transform 0.3s; -} -#sidebar #sidebar-menus .menus_items .site-page.group.hide > i:last-child { - -webkit-transform: rotate(90deg); - -moz-transform: rotate(90deg); - -o-transform: rotate(90deg); - -ms-transform: rotate(90deg); - transform: rotate(90deg); -} -#sidebar #sidebar-menus .menus_items .site-page.group.hide + .menus_item_child { - display: none; -} -#sidebar #sidebar-menus .menus_items .menus_item_child { - margin: 0; - list-style: none; -} -#vcomment { - font-size: 1.1em; -} -#vcomment .vbtn { - border: none; - background: var(--btn-bg); - color: var(--btn-color); -} -#vcomment .vbtn:hover { - background: var(--btn-hover-color); -} -#vcomment .vimg { - -webkit-transition: all 0.3s; - -moz-transition: all 0.3s; - -o-transition: all 0.3s; - -ms-transition: all 0.3s; - transition: all 0.3s; -} -#vcomment .vimg:hover { - -webkit-transform: rotate(360deg); - -moz-transform: rotate(360deg); - -o-transform: rotate(360deg); - -ms-transform: rotate(360deg); - transform: rotate(360deg); -} -#vcomment .vcards .vcard .vcontent.expand:before, -#vcomment .vcards .vcard .vcontent.expand:after { - z-index: 22; -} -#waline-wrap { - --waline-font-size: 1.1em; - --waline-theme-color: #49b1f5; - --waline-active-color: #ff7242; -} -#waline-wrap .wl-comment-actions > button:not(last-child) { - padding-right: 4px; -} -.fireworks { - position: fixed; - top: 0; - left: 0; - z-index: 9999; - pointer-events: none; -} -.medium-zoom-image--opened { - z-index: 99999 !important; - margin: 0 !important; -} -.medium-zoom-overlay { - z-index: 99999 !important; -} -.mermaid-wrap { - margin: 0 0 20px; - text-align: center; -} -.mermaid-wrap > svg { - height: 100%; -} -.utterances, -.fb-comments iframe { - width: 100% !important; -} -#gitalk-container .gt-meta { - margin: 0 0 0.8em; - padding: 6px 0 16px; -} -.katex-wrap { - overflow: auto; -} -.katex-wrap::-webkit-scrollbar { - display: none; -} -.mathjax-overflow { - overflow-x: auto; - overflow-y: hidden; -} -span.mathjax-overflow { - display: inline-block; - padding: 0 2px; - max-width: 100%; - vertical-align: bottom; -} -.aplayer { - color: #4c4948; -} -#article-container .aplayer { - margin: 0 0 20px; -} -#article-container .aplayer ol, -#article-container .aplayer ul { - margin: 0; - padding: 0; -} -#article-container .aplayer ol li, -#article-container .aplayer ul li { - margin: 0; - padding: 0 15px; -} -#article-container .aplayer ol li:before, -#article-container .aplayer ul li:before { - content: none; -} -.snackbar-css { - border-radius: 5px !important; -} -#article-container .btn-center { - margin: 0 0 20px; - text-align: center; -} -#article-container .btn-beautify { - display: inline-block; - margin: 0 4px 6px; - padding: 0 15px; - background-color: var(--btn-beautify-color, #777); - color: #fff; - line-height: 2; -} -#article-container .btn-beautify.blue { - --btn-beautify-color: #428bca; -} -#article-container .btn-beautify.pink { - --btn-beautify-color: #ff69b4; -} -#article-container .btn-beautify.red { - --btn-beautify-color: #f00; -} -#article-container .btn-beautify.purple { - --btn-beautify-color: #6f42c1; -} -#article-container .btn-beautify.orange { - --btn-beautify-color: #ff8c00; -} -#article-container .btn-beautify.green { - --btn-beautify-color: #5cb85c; -} -#article-container .btn-beautify:hover { - background-color: var(--btn-hover-color); -} -#article-container .btn-beautify i + span { - margin-left: 6px; -} -#article-container .btn-beautify:not(.block) + .btn-beautify:not(.block) { - margin: 0 4px 20px; -} -#article-container .btn-beautify.block { - display: block; - margin: 0 0 20px; - width: fit-content; - width: -moz-fit-content; -} -#article-container .btn-beautify.block.center { - margin: 0 auto 20px; -} -#article-container .btn-beautify.block.right { - margin: 0 0 20px auto; -} -#article-container .btn-beautify.larger { - padding: 6px 15px; -} -#article-container .btn-beautify:hover { - text-decoration: none; -} -#article-container .btn-beautify.outline { - border: 1px solid transparent; - border-color: var(--btn-beautify-color, #777); - background-color: transparent; - color: var(--btn-beautify-color, #777); -} -#article-container .btn-beautify.outline:hover { - background-color: var(--btn-beautify-color, #777); -} -#article-container .btn-beautify.outline:hover { - color: #fff !important; -} -#article-container figure.gallery-group { - position: relative; - float: left; - overflow: hidden; - margin: 6px 4px; - width: calc(50% - 8px); - height: 250px; - border-radius: 8px; - background: #000; - -webkit-transform: translate3d(0, 0, 0); -} -@media screen and (max-width: 600px) { - #article-container figure.gallery-group { - width: calc(100% - 8px); - } -} -#article-container figure.gallery-group:hover img { - opacity: 0.4; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=40)"; - filter: alpha(opacity=40); - -webkit-transform: translate3d(0, 0, 0); - -moz-transform: translate3d(0, 0, 0); - -o-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); -} -#article-container figure.gallery-group:hover .gallery-group-name::after { - -webkit-transform: translate3d(0, 0, 0); - -moz-transform: translate3d(0, 0, 0); - -o-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); -} -#article-container figure.gallery-group:hover p { - opacity: 1; - -ms-filter: none; - filter: none; - -webkit-transform: translate3d(0, 0, 0); - -moz-transform: translate3d(0, 0, 0); - -o-transform: translate3d(0, 0, 0); - -ms-transform: translate3d(0, 0, 0); - transform: translate3d(0, 0, 0); -} -#article-container figure.gallery-group img { - position: relative; - margin: 0; - max-width: none; - width: calc(100% + 20px); - height: 250px; - -webkit-backface-visibility: hidden; - -moz-backface-visibility: hidden; - -ms-backface-visibility: hidden; - backface-visibility: hidden; - opacity: 0.8; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; - filter: alpha(opacity=80); - -webkit-transition: all 0.3s, filter 375ms ease-in 0.2s; - -moz-transition: all 0.3s, filter 375ms ease-in 0.2s; - -o-transition: all 0.3s, filter 375ms ease-in 0.2s; - -ms-transition: all 0.3s, filter 375ms ease-in 0.2s; - transition: all 0.3s, filter 375ms ease-in 0.2s; - -webkit-transform: translate3d(-10px, 0, 0); - -moz-transform: translate3d(-10px, 0, 0); - -o-transform: translate3d(-10px, 0, 0); - -ms-transform: translate3d(-10px, 0, 0); - transform: translate3d(-10px, 0, 0); - object-fit: cover; -} -#article-container figure.gallery-group figcaption { - position: absolute; - top: 0; - left: 0; - padding: 30px; - width: 100%; - height: 100%; - color: #fff; - text-transform: uppercase; - -webkit-backface-visibility: hidden; - -moz-backface-visibility: hidden; - -ms-backface-visibility: hidden; - backface-visibility: hidden; -} -#article-container figure.gallery-group figcaption > a { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - z-index: 1000; - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); -} -#article-container figure.gallery-group p { - margin: 0; - padding: 8px 0 0; - letter-spacing: 1px; - font-size: 1.1em; - line-height: 1.5; - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); - -webkit-transition: opacity 0.35s, -webkit-transform 0.35s; - -moz-transition: opacity 0.35s, -moz-transform 0.35s; - -o-transition: opacity 0.35s, -o-transform 0.35s; - -ms-transition: opacity 0.35s, -ms-transform 0.35s; - transition: opacity 0.35s, transform 0.35s; - -webkit-transform: translate3d(100%, 0, 0); - -moz-transform: translate3d(100%, 0, 0); - -o-transform: translate3d(100%, 0, 0); - -ms-transform: translate3d(100%, 0, 0); - transform: translate3d(100%, 0, 0); - -webkit-line-clamp: 4; -} -#article-container figure.gallery-group .gallery-group-name { - position: relative; - margin: 0; - padding: 8px 0; - font-weight: bold; - font-size: 1.65em; - line-height: 1.5; - -webkit-line-clamp: 2; -} -#article-container figure.gallery-group .gallery-group-name:after { - position: absolute; - bottom: 0; - left: 0; - width: 100%; - height: 2px; - background: #fff; - content: ''; - -webkit-transition: -webkit-transform 0.35s; - -moz-transition: -moz-transform 0.35s; - -o-transition: -o-transform 0.35s; - -ms-transition: -ms-transform 0.35s; - transition: transform 0.35s; - -webkit-transform: translate3d(-100%, 0, 0); - -moz-transform: translate3d(-100%, 0, 0); - -o-transform: translate3d(-100%, 0, 0); - -ms-transform: translate3d(-100%, 0, 0); - transform: translate3d(-100%, 0, 0); -} -#article-container .gallery-group-main { - overflow: auto; - padding: 0 0 16px; -} -#article-container .fj-gallery { - margin: 0 0 16px; - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); -} -#article-container .fj-gallery .img-alt { - display: none; -} -blockquote.pullquote { - position: relative; - max-width: 45%; - font-size: 110%; -} -blockquote.pullquote.left { - float: left; - margin: 1em 0.5em 0 0; -} -blockquote.pullquote.right { - float: right; - margin: 1em 0 0 0.5em; -} -.video-container { - position: relative; - overflow: hidden; - margin-bottom: 16px; - padding-top: 56.25%; - height: 0; -} -.video-container iframe { - position: absolute; - top: 0; - left: 0; - margin-top: 0; - width: 100%; - height: 100%; -} -.hide-inline > .hide-button, -.hide-block > .hide-button { - display: inline-block; - padding: 5px 18px; - background: #49b1f5; - color: var(--white); -} -.hide-inline > .hide-button:hover, -.hide-block > .hide-button:hover { - background-color: var(--btn-hover-color); -} -.hide-inline > .hide-button.open, -.hide-block > .hide-button.open { - display: none; -} -.hide-inline > .hide-button.open + div, -.hide-block > .hide-button.open + div { - display: block; -} -.hide-inline > .hide-button.open + span, -.hide-block > .hide-button.open + span { - display: inline; -} -.hide-inline > .hide-content, -.hide-block > .hide-content { - display: none; -} -.hide-inline > .hide-button { - margin: 0 6px; -} -.hide-inline > .hide-content { - margin: 0 6px; -} -.hide-block { - margin: 0 0 16px; -} -.toggle { - margin-bottom: 20px; - border: 1px solid #f0f0f0; -} -.toggle > .toggle-button { - padding: 6px 15px; - background: #f0f0f0; - color: #1f2d3d; - cursor: pointer; -} -.toggle > .toggle-content { - margin: 30px 24px; -} -#article-container .inline-img { - display: inline; - margin: 0 3px; - height: 1.1em; - vertical-align: text-bottom; -} -.hl-label { - padding: 2px 4px; - border-radius: 3px; - color: #fff; -} -.hl-label.default { - background-color: #777; -} -.hl-label.blue { - background-color: #428bca; -} -.hl-label.pink { - background-color: #ff69b4; -} -.hl-label.red { - background-color: #f00; -} -.hl-label.purple { - background-color: #6f42c1; -} -.hl-label.orange { - background-color: #ff8c00; -} -.hl-label.green { - background-color: #5cb85c; -} -.note { - position: relative; - margin: 0 0 20px; - padding: 15px; - border-radius: 3px; -} -.note.icon-padding { - padding-left: 3em; -} -.note > .note-icon { - position: absolute; - top: calc(50% - 0.5em); - left: 0.8em; - font-size: larger; -} -.note.blue:not(.disabled) { - border-left-color: #428bca !important; -} -.note.blue:not(.disabled).modern { - border-left-color: transparent !important; - color: #428bca; -} -.note.blue:not(.disabled):not(.simple) { - background: #e3eef7 !important; -} -.note.blue > .note-icon { - color: #428bca; -} -.note.pink:not(.disabled) { - border-left-color: #ff69b4 !important; -} -.note.pink:not(.disabled).modern { - border-left-color: transparent !important; - color: #ff69b4; -} -.note.pink:not(.disabled):not(.simple) { - background: #ffe9f4 !important; -} -.note.pink > .note-icon { - color: #ff69b4; -} -.note.red:not(.disabled) { - border-left-color: #f00 !important; -} -.note.red:not(.disabled).modern { - border-left-color: transparent !important; - color: #f00; -} -.note.red:not(.disabled):not(.simple) { - background: #ffd9d9 !important; -} -.note.red > .note-icon { - color: #f00; -} -.note.purple:not(.disabled) { - border-left-color: #6f42c1 !important; -} -.note.purple:not(.disabled).modern { - border-left-color: transparent !important; - color: #6f42c1; -} -.note.purple:not(.disabled):not(.simple) { - background: #e9e3f6 !important; -} -.note.purple > .note-icon { - color: #6f42c1; -} -.note.orange:not(.disabled) { - border-left-color: #ff8c00 !important; -} -.note.orange:not(.disabled).modern { - border-left-color: transparent !important; - color: #ff8c00; -} -.note.orange:not(.disabled):not(.simple) { - background: #ffeed9 !important; -} -.note.orange > .note-icon { - color: #ff8c00; -} -.note.green:not(.disabled) { - border-left-color: #5cb85c !important; -} -.note.green:not(.disabled).modern { - border-left-color: transparent !important; - color: #5cb85c; -} -.note.green:not(.disabled):not(.simple) { - background: #e7f4e7 !important; -} -.note.green > .note-icon { - color: #5cb85c; -} -.note.simple { - border: 1px solid #eee; - border-left-width: 5px; -} -.note.modern { - border: 1px solid transparent !important; - background-color: #f5f5f5; - color: #4c4948; -} -.note.flat { - border: initial; - border-left: 5px solid #eee; - background-color: #f9f9f9; - color: #4c4948; -} -.note h2, -.note h3, -.note h4, -.note h5, -.note h6 { - margin-top: 3px; - margin-bottom: 0; - padding-top: 0 !important; - border-bottom: initial; -} -.note p:first-child, -.note ul:first-child, -.note ol:first-child, -.note table:first-child, -.note pre:first-child, -.note blockquote:first-child, -.note img:first-child { - margin-top: 0 !important; -} -.note p:last-child, -.note ul:last-child, -.note ol:last-child, -.note table:last-child, -.note pre:last-child, -.note blockquote:last-child, -.note img:last-child { - margin-bottom: 0 !important; -} -.note:not(.no-icon) { - padding-left: 3em; -} -.note:not(.no-icon)::before { - position: absolute; - top: calc(50% - 0.95em); - left: 0.8em; - font-size: larger; -} -.note.default.flat { - background: #f7f7f7; -} -.note.default.modern { - border-color: #e1e1e1; - background: #f3f3f3; - color: #666; -} -.note.default.modern a:not(.btn) { - color: #666; -} -.note.default.modern a:not(.btn):hover { - color: #454545; -} -.note.default:not(.modern) { - border-left-color: #777; -} -.note.default:not(.modern) h2, -.note.default:not(.modern) h3, -.note.default:not(.modern) h4, -.note.default:not(.modern) h5, -.note.default:not(.modern) h6 { - color: #777; -} -.note.default:not(.no-icon)::before { - content: '\f0a9'; -} -.note.default:not(.no-icon):not(.modern)::before { - color: #777; -} -.note.primary.flat { - background: #f5f0fa; -} -.note.primary.modern { - border-color: #e1c2ff; - background: #f3daff; - color: #6f42c1; -} -.note.primary.modern a:not(.btn) { - color: #6f42c1; -} -.note.primary.modern a:not(.btn):hover { - color: #453298; -} -.note.primary:not(.modern) { - border-left-color: #6f42c1; -} -.note.primary:not(.modern) h2, -.note.primary:not(.modern) h3, -.note.primary:not(.modern) h4, -.note.primary:not(.modern) h5, -.note.primary:not(.modern) h6 { - color: #6f42c1; -} -.note.primary:not(.no-icon)::before { - content: '\f055'; -} -.note.primary:not(.no-icon):not(.modern)::before { - color: #6f42c1; -} -.note.info.flat { - background: #eef7fa; -} -.note.info.modern { - border-color: #b3e5ef; - background: #d9edf7; - color: #31708f; -} -.note.info.modern a:not(.btn) { - color: #31708f; -} -.note.info.modern a:not(.btn):hover { - color: #215761; -} -.note.info:not(.modern) { - border-left-color: #428bca; -} -.note.info:not(.modern) h2, -.note.info:not(.modern) h3, -.note.info:not(.modern) h4, -.note.info:not(.modern) h5, -.note.info:not(.modern) h6 { - color: #428bca; -} -.note.info:not(.no-icon)::before { - content: '\f05a'; -} -.note.info:not(.no-icon):not(.modern)::before { - color: #428bca; -} -.note.success.flat { - background: #eff8f0; -} -.note.success.modern { - border-color: #d0e6be; - background: #dff0d8; - color: #3c763d; -} -.note.success.modern a:not(.btn) { - color: #3c763d; -} -.note.success.modern a:not(.btn):hover { - color: #32562c; -} -.note.success:not(.modern) { - border-left-color: #5cb85c; -} -.note.success:not(.modern) h2, -.note.success:not(.modern) h3, -.note.success:not(.modern) h4, -.note.success:not(.modern) h5, -.note.success:not(.modern) h6 { - color: #5cb85c; -} -.note.success:not(.no-icon)::before { - content: '\f058'; -} -.note.success:not(.no-icon):not(.modern)::before { - color: #5cb85c; -} -.note.warning.flat { - background: #fdf8ea; -} -.note.warning.modern { - border-color: #fae4cd; - background: #fcf4e3; - color: #8a6d3b; -} -.note.warning.modern a:not(.btn) { - color: #8a6d3b; -} -.note.warning.modern a:not(.btn):hover { - color: #714f30; -} -.note.warning:not(.modern) { - border-left-color: #f0ad4e; -} -.note.warning:not(.modern) h2, -.note.warning:not(.modern) h3, -.note.warning:not(.modern) h4, -.note.warning:not(.modern) h5, -.note.warning:not(.modern) h6 { - color: #f0ad4e; -} -.note.warning:not(.no-icon)::before { - content: '\f06a'; -} -.note.warning:not(.no-icon):not(.modern)::before { - color: #f0ad4e; -} -.note.danger.flat { - background: #fcf1f2; -} -.note.danger.modern { - border-color: #ebcdd2; - background: #f2dfdf; - color: #a94442; -} -.note.danger.modern a:not(.btn) { - color: #a94442; -} -.note.danger.modern a:not(.btn):hover { - color: #84333f; -} -.note.danger:not(.modern) { - border-left-color: #d9534f; -} -.note.danger:not(.modern) h2, -.note.danger:not(.modern) h3, -.note.danger:not(.modern) h4, -.note.danger:not(.modern) h5, -.note.danger:not(.modern) h6 { - color: #d9534f; -} -.note.danger:not(.no-icon)::before { - content: '\f056'; -} -.note.danger:not(.no-icon):not(.modern)::before { - color: #d9534f; -} -#article-container .tabs { - position: relative; - margin: 0 0 20px; - border-right: 1px solid var(--tab-border-color); - border-bottom: 1px solid var(--tab-border-color); - border-left: 1px solid var(--tab-border-color); -} -#article-container .tabs > .nav-tabs { - display: -webkit-box; - display: -moz-box; - display: -webkit-flex; - display: -ms-flexbox; - display: box; - display: flex; - -webkit-box-lines: multiple; - -moz-box-lines: multiple; - -o-box-lines: multiple; - -webkit-flex-wrap: wrap; - -ms-flex-wrap: wrap; - flex-wrap: wrap; - margin: 0; - padding: 0; - background: var(--tab-botton-bg); -} -#article-container .tabs > .nav-tabs > .tab { - margin: 0; - padding: 0; - list-style: none; -} -@media screen and (max-width: 768px) { - #article-container .tabs > .nav-tabs > .tab { - -webkit-box-flex: 1; - -moz-box-flex: 1; - -o-box-flex: 1; - -ms-box-flex: 1; - box-flex: 1; - -webkit-flex-grow: 1; - flex-grow: 1; - } -} -#article-container .tabs > .nav-tabs > .tab button { - display: block; - padding: 8px 18px; - width: 100%; - border-top: 2px solid var(--tab-border-color); - background: var(--tab-botton-bg); - color: var(--tab-botton-color); - line-height: 2; - -webkit-transition: all 0.4s; - -moz-transition: all 0.4s; - -o-transition: all 0.4s; - -ms-transition: all 0.4s; - transition: all 0.4s; -} -#article-container .tabs > .nav-tabs > .tab button i { - width: 1.5em; -} -#article-container .tabs > .nav-tabs > .tab.active button { - border-top: 2px solid #49b1f5; - background: var(--tab-button-active-bg); - cursor: default; -} -#article-container .tabs > .nav-tabs > .tab:not(.active) button:hover { - border-top: 2px solid var(--tab-button-hover-bg); - background: var(--tab-button-hover-bg); -} -#article-container .tabs > .tab-contents .tab-item-content { - position: relative; - display: none; - padding: 36px 24px; -} -@media screen and (max-width: 768px) { - #article-container .tabs > .tab-contents .tab-item-content { - padding: 24px 14px; - } -} -#article-container .tabs > .tab-contents .tab-item-content.active { - display: block; - -webkit-animation: tabshow 0.5s; - -moz-animation: tabshow 0.5s; - -o-animation: tabshow 0.5s; - -ms-animation: tabshow 0.5s; - animation: tabshow 0.5s; -} -#article-container .tabs .tab-to-top { - position: relative; - display: block; - margin: 0 0 0 auto; - color: #99a9bf; -} -@-moz-keyframes tabshow { - 0% { - -webkit-transform: translateY(15px); - -moz-transform: translateY(15px); - -o-transform: translateY(15px); - -ms-transform: translateY(15px); - transform: translateY(15px); - } - 100% { - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-webkit-keyframes tabshow { - 0% { - -webkit-transform: translateY(15px); - -moz-transform: translateY(15px); - -o-transform: translateY(15px); - -ms-transform: translateY(15px); - transform: translateY(15px); - } - 100% { - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@-o-keyframes tabshow { - 0% { - -webkit-transform: translateY(15px); - -moz-transform: translateY(15px); - -o-transform: translateY(15px); - -ms-transform: translateY(15px); - transform: translateY(15px); - } - 100% { - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -@keyframes tabshow { - 0% { - -webkit-transform: translateY(15px); - -moz-transform: translateY(15px); - -o-transform: translateY(15px); - -ms-transform: translateY(15px); - transform: translateY(15px); - } - 100% { - -webkit-transform: translateY(0); - -moz-transform: translateY(0); - -o-transform: translateY(0); - -ms-transform: translateY(0); - transform: translateY(0); - } -} -#article-container .timeline { - margin: 0 0 20px 10px; - padding: 14px 20px 5px; - border-left: 2px solid var(--timeline-color, #49b1f5); -} -#article-container .timeline.blue { - --timeline-color: #428bca; - --timeline-bg: rgba(66,139,202, 0.2); -} -#article-container .timeline.pink { - --timeline-color: #ff69b4; - --timeline-bg: rgba(255,105,180, 0.2); -} -#article-container .timeline.red { - --timeline-color: #f00; - --timeline-bg: rgba(255,0,0, 0.2); -} -#article-container .timeline.purple { - --timeline-color: #6f42c1; - --timeline-bg: rgba(111,66,193, 0.2); -} -#article-container .timeline.orange { - --timeline-color: #ff8c00; - --timeline-bg: rgba(255,140,0, 0.2); -} -#article-container .timeline.green { - --timeline-color: #5cb85c; - --timeline-bg: rgba(92,184,92, 0.2); -} -#article-container .timeline .timeline-item { - margin: 0 0 15px; -} -#article-container .timeline .timeline-item:hover .item-circle:before { - border-color: var(--timeline-color, #49b1f5); -} -#article-container .timeline .timeline-item.headline .timeline-item-title .item-circle > p { - font-weight: 600; - font-size: 1.2em; -} -#article-container .timeline .timeline-item.headline .timeline-item-title .item-circle:before { - left: -28px; - border: 4px solid var(--timeline-color, #49b1f5); -} -#article-container .timeline .timeline-item.headline:hover .item-circle:before { - border-color: var(--pseudo-hover); -} -#article-container .timeline .timeline-item .timeline-item-title { - position: relative; -} -#article-container .timeline .timeline-item .item-circle:before { - position: absolute; - top: 50%; - left: -27px; - width: 6px; - height: 6px; - border: 3px solid var(--pseudo-hover); - border-radius: 50%; - background: var(--card-bg); - content: ''; - -webkit-transition: all 0.3s; - -moz-transition: all 0.3s; - -o-transition: all 0.3s; - -ms-transition: all 0.3s; - transition: all 0.3s; - -webkit-transform: translate(0, -50%); - -moz-transform: translate(0, -50%); - -o-transform: translate(0, -50%); - -ms-transform: translate(0, -50%); - transform: translate(0, -50%); -} -#article-container .timeline .timeline-item .item-circle > p { - margin: 0 0 8px; - font-weight: 500; -} -#article-container .timeline .timeline-item .timeline-item-content { - position: relative; - padding: 12px 15px; - border-radius: 8px; - background: var(--timeline-bg, #e4f3fd); - font-size: 0.93em; -} -#article-container .timeline .timeline-item .timeline-item-content > :last-child { - margin-bottom: 0; -} -#article-container .timeline + .timeline { - margin-top: -20px; -} -[data-theme='dark'] { - --global-bg: #0d0d0d; - --font-color: rgba(255,255,255,0.7); - --hr-border: rgba(255,255,255,0.4); - --hr-before-color: rgba(255,255,255,0.7); - --search-bg: #121212; - --search-input-color: rgba(255,255,255,0.7); - --search-result-title: rgba(255,255,255,0.9); - --preloader-bg: #0d0d0d; - --preloader-color: rgba(255,255,255,0.7); - --tab-border-color: #2c2c2c; - --tab-botton-bg: #2c2c2c; - --tab-botton-color: rgba(255,255,255,0.7); - --tab-button-hover-bg: #383838; - --tab-button-active-bg: #121212; - --card-bg: #121212; - --sidebar-bg: #121212; - --btn-hover-color: #787878; - --btn-color: rgba(255,255,255,0.7); - --btn-bg: #1f1f1f; - --text-bg-hover: #383838; - --light-grey: rgba(255,255,255,0.7); - --dark-grey: rgba(255,255,255,0.2); - --white: rgba(255,255,255,0.9); - --text-highlight-color: rgba(255,255,255,0.9); - --blockquote-color: rgba(255,255,255,0.7); - --blockquote-bg: #2c2c2c; - --reward-pop: #2c2c2c; - --toc-link-color: rgba(255,255,255,0.6); - --hl-color: rgba(255,255,255,0.7); - --hl-bg: #171717; - --hltools-bg: #1a1a1a; - --hltools-color: #90a4ae; - --hlnumber-bg: #171717; - --hlnumber-color: rgba(255,255,255,0.4); - --hlscrollbar-bg: #1f1f1f; - --hlexpand-bg: linear-gradient(180deg, rgba(23,23,23,0.6), rgba(23,23,23,0.9)); - --scrollbar-color: #1f1f1f; - --timeline-bg: #1f1f1f; -} -[data-theme='dark'] #web_bg:before, -[data-theme='dark'] #footer:before, -[data-theme='dark'] #page-header:before { - position: absolute; - width: 100%; - height: 100%; - background-color: rgba(0,0,0,0.7); - content: ''; -} -[data-theme='dark'] #article-container code { - background: #2c2c2c; -} -[data-theme='dark'] #article-container pre > code { - background: #171717; -} -[data-theme='dark'] #article-container figure.highlight { - -webkit-box-shadow: none; - box-shadow: none; -} -[data-theme='dark'] #article-container .note code { - background: rgba(27,31,35,0.05); -} -[data-theme='dark'] #article-container .aplayer { - filter: brightness(0.8); -} -[data-theme='dark'] #article-container kbd { - border-color: #696969; - background-color: #525252; - color: #e2f1ff; -} -[data-theme='dark'] #page-header.nav-fixed > #nav, -[data-theme='dark'] #page-header.not-top-img > #nav { - background: rgba(18,18,18,0.8); - -webkit-box-shadow: 0 5px 6px -5px rgba(133,133,133,0); - box-shadow: 0 5px 6px -5px rgba(133,133,133,0); -} -[data-theme='dark'] #post-comment #comment-switch { - background: #2c2c2c !important; -} -[data-theme='dark'] #post-comment #comment-switch .switch-btn { - filter: brightness(0.8); -} -[data-theme='dark'] .note { - filter: brightness(0.8); -} -[data-theme='dark'] .hide-button, -[data-theme='dark'] .btn-beautify, -[data-theme='dark'] .hl-label, -[data-theme='dark'] .post-outdate-notice, -[data-theme='dark'] .error-img, -[data-theme='dark'] #article-container iframe, -[data-theme='dark'] .gist, -[data-theme='dark'] .ads-wrap { - filter: brightness(0.8); -} -[data-theme='dark'] img { - filter: brightness(0.8); -} -[data-theme='dark'] #aside-content .aside-list > .aside-list-item:not(:last-child) { - border-bottom: 1px dashed rgba(255,255,255,0.1); -} -[data-theme='dark'] #gitalk-container { - filter: brightness(0.8); -} -[data-theme='dark'] #gitalk-container svg { - fill: rgba(255,255,255,0.9) !important; -} -[data-theme='dark'] #disqusjs #dsqjs:hover, -[data-theme='dark'] #disqusjs #dsqjs:focus, -[data-theme='dark'] #disqusjs #dsqjs .dsqjs-tab-active, -[data-theme='dark'] #disqusjs #dsqjs .dsqjs-no-comment { - color: rgba(255,255,255,0.7); -} -[data-theme='dark'] #disqusjs #dsqjs .dsqjs-order-label { - background-color: #1f1f1f; -} -[data-theme='dark'] #disqusjs #dsqjs .dsqjs-post-body { - color: rgba(255,255,255,0.7); -} -[data-theme='dark'] #disqusjs #dsqjs .dsqjs-post-body code, -[data-theme='dark'] #disqusjs #dsqjs .dsqjs-post-body pre { - background: #2c2c2c; -} -[data-theme='dark'] #disqusjs #dsqjs .dsqjs-post-body blockquote { - color: rgba(255,255,255,0.7); -} -[data-theme='dark'] #artitalk_main #lazy { - background: #121212; -} -[data-theme='dark'] #operare_artitalk .c2 { - background: #121212; -} -@media screen and (max-width: 900px) { - [data-theme='dark'] #card-toc { - background: #1f1f1f; - } -} -.read-mode { - --font-color: #4c4948; - --readmode-light-color: #fff; - --white: #4c4948; - --light-grey: #4c4948; - --gray: #d6dbdf; - --hr-border: #d6dbdf; - --hr-before-color: #b9c2c9; - --highlight-bg: #f7f7f7; - --exit-btn-bg: #c0c0c0; - --exit-btn-color: #fff; - --exit-btn-hover: #8d8d8d; - --pseudo-hover: none; -} -[data-theme='dark'] .read-mode { - --font-color: rgba(255,255,255,0.7); - --readmode-light-color: #0d0d0d; - --white: rgba(255,255,255,0.9); - --light-grey: rgba(255,255,255,0.7); - --gray: rgba(255,255,255,0.7); - --hr-border: rgba(255,255,255,0.5); - --hr-before-color: rgba(255,255,255,0.7); - --highlight-bg: #171717; - --exit-btn-bg: #1f1f1f; - --exit-btn-color: rgba(255,255,255,0.9); - --exit-btn-hover: #525252; -} -.read-mode { - background: var(--readmode-light-color); -} -.read-mode .exit-readmode { - position: fixed; - top: 30px; - right: 30px; - z-index: 100; - width: 40px; - height: 40px; - border-radius: 8px; - background: var(--exit-btn-bg); - color: var(--exit-btn-color); - font-size: 16px; - -webkit-transition: background 0.3s; - -moz-transition: background 0.3s; - -o-transition: background 0.3s; - -ms-transition: background 0.3s; - transition: background 0.3s; -} -@media screen and (max-width: 768px) { - .read-mode .exit-readmode { - top: initial; - bottom: 30px; - } -} -.read-mode .exit-readmode:hover { - background: var(--exit-btn-hover); -} -.read-mode #aside-content { - display: none; -} -.read-mode #page-header.post-bg { - background-color: transparent; - background-image: none !important; -} -.read-mode #page-header.post-bg:before { - opacity: 0; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"; - filter: alpha(opacity=0); -} -.read-mode #page-header.post-bg > #post-info { - text-align: center; -} -.read-mode #post { - margin: 0 auto; - background: transparent; - -webkit-box-shadow: none; - box-shadow: none; -} -.read-mode #post:hover { - -webkit-box-shadow: none; - box-shadow: none; -} -.read-mode > canvas { - display: none !important; -} -.read-mode .highlight-tools, -.read-mode #footer, -.read-mode #post > *:not(#post-info):not(.post-content), -.read-mode #nav, -.read-mode .post-outdate-notice, -.read-mode #web_bg, -.read-mode #rightside, -.read-mode .not-top-img { - display: none !important; -} -.read-mode #article-container a { - color: #99a9bf; -} -.read-mode #article-container pre, -.read-mode #article-container .highlight:not(.js-file-line-container) { - background: var(--highlight-bg) !important; -} -.read-mode #article-container pre *, -.read-mode #article-container .highlight:not(.js-file-line-container) * { - color: var(--font-color) !important; -} -.read-mode #article-container figure.highlight { - border-radius: 0 !important; - -webkit-box-shadow: none !important; - box-shadow: none !important; -} -.read-mode #article-container figure.highlight > :not(.highlight-tools) { - display: block !important; -} -.read-mode #article-container figure.highlight .line:before { - color: var(--font-color) !important; -} -.read-mode #article-container figure.highlight .hljs { - background: var(-highlight-bg) !important; -} -.read-mode #article-container h1, -.read-mode #article-container h2, -.read-mode #article-container h3, -.read-mode #article-container h4, -.read-mode #article-container h5, -.read-mode #article-container h6 { - padding: 0; -} -.read-mode #article-container h1:before, -.read-mode #article-container h2:before, -.read-mode #article-container h3:before, -.read-mode #article-container h4:before, -.read-mode #article-container h5:before, -.read-mode #article-container h6:before { - content: ''; -} -.read-mode #article-container h1:hover, -.read-mode #article-container h2:hover, -.read-mode #article-container h3:hover, -.read-mode #article-container h4:hover, -.read-mode #article-container h5:hover, -.read-mode #article-container h6:hover { - padding: 0; -} -.read-mode #article-container ul:hover:before, -.read-mode #article-container li:hover:before, -.read-mode #article-container ol:hover:before { - -webkit-transform: none !important; - -moz-transform: none !important; - -o-transform: none !important; - -ms-transform: none !important; - transform: none !important; -} -.read-mode #article-container ol:before, -.read-mode #article-container li:before { - background: transparent !important; - color: var(--font-color) !important; -} -.read-mode #article-container ul >li:before { - border-color: var(--gray) !important; -} -.read-mode #article-container .tabs { - border: 2px solid var(--tab-border-color); -} -.read-mode #article-container .tabs > .nav-tabs { - background: transparent; -} -.read-mode #article-container .tabs > .nav-tabs > .tab { - border-bottom: 0; -} -.read-mode #article-container .tabs > .nav-tabs > .tab button { - border-top: none !important; - background: transparent; -} -.read-mode #article-container .tabs > .nav-tabs > .tab button:hover { - background: none !important; -} -.read-mode #article-container .tabs > .nav-tabs > .tab.active button { - text-decoration: underline; -} -.read-mode #article-container .tabs > .tab-contents .tab-item-content.active { - -webkit-animation: none; - -moz-animation: none; - -o-animation: none; - -ms-animation: none; - animation: none; -} -.read-mode #article-container code { - color: var(--font-color); -} -.read-mode #article-container blockquote { - border-color: var(--gray); - background-color: var(--readmode-light-color); -} -.read-mode #article-container kbd { - border: 1px solid var(--gray); - background-color: transparent; - -webkit-box-shadow: none; - box-shadow: none; - color: var(--font-color); -} -.read-mode #article-container .hide-toggle { - border: 1px solid var(--gray) !important; -} -.read-mode #article-container .hide-button, -.read-mode #article-container .btn-beautify, -.read-mode #article-container .hl-label { - border: 1px solid var(--gray) !important; - background: var(--readmode-light-color) !important; - color: var(--font-color) !important; -} -.read-mode #article-container .note { - border: 2px solid var(--gray); - border-left-color: var(--gray) !important; - filter: none; - background-color: var(--readmode-light-color) !important; - color: var(--font-color); -} -.read-mode #article-container .note:before, -.read-mode #article-container .note .note-icon { - color: var(--font-color); -} diff --git a/css/plugins/gitment.css b/css/plugins/gitment.css new file mode 100644 index 0000000..af5547b --- /dev/null +++ b/css/plugins/gitment.css @@ -0,0 +1,1151 @@ +.gitment-container { + font-size: 14px; + line-height: 1.5; + color: #333; + word-wrap: break-word; +} + +.gitment-container * { + box-sizing: border-box; +} + +.gitment-container *:disabled { + cursor: not-allowed; +} + +.gitment-container a, +.gitment-container a:visited { + cursor: pointer; + text-decoration: none; +} + +.gitment-container a:hover { + text-decoration: underline; +} + +.gitment-container .gitment-hidden { + display: none; +} + +.gitment-container .gitment-spinner-icon { + fill: #333; + + -webkit-animation: gitment-spin 1s steps(12) infinite; + animation: gitment-spin 1s steps(12) infinite; +} + +@-webkit-keyframes gitment-spin { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg) + } +} + +@keyframes gitment-spin { + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg) + } +} + +.gitment-root-container { + margin: 19px 0; +} + +.gitment-header-container { + margin: 19px 0; +} + +.gitment-header-like-btn, +.gitment-comment-like-btn { + cursor: pointer; +} + +.gitment-comment-like-btn { + float: right; +} + +.gitment-comment-like-btn.liked { + color: #F44336; +} + +.gitment-header-like-btn svg { + vertical-align: middle; + height: 30px; +} + +.gitment-comment-like-btn svg { + vertical-align: middle; + height: 20px; +} + +.gitment-header-like-btn.liked svg, +.gitment-comment-like-btn.liked svg { + fill: #F44336; +} + +a.gitment-header-issue-link, +a.gitment-header-issue-link:visited { + float: right; + line-height: 30px; + color: #666; +} + +a.gitment-header-issue-link:hover { + color: #666; +} + +.gitment-comments-loading, +.gitment-comments-error, +.gitment-comments-empty { + text-align: center; + margin: 50px 0; +} + +.gitment-comments-list { + list-style: none; + padding-left: 0; + margin: 0 0 38px; +} + +.gitment-comment, +.gitment-editor-container { + position: relative; + min-height: 60px; + padding-left: 60px; + margin: 19px 0; +} + +.gitment-comment-avatar, +.gitment-editor-avatar { + float: left; + margin-left: -60px; +} + +.gitment-comment-avatar, +.gitment-comment-avatar-img, +.gitment-comment-avatar, +.gitment-editor-avatar-img, +.gitment-editor-avatar svg { + width: 44px; + height: 44px; + border-radius: 22px; +} + +.gitment-editor-avatar .gitment-github-icon { + fill: #fff; + background-color: #333; +} + +.gitment-comment-main, +.gitment-editor-main { + position: relative; + border: 1px solid #CFD8DC; + border-radius: 0; +} + +.gitment-editor-main::before, +.gitment-editor-main::after, +.gitment-comment-main::before, +.gitment-comment-main::after { + position: absolute; + top: 11px; + left: -16px; + display: block; + width: 0; + height: 0; + pointer-events: none; + content: ""; + border-color: transparent; + border-style: solid solid outset; +} + +.gitment-editor-main::before, +.gitment-comment-main::before { + border-width: 8px; + border-right-color: #CFD8DC; +} + +.gitment-editor-main::after, +.gitment-comment-main::after { + margin-top: 1px; + margin-left: 2px; + border-width: 7px; + border-right-color: #fff; +} + +.gitment-comment-header { + margin: 12px 15px; + color: #666; + background-color: #fff; + border-radius: 3px; +} + +.gitment-editor-header { + padding: 0; + margin: 0; + border-bottom: 1px solid #CFD8DC; +} + +a.gitment-comment-name, +a.gitment-comment-name:visited { + font-weight: 600; + color: #666; +} + +.gitment-editor-tabs { + margin-bottom: -1px; + margin-left: -1px; +} + +.gitment-editor-tab { + display: inline-block; + padding: 11px 12px; + font-size: 14px; + line-height: 20px; + color: #666; + text-decoration: none; + background-color: transparent; + border-width: 0 1px; + border-style: solid; + border-color: transparent; + border-radius: 0; + + white-space: nowrap; + cursor: pointer; + user-select: none; + + outline: none; +} + +.gitment-editor-tab.gitment-selected { + color: #333; + background-color: #fff; + border-color: #CFD8DC; +} + +.gitment-editor-login { + float: right; + margin-top: -30px; + margin-right: 15px; +} + +a.gitment-footer-project-link, +a.gitment-footer-project-link:visited, +a.gitment-editor-login-link, +a.gitment-editor-login-link:visited { + color: #42b983; +} + +a.gitment-editor-logout-link, +a.gitment-editor-logout-link:visited { + color: #666; +} + +a.gitment-editor-logout-link:hover { + color: #42b983; + text-decoration: none; +} + +.gitment-comment-body { + position: relative; + margin: 12px 15px; + overflow: hidden; + border-radius: 3px; +} + +.gitment-comment-body-folded { + cursor: pointer; +} + +.gitment-comment-body-folded::before { + display: block !important; + content: ""; + position: absolute; + width: 100%; + left: 0; + top: 0; + bottom: 50px; + pointer-events: none; + background: -webkit-linear-gradient(top, rgba(255, 255, 255, 0), rgba(255, 255, 255, .9)); + background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .9)); +} + +.gitment-comment-body-folded::after { + display: block !important; + content: "Click to Expand" !important; + text-align: center; + color: #666; + position: absolute; + width: 100%; + height: 50px; + line-height: 50px; + left: 0; + bottom: 0; + pointer-events: none; + background: rgba(255, 255, 255, .9); +} + +.gitment-editor-body { + margin: 0; +} + +.gitment-comment-body > *:first-child, +.gitment-editor-preview > *:first-child { + margin-top: 0 !important; +} + +.gitment-comment-body > *:last-child, +.gitment-editor-preview > *:last-child { + margin-bottom: 0 !important; +} + +.gitment-editor-body textarea { + display: block; + width: 100%; + min-height: 100px; + max-height: 500px; + padding: 16px; + resize: vertical; + + max-width: 100%; + margin: 0; + font-size: 14px; + line-height: 1.6; + + background-color: #fff; + + color: #333; + vertical-align: middle; + border: none; + border-radius: 0; + outline: none; + box-shadow: none; + + overflow: visible; +} + +.gitment-editor-body textarea:focus { + background-color: #fff; +} + +.gitment-editor-preview { + min-height: 150px; + + padding: 16px; + background-color: transparent; + + width: 100%; + font-size: 14px; + + line-height: 1.5; + word-wrap: break-word; +} + +.gitment-editor-footer { + padding: 0; + margin-top: 10px; +} + +.gitment-editor-footer::after { + display: table; + clear: both; + content: ""; +} + +a.gitment-editor-footer-tip { + display: none; + padding-top: 10px; + font-size: 12px; + color: #666; +} + +a.gitment-editor-footer-tip:hover { + color: #42b983; + text-decoration: none; +} + +.gitment-comments-pagination { + list-style: none; + text-align: right; + border-radius: 0; + margin: -19px 0 19px 0; +} + +.gitment-comments-page-item { + display: inline-block; + cursor: pointer; + border: 1px solid #CFD8DC; + margin-left: -1px; + padding: .25rem .5rem; +} + +.gitment-comments-page-item:hover { + background-color: #f5f5f5; +} + +.gitment-comments-page-item.gitment-selected { + background-color: #f5f5f5; +} + +.gitment-editor-submit, +.gitment-comments-init-btn { + border-radius: 20px; + color: #fff; + background-color: #42b983; + + position: relative; + display: inline-block; + padding: 7px 13px; + font-size: 14px; + font-weight: 600; + line-height: 20px; + white-space: nowrap; + vertical-align: middle; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-size: 110% 110%; + border: none; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + +.gitment-editor-submit:hover, +.gitment-comments-init-btn:hover { + background-color: #42b983; +} + +.gitment-comments-init-btn:disabled, +.gitment-editor-submit:disabled { + color: rgba(255,255,255,0.75); + background-color: #42b983; + box-shadow: none; +} + +.gitment-editor-submit { + float: right; +} + +.gitment-footer-container { + margin-top: 30px; + margin-bottom: 20px; + text-align: right; + font-size: 12px; +} + +/* + * Markdown CSS + * Copied from https://github.com/sindresorhus/github-markdown-css + */ +.gitment-markdown { + -ms-text-size-adjust: 100%; + -webkit-text-size-adjust: 100%; + line-height: 1.5; + color: #333; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; + font-size: 16px; + line-height: 1.5; + word-wrap: break-word; +} + +.gitment-markdown .pl-c { + color: #969896; +} + +.gitment-markdown .pl-c1, +.gitment-markdown .pl-s .pl-v { + color: #0086b3; +} + +.gitment-markdown .pl-e, +.gitment-markdown .pl-en { + color: #795da3; +} + +.gitment-markdown .pl-smi, +.gitment-markdown .pl-s .pl-s1 { + color: #333; +} + +.gitment-markdown .pl-ent { + color: #63a35c; +} + +.gitment-markdown .pl-k { + color: #a71d5d; +} + +.gitment-markdown .pl-s, +.gitment-markdown .pl-pds, +.gitment-markdown .pl-s .pl-pse .pl-s1, +.gitment-markdown .pl-sr, +.gitment-markdown .pl-sr .pl-cce, +.gitment-markdown .pl-sr .pl-sre, +.gitment-markdown .pl-sr .pl-sra { + color: #183691; +} + +.gitment-markdown .pl-v, +.gitment-markdown .pl-smw { + color: #ed6a43; +} + +.gitment-markdown .pl-bu { + color: #b52a1d; +} + +.gitment-markdown .pl-ii { + color: #f8f8f8; + background-color: #b52a1d; +} + +.gitment-markdown .pl-c2 { + color: #f8f8f8; + background-color: #b52a1d; +} + +.gitment-markdown .pl-c2::before { + content: "^M"; +} + +.gitment-markdown .pl-sr .pl-cce { + font-weight: bold; + color: #63a35c; +} + +.gitment-markdown .pl-ml { + color: #693a17; +} + +.gitment-markdown .pl-mh, +.gitment-markdown .pl-mh .pl-en, +.gitment-markdown .pl-ms { + font-weight: bold; + color: #1d3e81; +} + +.gitment-markdown .pl-mq { + color: #008080; +} + +.gitment-markdown .pl-mi { + font-style: italic; + color: #333; +} + +.gitment-markdown .pl-mb { + font-weight: bold; + color: #333; +} + +.gitment-markdown .pl-md { + color: #bd2c00; + background-color: #ffecec; +} + +.gitment-markdown .pl-mi1 { + color: #55a532; + background-color: #eaffea; +} + +.gitment-markdown .pl-mc { + color: #ef9700; + background-color: #ffe3b4; +} + +.gitment-markdown .pl-mi2 { + color: #d8d8d8; + background-color: #808080; +} + +.gitment-markdown .pl-mdr { + font-weight: bold; + color: #795da3; +} + +.gitment-markdown .pl-mo { + color: #1d3e81; +} + +.gitment-markdown .pl-ba { + color: #595e62; +} + +.gitment-markdown .pl-sg { + color: #c0c0c0; +} + +.gitment-markdown .pl-corl { + text-decoration: underline; + color: #183691; +} + +.gitment-markdown .octicon { + display: inline-block; + vertical-align: text-top; + fill: currentColor; +} + +.gitment-markdown a { + background-color: transparent; + -webkit-text-decoration-skip: objects; +} + +.gitment-markdown a:active, +.gitment-markdown a:hover { + outline-width: 0; +} + +.gitment-markdown strong { + font-weight: inherit; +} + +.gitment-markdown strong { + font-weight: bolder; +} + +.gitment-markdown h1 { + font-size: 2em; + margin: 0.67em 0; +} + +.gitment-markdown img { + border-style: none; +} + +.gitment-markdown svg:not(:root) { + overflow: hidden; +} + +.gitment-markdown code, +.gitment-markdown kbd, +.gitment-markdown pre { + font-family: monospace, monospace; + font-size: 1em; +} + +.gitment-markdown hr { + box-sizing: content-box; + height: 0; + overflow: visible; +} + +.gitment-markdown input { + font: inherit; + margin: 0; +} + +.gitment-markdown input { + overflow: visible; +} + +.gitment-markdown [type="checkbox"] { + box-sizing: border-box; + padding: 0; +} + +.gitment-markdown * { + box-sizing: border-box; +} + +.gitment-markdown input { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} + +.gitment-markdown a { + color: #0366d6; + text-decoration: none; +} + +.gitment-markdown a:hover { + text-decoration: underline; +} + +.gitment-markdown strong { + font-weight: 600; +} + +.gitment-markdown hr { + height: 0; + margin: 15px 0; + overflow: hidden; + background: transparent; + border: 0; + border-bottom: 1px solid #dfe2e5; +} + +.gitment-markdown hr::before { + display: table; + content: ""; +} + +.gitment-markdown hr::after { + display: table; + clear: both; + content: ""; +} + +.gitment-markdown table { + border-spacing: 0; + border-collapse: collapse; +} + +.gitment-markdown td, +.gitment-markdown th { + padding: 0; +} + +.gitment-markdown h1, +.gitment-markdown h2, +.gitment-markdown h3, +.gitment-markdown h4, +.gitment-markdown h5, +.gitment-markdown h6 { + margin-top: 0; + margin-bottom: 0; +} + +.gitment-markdown h1 { + font-size: 32px; + font-weight: 600; +} + +.gitment-markdown h2 { + font-size: 24px; + font-weight: 600; +} + +.gitment-markdown h3 { + font-size: 20px; + font-weight: 600; +} + +.gitment-markdown h4 { + font-size: 16px; + font-weight: 600; +} + +.gitment-markdown h5 { + font-size: 14px; + font-weight: 600; +} + +.gitment-markdown h6 { + font-size: 12px; + font-weight: 600; +} + +.gitment-markdown p { + margin-top: 0; + margin-bottom: 10px; +} + +.gitment-markdown blockquote { + margin: 0; +} + +.gitment-markdown ul, +.gitment-markdown ol { + padding-left: 0; + margin-top: 0; + margin-bottom: 0; +} + +.gitment-markdown ol ol, +.gitment-markdown ul ol { + list-style-type: lower-roman; +} + +.gitment-markdown ul ul ol, +.gitment-markdown ul ol ol, +.gitment-markdown ol ul ol, +.gitment-markdown ol ol ol { + list-style-type: lower-alpha; +} + +.gitment-markdown dd { + margin-left: 0; +} + +.gitment-markdown code { + font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; + font-size: 12px; +} + +.gitment-markdown pre { + margin-top: 0; + margin-bottom: 0; + font: 12px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; +} + +.gitment-markdown .octicon { + vertical-align: text-bottom; +} + +.gitment-markdown .pl-0 { + padding-left: 0 !important; +} + +.gitment-markdown .pl-1 { + padding-left: 4px !important; +} + +.gitment-markdown .pl-2 { + padding-left: 8px !important; +} + +.gitment-markdown .pl-3 { + padding-left: 16px !important; +} + +.gitment-markdown .pl-4 { + padding-left: 24px !important; +} + +.gitment-markdown .pl-5 { + padding-left: 32px !important; +} + +.gitment-markdown .pl-6 { + padding-left: 40px !important; +} + +.gitment-markdown::before { + display: table; + content: ""; +} + +.gitment-markdown::after { + display: table; + clear: both; + content: ""; +} + +.gitment-markdown>*:first-child { + margin-top: 0 !important; +} + +.gitment-markdown>*:last-child { + margin-bottom: 0 !important; +} + +.gitment-markdown a:not([href]) { + color: inherit; + text-decoration: none; +} + +.gitment-markdown .anchor { + float: left; + padding-right: 4px; + margin-left: -20px; + line-height: 1; +} + +.gitment-markdown .anchor:focus { + outline: none; +} + +.gitment-markdown p, +.gitment-markdown blockquote, +.gitment-markdown ul, +.gitment-markdown ol, +.gitment-markdown dl, +.gitment-markdown table, +.gitment-markdown pre { + margin-top: 0; + margin-bottom: 16px; +} + +.gitment-markdown hr { + height: 0.25em; + padding: 0; + margin: 24px 0; + background-color: #e1e4e8; + border: 0; +} + +.gitment-markdown blockquote { + padding: 0 1em; + color: #6a737d; + border-left: 0.25em solid #dfe2e5; +} + +.gitment-markdown blockquote>:first-child { + margin-top: 0; +} + +.gitment-markdown blockquote>:last-child { + margin-bottom: 0; +} + +.gitment-markdown kbd { + display: inline-block; + padding: 3px 5px; + font-size: 11px; + line-height: 10px; + color: #444d56; + vertical-align: middle; + background-color: #fafbfc; + border: solid 1px #c6cbd1; + border-bottom-color: #959da5; + border-radius: 0; + box-shadow: inset 0 -1px 0 #959da5; +} + +.gitment-markdown h1, +.gitment-markdown h2, +.gitment-markdown h3, +.gitment-markdown h4, +.gitment-markdown h5, +.gitment-markdown h6 { + margin-top: 24px; + margin-bottom: 16px; + font-weight: 600; + line-height: 1.25; +} + +.gitment-markdown h1 .octicon-link, +.gitment-markdown h2 .octicon-link, +.gitment-markdown h3 .octicon-link, +.gitment-markdown h4 .octicon-link, +.gitment-markdown h5 .octicon-link, +.gitment-markdown h6 .octicon-link { + color: #1b1f23; + vertical-align: middle; + visibility: hidden; +} + +.gitment-markdown h1:hover .anchor, +.gitment-markdown h2:hover .anchor, +.gitment-markdown h3:hover .anchor, +.gitment-markdown h4:hover .anchor, +.gitment-markdown h5:hover .anchor, +.gitment-markdown h6:hover .anchor { + text-decoration: none; +} + +.gitment-markdown h1:hover .anchor .octicon-link, +.gitment-markdown h2:hover .anchor .octicon-link, +.gitment-markdown h3:hover .anchor .octicon-link, +.gitment-markdown h4:hover .anchor .octicon-link, +.gitment-markdown h5:hover .anchor .octicon-link, +.gitment-markdown h6:hover .anchor .octicon-link { + visibility: visible; +} + +.gitment-markdown h1 { + padding-bottom: 0.3em; + font-size: 2em; + border-bottom: 1px solid #eaecef; +} + +.gitment-markdown h2 { + padding-bottom: 0.3em; + font-size: 1.5em; + border-bottom: 1px solid #eaecef; +} + +.gitment-markdown h3 { + font-size: 1.25em; +} + +.gitment-markdown h4 { + font-size: 1em; +} + +.gitment-markdown h5 { + font-size: 0.875em; +} + +.gitment-markdown h6 { + font-size: 0.85em; + color: #6a737d; +} + +.gitment-markdown ul, +.gitment-markdown ol { + padding-left: 2em; +} + +.gitment-markdown ul ul, +.gitment-markdown ul ol, +.gitment-markdown ol ol, +.gitment-markdown ol ul { + margin-top: 0; + margin-bottom: 0; +} + +.gitment-markdown li>p { + margin-top: 16px; +} + +.gitment-markdown li+li { + margin-top: 0.25em; +} + +.gitment-markdown dl { + padding: 0; +} + +.gitment-markdown dl dt { + padding: 0; + margin-top: 16px; + font-size: 1em; + font-style: italic; + font-weight: 600; +} + +.gitment-markdown dl dd { + padding: 0 16px; + margin-bottom: 16px; +} + +.gitment-markdown table { + display: block; + width: 100%; + overflow: auto; +} + +.gitment-markdown table th { + font-weight: 600; +} + +.gitment-markdown table th, +.gitment-markdown table td { + padding: 6px 13px; + border: 1px solid #dfe2e5; +} + +.gitment-markdown table tr { + background-color: #fff; + border-top: 1px solid #c6cbd1; +} + +.gitment-markdown table tr:nth-child(2n) { + background-color: #f5f5f5; +} + +.gitment-markdown img { + max-width: 100%; + box-sizing: content-box; + background-color: #fff; +} + +.gitment-markdown code { + padding: 0; + padding-top: 0.2em; + padding-bottom: 0.2em; + margin: 0; + font-size: 85%; + background-color: rgba(27,31,35,0.05); + border-radius: 0; +} + +.gitment-markdown code::before, +.gitment-markdown code::after { + letter-spacing: -0.2em; + content: "\00a0"; +} + +.gitment-markdown pre { + word-wrap: normal; +} + +.gitment-markdown pre>code { + padding: 0; + margin: 0; + font-size: 100%; + word-break: normal; + white-space: pre; + background: transparent; + border: 0; +} + +.gitment-markdown .highlight { + margin-bottom: 16px; +} + +.gitment-markdown .highlight pre { + margin-bottom: 0; + word-break: normal; +} + +.gitment-markdown .highlight pre, +.gitment-markdown pre { + padding: 16px; + overflow: auto; + font-size: 85%; + line-height: 1.45; + background-color: #f5f5f5; + border-radius: 0; +} + +.gitment-markdown pre code { + display: inline; + max-width: auto; + padding: 0; + margin: 0; + overflow: visible; + line-height: inherit; + word-wrap: normal; + background-color: transparent; + border: 0; +} + +.gitment-markdown pre code::before, +.gitment-markdown pre code::after { + content: normal; +} + +.gitment-markdown .full-commit .btn-outline:not(:disabled):hover { + color: #42b983; + border-color: #42b983; +} + +.gitment-markdown kbd { + display: inline-block; + padding: 3px 5px; + font: 11px "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace; + line-height: 10px; + color: #444d56; + vertical-align: middle; + background-color: #fcfcfc; + border: solid 1px #c6cbd1; + border-bottom-color: #959da5; + border-radius: 0; + box-shadow: inset 0 -1px 0 #959da5; +} + +.gitment-markdown :checked+.radio-label { + position: relative; + z-index: 1; + border-color: #42b983; +} + +.gitment-markdown .task-list-item { + list-style-type: none; +} + +.gitment-markdown .task-list-item+.task-list-item { + margin-top: 3px; +} + +.gitment-markdown .task-list-item input { + margin: 0 0.2em 0.25em -1.6em; + vertical-align: middle; +} + +.gitment-markdown hr { + border-bottom-color: #eee; +} +@media screen and (max-width: 420px) { + .gitment-editor-tab:last-child { + display: none; + } +} diff --git a/css/style.css b/css/style.css new file mode 100644 index 0000000..1f02a90 --- /dev/null +++ b/css/style.css @@ -0,0 +1,1207 @@ +@font-face { + font-family: 'Source Sans Pro'; + src: url("../fonts/SourceSansPro.ttf"); +} +::selection { + background: #42b983; + color: #fff; +} +body { + font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + -webkit-text-size-adjust: none; + position: relative; + height: 100%; + margin: 0; + color: #34495e; + font-size: 16px; +} +@media screen and (max-width: 480px) { + body { + font-size: 15px; + } +} +ol, +ul, +form, +p { + margin: 0; +} +a { + text-decoration: none; + color: #42b983; + cursor: pointer; +} +p { + word-spacing: 0.05em; +} +pre { + overflow-x: auto; +} +.flex-box { + display: flex; + display: -ms-flexbox; + display: -webkit-box; + display: -webkit-flex; + transform: unset !important; +} +.wechat-share { + width: 0; + height: 0; + overflow: hidden; +} +.wechat-share img { + width: 400px; + height: 400px; +} +.app-body { + padding: 2em 1em; + margin: 0 auto; + height: 100%; + max-width: 980px; + position: relative; + opacity: 0; + transform: translateY(-20px); + transition: all 0.4s; +} +.hljs { + background: none !important; +} +.tags { + margin: 15px 0; +} +.tags span:first-child { + margin-right: 10px; + font-weight: 600; +} +.tag-code { + font-family: 'Roboto Mono', Monaco, courier, monospace; + font-size: 0.8em; + display: inline-block; + background-color: #f8f8f8; + color: #e96900; + padding: 3px 5px; + margin: 0 2px 5px 0; + border-radius: 2px; + white-space: nowrap; +} +.article-card { + padding-bottom: 20px; +} +.article-card:first-child { + margin-top: 60px; +} +h2.article-head { + font-size: 1.6em; + margin-bottom: 0; +} +.article-head > a { + color: #34495e; +} +.article-head > a:hover { + border-bottom: 2px solid #42b983; +} +.article-date { + color: #7f8c8d; + margin: 10px 0; + font-size: 0.9em; +} +.article-summary { + margin: 10px 0; + color: #34495e; +} +.more { + font-weight: 600; + display: inline-block; + transition: all 0.3s; +} +.more:hover { + transform: translateX(10px); +} +#article-banner { + width: 100%; + box-sizing: border-box; + top: 0; + left: 0; + padding: 100px 20px 25px 20px; + text-align: center; + position: relative; + background-repeat: no-repeat; + background-position: center; + background-size: cover; +} +@media screen and (max-width: 480px) { + #article-banner { + padding: 80px 10px 25px 10px; + } +} +#article-banner h2 { + margin: 0.4em 0; + font-size: 2.2em; + color: #fff; + text-shadow: 0 0 40px #34495e; + opacity: 0; + transform: translateY(-20px); + transition: all 0.4s; +} +@media screen and (max-width: 480px) { + #article-banner h2 { + font-size: 2em; + } +} +#article-banner .post-date { + margin: 10px 0 20px 0; + color: #fff; + opacity: 0; + transform: translateY(-20px); + transition: all 0.4s; + transition-delay: 0.05s; +} +#article-banner .arrow-down { + display: flex; + width: 100%; + justify-content: center; + opacity: 0; + transform: translateY(-20px); + transition: all 0.4s; + transition-delay: 0.1s; +} +#article-banner .arrow-down a { + z-index: 4; + display: block; + width: 25px; + height: 25px; + -webkit-transform: rotate(315deg); + transform: rotate(315deg); + -webkit-animation-name: shine; + -webkit-animation-duration: 1.5s; + -webkit-animation-iteration-count: infinite; + animation-iteration-count: infinite; + border-bottom: 1px solid #fff; + border-left: 1px solid #fff; +} +.post-article { + margin-top: 0; + width: 100%; + display: inline-grid; +} +.money-like { + padding: 2em 0 3em; +} +.money-like .reward-btn { + cursor: pointer; + font-size: 1.6em; + line-height: 2em; + position: relative; + display: block; + width: 2em; + height: 2em; + margin: 0 auto; + padding: 0; + text-align: center; + vertical-align: middle; + color: #fff; + border: 1px solid #f1b60e; + border-radius: 50%; + background: linear-gradient(to bottom, #fccd60 0, #fbae12 100%, #2989d8 100%, #207cca 100%); +} +.money-like .money-code { + position: absolute; + top: -7em; + left: 50%; + display: none; + width: 10.5em; + height: 5.5em; + margin-left: -5.9em; + padding: 10px 15px; + background: #fff; + box-shadow: 0 0 0 1px #e5e5e5; + border-radius: 4px; +} +.money-like .money-code span { + display: inline-block; + width: 4.5em; + height: 4.5em; +} +.money-like .money-code .alipay-code { + float: left; +} +.money-like .money-code .alipay-code .code-image { + background-image: url("images/alipay.jpg"); + background-size: contain; + background-repeat: no-repeat; + width: 4.5em; + height: 4.5em; +} +.money-like .money-code .wechat-code { + float: right; +} +.money-like .money-code .wechat-code .code-image { + background-image: url("images/wechat.jpg"); + background-size: contain; + background-repeat: no-repeat; + width: 4.5em; + height: 4.5em; +} +.money-like .money-code b { + font-size: 0.5em; + line-height: 24px; + display: block; + margin: 0; + text-align: center; + color: #34495e; +} +.notice { + font-size: 12px; + display: block; + margin-top: 10px; + text-align: center; + color: #7f8c8d; + font-style: italic; +} +.qrcode { + padding-bottom: 30px; + text-align: center; + border-bottom: 1px dashed #e5e5e5; +} +.qrcode canvas { + width: 8em; + height: 8em; + padding: 5px; + box-shadow: 0 0 1px #e3e3e3; +} +#uyan_frame { + margin-top: 20px; +} +.image-view-wrap { + position: fixed; + top: 0; + left: 0; + bottom: 0; + right: 0; + z-index: 1000; + transition: all 0.3s ease-in-out; +} +.image-view-wrap .image-view-inner { + position: relative; +} +.image-view-wrap img { + display: block; + margin: 0 auto; + cursor: zoom-out; + transition: all 0.3s ease-in-out; +} +.wrap-active { + background-color: rgba(255,255,255,0.9); +} +.scroll-top { + cursor: pointer; + opacity: 0; + position: fixed; + box-sizing: border-box; + right: 2em; + bottom: 45px; + width: 40px; + height: 40px; + padding: 5px; + background-color: #42b983; + border-radius: 20px; + transform: translate(80px, 0); + transition: all 0.3s ease; + box-shadow: 0 0 3px 0 rgba(0,0,0,0.12), 0 3px 3px 0 rgba(0,0,0,0.24); +} +.scroll-top .arrow-icon { + background-image: url("images/top.png"); + width: 30px; + height: 30px; + display: block; + background-size: contain; +} +.opacity { + opacity: 1; + transform: translate(0, 0); +} +.header { + background: none; + border: none; + position: absolute; + top: 0; + left: 0; + width: 100%; + z-index: 200; + transition: background 0.5s; +} +.fixed-header { + position: fixed; + background-color: rgba(255,255,255,0.98); + box-shadow: 0 0 3px rgba(14,14,14,0.26); +} +.fixed-header .home-link { + color: #42b983; +} +.fixed-header .menu .icon-bar { + background-color: #7f8c8d; +} +.fixed-header .item-link { + color: #34495e; +} +.header-container { + max-width: 1200px; + height: 40px; + margin: 0 auto; + padding: 10px 40px; + position: relative; +} +@media screen and (max-width: 480px) { + .header-container { + padding: 6px 20px; + position: relative; + } +} +.logo { + background: url("images/logo.png"); + background-size: contain; + width: 40px; + height: 40px; + margin-right: 10px; +} +.home-link { + display: flex; + align-items: center; + float: left; + font-weight: 500; + color: #fff; + font-size: 1.5em; + line-height: 40px; +} +.right-list { + list-style: none; + float: right; + padding: 0; +} +@media screen and (max-width: 480px) { + .right-list { + display: none; + } +} +.list-item { + display: inline-block; + margin: 0 8px; +} +.item-link { + height: 40px; + line-height: 40px; + text-decoration: none; + color: #fff; + padding-bottom: 3px; +} +.item-link:hover { + border-bottom: 3px solid #42b983; +} +.active { + border-bottom: 3px solid #42b983; +} +.menu { + display: none; + float: right; + width: 24px; + height: 24px; + margin-top: 10px; +} +.menu .icon-bar { + display: block; + width: 24px; + height: 2px; + border-radius: 1px; + margin-top: 4px; + background-color: #fff; +} +@media screen and (max-width: 480px) { + .menu { + display: block; + } +} +.menu-mask { + display: none; + position: fixed; + left: 0; + top: 52px; + z-index: 99; + width: 100%; + overflow: hidden; + max-height: 0; + background: rgba(255,255,255,0.98); + -webkit-transition: max-height 0.2s ease; + transition: max-height 0.2s ease; +} +@media screen and (max-width: 480px) { + .menu-mask { + display: block; + } +} +.open { + max-height: 300px; + transition-delay: 0.1s; +} +.menu-list { + padding: 0; +} +.menu-item { + position: relative; + list-style: none; + text-align: center; + padding: 10px 0; +} +.menu-item:after { + content: ''; + position: absolute; + left: 0; + bottom: 0; + width: 100%; + -webkit-transform: scaleY(0.5); + transform: scaleY(0.5); +} +.menu-link { + text-decoration: none; + color: #7f8c8d; +} +.mobile-active { + color: #42b983; +} +.app-footer { + padding: 1em 0; + margin: 0 auto; + max-width: 960px; + border-top: 1px solid #e5e5e5; + background-color: #fff; + text-align: center; + font-size: 0.9em; +} +.copyright { + color: #7f8c8d; + line-height: 1.5; +} +.guide-pager { + margin: 1em 3em; + display: flex; + justify-content: space-between; + font-size: 15px; + font-weight: 600; +} +.page-arrow { + color: #34495e; +} +.unvisible { + visibility: hidden; +} +.markdown-content, +.article-summary { + overflow-y: auto; + overflow-x: auto; +} +.markdown-content pre, +.article-summary pre, +.markdown-content code, +.article-summary code { + font-family: 'Roboto Mono', Monaco, courier, monospace; + font-size: 15px; +} +@media screen and (max-width: 480px) { + .markdown-content pre, + .article-summary pre, + .markdown-content code, + .article-summary code { + font-size: 14px; + } +} +.markdown-content pre .line, +.article-summary pre .line, +.markdown-content code .line, +.article-summary code .line { + min-height: 13px; + margin: 2px 0; +} +.markdown-content p, +.article-summary p { + line-height: 1.6em; + padding: 8px 0px; +} +.markdown-content p code, +.article-summary p code { + background-color: #f8f8f8; + color: #e96900; + padding: 3px 5px; + margin: 0 2px; + border-radius: 2px; + white-space: nowrap; +} +.markdown-content h1, +.article-summary h1 { + font-size: 1.8em; +} +.markdown-content h2, +.article-summary h2 { + font-size: 1.5em; +} +.markdown-content h3, +.article-summary h3 { + margin: 1em 0; + font-size: 1.3em; + padding-bottom: 0.3em; + border-bottom: 1px solid #e5e5e5; +} +.markdown-content h4, +.article-summary h4 { + margin: 1em 0; + font-size: 1.2em; +} +.markdown-content h4:before, +.article-summary h4:before { + content: "#"; + color: #42b983; + margin-right: 5px; + font-size: 1.2em; + font-weight: 700; +} +.markdown-content h5, +.article-summary h5 { + font-size: 1em; + margin: 0.8em 0; +} +.markdown-content blockquote, +.article-summary blockquote { + margin: 1em 0; + padding: 10px 20px; + border-left: 4px solid #42b983; + background: #f8f8f8; + border-bottom-right-radius: 2px; + border-top-right-radius: 2px; +} +.markdown-content ul, +.article-summary ul, +.markdown-content ol, +.article-summary ol { + overflow: auto; + margin: 5px 0; +} +.markdown-content ul li, +.article-summary ul li, +.markdown-content ol li, +.article-summary ol li { + padding: 5px 0; +} +.markdown-content img, +.article-summary img { + max-width: 100%; + display: block; + margin: 20px auto; + cursor: zoom-in; +} +.markdown-content figure, +.article-summary figure { + background: #f8f8f8; + padding: 0 10px; + border-radius: 2px; + margin: 20px 0; + overflow: auto; + position: relative; +} +.markdown-content figure:after, +.article-summary figure:after { + content: attr(data-lang); + position: absolute; + top: 0; + right: 0; + color: #ccc; + text-align: right; + font-size: 0.7em; + padding: 5px 10px 0; + line-height: 15px; + height: 15px; + font-weight: 500; +} +.markdown-content > table, +.article-summary > table { + width: 100%; +} +.markdown-content > table thead, +.article-summary > table thead { + background-color: #42b983; + border-top-width: 1px; + border-top-style: solid; + border-top-color: #e5e5e5; +} +.markdown-content > table thead th, +.article-summary > table thead th { + padding: 5px 10px; + color: #fff; +} +.markdown-content > table tbody tr:nth-child(even), +.article-summary > table tbody tr:nth-child(even) { + background: #e6eed6; +} +.markdown-content > table tbody tr:nth-child(odd), +.article-summary > table tbody tr:nth-child(odd) { + background: #fff; +} +.markdown-content > table tbody tr td, +.article-summary > table tbody tr td { + padding: 5px 10px; +} +.markdown-content hr, +.article-summary hr { + border: none; + border-bottom: 1px dashed #e5e5e5; + margin: 30px 0; +} +#tag-cloud { + margin: 30px 0; + text-align: center; +} +#tag-cloud a { + border: none; + line-height: 28px; + margin: 0 4px; + margin-bottom: 8px; + background: #63a35c; + display: inline-block; + border-radius: 4px; + padding: 0 10px; + color: #fff; + transition: background 0.5s; +} +#tag-cloud a:hover { + background: #0085a1; +} +#tag-cloud .tag0 { + background: #bbe; +} +#tag-cloud .tag1 { + background: #9cb2e1; +} +#tag-cloud .tag2 { + background-color: rgba(0,133,161,0.8); +} +.tag-list { + margin-left: 1em; + margin-right: 1em; +} +.tag-name { + font-size: 1.4em; + position: relative; +} +.tag-name:before { + content: "#"; + color: #42b983; + position: absolute; + left: -0.7em; + top: -2px; + font-size: 1.2em; + font-weight: 700; +} +.tag-preview { + font-size: 1.1em; + padding-left: 1em; +} +.tag-preview li { + cursor: pointer; + margin: 10px 0; +} +#category-cloud { + margin: 30px 0; + text-align: center; +} +#category-cloud a { + border: none; + line-height: 28px; + margin: 0 4px; + margin-bottom: 8px; + background: #63a35c; + display: inline-block; + border-radius: 4px; + padding: 0 10px; + color: #fff; + transition: background 0.5s; +} +#category-cloud a:hover { + background: #0085a1; +} +#category-cloud .category0 { + background: #bbe; +} +#category-cloud .category1 { + background: #9cb2e1; +} +#category-cloud .category2 { + background-color: rgba(0,133,161,0.8); +} +.category-list { + margin-left: 1em; + margin-right: 1em; +} +.category-name { + font-size: 1.4em; + position: relative; +} +.category-name:before { + content: "#"; + color: #42b983; + position: absolute; + left: -0.7em; + top: -2px; + font-size: 1.2em; + font-weight: 700; +} +.category-preview { + font-size: 1.1em; + padding-left: 1em; +} +.category-preview li { + cursor: pointer; + margin: 10px 0; +} +#archives:before { + position: absolute; + top: 2em; + bottom: 1em; + left: 30px; + height: auto; + content: ''; + background-color: #42b983; + width: 4px; +} +.time-section { + padding-left: 30px; + position: relative; +} +.time-section .section-year { + cursor: pointer; + font-size: 1.8em; + margin-left: 10px; +} +.time-section .section-year:before { + position: absolute; + left: 8px; + top: 11px; + content: ''; + background-color: #fff; + width: 12px; + height: 12px; + border: 2px solid #42b983; + border-radius: 50%; +} +.time-section .section-list .section-list-item { + margin: 20px 0 20px 10px; + position: relative; +} +.time-section .section-list .section-list-item:before { + position: absolute; + left: -29px; + top: 7px; + content: ''; + background-color: #42b983; + width: 10px; + height: 10px; + border-radius: 50%; +} +.time-section .section-list .section-list-item .archive-title { + color: #34495e; + transition: all 0.3s ease; + font-size: 1.1em; +} +.time-section .section-list .section-list-item .archive-title:hover { + color: #42b983; + padding-left: 10px; +} +.time-section .section-list .section-list-item .archive-date { + color: #7f8c8d; + font-size: 0.9em; + margin: 5px 0; +} +#about-banner { + width: 100%; + position: relative; + background-repeat: no-repeat; + background-position: center; + background-size: cover; + height: 350px; +} +#about-banner:after { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + content: ''; + background: url("images/escheres.png"); + background-color: rgba(0,0,0,0.05); +} +@media screen and (max-width: 480px) { + #about-banner { + height: 250px; + } +} +.author { + margin-top: -50px; + width: 100%; + background: #f8f8f8; + text-align: center; + padding: 0 1em 30px 1em; + box-sizing: border-box; +} +.author .head { + width: 100px; + height: 100px; + border-radius: 50%; + padding: 3px; + background: #fff; + box-shadow: 0 0 5px #95a5a6; + position: relative; + margin: 0 auto; + opacity: 0; + transform: translateY(-20px); + transition: all 0.4s; +} +.author .head img { + width: 100%; + height: 100%; + display: block; + border-radius: 50%; +} +.author h3 { + font-size: 1.4em; + opacity: 0; + transform: translateY(-20px); + transition: all 0.4s; + transition-delay: 0.05s; +} +.author .description { + opacity: 0; + transform: translateY(-20px); + transition: all 0.4s; + transition-delay: 0.1s; +} +.author .share-icons { + opacity: 0; + transform: translateY(-20px); + transition: all 0.4s; + transition-delay: 0.15s; + margin-top: 2em; +} +.author .share-icons a { + font-size: 1em; + display: inline-block; + margin: 0 0.4em; +} +.author .share-icons a:hover { + transition: opacity 0.2s; + opacity: 0.6; +} +.author .share-icons .icon-weibo { + color: #e6162d; +} +.author .share-icons .icon-github { + color: #333; +} +.author .share-icons .icon-linkedin { + color: #0077b5; +} +.author .share-icons .icon-zhihu { + color: #0767c8; +} +.author .share-icons .icon-twitter { + color: #2aa9e0; +} +.author .share-icons .icon-douban { + color: #00b51d; +} +.project-app { + max-width: 1020px; + min-width: 300px; + padding: 1em 0; +} +.card-container { + margin: 30px auto; + display: -webkit-flex; + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} +@media screen and (max-width: 960px) { + .card-container { + width: 660px; + } +} +@media screen and (max-width: 660px) { + .card-container { + width: 320px; + } +} +.card-container .project-card { + width: 320px; + height: 160px; + margin-bottom: 20px; + position: relative; +} +.card-container .project-card .card-wrap { + box-sizing: border-box; + height: 100%; + display: block; + padding: 20px; + border: 1px solid #e5e5e5; + border-radius: 4px; + color: #34495e; + transition: border-color 0.1s ease-in-out, box-shadow 0.1s ease-in-out; +} +.card-container .project-card .card-wrap:hover { + border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.15); + box-shadow: 0 1px 3px rgba(0,0,0,0.05), 0 4px 12px rgba(0,0,0,0.1); +} +.card-container .project-card .card-wrap .card-header { + position: absolute; + width: 100%; + height: 20px; + top: 0; + left: 0; + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} +.card-container .project-card .card-wrap .card-title { + margin-top: 10px; + margin-bottom: 5px; + font-size: 1.2em; +} +.card-container .project-card .card-wrap .card-footer { + box-sizing: border-box; + position: absolute; + width: 100%; + padding: 0 20px; + bottom: 20px; + left: 0; +} +.card-container .project-card .card-wrap .card-footer span:first-child { + padding-right: 20px; +} +.card-container .project-card .card-wrap .card-footer span .fa { + padding-right: 5px; +} +.catalog-container { + display: block; + margin-left: 30px; + flex-basis: 280px; + -webkit-flex-basis: 280px; + flex-shrink: 0; + -webkit-flex-shrink: 0; +} +@media screen and (max-width: 960px) { + .catalog-container { + display: none; + } +} +.catalog-container .fixed-toc { + position: fixed; + top: 90px; +} +.catalog-container .toc-main { + padding-left: 30px; + border-left: 1px solid #e5e5e5; + width: 280px; + box-sizing: border-box; +} +.catalog-container .toc-main .toc-title { + font-size: 1.2em; + position: relative; + padding-left: 28px; +} +.catalog-container .toc-main .toc-title:before { + content: ''; + position: absolute; + width: 22px; + height: 22px; + left: 0; + top: 2px; + background: url("images/catalog.png") no-repeat; + background-size: contain; +} +.catalog-container .toc-main .toc-nav { + padding: 0; + margin-top: 1em; + overflow-y: scroll; + max-height: 480px; +} +.catalog-container .toc-main .toc-nav::-webkit-scrollbar { + display: none; +} +.catalog-container .toc-main ol { + padding-left: 20px; +} +.catalog-container .toc-main li { + list-style-type: none; + line-height: 1.5; +} +.nav-container { + width: 100%; + padding-top: 1.5em; + margin-top: 1.5em; + border-top: 1px dashed #e5e5e5; + font-weight: 600; +} +.nav-container:after, +.nav-container:before { + content: ''; + display: table; + clear: both; +} +.nav-container .nav-left { + float: left; +} +.nav-container .nav-right { + float: right; +} +.nav-container .nav-arrow { + color: #34495e; +} +.search-pop-overlay { + background: rgba(0,0,0,0); + height: 100%; + left: 0; + position: fixed; + top: 0; + transition: visibility 0s linear 0.2s, background 0.2s; + visibility: hidden; + width: 100%; + z-index: 1400; +} +.search-pop-overlay.search-active { + background: rgba(0,0,0,0.3); + transition: background 0.2s; + visibility: visible; +} +.search-popup { + background: #f5f5f5; + border-radius: 5px; + height: 80%; + left: calc(50% - 350px); + position: fixed; + top: 10%; + transform: scale(0); + transition: transform 0.2s; + width: 700px; + z-index: 1500; +mobile() +} +.search-active .search-popup { + transform: scale(1); +} +.search-popup .search-icon, +.search-popup .popup-btn-close { + color: #999; + font-size: 18px; + padding: 0 10px; +} +.search-popup .popup-btn-close { + cursor: pointer; +} +.search-popup .popup-btn-close:hover .fa { + color: #222; +} +.search-popup .search-header { + background: #eee; + border-top-left-radius: 5px; + border-top-right-radius: 5px; + display: flex; + padding: 5px; +} +.search-popup input.search-input { + background: transparent; + border: 0; + outline: 0; + width: 100%; +} +.search-popup input.search-input::-webkit-search-cancel-button { + display: none; +} +.search-popup .search-input-container { + flex-grow: 1; + padding: 2px; +} +.search-popup ul.search-result-list { + margin: 0 5px; + padding: 0; + width: 100%; +} +.search-popup li.search-result-element { + padding: 10px 0px 10px 0px; +} +.search-popup p.search-result { + border-bottom: 1px; + padding: 3px 0px 0px 0px; + color: #34495e; +} +.search-popup a.search-result-title { + font-weight: bold; + color: #34495e; +} +.search-popup .search-keyword { + border-bottom: 1px dashed #ff2a2a; + color: #ff2a2a; + font-weight: bold; +} +.search-popup #search-result { + display: flex; + height: calc(100% - 55px); + overflow: auto; + padding: 5px 25px; +} +.search-popup #no-result { + color: #ccc; + margin: auto; +} +li.menu-item.menu-item-search.right-list { + padding: 10px; +} +@-moz-keyframes shine { + 0%, 100% { + opacity: 0.1; + } + 25%, 75% { + opacity: 0.2; + } + 50% { + opacity: 1; + } +} +@-webkit-keyframes shine { + 0%, 100% { + opacity: 0.1; + } + 25%, 75% { + opacity: 0.2; + } + 50% { + opacity: 1; + } +} +@-o-keyframes shine { + 0%, 100% { + opacity: 0.1; + } + 25%, 75% { + opacity: 0.2; + } + 50% { + opacity: 1; + } +} +@keyframes shine { + 0%, 100% { + opacity: 0.1; + } + 25%, 75% { + opacity: 0.2; + } + 50% { + opacity: 1; + } +} diff --git a/css/var.css b/css/var.css deleted file mode 100644 index e69de29..0000000 diff --git a/fonts/SourceSansPro.ttf b/fonts/SourceSansPro.ttf new file mode 100644 index 0000000..91e9ea5 Binary files /dev/null and b/fonts/SourceSansPro.ttf differ diff --git a/img/404.jpg b/img/404.jpg deleted file mode 100644 index 4bab3c3..0000000 Binary files a/img/404.jpg and /dev/null differ diff --git a/img/avatar.png b/img/avatar.png deleted file mode 100644 index 53785e6..0000000 Binary files a/img/avatar.png and /dev/null differ diff --git a/img/cover.png b/img/cover.png deleted file mode 100644 index 561bde9..0000000 Binary files a/img/cover.png and /dev/null differ diff --git a/img/favicon.png b/img/favicon.png deleted file mode 100644 index 862ebe8..0000000 Binary files a/img/favicon.png and /dev/null differ diff --git a/img/favicon.svg b/img/favicon.svg deleted file mode 100644 index a881b26..0000000 --- a/img/favicon.svg +++ /dev/null @@ -1,353 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/img/friend_404.gif b/img/friend_404.gif deleted file mode 100644 index 91dd56a..0000000 Binary files a/img/friend_404.gif and /dev/null differ diff --git a/img/top.png b/img/top.png deleted file mode 100644 index fa3e653..0000000 Binary files a/img/top.png and /dev/null differ diff --git a/index.html b/index.html index 93230e4..61bb528 100644 --- a/index.html +++ b/index.html @@ -1,223 +1,242 @@ -Bluecode - - - - - - - - + + + + + + + + - if (!itemStr) { - return undefined + + + + + - if (now.getTime() > item.expiry) { - localStorage.removeItem(key) - return undefined - } - return item.value - } - } - win.getScript = url => new Promise((resolve, reject) => { - const script = document.createElement('script') - script.src = url - script.async = true - script.onerror = reject - script.onload = script.onreadystatechange = function() { - const loadState = this.readyState - if (loadState && loadState !== 'loaded' && loadState !== 'complete') return - script.onload = script.onreadystatechange = null - resolve() - } - document.head.appendChild(script) - }) - win.activateDarkMode = function () { - document.documentElement.setAttribute('data-theme', 'dark') - if (document.querySelector('meta[name="theme-color"]') !== null) { - document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d') - } - } - win.activateLightMode = function () { - document.documentElement.setAttribute('data-theme', 'light') - if (document.querySelector('meta[name="theme-color"]') !== null) { - document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff') - } - } - const t = saveToLocal.get('theme') - if (t === 'dark') activateDarkMode() - else if (t === 'light') activateLightMode() + + + + +
+ +
+ +
+
+ + + Bluecode + + + + - const detectApple = () => { - if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){ - document.documentElement.classList.add('apple') - } - } - detectApple() - })(window)
私人密码库Bitwarden部署
利用GitHub自动化部署Blog
Announcement
还没想好说什么
Recent Post
Info
Article :
2
Run time :
Total Count :
1.4k
UV :
PV :
Last Push :
访客地图
+ - window.pjax ? loadValine() : window.addEventListener('load', loadValine) -})()
\ No newline at end of file + hljs.configure({useBR: true}); + var lang = figure.attr('class').split(' ')[1] || 'code'; + var codeHtml = $(this).html(); + var codeTag = document.createElement('code'); + codeTag.className = lang; + codeTag.innerHTML = codeHtml; + $(this).attr('class', '').empty().html(codeTag); + figure.attr('data-lang', lang.toUpperCase()); + hljs.highlightBlock(block); + }); + }) + + + + + + + + + \ No newline at end of file diff --git a/js/gitment.js b/js/gitment.js new file mode 100644 index 0000000..06e1322 --- /dev/null +++ b/js/gitment.js @@ -0,0 +1,3751 @@ +var Gitment = +/******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 5); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +var LS_ACCESS_TOKEN_KEY = exports.LS_ACCESS_TOKEN_KEY = 'gitment-comments-token'; +var LS_USER_KEY = exports.LS_USER_KEY = 'gitment-user-info'; + +var NOT_INITIALIZED_ERROR = exports.NOT_INITIALIZED_ERROR = new Error('Comments Not Initialized'); + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +/* WEBPACK VAR INJECTION */(function(global) { + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var __extends = undefined && undefined.__extends || function () { + var extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { + d.__proto__ = b; + } || function (d, b) { + for (var p in b) { + if (b.hasOwnProperty(p)) d[p] = b[p]; + } + }; + return function (d, b) { + extendStatics(d, b); + function __() { + this.constructor = d; + } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +}(); +Object.defineProperty(exports, "__esModule", { value: true }); +registerGlobals(); +exports.extras = { + allowStateChanges: allowStateChanges, + deepEqual: deepEqual, + getAtom: getAtom, + getDebugName: getDebugName, + getDependencyTree: getDependencyTree, + getAdministration: getAdministration, + getGlobalState: getGlobalState, + getObserverTree: getObserverTree, + isComputingDerivation: isComputingDerivation, + isSpyEnabled: isSpyEnabled, + onReactionError: onReactionError, + resetGlobalState: resetGlobalState, + shareGlobalState: shareGlobalState, + spyReport: spyReport, + spyReportEnd: spyReportEnd, + spyReportStart: spyReportStart, + setReactionScheduler: setReactionScheduler +}; +if ((typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ === "undefined" ? "undefined" : _typeof(__MOBX_DEVTOOLS_GLOBAL_HOOK__)) === "object") { + __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx(module.exports); +} +module.exports.default = module.exports; +var actionFieldDecorator = createClassPropertyDecorator(function (target, key, value, args, originalDescriptor) { + var actionName = args && args.length === 1 ? args[0] : value.name || key || ""; + var wrappedAction = action(actionName, value); + addHiddenProp(target, key, wrappedAction); +}, function (key) { + return this[key]; +}, function () { + invariant(false, getMessage("m001")); +}, false, true); +var boundActionDecorator = createClassPropertyDecorator(function (target, key, value) { + defineBoundAction(target, key, value); +}, function (key) { + return this[key]; +}, function () { + invariant(false, getMessage("m001")); +}, false, false); +var action = function action(arg1, arg2, arg3, arg4) { + if (arguments.length === 1 && typeof arg1 === "function") return createAction(arg1.name || "", arg1); + if (arguments.length === 2 && typeof arg2 === "function") return createAction(arg1, arg2); + if (arguments.length === 1 && typeof arg1 === "string") return namedActionDecorator(arg1); + return namedActionDecorator(arg2).apply(null, arguments); +}; +exports.action = action; +action.bound = function boundAction(arg1, arg2, arg3) { + if (typeof arg1 === "function") { + var action_1 = createAction("", arg1); + action_1.autoBind = true; + return action_1; + } + return boundActionDecorator.apply(null, arguments); +}; +function namedActionDecorator(name) { + return function (target, prop, descriptor) { + if (descriptor && typeof descriptor.value === "function") { + descriptor.value = createAction(name, descriptor.value); + descriptor.enumerable = false; + descriptor.configurable = true; + return descriptor; + } + return actionFieldDecorator(name).apply(this, arguments); + }; +} +function runInAction(arg1, arg2, arg3) { + var actionName = typeof arg1 === "string" ? arg1 : arg1.name || ""; + var fn = typeof arg1 === "function" ? arg1 : arg2; + var scope = typeof arg1 === "function" ? arg2 : arg3; + invariant(typeof fn === "function", getMessage("m002")); + invariant(fn.length === 0, getMessage("m003")); + invariant(typeof actionName === "string" && actionName.length > 0, "actions should have valid names, got: '" + actionName + "'"); + return executeAction(actionName, fn, scope, undefined); +} +exports.runInAction = runInAction; +function isAction(thing) { + return typeof thing === "function" && thing.isMobxAction === true; +} +exports.isAction = isAction; +function defineBoundAction(target, propertyName, fn) { + var res = function res() { + return executeAction(propertyName, fn, target, arguments); + }; + res.isMobxAction = true; + addHiddenProp(target, propertyName, res); +} +function autorun(arg1, arg2, arg3) { + var name, view, scope; + if (typeof arg1 === "string") { + name = arg1; + view = arg2; + scope = arg3; + } else { + name = arg1.name || "Autorun@" + getNextId(); + view = arg1; + scope = arg2; + } + invariant(typeof view === "function", getMessage("m004")); + invariant(isAction(view) === false, getMessage("m005")); + if (scope) view = view.bind(scope); + var reaction = new Reaction(name, function () { + this.track(reactionRunner); + }); + function reactionRunner() { + view(reaction); + } + reaction.schedule(); + return reaction.getDisposer(); +} +exports.autorun = autorun; +function when(arg1, arg2, arg3, arg4) { + var name, predicate, effect, scope; + if (typeof arg1 === "string") { + name = arg1; + predicate = arg2; + effect = arg3; + scope = arg4; + } else { + name = "When@" + getNextId(); + predicate = arg1; + effect = arg2; + scope = arg3; + } + var disposer = autorun(name, function (r) { + if (predicate.call(scope)) { + r.dispose(); + var prevUntracked = untrackedStart(); + effect.call(scope); + untrackedEnd(prevUntracked); + } + }); + return disposer; +} +exports.when = when; +function autorunAsync(arg1, arg2, arg3, arg4) { + var name, func, delay, scope; + if (typeof arg1 === "string") { + name = arg1; + func = arg2; + delay = arg3; + scope = arg4; + } else { + name = arg1.name || "AutorunAsync@" + getNextId(); + func = arg1; + delay = arg2; + scope = arg3; + } + invariant(isAction(func) === false, getMessage("m006")); + if (delay === void 0) delay = 1; + if (scope) func = func.bind(scope); + var isScheduled = false; + var r = new Reaction(name, function () { + if (!isScheduled) { + isScheduled = true; + setTimeout(function () { + isScheduled = false; + if (!r.isDisposed) r.track(reactionRunner); + }, delay); + } + }); + function reactionRunner() { + func(r); + } + r.schedule(); + return r.getDisposer(); +} +exports.autorunAsync = autorunAsync; +function reaction(expression, effect, arg3) { + if (arguments.length > 3) { + fail(getMessage("m007")); + } + if (isModifierDescriptor(expression)) { + fail(getMessage("m008")); + } + var opts; + if ((typeof arg3 === "undefined" ? "undefined" : _typeof(arg3)) === "object") { + opts = arg3; + } else { + opts = {}; + } + opts.name = opts.name || expression.name || effect.name || "Reaction@" + getNextId(); + opts.fireImmediately = arg3 === true || opts.fireImmediately === true; + opts.delay = opts.delay || 0; + opts.compareStructural = opts.compareStructural || opts.struct || false; + effect = action(opts.name, opts.context ? effect.bind(opts.context) : effect); + if (opts.context) { + expression = expression.bind(opts.context); + } + var firstTime = true; + var isScheduled = false; + var nextValue; + var r = new Reaction(opts.name, function () { + if (firstTime || opts.delay < 1) { + reactionRunner(); + } else if (!isScheduled) { + isScheduled = true; + setTimeout(function () { + isScheduled = false; + reactionRunner(); + }, opts.delay); + } + }); + function reactionRunner() { + if (r.isDisposed) return; + var changed = false; + r.track(function () { + var v = expression(r); + changed = valueDidChange(opts.compareStructural, nextValue, v); + nextValue = v; + }); + if (firstTime && opts.fireImmediately) effect(nextValue, r); + if (!firstTime && changed === true) effect(nextValue, r); + if (firstTime) firstTime = false; + } + r.schedule(); + return r.getDisposer(); +} +exports.reaction = reaction; +function createComputedDecorator(compareStructural) { + return createClassPropertyDecorator(function (target, name, _, __, originalDescriptor) { + invariant(typeof originalDescriptor !== "undefined", getMessage("m009")); + invariant(typeof originalDescriptor.get === "function", getMessage("m010")); + var adm = asObservableObject(target, ""); + defineComputedProperty(adm, name, originalDescriptor.get, originalDescriptor.set, compareStructural, false); + }, function (name) { + var observable = this.$mobx.values[name]; + if (observable === undefined) return undefined; + return observable.get(); + }, function (name, value) { + this.$mobx.values[name].set(value); + }, false, false); +} +var computedDecorator = createComputedDecorator(false); +var computedStructDecorator = createComputedDecorator(true); +var computed = function computed(arg1, arg2, arg3) { + if (typeof arg2 === "string") { + return computedDecorator.apply(null, arguments); + } + invariant(typeof arg1 === "function", getMessage("m011")); + invariant(arguments.length < 3, getMessage("m012")); + var opts = (typeof arg2 === "undefined" ? "undefined" : _typeof(arg2)) === "object" ? arg2 : {}; + opts.setter = typeof arg2 === "function" ? arg2 : opts.setter; + return new ComputedValue(arg1, opts.context, opts.compareStructural || opts.struct || false, opts.name || arg1.name || "", opts.setter); +}; +exports.computed = computed; +computed.struct = computedStructDecorator; +function createTransformer(transformer, onCleanup) { + invariant(typeof transformer === "function" && transformer.length < 2, "createTransformer expects a function that accepts one argument"); + var objectCache = {}; + var resetId = globalState.resetId; + var Transformer = function (_super) { + __extends(Transformer, _super); + function Transformer(sourceIdentifier, sourceObject) { + var _this = _super.call(this, function () { + return transformer(sourceObject); + }, undefined, false, "Transformer-" + transformer.name + "-" + sourceIdentifier, undefined) || this; + _this.sourceIdentifier = sourceIdentifier; + _this.sourceObject = sourceObject; + return _this; + } + Transformer.prototype.onBecomeUnobserved = function () { + var lastValue = this.value; + _super.prototype.onBecomeUnobserved.call(this); + delete objectCache[this.sourceIdentifier]; + if (onCleanup) onCleanup(lastValue, this.sourceObject); + }; + return Transformer; + }(ComputedValue); + return function (object) { + if (resetId !== globalState.resetId) { + objectCache = {}; + resetId = globalState.resetId; + } + var identifier = getMemoizationId(object); + var reactiveTransformer = objectCache[identifier]; + if (reactiveTransformer) return reactiveTransformer.get(); + reactiveTransformer = objectCache[identifier] = new Transformer(identifier, object); + return reactiveTransformer.get(); + }; +} +exports.createTransformer = createTransformer; +function getMemoizationId(object) { + if (object === null || (typeof object === "undefined" ? "undefined" : _typeof(object)) !== "object") throw new Error("[mobx] transform expected some kind of object, got: " + object); + var tid = object.$transformId; + if (tid === undefined) { + tid = getNextId(); + addHiddenProp(object, "$transformId", tid); + } + return tid; +} +function expr(expr, scope) { + if (!isComputingDerivation()) console.warn(getMessage("m013")); + return computed(expr, { context: scope }).get(); +} +exports.expr = expr; +function extendObservable(target) { + var properties = []; + for (var _i = 1; _i < arguments.length; _i++) { + properties[_i - 1] = arguments[_i]; + } + return extendObservableHelper(target, deepEnhancer, properties); +} +exports.extendObservable = extendObservable; +function extendShallowObservable(target) { + var properties = []; + for (var _i = 1; _i < arguments.length; _i++) { + properties[_i - 1] = arguments[_i]; + } + return extendObservableHelper(target, referenceEnhancer, properties); +} +exports.extendShallowObservable = extendShallowObservable; +function extendObservableHelper(target, defaultEnhancer, properties) { + invariant(arguments.length >= 2, getMessage("m014")); + invariant((typeof target === "undefined" ? "undefined" : _typeof(target)) === "object", getMessage("m015")); + invariant(!isObservableMap(target), getMessage("m016")); + properties.forEach(function (propSet) { + invariant((typeof propSet === "undefined" ? "undefined" : _typeof(propSet)) === "object", getMessage("m017")); + invariant(!isObservable(propSet), getMessage("m018")); + }); + var adm = asObservableObject(target); + var definedProps = {}; + for (var i = properties.length - 1; i >= 0; i--) { + var propSet = properties[i]; + for (var key in propSet) { + if (definedProps[key] !== true && hasOwnProperty(propSet, key)) { + definedProps[key] = true; + if (target === propSet && !isPropertyConfigurable(target, key)) continue; + var descriptor = Object.getOwnPropertyDescriptor(propSet, key); + defineObservablePropertyFromDescriptor(adm, key, descriptor, defaultEnhancer); + } + } + } + return target; +} +function getDependencyTree(thing, property) { + return nodeToDependencyTree(getAtom(thing, property)); +} +function nodeToDependencyTree(node) { + var result = { + name: node.name + }; + if (node.observing && node.observing.length > 0) result.dependencies = unique(node.observing).map(nodeToDependencyTree); + return result; +} +function getObserverTree(thing, property) { + return nodeToObserverTree(getAtom(thing, property)); +} +function nodeToObserverTree(node) { + var result = { + name: node.name + }; + if (hasObservers(node)) result.observers = getObservers(node).map(nodeToObserverTree); + return result; +} +function intercept(thing, propOrHandler, handler) { + if (typeof handler === "function") return interceptProperty(thing, propOrHandler, handler);else return interceptInterceptable(thing, propOrHandler); +} +exports.intercept = intercept; +function interceptInterceptable(thing, handler) { + return getAdministration(thing).intercept(handler); +} +function interceptProperty(thing, property, handler) { + return getAdministration(thing, property).intercept(handler); +} +function isComputed(value, property) { + if (value === null || value === undefined) return false; + if (property !== undefined) { + if (isObservableObject(value) === false) return false; + var atom = getAtom(value, property); + return isComputedValue(atom); + } + return isComputedValue(value); +} +exports.isComputed = isComputed; +function isObservable(value, property) { + if (value === null || value === undefined) return false; + if (property !== undefined) { + if (isObservableArray(value) || isObservableMap(value)) throw new Error(getMessage("m019"));else if (isObservableObject(value)) { + var o = value.$mobx; + return o.values && !!o.values[property]; + } + return false; + } + return isObservableObject(value) || !!value.$mobx || isAtom(value) || isReaction(value) || isComputedValue(value); +} +exports.isObservable = isObservable; +var deepDecorator = createDecoratorForEnhancer(deepEnhancer); +var shallowDecorator = createDecoratorForEnhancer(shallowEnhancer); +var refDecorator = createDecoratorForEnhancer(referenceEnhancer); +var deepStructDecorator = createDecoratorForEnhancer(deepStructEnhancer); +var refStructDecorator = createDecoratorForEnhancer(refStructEnhancer); +function createObservable(v) { + if (v === void 0) { + v = undefined; + } + if (typeof arguments[1] === "string") return deepDecorator.apply(null, arguments); + invariant(arguments.length <= 1, getMessage("m021")); + invariant(!isModifierDescriptor(v), getMessage("m020")); + if (isObservable(v)) return v; + var res = deepEnhancer(v, undefined, undefined); + if (res !== v) return res; + return observable.box(v); +} +var IObservableFactories = function () { + function IObservableFactories() {} + IObservableFactories.prototype.box = function (value, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("box"); + return new ObservableValue(value, deepEnhancer, name); + }; + IObservableFactories.prototype.shallowBox = function (value, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowBox"); + return new ObservableValue(value, referenceEnhancer, name); + }; + IObservableFactories.prototype.array = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("array"); + return new ObservableArray(initialValues, deepEnhancer, name); + }; + IObservableFactories.prototype.shallowArray = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowArray"); + return new ObservableArray(initialValues, referenceEnhancer, name); + }; + IObservableFactories.prototype.map = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("map"); + return new ObservableMap(initialValues, deepEnhancer, name); + }; + IObservableFactories.prototype.shallowMap = function (initialValues, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowMap"); + return new ObservableMap(initialValues, referenceEnhancer, name); + }; + IObservableFactories.prototype.object = function (props, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("object"); + var res = {}; + asObservableObject(res, name); + extendObservable(res, props); + return res; + }; + IObservableFactories.prototype.shallowObject = function (props, name) { + if (arguments.length > 2) incorrectlyUsedAsDecorator("shallowObject"); + var res = {}; + asObservableObject(res, name); + extendShallowObservable(res, props); + return res; + }; + IObservableFactories.prototype.ref = function () { + if (arguments.length < 2) { + return createModifierDescriptor(referenceEnhancer, arguments[0]); + } else { + return refDecorator.apply(null, arguments); + } + }; + IObservableFactories.prototype.shallow = function () { + if (arguments.length < 2) { + return createModifierDescriptor(shallowEnhancer, arguments[0]); + } else { + return shallowDecorator.apply(null, arguments); + } + }; + IObservableFactories.prototype.deep = function () { + if (arguments.length < 2) { + return createModifierDescriptor(deepEnhancer, arguments[0]); + } else { + return deepDecorator.apply(null, arguments); + } + }; + IObservableFactories.prototype.struct = function () { + if (arguments.length < 2) { + return createModifierDescriptor(deepStructEnhancer, arguments[0]); + } else { + return deepStructDecorator.apply(null, arguments); + } + }; + return IObservableFactories; +}(); +exports.IObservableFactories = IObservableFactories; +var observable = createObservable; +exports.observable = observable; +Object.keys(IObservableFactories.prototype).forEach(function (key) { + return observable[key] = IObservableFactories.prototype[key]; +}); +observable.deep.struct = observable.struct; +observable.ref.struct = function () { + if (arguments.length < 2) { + return createModifierDescriptor(refStructEnhancer, arguments[0]); + } else { + return refStructDecorator.apply(null, arguments); + } +}; +function incorrectlyUsedAsDecorator(methodName) { + fail("Expected one or two arguments to observable." + methodName + ". Did you accidentally try to use observable." + methodName + " as decorator?"); +} +function createDecoratorForEnhancer(enhancer) { + invariant(!!enhancer, ":("); + return createClassPropertyDecorator(function (target, name, baseValue, _, baseDescriptor) { + assertPropertyConfigurable(target, name); + invariant(!baseDescriptor || !baseDescriptor.get, getMessage("m022")); + var adm = asObservableObject(target, undefined); + defineObservableProperty(adm, name, baseValue, enhancer); + }, function (name) { + var observable = this.$mobx.values[name]; + if (observable === undefined) return undefined; + return observable.get(); + }, function (name, value) { + setPropertyValue(this, name, value); + }, true, false); +} +function observe(thing, propOrCb, cbOrFire, fireImmediately) { + if (typeof cbOrFire === "function") return observeObservableProperty(thing, propOrCb, cbOrFire, fireImmediately);else return observeObservable(thing, propOrCb, cbOrFire); +} +exports.observe = observe; +function observeObservable(thing, listener, fireImmediately) { + return getAdministration(thing).observe(listener, fireImmediately); +} +function observeObservableProperty(thing, property, listener, fireImmediately) { + return getAdministration(thing, property).observe(listener, fireImmediately); +} +function toJS(source, detectCycles, __alreadySeen) { + if (detectCycles === void 0) { + detectCycles = true; + } + if (__alreadySeen === void 0) { + __alreadySeen = []; + } + function cache(value) { + if (detectCycles) __alreadySeen.push([source, value]); + return value; + } + if (isObservable(source)) { + if (detectCycles && __alreadySeen === null) __alreadySeen = []; + if (detectCycles && source !== null && (typeof source === "undefined" ? "undefined" : _typeof(source)) === "object") { + for (var i = 0, l = __alreadySeen.length; i < l; i++) { + if (__alreadySeen[i][0] === source) return __alreadySeen[i][1]; + } + } + if (isObservableArray(source)) { + var res = cache([]); + var toAdd = source.map(function (value) { + return toJS(value, detectCycles, __alreadySeen); + }); + res.length = toAdd.length; + for (var i = 0, l = toAdd.length; i < l; i++) { + res[i] = toAdd[i]; + }return res; + } + if (isObservableObject(source)) { + var res = cache({}); + for (var key in source) { + res[key] = toJS(source[key], detectCycles, __alreadySeen); + }return res; + } + if (isObservableMap(source)) { + var res_1 = cache({}); + source.forEach(function (value, key) { + return res_1[key] = toJS(value, detectCycles, __alreadySeen); + }); + return res_1; + } + if (isObservableValue(source)) return toJS(source.get(), detectCycles, __alreadySeen); + } + return source; +} +exports.toJS = toJS; +function transaction(action, thisArg) { + if (thisArg === void 0) { + thisArg = undefined; + } + deprecated(getMessage("m023")); + return runInTransaction.apply(undefined, arguments); +} +exports.transaction = transaction; +function runInTransaction(action, thisArg) { + if (thisArg === void 0) { + thisArg = undefined; + } + return executeAction("", action); +} +function log(msg) { + console.log(msg); + return msg; +} +function whyRun(thing, prop) { + switch (arguments.length) { + case 0: + thing = globalState.trackingDerivation; + if (!thing) return log(getMessage("m024")); + break; + case 2: + thing = getAtom(thing, prop); + break; + } + thing = getAtom(thing); + if (isComputedValue(thing)) return log(thing.whyRun());else if (isReaction(thing)) return log(thing.whyRun()); + return fail(getMessage("m025")); +} +exports.whyRun = whyRun; +function createAction(actionName, fn) { + invariant(typeof fn === "function", getMessage("m026")); + invariant(typeof actionName === "string" && actionName.length > 0, "actions should have valid names, got: '" + actionName + "'"); + var res = function res() { + return executeAction(actionName, fn, this, arguments); + }; + res.originalFn = fn; + res.isMobxAction = true; + return res; +} +function executeAction(actionName, fn, scope, args) { + var runInfo = startAction(actionName, fn, scope, args); + try { + return fn.apply(scope, args); + } finally { + endAction(runInfo); + } +} +function startAction(actionName, fn, scope, args) { + var notifySpy = isSpyEnabled() && !!actionName; + var startTime = 0; + if (notifySpy) { + startTime = Date.now(); + var l = args && args.length || 0; + var flattendArgs = new Array(l); + if (l > 0) for (var i = 0; i < l; i++) { + flattendArgs[i] = args[i]; + }spyReportStart({ + type: "action", + name: actionName, + fn: fn, + object: scope, + arguments: flattendArgs + }); + } + var prevDerivation = untrackedStart(); + startBatch(); + var prevAllowStateChanges = allowStateChangesStart(true); + return { + prevDerivation: prevDerivation, + prevAllowStateChanges: prevAllowStateChanges, + notifySpy: notifySpy, + startTime: startTime + }; +} +function endAction(runInfo) { + allowStateChangesEnd(runInfo.prevAllowStateChanges); + endBatch(); + untrackedEnd(runInfo.prevDerivation); + if (runInfo.notifySpy) spyReportEnd({ time: Date.now() - runInfo.startTime }); +} +function useStrict(strict) { + invariant(globalState.trackingDerivation === null, getMessage("m028")); + globalState.strictMode = strict; + globalState.allowStateChanges = !strict; +} +exports.useStrict = useStrict; +function isStrictModeEnabled() { + return globalState.strictMode; +} +exports.isStrictModeEnabled = isStrictModeEnabled; +function allowStateChanges(allowStateChanges, func) { + var prev = allowStateChangesStart(allowStateChanges); + var res; + try { + res = func(); + } finally { + allowStateChangesEnd(prev); + } + return res; +} +function allowStateChangesStart(allowStateChanges) { + var prev = globalState.allowStateChanges; + globalState.allowStateChanges = allowStateChanges; + return prev; +} +function allowStateChangesEnd(prev) { + globalState.allowStateChanges = prev; +} +var BaseAtom = function () { + function BaseAtom(name) { + if (name === void 0) { + name = "Atom@" + getNextId(); + } + this.name = name; + this.isPendingUnobservation = true; + this.observers = []; + this.observersIndexes = {}; + this.diffValue = 0; + this.lastAccessedBy = 0; + this.lowestObserverState = IDerivationState.NOT_TRACKING; + } + BaseAtom.prototype.onBecomeUnobserved = function () {}; + BaseAtom.prototype.reportObserved = function () { + reportObserved(this); + }; + BaseAtom.prototype.reportChanged = function () { + startBatch(); + propagateChanged(this); + endBatch(); + }; + BaseAtom.prototype.toString = function () { + return this.name; + }; + return BaseAtom; +}(); +exports.BaseAtom = BaseAtom; +var Atom = function (_super) { + __extends(Atom, _super); + function Atom(name, onBecomeObservedHandler, onBecomeUnobservedHandler) { + if (name === void 0) { + name = "Atom@" + getNextId(); + } + if (onBecomeObservedHandler === void 0) { + onBecomeObservedHandler = noop; + } + if (onBecomeUnobservedHandler === void 0) { + onBecomeUnobservedHandler = noop; + } + var _this = _super.call(this, name) || this; + _this.name = name; + _this.onBecomeObservedHandler = onBecomeObservedHandler; + _this.onBecomeUnobservedHandler = onBecomeUnobservedHandler; + _this.isPendingUnobservation = false; + _this.isBeingTracked = false; + return _this; + } + Atom.prototype.reportObserved = function () { + startBatch(); + _super.prototype.reportObserved.call(this); + if (!this.isBeingTracked) { + this.isBeingTracked = true; + this.onBecomeObservedHandler(); + } + endBatch(); + return !!globalState.trackingDerivation; + }; + Atom.prototype.onBecomeUnobserved = function () { + this.isBeingTracked = false; + this.onBecomeUnobservedHandler(); + }; + return Atom; +}(BaseAtom); +exports.Atom = Atom; +var isAtom = createInstanceofPredicate("Atom", BaseAtom); +var ComputedValue = function () { + function ComputedValue(derivation, scope, compareStructural, name, setter) { + this.derivation = derivation; + this.scope = scope; + this.compareStructural = compareStructural; + this.dependenciesState = IDerivationState.NOT_TRACKING; + this.observing = []; + this.newObserving = null; + this.isPendingUnobservation = false; + this.observers = []; + this.observersIndexes = {}; + this.diffValue = 0; + this.runId = 0; + this.lastAccessedBy = 0; + this.lowestObserverState = IDerivationState.UP_TO_DATE; + this.unboundDepsCount = 0; + this.__mapid = "#" + getNextId(); + this.value = undefined; + this.isComputing = false; + this.isRunningSetter = false; + this.name = name || "ComputedValue@" + getNextId(); + if (setter) this.setter = createAction(name + "-setter", setter); + } + ComputedValue.prototype.onBecomeStale = function () { + propagateMaybeChanged(this); + }; + ComputedValue.prototype.onBecomeUnobserved = function () { + invariant(this.dependenciesState !== IDerivationState.NOT_TRACKING, getMessage("m029")); + clearObserving(this); + this.value = undefined; + }; + ComputedValue.prototype.get = function () { + invariant(!this.isComputing, "Cycle detected in computation " + this.name, this.derivation); + if (globalState.inBatch === 0) { + startBatch(); + if (shouldCompute(this)) this.value = this.computeValue(false); + endBatch(); + } else { + reportObserved(this); + if (shouldCompute(this)) if (this.trackAndCompute()) propagateChangeConfirmed(this); + } + var result = this.value; + if (isCaughtException(result)) throw result.cause; + return result; + }; + ComputedValue.prototype.peek = function () { + var res = this.computeValue(false); + if (isCaughtException(res)) throw res.cause; + return res; + }; + ComputedValue.prototype.set = function (value) { + if (this.setter) { + invariant(!this.isRunningSetter, "The setter of computed value '" + this.name + "' is trying to update itself. Did you intend to update an _observable_ value, instead of the computed property?"); + this.isRunningSetter = true; + try { + this.setter.call(this.scope, value); + } finally { + this.isRunningSetter = false; + } + } else invariant(false, "[ComputedValue '" + this.name + "'] It is not possible to assign a new value to a computed value."); + }; + ComputedValue.prototype.trackAndCompute = function () { + if (isSpyEnabled()) { + spyReport({ + object: this.scope, + type: "compute", + fn: this.derivation + }); + } + var oldValue = this.value; + var newValue = this.value = this.computeValue(true); + return isCaughtException(newValue) || valueDidChange(this.compareStructural, newValue, oldValue); + }; + ComputedValue.prototype.computeValue = function (track) { + this.isComputing = true; + globalState.computationDepth++; + var res; + if (track) { + res = trackDerivedFunction(this, this.derivation, this.scope); + } else { + try { + res = this.derivation.call(this.scope); + } catch (e) { + res = new CaughtException(e); + } + } + globalState.computationDepth--; + this.isComputing = false; + return res; + }; + ; + ComputedValue.prototype.observe = function (listener, fireImmediately) { + var _this = this; + var firstTime = true; + var prevValue = undefined; + return autorun(function () { + var newValue = _this.get(); + if (!firstTime || fireImmediately) { + var prevU = untrackedStart(); + listener({ + type: "update", + object: _this, + newValue: newValue, + oldValue: prevValue + }); + untrackedEnd(prevU); + } + firstTime = false; + prevValue = newValue; + }); + }; + ComputedValue.prototype.toJSON = function () { + return this.get(); + }; + ComputedValue.prototype.toString = function () { + return this.name + "[" + this.derivation.toString() + "]"; + }; + ComputedValue.prototype.valueOf = function () { + return toPrimitive(this.get()); + }; + ; + ComputedValue.prototype.whyRun = function () { + var isTracking = Boolean(globalState.trackingDerivation); + var observing = unique(this.isComputing ? this.newObserving : this.observing).map(function (dep) { + return dep.name; + }); + var observers = unique(getObservers(this).map(function (dep) { + return dep.name; + })); + return "\nWhyRun? computation '" + this.name + "':\n * Running because: " + (isTracking ? "[active] the value of this computation is needed by a reaction" : this.isComputing ? "[get] The value of this computed was requested outside a reaction" : "[idle] not running at the moment") + "\n" + (this.dependenciesState === IDerivationState.NOT_TRACKING ? getMessage("m032") : " * This computation will re-run if any of the following observables changes:\n " + joinStrings(observing) + "\n " + (this.isComputing && isTracking ? " (... or any observable accessed during the remainder of the current run)" : "") + "\n\t" + getMessage("m038") + "\n\n * If the outcome of this computation changes, the following observers will be re-run:\n " + joinStrings(observers) + "\n"); + }; + return ComputedValue; +}(); +ComputedValue.prototype[primitiveSymbol()] = ComputedValue.prototype.valueOf; +var isComputedValue = createInstanceofPredicate("ComputedValue", ComputedValue); +var IDerivationState; +(function (IDerivationState) { + IDerivationState[IDerivationState["NOT_TRACKING"] = -1] = "NOT_TRACKING"; + IDerivationState[IDerivationState["UP_TO_DATE"] = 0] = "UP_TO_DATE"; + IDerivationState[IDerivationState["POSSIBLY_STALE"] = 1] = "POSSIBLY_STALE"; + IDerivationState[IDerivationState["STALE"] = 2] = "STALE"; +})(IDerivationState || (IDerivationState = {})); +exports.IDerivationState = IDerivationState; +var CaughtException = function () { + function CaughtException(cause) { + this.cause = cause; + } + return CaughtException; +}(); +function isCaughtException(e) { + return e instanceof CaughtException; +} +function shouldCompute(derivation) { + switch (derivation.dependenciesState) { + case IDerivationState.UP_TO_DATE: + return false; + case IDerivationState.NOT_TRACKING: + case IDerivationState.STALE: + return true; + case IDerivationState.POSSIBLY_STALE: + { + var prevUntracked = untrackedStart(); + var obs = derivation.observing, + l = obs.length; + for (var i = 0; i < l; i++) { + var obj = obs[i]; + if (isComputedValue(obj)) { + try { + obj.get(); + } catch (e) { + untrackedEnd(prevUntracked); + return true; + } + if (derivation.dependenciesState === IDerivationState.STALE) { + untrackedEnd(prevUntracked); + return true; + } + } + } + changeDependenciesStateTo0(derivation); + untrackedEnd(prevUntracked); + return false; + } + } +} +function isComputingDerivation() { + return globalState.trackingDerivation !== null; +} +function checkIfStateModificationsAreAllowed(atom) { + var hasObservers = atom.observers.length > 0; + if (globalState.computationDepth > 0 && hasObservers) fail(getMessage("m031") + atom.name); + if (!globalState.allowStateChanges && hasObservers) fail(getMessage(globalState.strictMode ? "m030a" : "m030b") + atom.name); +} +function trackDerivedFunction(derivation, f, context) { + changeDependenciesStateTo0(derivation); + derivation.newObserving = new Array(derivation.observing.length + 100); + derivation.unboundDepsCount = 0; + derivation.runId = ++globalState.runId; + var prevTracking = globalState.trackingDerivation; + globalState.trackingDerivation = derivation; + var result; + try { + result = f.call(context); + } catch (e) { + result = new CaughtException(e); + } + globalState.trackingDerivation = prevTracking; + bindDependencies(derivation); + return result; +} +function bindDependencies(derivation) { + var prevObserving = derivation.observing; + var observing = derivation.observing = derivation.newObserving; + derivation.newObserving = null; + var i0 = 0, + l = derivation.unboundDepsCount; + for (var i = 0; i < l; i++) { + var dep = observing[i]; + if (dep.diffValue === 0) { + dep.diffValue = 1; + if (i0 !== i) observing[i0] = dep; + i0++; + } + } + observing.length = i0; + l = prevObserving.length; + while (l--) { + var dep = prevObserving[l]; + if (dep.diffValue === 0) { + removeObserver(dep, derivation); + } + dep.diffValue = 0; + } + while (i0--) { + var dep = observing[i0]; + if (dep.diffValue === 1) { + dep.diffValue = 0; + addObserver(dep, derivation); + } + } +} +function clearObserving(derivation) { + var obs = derivation.observing; + var i = obs.length; + while (i--) { + removeObserver(obs[i], derivation); + }derivation.dependenciesState = IDerivationState.NOT_TRACKING; + obs.length = 0; +} +function untracked(action) { + var prev = untrackedStart(); + var res = action(); + untrackedEnd(prev); + return res; +} +exports.untracked = untracked; +function untrackedStart() { + var prev = globalState.trackingDerivation; + globalState.trackingDerivation = null; + return prev; +} +function untrackedEnd(prev) { + globalState.trackingDerivation = prev; +} +function changeDependenciesStateTo0(derivation) { + if (derivation.dependenciesState === IDerivationState.UP_TO_DATE) return; + derivation.dependenciesState = IDerivationState.UP_TO_DATE; + var obs = derivation.observing; + var i = obs.length; + while (i--) { + obs[i].lowestObserverState = IDerivationState.UP_TO_DATE; + } +} +var persistentKeys = ["mobxGuid", "resetId", "spyListeners", "strictMode", "runId"]; +var MobXGlobals = function () { + function MobXGlobals() { + this.version = 5; + this.trackingDerivation = null; + this.computationDepth = 0; + this.runId = 0; + this.mobxGuid = 0; + this.inBatch = 0; + this.pendingUnobservations = []; + this.pendingReactions = []; + this.isRunningReactions = false; + this.allowStateChanges = true; + this.strictMode = false; + this.resetId = 0; + this.spyListeners = []; + this.globalReactionErrorHandlers = []; + } + return MobXGlobals; +}(); +var globalState = new MobXGlobals(); +function shareGlobalState() { + var global = getGlobal(); + var ownState = globalState; + if (global.__mobservableTrackingStack || global.__mobservableViewStack) throw new Error("[mobx] An incompatible version of mobservable is already loaded."); + if (global.__mobxGlobal && global.__mobxGlobal.version !== ownState.version) throw new Error("[mobx] An incompatible version of mobx is already loaded."); + if (global.__mobxGlobal) globalState = global.__mobxGlobal;else global.__mobxGlobal = ownState; +} +function getGlobalState() { + return globalState; +} +function registerGlobals() {} +function resetGlobalState() { + globalState.resetId++; + var defaultGlobals = new MobXGlobals(); + for (var key in defaultGlobals) { + if (persistentKeys.indexOf(key) === -1) globalState[key] = defaultGlobals[key]; + }globalState.allowStateChanges = !globalState.strictMode; +} +function hasObservers(observable) { + return observable.observers && observable.observers.length > 0; +} +function getObservers(observable) { + return observable.observers; +} +function invariantObservers(observable) { + var list = observable.observers; + var map = observable.observersIndexes; + var l = list.length; + for (var i = 0; i < l; i++) { + var id = list[i].__mapid; + if (i) { + invariant(map[id] === i, "INTERNAL ERROR maps derivation.__mapid to index in list"); + } else { + invariant(!(id in map), "INTERNAL ERROR observer on index 0 shouldnt be held in map."); + } + } + invariant(list.length === 0 || Object.keys(map).length === list.length - 1, "INTERNAL ERROR there is no junk in map"); +} +function addObserver(observable, node) { + var l = observable.observers.length; + if (l) { + observable.observersIndexes[node.__mapid] = l; + } + observable.observers[l] = node; + if (observable.lowestObserverState > node.dependenciesState) observable.lowestObserverState = node.dependenciesState; +} +function removeObserver(observable, node) { + if (observable.observers.length === 1) { + observable.observers.length = 0; + queueForUnobservation(observable); + } else { + var list = observable.observers; + var map_1 = observable.observersIndexes; + var filler = list.pop(); + if (filler !== node) { + var index = map_1[node.__mapid] || 0; + if (index) { + map_1[filler.__mapid] = index; + } else { + delete map_1[filler.__mapid]; + } + list[index] = filler; + } + delete map_1[node.__mapid]; + } +} +function queueForUnobservation(observable) { + if (!observable.isPendingUnobservation) { + observable.isPendingUnobservation = true; + globalState.pendingUnobservations.push(observable); + } +} +function startBatch() { + globalState.inBatch++; +} +function endBatch() { + if (--globalState.inBatch === 0) { + runReactions(); + var list = globalState.pendingUnobservations; + for (var i = 0; i < list.length; i++) { + var observable_1 = list[i]; + observable_1.isPendingUnobservation = false; + if (observable_1.observers.length === 0) { + observable_1.onBecomeUnobserved(); + } + } + globalState.pendingUnobservations = []; + } +} +function reportObserved(observable) { + var derivation = globalState.trackingDerivation; + if (derivation !== null) { + if (derivation.runId !== observable.lastAccessedBy) { + observable.lastAccessedBy = derivation.runId; + derivation.newObserving[derivation.unboundDepsCount++] = observable; + } + } else if (observable.observers.length === 0) { + queueForUnobservation(observable); + } +} +function invariantLOS(observable, msg) { + var min = getObservers(observable).reduce(function (a, b) { + return Math.min(a, b.dependenciesState); + }, 2); + if (min >= observable.lowestObserverState) return; + throw new Error("lowestObserverState is wrong for " + msg + " because " + min + " < " + observable.lowestObserverState); +} +function propagateChanged(observable) { + if (observable.lowestObserverState === IDerivationState.STALE) return; + observable.lowestObserverState = IDerivationState.STALE; + var observers = observable.observers; + var i = observers.length; + while (i--) { + var d = observers[i]; + if (d.dependenciesState === IDerivationState.UP_TO_DATE) d.onBecomeStale(); + d.dependenciesState = IDerivationState.STALE; + } +} +function propagateChangeConfirmed(observable) { + if (observable.lowestObserverState === IDerivationState.STALE) return; + observable.lowestObserverState = IDerivationState.STALE; + var observers = observable.observers; + var i = observers.length; + while (i--) { + var d = observers[i]; + if (d.dependenciesState === IDerivationState.POSSIBLY_STALE) d.dependenciesState = IDerivationState.STALE;else if (d.dependenciesState === IDerivationState.UP_TO_DATE) observable.lowestObserverState = IDerivationState.UP_TO_DATE; + } +} +function propagateMaybeChanged(observable) { + if (observable.lowestObserverState !== IDerivationState.UP_TO_DATE) return; + observable.lowestObserverState = IDerivationState.POSSIBLY_STALE; + var observers = observable.observers; + var i = observers.length; + while (i--) { + var d = observers[i]; + if (d.dependenciesState === IDerivationState.UP_TO_DATE) { + d.dependenciesState = IDerivationState.POSSIBLY_STALE; + d.onBecomeStale(); + } + } +} +var Reaction = function () { + function Reaction(name, onInvalidate) { + if (name === void 0) { + name = "Reaction@" + getNextId(); + } + this.name = name; + this.onInvalidate = onInvalidate; + this.observing = []; + this.newObserving = []; + this.dependenciesState = IDerivationState.NOT_TRACKING; + this.diffValue = 0; + this.runId = 0; + this.unboundDepsCount = 0; + this.__mapid = "#" + getNextId(); + this.isDisposed = false; + this._isScheduled = false; + this._isTrackPending = false; + this._isRunning = false; + } + Reaction.prototype.onBecomeStale = function () { + this.schedule(); + }; + Reaction.prototype.schedule = function () { + if (!this._isScheduled) { + this._isScheduled = true; + globalState.pendingReactions.push(this); + runReactions(); + } + }; + Reaction.prototype.isScheduled = function () { + return this._isScheduled; + }; + Reaction.prototype.runReaction = function () { + if (!this.isDisposed) { + startBatch(); + this._isScheduled = false; + if (shouldCompute(this)) { + this._isTrackPending = true; + this.onInvalidate(); + if (this._isTrackPending && isSpyEnabled()) { + spyReport({ + object: this, + type: "scheduled-reaction" + }); + } + } + endBatch(); + } + }; + Reaction.prototype.track = function (fn) { + startBatch(); + var notify = isSpyEnabled(); + var startTime; + if (notify) { + startTime = Date.now(); + spyReportStart({ + object: this, + type: "reaction", + fn: fn + }); + } + this._isRunning = true; + var result = trackDerivedFunction(this, fn, undefined); + this._isRunning = false; + this._isTrackPending = false; + if (this.isDisposed) { + clearObserving(this); + } + if (isCaughtException(result)) this.reportExceptionInDerivation(result.cause); + if (notify) { + spyReportEnd({ + time: Date.now() - startTime + }); + } + endBatch(); + }; + Reaction.prototype.reportExceptionInDerivation = function (error) { + var _this = this; + if (this.errorHandler) { + this.errorHandler(error, this); + return; + } + var message = "[mobx] Encountered an uncaught exception that was thrown by a reaction or observer component, in: '" + this; + var messageToUser = getMessage("m037"); + console.error(message || messageToUser, error); + if (isSpyEnabled()) { + spyReport({ + type: "error", + message: message, + error: error, + object: this + }); + } + globalState.globalReactionErrorHandlers.forEach(function (f) { + return f(error, _this); + }); + }; + Reaction.prototype.dispose = function () { + if (!this.isDisposed) { + this.isDisposed = true; + if (!this._isRunning) { + startBatch(); + clearObserving(this); + endBatch(); + } + } + }; + Reaction.prototype.getDisposer = function () { + var r = this.dispose.bind(this); + r.$mobx = this; + r.onError = registerErrorHandler; + return r; + }; + Reaction.prototype.toString = function () { + return "Reaction[" + this.name + "]"; + }; + Reaction.prototype.whyRun = function () { + var observing = unique(this._isRunning ? this.newObserving : this.observing).map(function (dep) { + return dep.name; + }); + return "\nWhyRun? reaction '" + this.name + "':\n * Status: [" + (this.isDisposed ? "stopped" : this._isRunning ? "running" : this.isScheduled() ? "scheduled" : "idle") + "]\n * This reaction will re-run if any of the following observables changes:\n " + joinStrings(observing) + "\n " + (this._isRunning ? " (... or any observable accessed during the remainder of the current run)" : "") + "\n\t" + getMessage("m038") + "\n"; + }; + return Reaction; +}(); +exports.Reaction = Reaction; +function registerErrorHandler(handler) { + invariant(this && this.$mobx && isReaction(this.$mobx), "Invalid `this`"); + invariant(!this.$mobx.errorHandler, "Only one onErrorHandler can be registered"); + this.$mobx.errorHandler = handler; +} +function onReactionError(handler) { + globalState.globalReactionErrorHandlers.push(handler); + return function () { + var idx = globalState.globalReactionErrorHandlers.indexOf(handler); + if (idx >= 0) globalState.globalReactionErrorHandlers.splice(idx, 1); + }; +} +var MAX_REACTION_ITERATIONS = 100; +var reactionScheduler = function reactionScheduler(f) { + return f(); +}; +function runReactions() { + if (globalState.inBatch > 0 || globalState.isRunningReactions) return; + reactionScheduler(runReactionsHelper); +} +function runReactionsHelper() { + globalState.isRunningReactions = true; + var allReactions = globalState.pendingReactions; + var iterations = 0; + while (allReactions.length > 0) { + if (++iterations === MAX_REACTION_ITERATIONS) { + console.error("Reaction doesn't converge to a stable state after " + MAX_REACTION_ITERATIONS + " iterations." + (" Probably there is a cycle in the reactive function: " + allReactions[0])); + allReactions.splice(0); + } + var remainingReactions = allReactions.splice(0); + for (var i = 0, l = remainingReactions.length; i < l; i++) { + remainingReactions[i].runReaction(); + } + } + globalState.isRunningReactions = false; +} +var isReaction = createInstanceofPredicate("Reaction", Reaction); +function setReactionScheduler(fn) { + var baseScheduler = reactionScheduler; + reactionScheduler = function reactionScheduler(f) { + return fn(function () { + return baseScheduler(f); + }); + }; +} +function isSpyEnabled() { + return !!globalState.spyListeners.length; +} +function spyReport(event) { + if (!globalState.spyListeners.length) return; + var listeners = globalState.spyListeners; + for (var i = 0, l = listeners.length; i < l; i++) { + listeners[i](event); + } +} +function spyReportStart(event) { + var change = objectAssign({}, event, { spyReportStart: true }); + spyReport(change); +} +var END_EVENT = { spyReportEnd: true }; +function spyReportEnd(change) { + if (change) spyReport(objectAssign({}, change, END_EVENT));else spyReport(END_EVENT); +} +function spy(listener) { + globalState.spyListeners.push(listener); + return once(function () { + var idx = globalState.spyListeners.indexOf(listener); + if (idx !== -1) globalState.spyListeners.splice(idx, 1); + }); +} +exports.spy = spy; +function hasInterceptors(interceptable) { + return interceptable.interceptors && interceptable.interceptors.length > 0; +} +function registerInterceptor(interceptable, handler) { + var interceptors = interceptable.interceptors || (interceptable.interceptors = []); + interceptors.push(handler); + return once(function () { + var idx = interceptors.indexOf(handler); + if (idx !== -1) interceptors.splice(idx, 1); + }); +} +function interceptChange(interceptable, change) { + var prevU = untrackedStart(); + try { + var interceptors = interceptable.interceptors; + if (interceptors) for (var i = 0, l = interceptors.length; i < l; i++) { + change = interceptors[i](change); + invariant(!change || change.type, "Intercept handlers should return nothing or a change object"); + if (!change) break; + } + return change; + } finally { + untrackedEnd(prevU); + } +} +function hasListeners(listenable) { + return listenable.changeListeners && listenable.changeListeners.length > 0; +} +function registerListener(listenable, handler) { + var listeners = listenable.changeListeners || (listenable.changeListeners = []); + listeners.push(handler); + return once(function () { + var idx = listeners.indexOf(handler); + if (idx !== -1) listeners.splice(idx, 1); + }); +} +function notifyListeners(listenable, change) { + var prevU = untrackedStart(); + var listeners = listenable.changeListeners; + if (!listeners) return; + listeners = listeners.slice(); + for (var i = 0, l = listeners.length; i < l; i++) { + listeners[i](change); + } + untrackedEnd(prevU); +} +function asReference(value) { + deprecated("asReference is deprecated, use observable.ref instead"); + return observable.ref(value); +} +exports.asReference = asReference; +function asStructure(value) { + deprecated("asStructure is deprecated. Use observable.struct, computed.struct or reaction options instead."); + return observable.struct(value); +} +exports.asStructure = asStructure; +function asFlat(value) { + deprecated("asFlat is deprecated, use observable.shallow instead"); + return observable.shallow(value); +} +exports.asFlat = asFlat; +function asMap(data) { + deprecated("asMap is deprecated, use observable.map or observable.shallowMap instead"); + return observable.map(data || {}); +} +exports.asMap = asMap; +function isModifierDescriptor(thing) { + return (typeof thing === "undefined" ? "undefined" : _typeof(thing)) === "object" && thing !== null && thing.isMobxModifierDescriptor === true; +} +exports.isModifierDescriptor = isModifierDescriptor; +function createModifierDescriptor(enhancer, initialValue) { + invariant(!isModifierDescriptor(initialValue), "Modifiers cannot be nested"); + return { + isMobxModifierDescriptor: true, + initialValue: initialValue, + enhancer: enhancer + }; +} +function deepEnhancer(v, _, name) { + if (isModifierDescriptor(v)) fail("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"); + if (isObservable(v)) return v; + if (Array.isArray(v)) return observable.array(v, name); + if (isPlainObject(v)) return observable.object(v, name); + if (isES6Map(v)) return observable.map(v, name); + return v; +} +function shallowEnhancer(v, _, name) { + if (isModifierDescriptor(v)) fail("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"); + if (v === undefined || v === null) return v; + if (isObservableObject(v) || isObservableArray(v) || isObservableMap(v)) return v; + if (Array.isArray(v)) return observable.shallowArray(v, name); + if (isPlainObject(v)) return observable.shallowObject(v, name); + if (isES6Map(v)) return observable.shallowMap(v, name); + return fail("The shallow modifier / decorator can only used in combination with arrays, objects and maps"); +} +function referenceEnhancer(newValue) { + return newValue; +} +function deepStructEnhancer(v, oldValue, name) { + if (deepEqual(v, oldValue)) return oldValue; + if (isObservable(v)) return v; + if (Array.isArray(v)) return new ObservableArray(v, deepStructEnhancer, name); + if (isES6Map(v)) return new ObservableMap(v, deepStructEnhancer, name); + if (isPlainObject(v)) { + var res = {}; + asObservableObject(res, name); + extendObservableHelper(res, deepStructEnhancer, [v]); + return res; + } + return v; +} +function refStructEnhancer(v, oldValue, name) { + if (deepEqual(v, oldValue)) return oldValue; + return v; +} +var MAX_SPLICE_SIZE = 10000; +var safariPrototypeSetterInheritanceBug = function () { + var v = false; + var p = {}; + Object.defineProperty(p, "0", { set: function set() { + v = true; + } }); + Object.create(p)["0"] = 1; + return v === false; +}(); +var OBSERVABLE_ARRAY_BUFFER_SIZE = 0; +var StubArray = function () { + function StubArray() {} + return StubArray; +}(); +StubArray.prototype = []; +var ObservableArrayAdministration = function () { + function ObservableArrayAdministration(name, enhancer, array, owned) { + this.array = array; + this.owned = owned; + this.lastKnownLength = 0; + this.interceptors = null; + this.changeListeners = null; + this.atom = new BaseAtom(name || "ObservableArray@" + getNextId()); + this.enhancer = function (newV, oldV) { + return enhancer(newV, oldV, name + "[..]"); + }; + } + ObservableArrayAdministration.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + ObservableArrayAdministration.prototype.observe = function (listener, fireImmediately) { + if (fireImmediately === void 0) { + fireImmediately = false; + } + if (fireImmediately) { + listener({ + object: this.array, + type: "splice", + index: 0, + added: this.values.slice(), + addedCount: this.values.length, + removed: [], + removedCount: 0 + }); + } + return registerListener(this, listener); + }; + ObservableArrayAdministration.prototype.getArrayLength = function () { + this.atom.reportObserved(); + return this.values.length; + }; + ObservableArrayAdministration.prototype.setArrayLength = function (newLength) { + if (typeof newLength !== "number" || newLength < 0) throw new Error("[mobx.array] Out of range: " + newLength); + var currentLength = this.values.length; + if (newLength === currentLength) return;else if (newLength > currentLength) { + var newItems = new Array(newLength - currentLength); + for (var i = 0; i < newLength - currentLength; i++) { + newItems[i] = undefined; + }this.spliceWithArray(currentLength, 0, newItems); + } else this.spliceWithArray(newLength, currentLength - newLength); + }; + ObservableArrayAdministration.prototype.updateArrayLength = function (oldLength, delta) { + if (oldLength !== this.lastKnownLength) throw new Error("[mobx] Modification exception: the internal structure of an observable array was changed. Did you use peek() to change it?"); + this.lastKnownLength += delta; + if (delta > 0 && oldLength + delta + 1 > OBSERVABLE_ARRAY_BUFFER_SIZE) reserveArrayBuffer(oldLength + delta + 1); + }; + ObservableArrayAdministration.prototype.spliceWithArray = function (index, deleteCount, newItems) { + var _this = this; + checkIfStateModificationsAreAllowed(this.atom); + var length = this.values.length; + if (index === undefined) index = 0;else if (index > length) index = length;else if (index < 0) index = Math.max(0, length + index); + if (arguments.length === 1) deleteCount = length - index;else if (deleteCount === undefined || deleteCount === null) deleteCount = 0;else deleteCount = Math.max(0, Math.min(deleteCount, length - index)); + if (newItems === undefined) newItems = []; + if (hasInterceptors(this)) { + var change = interceptChange(this, { + object: this.array, + type: "splice", + index: index, + removedCount: deleteCount, + added: newItems + }); + if (!change) return EMPTY_ARRAY; + deleteCount = change.removedCount; + newItems = change.added; + } + newItems = newItems.map(function (v) { + return _this.enhancer(v, undefined); + }); + var lengthDelta = newItems.length - deleteCount; + this.updateArrayLength(length, lengthDelta); + var res = this.spliceItemsIntoValues(index, deleteCount, newItems); + if (deleteCount !== 0 || newItems.length !== 0) this.notifyArraySplice(index, newItems, res); + return res; + }; + ObservableArrayAdministration.prototype.spliceItemsIntoValues = function (index, deleteCount, newItems) { + if (newItems.length < MAX_SPLICE_SIZE) { + return (_a = this.values).splice.apply(_a, [index, deleteCount].concat(newItems)); + } else { + var res = this.values.slice(index, index + deleteCount); + this.values = this.values.slice(0, index).concat(newItems, this.values.slice(index + deleteCount)); + return res; + } + var _a; + }; + ObservableArrayAdministration.prototype.notifyArrayChildUpdate = function (index, newValue, oldValue) { + var notifySpy = !this.owned && isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + object: this.array, + type: "update", + index: index, newValue: newValue, oldValue: oldValue + } : null; + if (notifySpy) spyReportStart(change); + this.atom.reportChanged(); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + }; + ObservableArrayAdministration.prototype.notifyArraySplice = function (index, added, removed) { + var notifySpy = !this.owned && isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + object: this.array, + type: "splice", + index: index, removed: removed, added: added, + removedCount: removed.length, + addedCount: added.length + } : null; + if (notifySpy) spyReportStart(change); + this.atom.reportChanged(); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + }; + return ObservableArrayAdministration; +}(); +var ObservableArray = function (_super) { + __extends(ObservableArray, _super); + function ObservableArray(initialValues, enhancer, name, owned) { + if (name === void 0) { + name = "ObservableArray@" + getNextId(); + } + if (owned === void 0) { + owned = false; + } + var _this = _super.call(this) || this; + var adm = new ObservableArrayAdministration(name, enhancer, _this, owned); + addHiddenFinalProp(_this, "$mobx", adm); + if (initialValues && initialValues.length) { + adm.updateArrayLength(0, initialValues.length); + adm.values = initialValues.map(function (v) { + return enhancer(v, undefined, name + "[..]"); + }); + adm.notifyArraySplice(0, adm.values.slice(), EMPTY_ARRAY); + } else { + adm.values = []; + } + if (safariPrototypeSetterInheritanceBug) { + Object.defineProperty(adm.array, "0", ENTRY_0); + } + return _this; + } + ObservableArray.prototype.intercept = function (handler) { + return this.$mobx.intercept(handler); + }; + ObservableArray.prototype.observe = function (listener, fireImmediately) { + if (fireImmediately === void 0) { + fireImmediately = false; + } + return this.$mobx.observe(listener, fireImmediately); + }; + ObservableArray.prototype.clear = function () { + return this.splice(0); + }; + ObservableArray.prototype.concat = function () { + var arrays = []; + for (var _i = 0; _i < arguments.length; _i++) { + arrays[_i] = arguments[_i]; + } + this.$mobx.atom.reportObserved(); + return Array.prototype.concat.apply(this.peek(), arrays.map(function (a) { + return isObservableArray(a) ? a.peek() : a; + })); + }; + ObservableArray.prototype.replace = function (newItems) { + return this.$mobx.spliceWithArray(0, this.$mobx.values.length, newItems); + }; + ObservableArray.prototype.toJS = function () { + return this.slice(); + }; + ObservableArray.prototype.toJSON = function () { + return this.toJS(); + }; + ObservableArray.prototype.peek = function () { + return this.$mobx.values; + }; + ObservableArray.prototype.find = function (predicate, thisArg, fromIndex) { + if (fromIndex === void 0) { + fromIndex = 0; + } + this.$mobx.atom.reportObserved(); + var items = this.$mobx.values, + l = items.length; + for (var i = fromIndex; i < l; i++) { + if (predicate.call(thisArg, items[i], i, this)) return items[i]; + }return undefined; + }; + ObservableArray.prototype.splice = function (index, deleteCount) { + var newItems = []; + for (var _i = 2; _i < arguments.length; _i++) { + newItems[_i - 2] = arguments[_i]; + } + switch (arguments.length) { + case 0: + return []; + case 1: + return this.$mobx.spliceWithArray(index); + case 2: + return this.$mobx.spliceWithArray(index, deleteCount); + } + return this.$mobx.spliceWithArray(index, deleteCount, newItems); + }; + ObservableArray.prototype.spliceWithArray = function (index, deleteCount, newItems) { + return this.$mobx.spliceWithArray(index, deleteCount, newItems); + }; + ObservableArray.prototype.push = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + var adm = this.$mobx; + adm.spliceWithArray(adm.values.length, 0, items); + return adm.values.length; + }; + ObservableArray.prototype.pop = function () { + return this.splice(Math.max(this.$mobx.values.length - 1, 0), 1)[0]; + }; + ObservableArray.prototype.shift = function () { + return this.splice(0, 1)[0]; + }; + ObservableArray.prototype.unshift = function () { + var items = []; + for (var _i = 0; _i < arguments.length; _i++) { + items[_i] = arguments[_i]; + } + var adm = this.$mobx; + adm.spliceWithArray(0, 0, items); + return adm.values.length; + }; + ObservableArray.prototype.reverse = function () { + this.$mobx.atom.reportObserved(); + var clone = this.slice(); + return clone.reverse.apply(clone, arguments); + }; + ObservableArray.prototype.sort = function (compareFn) { + this.$mobx.atom.reportObserved(); + var clone = this.slice(); + return clone.sort.apply(clone, arguments); + }; + ObservableArray.prototype.remove = function (value) { + var idx = this.$mobx.values.indexOf(value); + if (idx > -1) { + this.splice(idx, 1); + return true; + } + return false; + }; + ObservableArray.prototype.move = function (fromIndex, toIndex) { + function checkIndex(index) { + if (index < 0) { + throw new Error("[mobx.array] Index out of bounds: " + index + " is negative"); + } + var length = this.$mobx.values.length; + if (index >= length) { + throw new Error("[mobx.array] Index out of bounds: " + index + " is not smaller than " + length); + } + } + checkIndex.call(this, fromIndex); + checkIndex.call(this, toIndex); + if (fromIndex === toIndex) { + return; + } + var oldItems = this.$mobx.values; + var newItems; + if (fromIndex < toIndex) { + newItems = oldItems.slice(0, fromIndex).concat(oldItems.slice(fromIndex + 1, toIndex + 1), [oldItems[fromIndex]], oldItems.slice(toIndex + 1)); + } else { + newItems = oldItems.slice(0, toIndex).concat([oldItems[fromIndex]], oldItems.slice(toIndex, fromIndex), oldItems.slice(fromIndex + 1)); + } + this.replace(newItems); + }; + ObservableArray.prototype.toString = function () { + this.$mobx.atom.reportObserved(); + return Array.prototype.toString.apply(this.$mobx.values, arguments); + }; + ObservableArray.prototype.toLocaleString = function () { + this.$mobx.atom.reportObserved(); + return Array.prototype.toLocaleString.apply(this.$mobx.values, arguments); + }; + return ObservableArray; +}(StubArray); +declareIterator(ObservableArray.prototype, function () { + return arrayAsIterator(this.slice()); +}); +makeNonEnumerable(ObservableArray.prototype, ["constructor", "intercept", "observe", "clear", "concat", "replace", "toJS", "toJSON", "peek", "find", "splice", "spliceWithArray", "push", "pop", "shift", "unshift", "reverse", "sort", "remove", "move", "toString", "toLocaleString"]); +Object.defineProperty(ObservableArray.prototype, "length", { + enumerable: false, + configurable: true, + get: function get() { + return this.$mobx.getArrayLength(); + }, + set: function set(newLength) { + this.$mobx.setArrayLength(newLength); + } +}); +["every", "filter", "forEach", "indexOf", "join", "lastIndexOf", "map", "reduce", "reduceRight", "slice", "some"].forEach(function (funcName) { + var baseFunc = Array.prototype[funcName]; + invariant(typeof baseFunc === "function", "Base function not defined on Array prototype: '" + funcName + "'"); + addHiddenProp(ObservableArray.prototype, funcName, function () { + this.$mobx.atom.reportObserved(); + return baseFunc.apply(this.$mobx.values, arguments); + }); +}); +var ENTRY_0 = { + configurable: true, + enumerable: false, + set: createArraySetter(0), + get: createArrayGetter(0) +}; +function createArrayBufferItem(index) { + var set = createArraySetter(index); + var get = createArrayGetter(index); + Object.defineProperty(ObservableArray.prototype, "" + index, { + enumerable: false, + configurable: true, + set: set, get: get + }); +} +function createArraySetter(index) { + return function (newValue) { + var adm = this.$mobx; + var values = adm.values; + if (index < values.length) { + checkIfStateModificationsAreAllowed(adm.atom); + var oldValue = values[index]; + if (hasInterceptors(adm)) { + var change = interceptChange(adm, { + type: "update", + object: adm.array, + index: index, newValue: newValue + }); + if (!change) return; + newValue = change.newValue; + } + newValue = adm.enhancer(newValue, oldValue); + var changed = newValue !== oldValue; + if (changed) { + values[index] = newValue; + adm.notifyArrayChildUpdate(index, newValue, oldValue); + } + } else if (index === values.length) { + adm.spliceWithArray(index, 0, [newValue]); + } else throw new Error("[mobx.array] Index out of bounds, " + index + " is larger than " + values.length); + }; +} +function createArrayGetter(index) { + return function () { + var impl = this.$mobx; + if (impl) { + if (index < impl.values.length) { + impl.atom.reportObserved(); + return impl.values[index]; + } + console.warn("[mobx.array] Attempt to read an array index (" + index + ") that is out of bounds (" + impl.values.length + "). Please check length first. Out of bound indices will not be tracked by MobX"); + } + return undefined; + }; +} +function reserveArrayBuffer(max) { + for (var index = OBSERVABLE_ARRAY_BUFFER_SIZE; index < max; index++) { + createArrayBufferItem(index); + }OBSERVABLE_ARRAY_BUFFER_SIZE = max; +} +reserveArrayBuffer(1000); +var isObservableArrayAdministration = createInstanceofPredicate("ObservableArrayAdministration", ObservableArrayAdministration); +function isObservableArray(thing) { + return isObject(thing) && isObservableArrayAdministration(thing.$mobx); +} +exports.isObservableArray = isObservableArray; +var ObservableMapMarker = {}; +var ObservableMap = function () { + function ObservableMap(initialData, enhancer, name) { + if (enhancer === void 0) { + enhancer = deepEnhancer; + } + if (name === void 0) { + name = "ObservableMap@" + getNextId(); + } + this.enhancer = enhancer; + this.name = name; + this.$mobx = ObservableMapMarker; + this._data = {}; + this._hasMap = {}; + this._keys = new ObservableArray(undefined, referenceEnhancer, this.name + ".keys()", true); + this.interceptors = null; + this.changeListeners = null; + this.merge(initialData); + } + ObservableMap.prototype._has = function (key) { + return typeof this._data[key] !== "undefined"; + }; + ObservableMap.prototype.has = function (key) { + if (!this.isValidKey(key)) return false; + key = "" + key; + if (this._hasMap[key]) return this._hasMap[key].get(); + return this._updateHasMapEntry(key, false).get(); + }; + ObservableMap.prototype.set = function (key, value) { + this.assertValidKey(key); + key = "" + key; + var hasKey = this._has(key); + if (hasInterceptors(this)) { + var change = interceptChange(this, { + type: hasKey ? "update" : "add", + object: this, + newValue: value, + name: key + }); + if (!change) return this; + value = change.newValue; + } + if (hasKey) { + this._updateValue(key, value); + } else { + this._addValue(key, value); + } + return this; + }; + ObservableMap.prototype.delete = function (key) { + var _this = this; + this.assertValidKey(key); + key = "" + key; + if (hasInterceptors(this)) { + var change = interceptChange(this, { + type: "delete", + object: this, + name: key + }); + if (!change) return false; + } + if (this._has(key)) { + var notifySpy = isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + type: "delete", + object: this, + oldValue: this._data[key].value, + name: key + } : null; + if (notifySpy) spyReportStart(change); + runInTransaction(function () { + _this._keys.remove(key); + _this._updateHasMapEntry(key, false); + var observable = _this._data[key]; + observable.setNewValue(undefined); + _this._data[key] = undefined; + }); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + return true; + } + return false; + }; + ObservableMap.prototype._updateHasMapEntry = function (key, value) { + var entry = this._hasMap[key]; + if (entry) { + entry.setNewValue(value); + } else { + entry = this._hasMap[key] = new ObservableValue(value, referenceEnhancer, this.name + "." + key + "?", false); + } + return entry; + }; + ObservableMap.prototype._updateValue = function (name, newValue) { + var observable = this._data[name]; + newValue = observable.prepareNewValue(newValue); + if (newValue !== UNCHANGED) { + var notifySpy = isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + type: "update", + object: this, + oldValue: observable.value, + name: name, newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + observable.setNewValue(newValue); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + } + }; + ObservableMap.prototype._addValue = function (name, newValue) { + var _this = this; + runInTransaction(function () { + var observable = _this._data[name] = new ObservableValue(newValue, _this.enhancer, _this.name + "." + name, false); + newValue = observable.value; + _this._updateHasMapEntry(name, true); + _this._keys.push(name); + }); + var notifySpy = isSpyEnabled(); + var notify = hasListeners(this); + var change = notify || notifySpy ? { + type: "add", + object: this, + name: name, newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + if (notify) notifyListeners(this, change); + if (notifySpy) spyReportEnd(); + }; + ObservableMap.prototype.get = function (key) { + key = "" + key; + if (this.has(key)) return this._data[key].get(); + return undefined; + }; + ObservableMap.prototype.keys = function () { + return arrayAsIterator(this._keys.slice()); + }; + ObservableMap.prototype.values = function () { + return arrayAsIterator(this._keys.map(this.get, this)); + }; + ObservableMap.prototype.entries = function () { + var _this = this; + return arrayAsIterator(this._keys.map(function (key) { + return [key, _this.get(key)]; + })); + }; + ObservableMap.prototype.forEach = function (callback, thisArg) { + var _this = this; + this.keys().forEach(function (key) { + return callback.call(thisArg, _this.get(key), key, _this); + }); + }; + ObservableMap.prototype.merge = function (other) { + var _this = this; + if (isObservableMap(other)) { + other = other.toJS(); + } + runInTransaction(function () { + if (isPlainObject(other)) Object.keys(other).forEach(function (key) { + return _this.set(key, other[key]); + });else if (Array.isArray(other)) other.forEach(function (_a) { + var key = _a[0], + value = _a[1]; + return _this.set(key, value); + });else if (isES6Map(other)) other.forEach(function (value, key) { + return _this.set(key, value); + });else if (other !== null && other !== undefined) fail("Cannot initialize map from " + other); + }); + return this; + }; + ObservableMap.prototype.clear = function () { + var _this = this; + runInTransaction(function () { + untracked(function () { + _this.keys().forEach(_this.delete, _this); + }); + }); + }; + ObservableMap.prototype.replace = function (values) { + var _this = this; + runInTransaction(function () { + _this.clear(); + _this.merge(values); + }); + return this; + }; + Object.defineProperty(ObservableMap.prototype, "size", { + get: function get() { + return this._keys.length; + }, + enumerable: true, + configurable: true + }); + ObservableMap.prototype.toJS = function () { + var _this = this; + var res = {}; + this.keys().forEach(function (key) { + return res[key] = _this.get(key); + }); + return res; + }; + ObservableMap.prototype.toJSON = function () { + return this.toJS(); + }; + ObservableMap.prototype.isValidKey = function (key) { + if (key === null || key === undefined) return false; + if (typeof key === "string" || typeof key === "number" || typeof key === "boolean") return true; + return false; + }; + ObservableMap.prototype.assertValidKey = function (key) { + if (!this.isValidKey(key)) throw new Error("[mobx.map] Invalid key: '" + key + "', only strings, numbers and booleans are accepted as key in observable maps."); + }; + ObservableMap.prototype.toString = function () { + var _this = this; + return this.name + "[{ " + this.keys().map(function (key) { + return key + ": " + ("" + _this.get(key)); + }).join(", ") + " }]"; + }; + ObservableMap.prototype.observe = function (listener, fireImmediately) { + invariant(fireImmediately !== true, getMessage("m033")); + return registerListener(this, listener); + }; + ObservableMap.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + return ObservableMap; +}(); +exports.ObservableMap = ObservableMap; +declareIterator(ObservableMap.prototype, function () { + return this.entries(); +}); +function map(initialValues) { + deprecated("`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead"); + return observable.map(initialValues); +} +exports.map = map; +var isObservableMap = createInstanceofPredicate("ObservableMap", ObservableMap); +exports.isObservableMap = isObservableMap; +var ObservableObjectAdministration = function () { + function ObservableObjectAdministration(target, name) { + this.target = target; + this.name = name; + this.values = {}; + this.changeListeners = null; + this.interceptors = null; + } + ObservableObjectAdministration.prototype.observe = function (callback, fireImmediately) { + invariant(fireImmediately !== true, "`observe` doesn't support the fire immediately property for observable objects."); + return registerListener(this, callback); + }; + ObservableObjectAdministration.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + return ObservableObjectAdministration; +}(); +function asObservableObject(target, name) { + if (isObservableObject(target)) return target.$mobx; + invariant(Object.isExtensible(target), getMessage("m035")); + if (!isPlainObject(target)) name = (target.constructor.name || "ObservableObject") + "@" + getNextId(); + if (!name) name = "ObservableObject@" + getNextId(); + var adm = new ObservableObjectAdministration(target, name); + addHiddenFinalProp(target, "$mobx", adm); + return adm; +} +function defineObservablePropertyFromDescriptor(adm, propName, descriptor, defaultEnhancer) { + if (adm.values[propName]) { + invariant("value" in descriptor, "The property " + propName + " in " + adm.name + " is already observable, cannot redefine it as computed property"); + adm.target[propName] = descriptor.value; + return; + } + if ("value" in descriptor) { + if (isModifierDescriptor(descriptor.value)) { + var modifierDescriptor = descriptor.value; + defineObservableProperty(adm, propName, modifierDescriptor.initialValue, modifierDescriptor.enhancer); + } else if (isAction(descriptor.value) && descriptor.value.autoBind === true) { + defineBoundAction(adm.target, propName, descriptor.value.originalFn); + } else if (isComputedValue(descriptor.value)) { + defineComputedPropertyFromComputedValue(adm, propName, descriptor.value); + } else { + defineObservableProperty(adm, propName, descriptor.value, defaultEnhancer); + } + } else { + defineComputedProperty(adm, propName, descriptor.get, descriptor.set, false, true); + } +} +function defineObservableProperty(adm, propName, newValue, enhancer) { + assertPropertyConfigurable(adm.target, propName); + if (hasInterceptors(adm)) { + var change = interceptChange(adm, { + object: adm.target, + name: propName, + type: "add", + newValue: newValue + }); + if (!change) return; + newValue = change.newValue; + } + var observable = adm.values[propName] = new ObservableValue(newValue, enhancer, adm.name + "." + propName, false); + newValue = observable.value; + Object.defineProperty(adm.target, propName, generateObservablePropConfig(propName)); + notifyPropertyAddition(adm, adm.target, propName, newValue); +} +function defineComputedProperty(adm, propName, getter, setter, compareStructural, asInstanceProperty) { + if (asInstanceProperty) assertPropertyConfigurable(adm.target, propName); + adm.values[propName] = new ComputedValue(getter, adm.target, compareStructural, adm.name + "." + propName, setter); + if (asInstanceProperty) { + Object.defineProperty(adm.target, propName, generateComputedPropConfig(propName)); + } +} +function defineComputedPropertyFromComputedValue(adm, propName, computedValue) { + var name = adm.name + "." + propName; + computedValue.name = name; + if (!computedValue.scope) computedValue.scope = adm.target; + adm.values[propName] = computedValue; + Object.defineProperty(adm.target, propName, generateComputedPropConfig(propName)); +} +var observablePropertyConfigs = {}; +var computedPropertyConfigs = {}; +function generateObservablePropConfig(propName) { + return observablePropertyConfigs[propName] || (observablePropertyConfigs[propName] = { + configurable: true, + enumerable: true, + get: function get() { + return this.$mobx.values[propName].get(); + }, + set: function set(v) { + setPropertyValue(this, propName, v); + } + }); +} +function generateComputedPropConfig(propName) { + return computedPropertyConfigs[propName] || (computedPropertyConfigs[propName] = { + configurable: true, + enumerable: false, + get: function get() { + return this.$mobx.values[propName].get(); + }, + set: function set(v) { + return this.$mobx.values[propName].set(v); + } + }); +} +function setPropertyValue(instance, name, newValue) { + var adm = instance.$mobx; + var observable = adm.values[name]; + if (hasInterceptors(adm)) { + var change = interceptChange(adm, { + type: "update", + object: instance, + name: name, newValue: newValue + }); + if (!change) return; + newValue = change.newValue; + } + newValue = observable.prepareNewValue(newValue); + if (newValue !== UNCHANGED) { + var notify = hasListeners(adm); + var notifySpy = isSpyEnabled(); + var change = notify || notifySpy ? { + type: "update", + object: instance, + oldValue: observable.value, + name: name, newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + observable.setNewValue(newValue); + if (notify) notifyListeners(adm, change); + if (notifySpy) spyReportEnd(); + } +} +function notifyPropertyAddition(adm, object, name, newValue) { + var notify = hasListeners(adm); + var notifySpy = isSpyEnabled(); + var change = notify || notifySpy ? { + type: "add", + object: object, name: name, newValue: newValue + } : null; + if (notifySpy) spyReportStart(change); + if (notify) notifyListeners(adm, change); + if (notifySpy) spyReportEnd(); +} +var isObservableObjectAdministration = createInstanceofPredicate("ObservableObjectAdministration", ObservableObjectAdministration); +function isObservableObject(thing) { + if (isObject(thing)) { + runLazyInitializers(thing); + return isObservableObjectAdministration(thing.$mobx); + } + return false; +} +exports.isObservableObject = isObservableObject; +var UNCHANGED = {}; +var ObservableValue = function (_super) { + __extends(ObservableValue, _super); + function ObservableValue(value, enhancer, name, notifySpy) { + if (name === void 0) { + name = "ObservableValue@" + getNextId(); + } + if (notifySpy === void 0) { + notifySpy = true; + } + var _this = _super.call(this, name) || this; + _this.enhancer = enhancer; + _this.hasUnreportedChange = false; + _this.value = enhancer(value, undefined, name); + if (notifySpy && isSpyEnabled()) { + spyReport({ type: "create", object: _this, newValue: _this.value }); + } + return _this; + } + ObservableValue.prototype.set = function (newValue) { + var oldValue = this.value; + newValue = this.prepareNewValue(newValue); + if (newValue !== UNCHANGED) { + var notifySpy = isSpyEnabled(); + if (notifySpy) { + spyReportStart({ + type: "update", + object: this, + newValue: newValue, oldValue: oldValue + }); + } + this.setNewValue(newValue); + if (notifySpy) spyReportEnd(); + } + }; + ObservableValue.prototype.prepareNewValue = function (newValue) { + checkIfStateModificationsAreAllowed(this); + if (hasInterceptors(this)) { + var change = interceptChange(this, { object: this, type: "update", newValue: newValue }); + if (!change) return UNCHANGED; + newValue = change.newValue; + } + newValue = this.enhancer(newValue, this.value, this.name); + return this.value !== newValue ? newValue : UNCHANGED; + }; + ObservableValue.prototype.setNewValue = function (newValue) { + var oldValue = this.value; + this.value = newValue; + this.reportChanged(); + if (hasListeners(this)) { + notifyListeners(this, { + type: "update", + object: this, + newValue: newValue, + oldValue: oldValue + }); + } + }; + ObservableValue.prototype.get = function () { + this.reportObserved(); + return this.value; + }; + ObservableValue.prototype.intercept = function (handler) { + return registerInterceptor(this, handler); + }; + ObservableValue.prototype.observe = function (listener, fireImmediately) { + if (fireImmediately) listener({ + object: this, + type: "update", + newValue: this.value, + oldValue: undefined + }); + return registerListener(this, listener); + }; + ObservableValue.prototype.toJSON = function () { + return this.get(); + }; + ObservableValue.prototype.toString = function () { + return this.name + "[" + this.value + "]"; + }; + ObservableValue.prototype.valueOf = function () { + return toPrimitive(this.get()); + }; + return ObservableValue; +}(BaseAtom); +ObservableValue.prototype[primitiveSymbol()] = ObservableValue.prototype.valueOf; +var isObservableValue = createInstanceofPredicate("ObservableValue", ObservableValue); +exports.isBoxedObservable = isObservableValue; +function getAtom(thing, property) { + if ((typeof thing === "undefined" ? "undefined" : _typeof(thing)) === "object" && thing !== null) { + if (isObservableArray(thing)) { + invariant(property === undefined, getMessage("m036")); + return thing.$mobx.atom; + } + if (isObservableMap(thing)) { + var anyThing = thing; + if (property === undefined) return getAtom(anyThing._keys); + var observable_2 = anyThing._data[property] || anyThing._hasMap[property]; + invariant(!!observable_2, "the entry '" + property + "' does not exist in the observable map '" + getDebugName(thing) + "'"); + return observable_2; + } + runLazyInitializers(thing); + if (isObservableObject(thing)) { + if (!property) return fail("please specify a property"); + var observable_3 = thing.$mobx.values[property]; + invariant(!!observable_3, "no observable property '" + property + "' found on the observable object '" + getDebugName(thing) + "'"); + return observable_3; + } + if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) { + return thing; + } + } else if (typeof thing === "function") { + if (isReaction(thing.$mobx)) { + return thing.$mobx; + } + } + return fail("Cannot obtain atom from " + thing); +} +function getAdministration(thing, property) { + invariant(thing, "Expecting some object"); + if (property !== undefined) return getAdministration(getAtom(thing, property)); + if (isAtom(thing) || isComputedValue(thing) || isReaction(thing)) return thing; + if (isObservableMap(thing)) return thing; + runLazyInitializers(thing); + if (thing.$mobx) return thing.$mobx; + invariant(false, "Cannot obtain administration from " + thing); +} +function getDebugName(thing, property) { + var named; + if (property !== undefined) named = getAtom(thing, property);else if (isObservableObject(thing) || isObservableMap(thing)) named = getAdministration(thing);else named = getAtom(thing); + return named.name; +} +function createClassPropertyDecorator(onInitialize, _get, _set, enumerable, allowCustomArguments) { + function classPropertyDecorator(target, key, descriptor, customArgs, argLen) { + if (argLen === void 0) { + argLen = 0; + } + invariant(allowCustomArguments || quacksLikeADecorator(arguments), "This function is a decorator, but it wasn't invoked like a decorator"); + if (!descriptor) { + var newDescriptor = { + enumerable: enumerable, + configurable: true, + get: function get() { + if (!this.__mobxInitializedProps || this.__mobxInitializedProps[key] !== true) typescriptInitializeProperty(this, key, undefined, onInitialize, customArgs, descriptor); + return _get.call(this, key); + }, + set: function set(v) { + if (!this.__mobxInitializedProps || this.__mobxInitializedProps[key] !== true) { + typescriptInitializeProperty(this, key, v, onInitialize, customArgs, descriptor); + } else { + _set.call(this, key, v); + } + } + }; + if (arguments.length < 3 || arguments.length === 5 && argLen < 3) { + Object.defineProperty(target, key, newDescriptor); + } + return newDescriptor; + } else { + if (!hasOwnProperty(target, "__mobxLazyInitializers")) { + addHiddenProp(target, "__mobxLazyInitializers", target.__mobxLazyInitializers && target.__mobxLazyInitializers.slice() || []); + } + var value_1 = descriptor.value, + initializer_1 = descriptor.initializer; + target.__mobxLazyInitializers.push(function (instance) { + onInitialize(instance, key, initializer_1 ? initializer_1.call(instance) : value_1, customArgs, descriptor); + }); + return { + enumerable: enumerable, configurable: true, + get: function get() { + if (this.__mobxDidRunLazyInitializers !== true) runLazyInitializers(this); + return _get.call(this, key); + }, + set: function set(v) { + if (this.__mobxDidRunLazyInitializers !== true) runLazyInitializers(this); + _set.call(this, key, v); + } + }; + } + } + if (allowCustomArguments) { + return function () { + if (quacksLikeADecorator(arguments)) return classPropertyDecorator.apply(null, arguments); + var outerArgs = arguments; + var argLen = arguments.length; + return function (target, key, descriptor) { + return classPropertyDecorator(target, key, descriptor, outerArgs, argLen); + }; + }; + } + return classPropertyDecorator; +} +function typescriptInitializeProperty(instance, key, v, onInitialize, customArgs, baseDescriptor) { + if (!hasOwnProperty(instance, "__mobxInitializedProps")) addHiddenProp(instance, "__mobxInitializedProps", {}); + instance.__mobxInitializedProps[key] = true; + onInitialize(instance, key, v, customArgs, baseDescriptor); +} +function runLazyInitializers(instance) { + if (instance.__mobxDidRunLazyInitializers === true) return; + if (instance.__mobxLazyInitializers) { + addHiddenProp(instance, "__mobxDidRunLazyInitializers", true); + instance.__mobxDidRunLazyInitializers && instance.__mobxLazyInitializers.forEach(function (initializer) { + return initializer(instance); + }); + } +} +function quacksLikeADecorator(args) { + return (args.length === 2 || args.length === 3) && typeof args[1] === "string"; +} +function iteratorSymbol() { + return typeof Symbol === "function" && Symbol.iterator || "@@iterator"; +} +var IS_ITERATING_MARKER = "__$$iterating"; +function arrayAsIterator(array) { + invariant(array[IS_ITERATING_MARKER] !== true, "Illegal state: cannot recycle array as iterator"); + addHiddenFinalProp(array, IS_ITERATING_MARKER, true); + var idx = -1; + addHiddenFinalProp(array, "next", function next() { + idx++; + return { + done: idx >= this.length, + value: idx < this.length ? this[idx] : undefined + }; + }); + return array; +} +function declareIterator(prototType, iteratorFactory) { + addHiddenFinalProp(prototType, iteratorSymbol(), iteratorFactory); +} +var messages = { + "m001": "It is not allowed to assign new values to @action fields", + "m002": "`runInAction` expects a function", + "m003": "`runInAction` expects a function without arguments", + "m004": "autorun expects a function", + "m005": "Warning: attempted to pass an action to autorun. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.", + "m006": "Warning: attempted to pass an action to autorunAsync. Actions are untracked and will not trigger on state changes. Use `reaction` or wrap only your state modification code in an action.", + "m007": "reaction only accepts 2 or 3 arguments. If migrating from MobX 2, please provide an options object", + "m008": "wrapping reaction expression in `asReference` is no longer supported, use options object instead", + "m009": "@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'. It looks like it was used on a property.", + "m010": "@computed can only be used on getter functions, like: '@computed get myProps() { return ...; }'", + "m011": "First argument to `computed` should be an expression. If using computed as decorator, don't pass it arguments", + "m012": "computed takes one or two arguments if used as function", + "m013": "[mobx.expr] 'expr' should only be used inside other reactive functions.", + "m014": "extendObservable expected 2 or more arguments", + "m015": "extendObservable expects an object as first argument", + "m016": "extendObservable should not be used on maps, use map.merge instead", + "m017": "all arguments of extendObservable should be objects", + "m018": "extending an object with another observable (object) is not supported. Please construct an explicit propertymap, using `toJS` if need. See issue #540", + "m019": "[mobx.isObservable] isObservable(object, propertyName) is not supported for arrays and maps. Use map.has or array.length instead.", + "m020": "modifiers can only be used for individual object properties", + "m021": "observable expects zero or one arguments", + "m022": "@observable can not be used on getters, use @computed instead", + "m023": "Using `transaction` is deprecated, use `runInAction` or `(@)action` instead.", + "m024": "whyRun() can only be used if a derivation is active, or by passing an computed value / reaction explicitly. If you invoked whyRun from inside a computation; the computation is currently suspended but re-evaluating because somebody requested its value.", + "m025": "whyRun can only be used on reactions and computed values", + "m026": "`action` can only be invoked on functions", + "m028": "It is not allowed to set `useStrict` when a derivation is running", + "m029": "INTERNAL ERROR only onBecomeUnobserved shouldn't be called twice in a row", + "m030a": "Since strict-mode is enabled, changing observed observable values outside actions is not allowed. Please wrap the code in an `action` if this change is intended. Tried to modify: ", + "m030b": "Side effects like changing state are not allowed at this point. Are you trying to modify state from, for example, the render function of a React component? Tried to modify: ", + "m031": "Computed values are not allowed to not cause side effects by changing observables that are already being observed. Tried to modify: ", + "m032": "* This computation is suspended (not in use by any reaction) and won't run automatically.\n Didn't expect this computation to be suspended at this point?\n 1. Make sure this computation is used by a reaction (reaction, autorun, observer).\n 2. Check whether you are using this computation synchronously (in the same stack as they reaction that needs it).", + "m033": "`observe` doesn't support the fire immediately property for observable maps.", + "m034": "`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead", + "m035": "Cannot make the designated object observable; it is not extensible", + "m036": "It is not possible to get index atoms from arrays", + "m037": "Hi there! I'm sorry you have just run into an exception.\nIf your debugger ends up here, know that some reaction (like the render() of an observer component, autorun or reaction)\nthrew an exception and that mobx caught it, to avoid that it brings the rest of your application down.\nThe original cause of the exception (the code that caused this reaction to run (again)), is still in the stack.\n\nHowever, more interesting is the actual stack trace of the error itself.\nHopefully the error is an instanceof Error, because in that case you can inspect the original stack of the error from where it was thrown.\nSee `error.stack` property, or press the very subtle \"(...)\" link you see near the console.error message that probably brought you here.\nThat stack is more interesting than the stack of this console.error itself.\n\nIf the exception you see is an exception you created yourself, make sure to use `throw new Error(\"Oops\")` instead of `throw \"Oops\"`,\nbecause the javascript environment will only preserve the original stack trace in the first form.\n\nYou can also make sure the debugger pauses the next time this very same exception is thrown by enabling \"Pause on caught exception\".\n(Note that it might pause on many other, unrelated exception as well).\n\nIf that all doesn't help you out, feel free to open an issue https://github.com/mobxjs/mobx/issues!\n", + "m038": "Missing items in this list?\n 1. Check whether all used values are properly marked as observable (use isObservable to verify)\n 2. Make sure you didn't dereference values too early. MobX observes props, not primitives. E.g: use 'person.name' instead of 'name' in your computation.\n" +}; +function getMessage(id) { + return messages[id]; +} +var EMPTY_ARRAY = []; +Object.freeze(EMPTY_ARRAY); +function getGlobal() { + return global; +} +function getNextId() { + return ++globalState.mobxGuid; +} +function fail(message, thing) { + invariant(false, message, thing); + throw "X"; +} +function invariant(check, message, thing) { + if (!check) throw new Error("[mobx] Invariant failed: " + message + (thing ? " in '" + thing + "'" : "")); +} +var deprecatedMessages = []; +function deprecated(msg) { + if (deprecatedMessages.indexOf(msg) !== -1) return false; + deprecatedMessages.push(msg); + console.error("[mobx] Deprecated: " + msg); + return true; +} +function once(func) { + var invoked = false; + return function () { + if (invoked) return; + invoked = true; + return func.apply(this, arguments); + }; +} +var noop = function noop() {}; +function unique(list) { + var res = []; + list.forEach(function (item) { + if (res.indexOf(item) === -1) res.push(item); + }); + return res; +} +function joinStrings(things, limit, separator) { + if (limit === void 0) { + limit = 100; + } + if (separator === void 0) { + separator = " - "; + } + if (!things) return ""; + var sliced = things.slice(0, limit); + return "" + sliced.join(separator) + (things.length > limit ? " (... and " + (things.length - limit) + "more)" : ""); +} +function isObject(value) { + return value !== null && (typeof value === "undefined" ? "undefined" : _typeof(value)) === "object"; +} +function isPlainObject(value) { + if (value === null || (typeof value === "undefined" ? "undefined" : _typeof(value)) !== "object") return false; + var proto = Object.getPrototypeOf(value); + return proto === Object.prototype || proto === null; +} +function objectAssign() { + var res = arguments[0]; + for (var i = 1, l = arguments.length; i < l; i++) { + var source = arguments[i]; + for (var key in source) { + if (hasOwnProperty(source, key)) { + res[key] = source[key]; + } + } + } + return res; +} +function valueDidChange(compareStructural, oldValue, newValue) { + if (typeof oldValue === 'number' && isNaN(oldValue)) { + return typeof newValue !== 'number' || !isNaN(newValue); + } + return compareStructural ? !deepEqual(oldValue, newValue) : oldValue !== newValue; +} +var prototypeHasOwnProperty = Object.prototype.hasOwnProperty; +function hasOwnProperty(object, propName) { + return prototypeHasOwnProperty.call(object, propName); +} +function makeNonEnumerable(object, propNames) { + for (var i = 0; i < propNames.length; i++) { + addHiddenProp(object, propNames[i], object[propNames[i]]); + } +} +function addHiddenProp(object, propName, value) { + Object.defineProperty(object, propName, { + enumerable: false, + writable: true, + configurable: true, + value: value + }); +} +function addHiddenFinalProp(object, propName, value) { + Object.defineProperty(object, propName, { + enumerable: false, + writable: false, + configurable: true, + value: value + }); +} +function isPropertyConfigurable(object, prop) { + var descriptor = Object.getOwnPropertyDescriptor(object, prop); + return !descriptor || descriptor.configurable !== false && descriptor.writable !== false; +} +function assertPropertyConfigurable(object, prop) { + invariant(isPropertyConfigurable(object, prop), "Cannot make property '" + prop + "' observable, it is not configurable and writable in the target object"); +} +function getEnumerableKeys(obj) { + var res = []; + for (var key in obj) { + res.push(key); + }return res; +} +function deepEqual(a, b) { + if (a === null && b === null) return true; + if (a === undefined && b === undefined) return true; + if ((typeof a === "undefined" ? "undefined" : _typeof(a)) !== "object") return a === b; + var aIsArray = isArrayLike(a); + var aIsMap = isMapLike(a); + if (aIsArray !== isArrayLike(b)) { + return false; + } else if (aIsMap !== isMapLike(b)) { + return false; + } else if (aIsArray) { + if (a.length !== b.length) return false; + for (var i = a.length - 1; i >= 0; i--) { + if (!deepEqual(a[i], b[i])) return false; + }return true; + } else if (aIsMap) { + if (a.size !== b.size) return false; + var equals_1 = true; + a.forEach(function (value, key) { + equals_1 = equals_1 && deepEqual(b.get(key), value); + }); + return equals_1; + } else if ((typeof a === "undefined" ? "undefined" : _typeof(a)) === "object" && (typeof b === "undefined" ? "undefined" : _typeof(b)) === "object") { + if (a === null || b === null) return false; + if (isMapLike(a) && isMapLike(b)) { + if (a.size !== b.size) return false; + return deepEqual(observable.shallowMap(a).entries(), observable.shallowMap(b).entries()); + } + if (getEnumerableKeys(a).length !== getEnumerableKeys(b).length) return false; + for (var prop in a) { + if (!(prop in b)) return false; + if (!deepEqual(a[prop], b[prop])) return false; + } + return true; + } + return false; +} +function createInstanceofPredicate(name, clazz) { + var propName = "isMobX" + name; + clazz.prototype[propName] = true; + return function (x) { + return isObject(x) && x[propName] === true; + }; +} +function isArrayLike(x) { + return Array.isArray(x) || isObservableArray(x); +} +exports.isArrayLike = isArrayLike; +function isMapLike(x) { + return isES6Map(x) || isObservableMap(x); +} +function isES6Map(thing) { + if (getGlobal().Map !== undefined && thing instanceof getGlobal().Map) return true; + return false; +} +function primitiveSymbol() { + return typeof Symbol === "function" && Symbol.toPrimitive || "@@toPrimitive"; +} +function toPrimitive(value) { + return value === null ? null : (typeof value === "undefined" ? "undefined" : _typeof(value)) === "object" ? "" + value : value; +} +/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(4))) + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +var _icons = __webpack_require__(6); + +var _constants = __webpack_require__(0); + +function renderHeader(_ref, instance) { + var meta = _ref.meta, + user = _ref.user, + reactions = _ref.reactions; + + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-header-container'; + + var likeButton = document.createElement('span'); + var likedReaction = reactions.find(function (reaction) { + return reaction.content === 'heart' && reaction.user.login === user.login; + }); + likeButton.className = 'gitment-header-like-btn'; + likeButton.innerHTML = '\n ' + _icons.heart + '\n ' + (likedReaction ? 'Unlike' : 'Like') + '\n ' + (meta.reactions && meta.reactions.heart ? ' \u2022 ' + meta.reactions.heart + ' Liked' : '') + '\n '; + + if (likedReaction) { + likeButton.classList.add('liked'); + likeButton.onclick = function () { + return instance.unlike(); + }; + } else { + likeButton.classList.remove('liked'); + likeButton.onclick = function () { + return instance.like(); + }; + } + container.appendChild(likeButton); + + var commentsCount = document.createElement('span'); + commentsCount.innerHTML = '\n ' + (meta.comments ? ' \u2022 ' + meta.comments + ' Comments' : '') + '\n '; + container.appendChild(commentsCount); + + var issueLink = document.createElement('a'); + issueLink.className = 'gitment-header-issue-link'; + issueLink.href = meta.html_url; + issueLink.target = '_blank'; + issueLink.innerText = 'Issue Page'; + container.appendChild(issueLink); + + return container; +} + +function renderComments(_ref2, instance) { + var meta = _ref2.meta, + comments = _ref2.comments, + commentReactions = _ref2.commentReactions, + currentPage = _ref2.currentPage, + user = _ref2.user, + error = _ref2.error; + + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-comments-container'; + + if (error) { + var errorBlock = document.createElement('div'); + errorBlock.className = 'gitment-comments-error'; + + if (error === _constants.NOT_INITIALIZED_ERROR && user.login && user.login.toLowerCase() === instance.owner.toLowerCase()) { + var initHint = document.createElement('div'); + var initButton = document.createElement('button'); + initButton.className = 'gitment-comments-init-btn'; + initButton.onclick = function () { + initButton.setAttribute('disabled', true); + instance.init().catch(function (e) { + initButton.removeAttribute('disabled'); + alert(e); + }); + }; + initButton.innerText = 'Initialize Comments'; + initHint.appendChild(initButton); + errorBlock.appendChild(initHint); + } else { + errorBlock.innerText = error; + } + container.appendChild(errorBlock); + return container; + } else if (comments === undefined) { + var loading = document.createElement('div'); + loading.innerText = 'Loading comments...'; + loading.className = 'gitment-comments-loading'; + container.appendChild(loading); + return container; + } else if (!comments.length) { + var emptyBlock = document.createElement('div'); + emptyBlock.className = 'gitment-comments-empty'; + emptyBlock.innerText = 'No Comment Yet'; + container.appendChild(emptyBlock); + return container; + } + + var commentsList = document.createElement('ul'); + commentsList.className = 'gitment-comments-list'; + + comments.forEach(function (comment) { + var createDate = new Date(comment.created_at); + var updateDate = new Date(comment.updated_at); + var commentItem = document.createElement('li'); + commentItem.className = 'gitment-comment'; + commentItem.innerHTML = '\n \n \n \n
\n
\n \n ' + comment.user.login + '\n \n commented on\n ' + createDate.toDateString() + '\n ' + (createDate.toString() !== updateDate.toString() ? ' \u2022 edited' : '') + '\n
' + _icons.heart + ' ' + (comment.reactions.heart || '') + '
\n
\n
' + comment.body_html + '
\n
\n '; + var likeButton = commentItem.querySelector('.gitment-comment-like-btn'); + var likedReaction = commentReactions[comment.id] && commentReactions[comment.id].find(function (reaction) { + return reaction.content === 'heart' && reaction.user.login === user.login; + }); + if (likedReaction) { + likeButton.classList.add('liked'); + likeButton.onclick = function () { + return instance.unlikeAComment(comment.id); + }; + } else { + likeButton.classList.remove('liked'); + likeButton.onclick = function () { + return instance.likeAComment(comment.id); + }; + } + + // dirty + // use a blank image to trigger height calculating when element rendered + var imgTrigger = document.createElement('img'); + var markdownBody = commentItem.querySelector('.gitment-comment-body'); + imgTrigger.className = 'gitment-hidden'; + imgTrigger.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + imgTrigger.onload = function () { + if (markdownBody.clientHeight > instance.maxCommentHeight) { + markdownBody.classList.add('gitment-comment-body-folded'); + markdownBody.style.maxHeight = instance.maxCommentHeight + 'px'; + markdownBody.title = 'Click to Expand'; + markdownBody.onclick = function () { + markdownBody.classList.remove('gitment-comment-body-folded'); + markdownBody.style.maxHeight = ''; + markdownBody.title = ''; + markdownBody.onclick = null; + }; + } + }; + commentItem.appendChild(imgTrigger); + + commentsList.appendChild(commentItem); + }); + + container.appendChild(commentsList); + + if (meta) { + var pageCount = Math.ceil(meta.comments / instance.perPage); + if (pageCount > 1) { + var pagination = document.createElement('ul'); + pagination.className = 'gitment-comments-pagination'; + + if (currentPage > 1) { + var previousButton = document.createElement('li'); + previousButton.className = 'gitment-comments-page-item'; + previousButton.innerText = 'Previous'; + previousButton.onclick = function () { + return instance.goto(currentPage - 1); + }; + pagination.appendChild(previousButton); + } + + var _loop = function _loop(i) { + var pageItem = document.createElement('li'); + pageItem.className = 'gitment-comments-page-item'; + pageItem.innerText = i; + pageItem.onclick = function () { + return instance.goto(i); + }; + if (currentPage === i) pageItem.classList.add('gitment-selected'); + pagination.appendChild(pageItem); + }; + + for (var i = 1; i <= pageCount; i++) { + _loop(i); + } + + if (currentPage < pageCount) { + var nextButton = document.createElement('li'); + nextButton.className = 'gitment-comments-page-item'; + nextButton.innerText = 'Next'; + nextButton.onclick = function () { + return instance.goto(currentPage + 1); + }; + pagination.appendChild(nextButton); + } + + container.appendChild(pagination); + } + } + + return container; +} + +function renderEditor(_ref3, instance) { + var user = _ref3.user, + error = _ref3.error; + + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-editor-container'; + + var shouldDisable = user.login && !error ? '' : 'disabled'; + var disabledTip = user.login ? '' : 'Login to Comment'; + container.innerHTML = '\n ' + (user.login ? '\n \n ' : user.isLoggingIn ? '
' + _icons.spinner + '
' : '\n ' + _icons.github + '\n ') + '\n \n
\n
\n \n \n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n \n '; + if (user.login) { + container.querySelector('.gitment-editor-logout-link').onclick = function () { + return instance.logout(); + }; + } + + var writeField = container.querySelector('.gitment-editor-write-field'); + var previewField = container.querySelector('.gitment-editor-preview-field'); + + var textarea = writeField.querySelector('textarea'); + textarea.oninput = function () { + textarea.style.height = 'auto'; + var style = window.getComputedStyle(textarea, null); + var height = parseInt(style.height, 10); + var clientHeight = textarea.clientHeight; + var scrollHeight = textarea.scrollHeight; + if (clientHeight < scrollHeight) { + textarea.style.height = height + scrollHeight - clientHeight + 'px'; + } + }; + + var _container$querySelec = container.querySelectorAll('.gitment-editor-tab'), + _container$querySelec2 = _slicedToArray(_container$querySelec, 2), + writeTab = _container$querySelec2[0], + previewTab = _container$querySelec2[1]; + + writeTab.onclick = function () { + writeTab.classList.add('gitment-selected'); + previewTab.classList.remove('gitment-selected'); + writeField.classList.remove('gitment-hidden'); + previewField.classList.add('gitment-hidden'); + + textarea.focus(); + }; + previewTab.onclick = function () { + previewTab.classList.add('gitment-selected'); + writeTab.classList.remove('gitment-selected'); + previewField.classList.remove('gitment-hidden'); + writeField.classList.add('gitment-hidden'); + + var preview = previewField.querySelector('.gitment-editor-preview'); + var content = textarea.value.trim(); + if (!content) { + preview.innerText = 'Nothing to preview'; + return; + } + + preview.innerText = 'Loading preview...'; + instance.markdown(content).then(function (html) { + return preview.innerHTML = html; + }); + }; + + var submitButton = container.querySelector('.gitment-editor-submit'); + submitButton.onclick = function () { + submitButton.innerText = 'Submitting...'; + submitButton.setAttribute('disabled', true); + instance.post(textarea.value.trim()).then(function (data) { + textarea.value = ''; + textarea.style.height = 'auto'; + submitButton.removeAttribute('disabled'); + submitButton.innerText = 'Comment'; + }).catch(function (e) { + alert(e); + submitButton.removeAttribute('disabled'); + submitButton.innerText = 'Comment'; + }); + }; + + return container; +} + +function renderFooter() { + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-footer-container'; + container.innerHTML = '\n Powered by\n \n Gitment\n \n '; + return container; +} + +function render(state, instance) { + var container = document.createElement('div'); + container.lang = "en-US"; + container.className = 'gitment-container gitment-root-container'; + container.appendChild(instance.renderHeader(state, instance)); + container.appendChild(instance.renderComments(state, instance)); + container.appendChild(instance.renderEditor(state, instance)); + container.appendChild(instance.renderFooter(state, instance)); + return container; +} + +exports.default = { render: render, renderHeader: renderHeader, renderComments: renderComments, renderEditor: renderEditor, renderFooter: renderFooter }; + +/***/ }), +/* 3 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +exports.http = exports.Query = exports.isString = undefined; + +var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }(); + +exports.getTargetContainer = getTargetContainer; + +var _constants = __webpack_require__(0); + +var isString = exports.isString = function isString(s) { + return toString.call(s) === '[object String]'; +}; + +function getTargetContainer(container) { + var targetContainer = void 0; + if (container instanceof Element) { + targetContainer = container; + } else if (isString(container)) { + targetContainer = document.getElementById(container); + } else { + targetContainer = document.createElement('div'); + } + + return targetContainer; +} + +var Query = exports.Query = { + parse: function parse() { + var search = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : window.location.search; + + if (!search) return {}; + var queryString = search[0] === '?' ? search.substring(1) : search; + var query = {}; + queryString.split('&').forEach(function (queryStr) { + var _queryStr$split = queryStr.split('='), + _queryStr$split2 = _slicedToArray(_queryStr$split, 2), + key = _queryStr$split2[0], + value = _queryStr$split2[1]; + + if (key) query[key] = value; + }); + + return query; + }, + stringify: function stringify(query) { + var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '?'; + + var queryString = Object.keys(query).map(function (key) { + return key + '=' + encodeURIComponent(query[key] || ''); + }).join('&'); + return queryString ? prefix + queryString : ''; + } +}; + +function ajaxFactory(method) { + return function (apiPath) { + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + var base = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'https://api.github.com'; + + var req = new XMLHttpRequest(); + var token = localStorage.getItem(_constants.LS_ACCESS_TOKEN_KEY); + + var url = '' + base + apiPath; + var body = null; + if (method === 'GET' || method === 'DELETE') { + url += Query.stringify(data); + } + + var p = new Promise(function (resolve, reject) { + req.addEventListener('load', function () { + var contentType = req.getResponseHeader('content-type'); + var res = req.responseText; + if (!/json/.test(contentType)) { + resolve(res); + return; + } + var data = req.responseText ? JSON.parse(res) : {}; + if (data.message) { + reject(new Error(data.message)); + } else { + resolve(data); + } + }); + req.addEventListener('error', function (error) { + return reject(error); + }); + }); + req.open(method, url, true); + + req.setRequestHeader('Accept', 'application/vnd.github.squirrel-girl-preview, application/vnd.github.html+json'); + if (token) { + req.setRequestHeader('Authorization', 'token ' + token); + } + if (method !== 'GET' && method !== 'DELETE') { + body = JSON.stringify(data); + req.setRequestHeader('Content-Type', 'application/json'); + } + + req.send(body); + return p; + }; +} + +var http = exports.http = { + get: ajaxFactory('GET'), + post: ajaxFactory('POST'), + delete: ajaxFactory('DELETE'), + put: ajaxFactory('PUT') +}; + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; + +var g; + +// This works in non-strict mode +g = function () { + return this; +}(); + +try { + // This works if eval is allowed (see CSP) + g = g || Function("return this")() || (1, eval)("this"); +} catch (e) { + // This works if the window reference is available + if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window; +} + +// g can still be undefined, but nothing to do about it... +// We return undefined, instead of nothing here, so it's +// easier to handle this case. if(!global) { ...} + +module.exports = g; + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + +var _mobx = __webpack_require__(1); + +var _constants = __webpack_require__(0); + +var _utils = __webpack_require__(3); + +var _default = __webpack_require__(2); + +var _default2 = _interopRequireDefault(_default); + +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + +var scope = 'public_repo'; + +function extendRenderer(instance, renderer) { + instance[renderer] = function (container) { + var targetContainer = (0, _utils.getTargetContainer)(container); + var render = instance.theme[renderer] || instance.defaultTheme[renderer]; + + (0, _mobx.autorun)(function () { + var e = render(instance.state, instance); + if (targetContainer.firstChild) { + targetContainer.replaceChild(e, targetContainer.firstChild); + } else { + targetContainer.appendChild(e); + } + }); + + return targetContainer; + }; +} + +var Gitment = function () { + _createClass(Gitment, [{ + key: 'accessToken', + get: function get() { + return localStorage.getItem(_constants.LS_ACCESS_TOKEN_KEY); + }, + set: function set(token) { + localStorage.setItem(_constants.LS_ACCESS_TOKEN_KEY, token); + } + }, { + key: 'loginLink', + get: function get() { + var oauthUri = 'https://github.com/login/oauth/authorize'; + var redirect_uri = this.oauth.redirect_uri || window.location.href; + + var oauthParams = Object.assign({ + scope: scope, + redirect_uri: redirect_uri + }, this.oauth); + + return '' + oauthUri + _utils.Query.stringify(oauthParams); + } + }]); + + function Gitment() { + var _this = this; + + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + _classCallCheck(this, Gitment); + + this.defaultTheme = _default2.default; + this.useTheme(_default2.default); + + Object.assign(this, { + id: window.location.href, + title: window.document.title, + link: window.location.href, + desc: '', + labels: [], + theme: _default2.default, + oauth: {}, + perPage: 20, + maxCommentHeight: 250 + }, options); + + this.useTheme(this.theme); + + var user = {}; + try { + var userInfo = localStorage.getItem(_constants.LS_USER_KEY); + if (this.accessToken && userInfo) { + Object.assign(user, JSON.parse(userInfo), { + fromCache: true + }); + } + } catch (e) { + localStorage.removeItem(_constants.LS_USER_KEY); + } + + this.state = (0, _mobx.observable)({ + user: user, + error: null, + meta: {}, + comments: undefined, + reactions: [], + commentReactions: {}, + currentPage: 1 + }); + + var query = _utils.Query.parse(); + if (query.code) { + var _oauth = this.oauth, + client_id = _oauth.client_id, + client_secret = _oauth.client_secret; + + var code = query.code; + delete query.code; + var search = _utils.Query.stringify(query); + var replacedUrl = '' + window.location.origin + window.location.pathname + search + window.location.hash; + history.replaceState({}, '', replacedUrl); + + Object.assign(this, { + id: replacedUrl, + link: replacedUrl + }, options); + + this.state.user.isLoggingIn = true; + _utils.http.post('https://gh-oauth.imsun.net', { + code: code, + client_id: client_id, + client_secret: client_secret + }, '').then(function (data) { + _this.accessToken = data.access_token; + _this.update(); + }).catch(function (e) { + _this.state.user.isLoggingIn = false; + alert(e); + }); + } else { + this.update(); + } + } + + _createClass(Gitment, [{ + key: 'init', + value: function init() { + var _this2 = this; + + return this.createIssue().then(function () { + return _this2.loadComments(); + }).then(function (comments) { + _this2.state.error = null; + return comments; + }); + } + }, { + key: 'useTheme', + value: function useTheme() { + var _this3 = this; + + var theme = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + + this.theme = theme; + + var renderers = Object.keys(this.theme); + renderers.forEach(function (renderer) { + return extendRenderer(_this3, renderer); + }); + } + }, { + key: 'update', + value: function update() { + var _this4 = this; + + return Promise.all([this.loadMeta(), this.loadUserInfo()]).then(function () { + return Promise.all([_this4.loadComments().then(function () { + return _this4.loadCommentReactions(); + }), _this4.loadReactions()]); + }).catch(function (e) { + return _this4.state.error = e; + }); + } + }, { + key: 'markdown', + value: function markdown(text) { + return _utils.http.post('/markdown', { + text: text, + mode: 'gfm' + }); + } + }, { + key: 'createIssue', + value: function createIssue() { + var _this5 = this; + + var id = this.id, + owner = this.owner, + repo = this.repo, + title = this.title, + link = this.link, + desc = this.desc, + labels = this.labels; + + + return _utils.http.post('/repos/' + owner + '/' + repo + '/issues', { + title: title, + labels: labels.concat(['gitment', id]), + body: link + '\n\n' + desc + }).then(function (meta) { + _this5.state.meta = meta; + return meta; + }); + } + }, { + key: 'getIssue', + value: function getIssue() { + if (this.state.meta.id) return Promise.resolve(this.state.meta); + + return this.loadMeta(); + } + }, { + key: 'post', + value: function post(body) { + var _this6 = this; + + return this.getIssue().then(function (issue) { + return _utils.http.post(issue.comments_url, { body: body }, ''); + }).then(function (data) { + _this6.state.meta.comments++; + var pageCount = Math.ceil(_this6.state.meta.comments / _this6.perPage); + if (_this6.state.currentPage === pageCount) { + _this6.state.comments.push(data); + } + return data; + }); + } + }, { + key: 'loadMeta', + value: function loadMeta() { + var _this7 = this; + + var id = this.id, + owner = this.owner, + repo = this.repo; + + return _utils.http.get('/repos/' + owner + '/' + repo + '/issues', { + creator: owner, + labels: id + }).then(function (issues) { + if (!issues.length) return Promise.reject(_constants.NOT_INITIALIZED_ERROR); + _this7.state.meta = issues[0]; + return issues[0]; + }); + } + }, { + key: 'loadComments', + value: function loadComments() { + var _this8 = this; + + var page = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.state.currentPage; + + return this.getIssue().then(function (issue) { + return _utils.http.get(issue.comments_url, { page: page, per_page: _this8.perPage }, ''); + }).then(function (comments) { + _this8.state.comments = comments; + return comments; + }); + } + }, { + key: 'loadUserInfo', + value: function loadUserInfo() { + var _this9 = this; + + if (!this.accessToken) { + this.logout(); + return Promise.resolve({}); + } + + return _utils.http.get('/user').then(function (user) { + _this9.state.user = user; + localStorage.setItem(_constants.LS_USER_KEY, JSON.stringify(user)); + return user; + }); + } + }, { + key: 'loadReactions', + value: function loadReactions() { + var _this10 = this; + + if (!this.accessToken) { + this.state.reactions = []; + return Promise.resolve([]); + } + + return this.getIssue().then(function (issue) { + if (!issue.reactions.total_count) return []; + return _utils.http.get(issue.reactions.url, {}, ''); + }).then(function (reactions) { + _this10.state.reactions = reactions; + return reactions; + }); + } + }, { + key: 'loadCommentReactions', + value: function loadCommentReactions() { + var _this11 = this; + + if (!this.accessToken) { + this.state.commentReactions = {}; + return Promise.resolve([]); + } + + var comments = this.state.comments; + var comentReactions = {}; + + return Promise.all(comments.map(function (comment) { + if (!comment.reactions.total_count) return []; + + var owner = _this11.owner, + repo = _this11.repo; + + return _utils.http.get('/repos/' + owner + '/' + repo + '/issues/comments/' + comment.id + '/reactions', {}); + })).then(function (reactionsArray) { + comments.forEach(function (comment, index) { + comentReactions[comment.id] = reactionsArray[index]; + }); + _this11.state.commentReactions = comentReactions; + + return comentReactions; + }); + } + }, { + key: 'login', + value: function login() { + window.location.href = this.loginLink; + } + }, { + key: 'logout', + value: function logout() { + localStorage.removeItem(_constants.LS_ACCESS_TOKEN_KEY); + localStorage.removeItem(_constants.LS_USER_KEY); + this.state.user = {}; + } + }, { + key: 'goto', + value: function goto(page) { + this.state.currentPage = page; + this.state.comments = undefined; + return this.loadComments(page); + } + }, { + key: 'like', + value: function like() { + var _this12 = this; + + if (!this.accessToken) { + alert('Login to Like'); + return Promise.reject(); + } + + var owner = this.owner, + repo = this.repo; + + + return _utils.http.post('/repos/' + owner + '/' + repo + '/issues/' + this.state.meta.number + '/reactions', { + content: 'heart' + }).then(function (reaction) { + _this12.state.reactions.push(reaction); + _this12.state.meta.reactions.heart++; + }); + } + }, { + key: 'unlike', + value: function unlike() { + var _this13 = this; + + if (!this.accessToken) return Promise.reject(); + + var _state = this.state, + user = _state.user, + reactions = _state.reactions; + + var index = reactions.findIndex(function (reaction) { + return reaction.user.login === user.login; + }); + return _utils.http.delete('/reactions/' + reactions[index].id).then(function () { + reactions.splice(index, 1); + _this13.state.meta.reactions.heart--; + }); + } + }, { + key: 'likeAComment', + value: function likeAComment(commentId) { + var _this14 = this; + + if (!this.accessToken) { + alert('Login to Like'); + return Promise.reject(); + } + + var owner = this.owner, + repo = this.repo; + + var comment = this.state.comments.find(function (comment) { + return comment.id === commentId; + }); + + return _utils.http.post('/repos/' + owner + '/' + repo + '/issues/comments/' + commentId + '/reactions', { + content: 'heart' + }).then(function (reaction) { + _this14.state.commentReactions[commentId].push(reaction); + comment.reactions.heart++; + }); + } + }, { + key: 'unlikeAComment', + value: function unlikeAComment(commentId) { + if (!this.accessToken) return Promise.reject(); + + var reactions = this.state.commentReactions[commentId]; + var comment = this.state.comments.find(function (comment) { + return comment.id === commentId; + }); + var user = this.state.user; + + var index = reactions.findIndex(function (reaction) { + return reaction.user.login === user.login; + }); + + return _utils.http.delete('/reactions/' + reactions[index].id).then(function () { + reactions.splice(index, 1); + comment.reactions.heart--; + }); + } + }]); + + return Gitment; +}(); + +module.exports = Gitment; + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, "__esModule", { + value: true +}); +/** + * Modified from https://github.com/evil-icons/evil-icons + */ + +var close = exports.close = ''; +var github = exports.github = ''; +var heart = exports.heart = ''; +var spinner = exports.spinner = ''; + +/***/ }) +/******/ ]); +//# sourceMappingURL=gitment.browser.js.map \ No newline at end of file diff --git a/js/local-search.js b/js/local-search.js new file mode 100644 index 0000000..e1de198 --- /dev/null +++ b/js/local-search.js @@ -0,0 +1,278 @@ +/* global CONFIG */ + +document.addEventListener('DOMContentLoaded', () => { + // Popup Window + let isfetched = false; + let datas; + let isXml = true; + // Search DB path + let searchPath = "/search.xml"; //CONFIG.search.path + if (searchPath.length === 0) { + searchPath = 'search.xml'; + } else if (searchPath.endsWith('json')) { + isXml = false; + } + const input = document.querySelector('.search-input'); + const resultContent = document.getElementById('search-result'); + + const getIndexByWord = (word, text, caseSensitive) => { + if (false) { // CONFIG.localsearch.unescape = false + let div = document.createElement('div'); + div.innerText = word; + word = div.innerHTML; + } + let wordLen = word.length; + if (wordLen === 0) return []; + let startPosition = 0; + let position = []; + let index = []; + if (!caseSensitive) { + text = text.toLowerCase(); + word = word.toLowerCase(); + } + while ((position = text.indexOf(word, startPosition)) > -1) { + index.push({ position, word }); + startPosition = position + wordLen; + } + return index; + }; + + // Merge hits into slices + const mergeIntoSlice = (start, end, index, searchText) => { + let item = index[index.length - 1]; + let { position, word } = item; + let hits = []; + let searchTextCountInSlice = 0; + while (position + word.length <= end && index.length !== 0) { + if (word === searchText) { + searchTextCountInSlice++; + } + hits.push({ + position, + length: word.length + }); + let wordEnd = position + word.length; + + // Move to next position of hit + index.pop(); + while (index.length !== 0) { + item = index[index.length - 1]; + position = item.position; + word = item.word; + if (wordEnd > position) { + index.pop(); + } else { + break; + } + } + } + return { + hits, + start, + end, + searchTextCount: searchTextCountInSlice + }; + }; + + // Highlight title and content + const highlightKeyword = (text, slice) => { + let result = ''; + let prevEnd = slice.start; + slice.hits.forEach(hit => { + result += text.substring(prevEnd, hit.position); + let end = hit.position + hit.length; + result += `${text.substring(hit.position, end)}`; + prevEnd = end; + }); + result += text.substring(prevEnd, slice.end); + return result; + }; + + const inputEventFunction = () => { + if (!isfetched) return; + let searchText = input.value.trim().toLowerCase(); + let keywords = searchText.split(/[-\s]+/); + if (keywords.length > 1) { + keywords.push(searchText); + } + let resultItems = []; + if (searchText.length > 0) { + // Perform local searching + datas.forEach(({ title, content, url }) => { + let titleInLowerCase = title.toLowerCase(); + let contentInLowerCase = content.toLowerCase(); + let indexOfTitle = []; + let indexOfContent = []; + let searchTextCount = 0; + keywords.forEach(keyword => { + indexOfTitle = indexOfTitle.concat(getIndexByWord(keyword, titleInLowerCase, false)); + indexOfContent = indexOfContent.concat(getIndexByWord(keyword, contentInLowerCase, false)); + }); + + // Show search results + if (indexOfTitle.length > 0 || indexOfContent.length > 0) { + let hitCount = indexOfTitle.length + indexOfContent.length; + // Sort index by position of keyword + [indexOfTitle, indexOfContent].forEach(index => { + index.sort((itemLeft, itemRight) => { + if (itemRight.position !== itemLeft.position) { + return itemRight.position - itemLeft.position; + } + return itemLeft.word.length - itemRight.word.length; + }); + }); + + let slicesOfTitle = []; + if (indexOfTitle.length !== 0) { + let tmp = mergeIntoSlice(0, title.length, indexOfTitle, searchText); + searchTextCount += tmp.searchTextCountInSlice; + slicesOfTitle.push(tmp); + } + + let slicesOfContent = []; + while (indexOfContent.length !== 0) { + let item = indexOfContent[indexOfContent.length - 1]; + let { position, word } = item; + // Cut out 100 characters + let start = position - 20; + let end = position + 80; + if (start < 0) { + start = 0; + } + if (end < position + word.length) { + end = position + word.length; + } + if (end > content.length) { + end = content.length; + } + let tmp = mergeIntoSlice(start, end, indexOfContent, searchText); + searchTextCount += tmp.searchTextCountInSlice; + slicesOfContent.push(tmp); + } + + // Sort slices in content by search text's count and hits' count + slicesOfContent.sort((sliceLeft, sliceRight) => { + if (sliceLeft.searchTextCount !== sliceRight.searchTextCount) { + return sliceRight.searchTextCount - sliceLeft.searchTextCount; + } else if (sliceLeft.hits.length !== sliceRight.hits.length) { + return sliceRight.hits.length - sliceLeft.hits.length; + } + return sliceLeft.start - sliceRight.start; + }); + + // Select top N slices in content + let upperBound = parseInt(1, 10); // CONFIG.localsearch.top_n_per_article: 1 + if (upperBound >= 0) { + slicesOfContent = slicesOfContent.slice(0, upperBound); + } + + let resultItem = ''; + + if (slicesOfTitle.length !== 0) { + resultItem += `
  • ${highlightKeyword(title, slicesOfTitle[0])}`; + } else { + resultItem += `
  • ${title}`; + } + + slicesOfContent.forEach(slice => { + resultItem += `

    ${highlightKeyword(content, slice)}...

    `; + }); + + resultItem += '
  • '; + resultItems.push({ + item: resultItem, + id : resultItems.length, + hitCount, + searchTextCount + }); + } + }); + } + if (keywords.length === 1 && keywords[0] === '') { + resultContent.innerHTML = '
    '; + } else if (resultItems.length === 0) { + resultContent.innerHTML = '
    '; + } else { + resultItems.sort((resultLeft, resultRight) => { + if (resultLeft.searchTextCount !== resultRight.searchTextCount) { + return resultRight.searchTextCount - resultLeft.searchTextCount; + } else if (resultLeft.hitCount !== resultRight.hitCount) { + return resultRight.hitCount - resultLeft.hitCount; + } + return resultRight.id - resultLeft.id; + }); + resultContent.innerHTML = `
      ${resultItems.map(result => result.item).join('')}
    `; + window.pjax && window.pjax.refresh(resultContent); + } + }; + + const fetchData = () => { + fetch('' + searchPath) // CONFIG.root = '' + .then(response => response.text()) + .then(res => { + // Get the contents from search data + isfetched = true; + datas = isXml ? [...new DOMParser().parseFromString(res, 'text/xml').querySelectorAll('entry')].map(element => { + return { + title : element.querySelector('title').textContent, + content: element.querySelector('content').textContent, + url : element.querySelector('url').textContent + }; + }) : JSON.parse(res); + // Only match articles with not empty titles + datas = datas.filter(data => data.title).map(data => { + data.title = data.title.trim(); + data.content = data.content ? data.content.trim().replace(/<[^>]+>/g, '') : ''; + data.url = decodeURIComponent(data.url).replace(/\/{2,}/g, '/'); + return data; + }); + // Remove loading animation + document.getElementById('no-result').innerHTML = ''; + inputEventFunction(); + }); + }; + + if (false) { // CONFIG.localsearch.preload: false + fetchData(); + } + + if ('auto' === 'auto') { // CONFIG.localsearch.trigger: 'auto' / 'manual' + input.addEventListener('input', inputEventFunction); + } else { + document.querySelector('.search-icon').addEventListener('click', inputEventFunction); + input.addEventListener('keypress', event => { + if (event.key === 'Enter') { + inputEventFunction(); + } + }); + } + + // Handle and trigger popup window + document.querySelectorAll('.popup-trigger').forEach(element => { + element.addEventListener('click', () => { + document.body.style.overflow = 'hidden'; + document.querySelector('.search-pop-overlay').classList.add('search-active'); + input.focus(); + if (!isfetched) fetchData(); + }); + }); + + // Monitor main search box + const onPopupClose = () => { + document.body.style.overflow = ''; + document.querySelector('.search-pop-overlay').classList.remove('search-active'); + }; + + document.querySelector('.search-pop-overlay').addEventListener('click', event => { + if (event.target === document.querySelector('.search-pop-overlay')) { + onPopupClose(); + } + }); + document.querySelector('.popup-btn-close').addEventListener('click', onPopupClose); + window.addEventListener('pjax:success', onPopupClose); + window.addEventListener('keyup', event => { + if (event.key === 'Escape') { + onPopupClose(); + } + }); +}); diff --git a/js/main.js b/js/main.js deleted file mode 100644 index 2e29ac8..0000000 --- a/js/main.js +++ /dev/null @@ -1,778 +0,0 @@ -document.addEventListener('DOMContentLoaded', function () { - let blogNameWidth, menusWidth, searchWidth, $nav - let mobileSidebarOpen = false - - const adjustMenu = (init) => { - if (init) { - blogNameWidth = document.getElementById('site-name').offsetWidth - const $menusEle = document.querySelectorAll('#menus .menus_item') - menusWidth = 0 - $menusEle.length && $menusEle.forEach(i => { menusWidth += i.offsetWidth }) - const $searchEle = document.querySelector('#search-button') - searchWidth = $searchEle ? $searchEle.offsetWidth : 0 - $nav = document.getElementById('nav') - } - - let hideMenuIndex = '' - if (window.innerWidth <= 768) hideMenuIndex = true - else hideMenuIndex = blogNameWidth + menusWidth + searchWidth > $nav.offsetWidth - 120 - - if (hideMenuIndex) { - $nav.classList.add('hide-menu') - } else { - $nav.classList.remove('hide-menu') - } - } - - // 初始化header - const initAdjust = () => { - adjustMenu(true) - $nav.classList.add('show') - } - - // sidebar menus - const sidebarFn = { - open: () => { - btf.sidebarPaddingR() - document.body.style.overflow = 'hidden' - btf.animateIn(document.getElementById('menu-mask'), 'to_show 0.5s') - document.getElementById('sidebar-menus').classList.add('open') - mobileSidebarOpen = true - }, - close: () => { - const $body = document.body - $body.style.overflow = '' - $body.style.paddingRight = '' - btf.animateOut(document.getElementById('menu-mask'), 'to_hide 0.5s') - document.getElementById('sidebar-menus').classList.remove('open') - mobileSidebarOpen = false - } - } - - /** - * 首頁top_img底下的箭頭 - */ - const scrollDownInIndex = () => { - const $scrollDownEle = document.getElementById('scroll-down') - $scrollDownEle && $scrollDownEle.addEventListener('click', function () { - btf.scrollToDest(document.getElementById('content-inner').offsetTop, 300) - }) - } - - /** - * 代碼 - * 只適用於Hexo默認的代碼渲染 - */ - const addHighlightTool = function () { - const highLight = GLOBAL_CONFIG.highlight - if (!highLight) return - - const isHighlightCopy = highLight.highlightCopy - const isHighlightLang = highLight.highlightLang - const isHighlightShrink = GLOBAL_CONFIG_SITE.isHighlightShrink - const highlightHeightLimit = highLight.highlightHeightLimit - const isShowTool = isHighlightCopy || isHighlightLang || isHighlightShrink !== undefined - const $figureHighlight = highLight.plugin === 'highlighjs' ? document.querySelectorAll('figure.highlight') : document.querySelectorAll('pre[class*="language-"]') - - if (!((isShowTool || highlightHeightLimit) && $figureHighlight.length)) return - - const isPrismjs = highLight.plugin === 'prismjs' - - let highlightShrinkEle = '' - let highlightCopyEle = '' - const highlightShrinkClass = isHighlightShrink === true ? 'closed' : '' - - if (isHighlightShrink !== undefined) { - highlightShrinkEle = `` - } - - if (isHighlightCopy) { - highlightCopyEle = '
    ' - } - - const copy = (text, ctx) => { - if (document.queryCommandSupported && document.queryCommandSupported('copy')) { - document.execCommand('copy') - if (GLOBAL_CONFIG.Snackbar !== undefined) { - btf.snackbarShow(GLOBAL_CONFIG.copy.success) - } else { - const prevEle = ctx.previousElementSibling - prevEle.innerText = GLOBAL_CONFIG.copy.success - prevEle.style.opacity = 1 - setTimeout(() => { prevEle.style.opacity = 0 }, 700) - } - } else { - if (GLOBAL_CONFIG.Snackbar !== undefined) { - btf.snackbarShow(GLOBAL_CONFIG.copy.noSupport) - } else { - ctx.previousElementSibling.innerText = GLOBAL_CONFIG.copy.noSupport - } - } - } - - // click events - const highlightCopyFn = (ele) => { - const $buttonParent = ele.parentNode - $buttonParent.classList.add('copy-true') - const selection = window.getSelection() - const range = document.createRange() - if (isPrismjs) range.selectNodeContents($buttonParent.querySelectorAll('pre code')[0]) - else range.selectNodeContents($buttonParent.querySelectorAll('table .code pre')[0]) - selection.removeAllRanges() - selection.addRange(range) - const text = selection.toString() - copy(text, ele.lastChild) - selection.removeAllRanges() - $buttonParent.classList.remove('copy-true') - } - - const highlightShrinkFn = (ele) => { - const $nextEle = [...ele.parentNode.children].slice(1) - ele.firstChild.classList.toggle('closed') - if (btf.isHidden($nextEle[$nextEle.length - 1])) { - $nextEle.forEach(e => { e.style.display = 'block' }) - } else { - $nextEle.forEach(e => { e.style.display = 'none' }) - } - } - - const highlightToolsFn = function (e) { - const $target = e.target.classList - if ($target.contains('expand')) highlightShrinkFn(this) - else if ($target.contains('copy-button')) highlightCopyFn(this) - } - - const expandCode = function () { - this.classList.toggle('expand-done') - } - - function createEle (lang, item, service) { - const fragment = document.createDocumentFragment() - - if (isShowTool) { - const hlTools = document.createElement('div') - hlTools.className = `highlight-tools ${highlightShrinkClass}` - hlTools.innerHTML = highlightShrinkEle + lang + highlightCopyEle - hlTools.addEventListener('click', highlightToolsFn) - fragment.appendChild(hlTools) - } - - if (highlightHeightLimit && item.offsetHeight > highlightHeightLimit + 30) { - const ele = document.createElement('div') - ele.className = 'code-expand-btn' - ele.innerHTML = '' - ele.addEventListener('click', expandCode) - fragment.appendChild(ele) - } - - if (service === 'hl') { - item.insertBefore(fragment, item.firstChild) - } else { - item.parentNode.insertBefore(fragment, item) - } - } - - if (isHighlightLang) { - if (isPrismjs) { - $figureHighlight.forEach(function (item) { - const langName = item.getAttribute('data-language') ? item.getAttribute('data-language') : 'Code' - const highlightLangEle = `
    ${langName}
    ` - btf.wrap(item, 'figure', { class: 'highlight' }) - createEle(highlightLangEle, item) - }) - } else { - $figureHighlight.forEach(function (item) { - let langName = item.getAttribute('class').split(' ')[1] - if (langName === 'plain' || langName === undefined) langName = 'Code' - const highlightLangEle = `
    ${langName}
    ` - createEle(highlightLangEle, item, 'hl') - }) - } - } else { - if (isPrismjs) { - $figureHighlight.forEach(function (item) { - btf.wrap(item, 'figure', { class: 'highlight' }) - createEle('', item) - }) - } else { - $figureHighlight.forEach(function (item) { - createEle('', item, 'hl') - }) - } - } - } - - /** - * PhotoFigcaption - */ - function addPhotoFigcaption () { - document.querySelectorAll('#article-container img').forEach(function (item) { - const parentEle = item.parentNode - const altValue = item.title || item.alt - if (altValue && !parentEle.parentNode.classList.contains('justified-gallery')) { - const ele = document.createElement('div') - ele.className = 'img-alt is-center' - ele.textContent = altValue - parentEle.insertBefore(ele, item.nextSibling) - } - }) - } - - /** - * Lightbox - */ - const runLightbox = () => { - btf.loadLightbox(document.querySelectorAll('#article-container img:not(.no-lightbox)')) - } - - /** - * justified-gallery 圖庫排版 - */ - const runJustifiedGallery = function (ele) { - ele.forEach(item => { - const $imgList = item.querySelectorAll('img') - - $imgList.forEach(i => { - const dataLazySrc = i.getAttribute('data-lazy-src') - if (dataLazySrc) i.src = dataLazySrc - btf.wrap(i, 'div', { class: 'fj-gallery-item' }) - }) - }) - - if (window.fjGallery) { - setTimeout(() => { btf.initJustifiedGallery(ele) }, 100) - return - } - - const newEle = document.createElement('link') - newEle.rel = 'stylesheet' - newEle.href = GLOBAL_CONFIG.source.justifiedGallery.css - document.body.appendChild(newEle) - getScript(`${GLOBAL_CONFIG.source.justifiedGallery.js}`).then(() => { btf.initJustifiedGallery(ele) }) - } - - /** - * 滾動處理 - */ - const scrollFn = function () { - const $rightside = document.getElementById('rightside') - const innerHeight = window.innerHeight + 56 - - // 當滾動條小于 56 的時候 - if (document.body.scrollHeight <= innerHeight) { - $rightside.style.cssText = 'opacity: 1; transform: translateX(-58px)' - return - } - - // find the scroll direction - function scrollDirection (currentTop) { - const result = currentTop > initTop // true is down & false is up - initTop = currentTop - return result - } - - let initTop = 0 - let isChatShow = true - const $header = document.getElementById('page-header') - const isChatBtnHide = typeof chatBtnHide === 'function' - const isChatBtnShow = typeof chatBtnShow === 'function' - - const scrollTask = btf.throttle(() => { - const currentTop = window.scrollY || document.documentElement.scrollTop - const isDown = scrollDirection(currentTop) - if (currentTop > 56) { - if (isDown) { - if ($header.classList.contains('nav-visible')) $header.classList.remove('nav-visible') - if (isChatBtnShow && isChatShow === true) { - chatBtnHide() - isChatShow = false - } - } else { - if (!$header.classList.contains('nav-visible')) $header.classList.add('nav-visible') - if (isChatBtnHide && isChatShow === false) { - chatBtnShow() - isChatShow = true - } - } - $header.classList.add('nav-fixed') - if (window.getComputedStyle($rightside).getPropertyValue('opacity') === '0') { - $rightside.style.cssText = 'opacity: 0.8; transform: translateX(-58px)' - } - } else { - if (currentTop === 0) { - $header.classList.remove('nav-fixed', 'nav-visible') - } - $rightside.style.cssText = "opacity: ''; transform: ''" - } - - if (document.body.scrollHeight <= innerHeight) { - $rightside.style.cssText = 'opacity: 0.8; transform: translateX(-58px)' - } - }, 200) - - window.scrollCollect = scrollTask - - window.addEventListener('scroll', scrollCollect) - } - - /** - * toc,anchor - */ - const scrollFnToDo = function () { - const isToc = GLOBAL_CONFIG_SITE.isToc - const isAnchor = GLOBAL_CONFIG.isAnchor - const $article = document.getElementById('article-container') - - if (!($article && (isToc || isAnchor))) return - - let $tocLink, $cardToc, scrollPercent, autoScrollToc, isExpand - - if (isToc) { - const $cardTocLayout = document.getElementById('card-toc') - $cardToc = $cardTocLayout.getElementsByClassName('toc-content')[0] - $tocLink = $cardToc.querySelectorAll('.toc-link') - const $tocPercentage = $cardTocLayout.querySelector('.toc-percentage') - isExpand = $cardToc.classList.contains('is-expand') - - scrollPercent = currentTop => { - const docHeight = $article.clientHeight - const winHeight = document.documentElement.clientHeight - const headerHeight = $article.offsetTop - const contentMath = (docHeight > winHeight) ? (docHeight - winHeight) : (document.documentElement.scrollHeight - winHeight) - const scrollPercent = (currentTop - headerHeight) / (contentMath) - const scrollPercentRounded = Math.round(scrollPercent * 100) - const percentage = (scrollPercentRounded > 100) ? 100 : (scrollPercentRounded <= 0) ? 0 : scrollPercentRounded - $tocPercentage.textContent = percentage - } - - window.mobileToc = { - open: () => { - $cardTocLayout.style.cssText = 'animation: toc-open .3s; opacity: 1; right: 55px' - }, - - close: () => { - $cardTocLayout.style.animation = 'toc-close .2s' - setTimeout(() => { - $cardTocLayout.style.cssText = "opacity:''; animation: ''; right: ''" - }, 100) - } - } - - // toc元素點擊 - $cardToc.addEventListener('click', e => { - e.preventDefault() - const target = e.target.classList - if (target.contains('toc-content')) return - const $target = target.contains('toc-link') - ? e.target - : e.target.parentElement - btf.scrollToDest(btf.getEleTop(document.getElementById(decodeURI($target.getAttribute('href')).replace('#', ''))), 300) - if (window.innerWidth < 900) { - window.mobileToc.close() - } - }) - - autoScrollToc = item => { - const activePosition = item.getBoundingClientRect().top - const sidebarScrollTop = $cardToc.scrollTop - if (activePosition > (document.documentElement.clientHeight - 100)) { - $cardToc.scrollTop = sidebarScrollTop + 150 - } - if (activePosition < 100) { - $cardToc.scrollTop = sidebarScrollTop - 150 - } - } - } - - // find head position & add active class - const list = $article.querySelectorAll('h1,h2,h3,h4,h5,h6') - let detectItem = '' - const findHeadPosition = function (top) { - if (top === 0) { - return false - } - - let currentId = '' - let currentIndex = '' - - list.forEach(function (ele, index) { - if (top > btf.getEleTop(ele) - 80) { - const id = ele.id - currentId = id ? '#' + encodeURI(id) : '' - currentIndex = index - } - }) - - if (detectItem === currentIndex) return - - if (isAnchor) btf.updateAnchor(currentId) - - detectItem = currentIndex - - if (isToc) { - $cardToc.querySelectorAll('.active').forEach(i => { i.classList.remove('active') }) - - if (currentId === '') { - return - } - - const currentActive = $tocLink[currentIndex] - currentActive.classList.add('active') - - setTimeout(() => { - autoScrollToc(currentActive) - }, 0) - - if (isExpand) return - let parent = currentActive.parentNode - - for (; !parent.matches('.toc'); parent = parent.parentNode) { - if (parent.matches('li')) parent.classList.add('active') - } - } - } - - // main of scroll - window.tocScrollFn = function () { - return btf.throttle(function () { - const currentTop = window.scrollY || document.documentElement.scrollTop - isToc && scrollPercent(currentTop) - findHeadPosition(currentTop) - }, 100)() - } - window.addEventListener('scroll', tocScrollFn) - } - - /** - * Rightside - */ - const rightSideFn = { - switchReadMode: () => { // read-mode - const $body = document.body - $body.classList.add('read-mode') - const newEle = document.createElement('button') - newEle.type = 'button' - newEle.className = 'fas fa-sign-out-alt exit-readmode' - $body.appendChild(newEle) - - function clickFn () { - $body.classList.remove('read-mode') - newEle.remove() - newEle.removeEventListener('click', clickFn) - } - - newEle.addEventListener('click', clickFn) - }, - switchDarkMode: () => { // Switch Between Light And Dark Mode - const nowMode = document.documentElement.getAttribute('data-theme') === 'dark' ? 'dark' : 'light' - if (nowMode === 'light') { - activateDarkMode() - saveToLocal.set('theme', 'dark', 2) - GLOBAL_CONFIG.Snackbar !== undefined && btf.snackbarShow(GLOBAL_CONFIG.Snackbar.day_to_night) - } else { - activateLightMode() - saveToLocal.set('theme', 'light', 2) - GLOBAL_CONFIG.Snackbar !== undefined && btf.snackbarShow(GLOBAL_CONFIG.Snackbar.night_to_day) - } - // handle some cases - typeof utterancesTheme === 'function' && utterancesTheme() - typeof changeGiscusTheme === 'function' && changeGiscusTheme() - typeof FB === 'object' && window.loadFBComment && window.loadFBComment() - typeof runMermaid === 'function' && window.runMermaid() - }, - showOrHideBtn: (e) => { // rightside 點擊設置 按鈕 展開 - const rightsideHideClassList = document.getElementById('rightside-config-hide').classList - rightsideHideClassList.toggle('show') - if (e.classList.contains('show')) { - rightsideHideClassList.add('status') - setTimeout(() => { - rightsideHideClassList.remove('status') - }, 300) - } - e.classList.toggle('show') - }, - scrollToTop: () => { // Back to top - btf.scrollToDest(0, 500) - }, - hideAsideBtn: () => { // Hide aside - const $htmlDom = document.documentElement.classList - $htmlDom.contains('hide-aside') - ? saveToLocal.set('aside-status', 'show', 2) - : saveToLocal.set('aside-status', 'hide', 2) - $htmlDom.toggle('hide-aside') - }, - - runMobileToc: () => { - if (window.getComputedStyle(document.getElementById('card-toc')).getPropertyValue('opacity') === '0') window.mobileToc.open() - else window.mobileToc.close() - } - } - - document.getElementById('rightside').addEventListener('click', function (e) { - const $target = e.target.id ? e.target : e.target.parentNode - switch ($target.id) { - case 'go-up': - rightSideFn.scrollToTop() - break - case 'rightside_config': - rightSideFn.showOrHideBtn($target) - break - case 'mobile-toc-button': - rightSideFn.runMobileToc() - break - case 'readmode': - rightSideFn.switchReadMode() - break - case 'darkmode': - rightSideFn.switchDarkMode() - break - case 'hide-aside-btn': - rightSideFn.hideAsideBtn() - break - default: - break - } - }) - - /** - * menu - * 側邊欄sub-menu 展開/收縮 - */ - const clickFnOfSubMenu = () => { - document.querySelectorAll('#sidebar-menus .site-page.group').forEach(function (item) { - item.addEventListener('click', function () { - this.classList.toggle('hide') - }) - }) - } - - /** - * 複製時加上版權信息 - */ - const addCopyright = () => { - const copyright = GLOBAL_CONFIG.copyright - document.body.oncopy = (e) => { - e.preventDefault() - let textFont; const copyFont = window.getSelection(0).toString() - if (copyFont.length > copyright.limitCount) { - textFont = copyFont + '\n' + '\n' + '\n' + - copyright.languages.author + '\n' + - copyright.languages.link + window.location.href + '\n' + - copyright.languages.source + '\n' + - copyright.languages.info - } else { - textFont = copyFont - } - if (e.clipboardData) { - return e.clipboardData.setData('text', textFont) - } else { - return window.clipboardData.setData('text', textFont) - } - } - } - - /** - * 網頁運行時間 - */ - const addRuntime = () => { - const $runtimeCount = document.getElementById('runtimeshow') - if ($runtimeCount) { - const publishDate = $runtimeCount.getAttribute('data-publishDate') - $runtimeCount.innerText = btf.diffDate(publishDate) + ' ' + GLOBAL_CONFIG.runtime - } - } - - /** - * 最後一次更新時間 - */ - const addLastPushDate = () => { - const $lastPushDateItem = document.getElementById('last-push-date') - if ($lastPushDateItem) { - const lastPushDate = $lastPushDateItem.getAttribute('data-lastPushDate') - $lastPushDateItem.innerText = btf.diffDate(lastPushDate, true) - } - } - - /** - * table overflow - */ - const addTableWrap = () => { - const $table = document.querySelectorAll('#article-container :not(.highlight) > table, #article-container > table') - if ($table.length) { - $table.forEach(item => { - btf.wrap(item, 'div', { class: 'table-wrap' }) - }) - } - } - - /** - * tag-hide - */ - const clickFnOfTagHide = function () { - const $hideInline = document.querySelectorAll('#article-container .hide-button') - if ($hideInline.length) { - $hideInline.forEach(function (item) { - item.addEventListener('click', function (e) { - const $this = this - $this.classList.add('open') - const $fjGallery = $this.nextElementSibling.querySelectorAll('.fj-gallery') - $fjGallery.length && btf.initJustifiedGallery($fjGallery) - }) - }) - } - } - - const tabsFn = { - clickFnOfTabs: function () { - document.querySelectorAll('#article-container .tab > button').forEach(function (item) { - item.addEventListener('click', function (e) { - const $this = this - const $tabItem = $this.parentNode - - if (!$tabItem.classList.contains('active')) { - const $tabContent = $tabItem.parentNode.nextElementSibling - const $siblings = btf.siblings($tabItem, '.active')[0] - $siblings && $siblings.classList.remove('active') - $tabItem.classList.add('active') - const tabId = $this.getAttribute('data-href').replace('#', '') - const childList = [...$tabContent.children] - childList.forEach(item => { - if (item.id === tabId) item.classList.add('active') - else item.classList.remove('active') - }) - const $isTabJustifiedGallery = $tabContent.querySelectorAll(`#${tabId} .fj-gallery`) - if ($isTabJustifiedGallery.length > 0) { - btf.initJustifiedGallery($isTabJustifiedGallery) - } - } - }) - }) - }, - backToTop: () => { - document.querySelectorAll('#article-container .tabs .tab-to-top').forEach(function (item) { - item.addEventListener('click', function () { - btf.scrollToDest(btf.getEleTop(btf.getParents(this, '.tabs')), 300) - }) - }) - } - } - - const toggleCardCategory = function () { - const $cardCategory = document.querySelectorAll('#aside-cat-list .card-category-list-item.parent i') - if ($cardCategory.length) { - $cardCategory.forEach(function (item) { - item.addEventListener('click', function (e) { - e.preventDefault() - const $this = this - $this.classList.toggle('expand') - const $parentEle = $this.parentNode.nextElementSibling - if (btf.isHidden($parentEle)) { - $parentEle.style.display = 'block' - } else { - $parentEle.style.display = 'none' - } - }) - }) - } - } - - const switchComments = function () { - let switchDone = false - const $switchBtn = document.querySelector('#comment-switch > .switch-btn') - $switchBtn && $switchBtn.addEventListener('click', function () { - this.classList.toggle('move') - document.querySelectorAll('#post-comment > .comment-wrap > div').forEach(function (item) { - if (btf.isHidden(item)) { - item.style.cssText = 'display: block;animation: tabshow .5s' - } else { - item.style.cssText = "display: none;animation: ''" - } - }) - - if (!switchDone && typeof loadOtherComment === 'function') { - switchDone = true - loadOtherComment() - } - }) - } - - const addPostOutdateNotice = function () { - const data = GLOBAL_CONFIG.noticeOutdate - const diffDay = btf.diffDate(GLOBAL_CONFIG_SITE.postUpdate) - if (diffDay >= data.limitDay) { - const ele = document.createElement('div') - ele.className = 'post-outdate-notice' - ele.textContent = data.messagePrev + ' ' + diffDay + ' ' + data.messageNext - const $targetEle = document.getElementById('article-container') - if (data.position === 'top') { - $targetEle.insertBefore(ele, $targetEle.firstChild) - } else { - $targetEle.appendChild(ele) - } - } - } - - const lazyloadImg = () => { - window.lazyLoadInstance = new LazyLoad({ - elements_selector: 'img', - threshold: 0, - data_src: 'lazy-src' - }) - } - - const relativeDate = function (selector) { - selector.forEach(item => { - const $this = item - const timeVal = $this.getAttribute('datetime') - $this.innerText = btf.diffDate(timeVal, true) - $this.style.display = 'inline' - }) - } - - const unRefreshFn = function () { - window.addEventListener('resize', () => { - adjustMenu(false) - btf.isHidden(document.getElementById('toggle-menu')) && mobileSidebarOpen && sidebarFn.close() - }) - - document.getElementById('menu-mask').addEventListener('click', e => { sidebarFn.close() }) - - clickFnOfSubMenu() - GLOBAL_CONFIG.islazyload && lazyloadImg() - GLOBAL_CONFIG.copyright !== undefined && addCopyright() - } - - window.refreshFn = function () { - initAdjust() - - if (GLOBAL_CONFIG_SITE.isPost) { - GLOBAL_CONFIG.noticeOutdate !== undefined && addPostOutdateNotice() - GLOBAL_CONFIG.relativeDate.post && relativeDate(document.querySelectorAll('#post-meta time')) - } else { - GLOBAL_CONFIG.relativeDate.homepage && relativeDate(document.querySelectorAll('#recent-posts time')) - GLOBAL_CONFIG.runtime && addRuntime() - addLastPushDate() - toggleCardCategory() - } - - scrollFnToDo() - GLOBAL_CONFIG_SITE.isHome && scrollDownInIndex() - addHighlightTool() - GLOBAL_CONFIG.isPhotoFigcaption && addPhotoFigcaption() - scrollFn() - - const $jgEle = document.querySelectorAll('#article-container .fj-gallery') - $jgEle.length && runJustifiedGallery($jgEle) - - runLightbox() - addTableWrap() - clickFnOfTagHide() - tabsFn.clickFnOfTabs() - tabsFn.backToTop() - switchComments() - document.getElementById('toggle-menu').addEventListener('click', () => { sidebarFn.open() }) - } - - refreshFn() - unRefreshFn() -}) diff --git a/js/qrious.js b/js/qrious.js new file mode 100644 index 0000000..5735ea6 --- /dev/null +++ b/js/qrious.js @@ -0,0 +1,6 @@ +/*! QRious v4.0.2 | (C) 2017 Alasdair Mercer | GPL v3 License +Based on jsqrencode | (C) 2010 tz@execpc.com | GPL v3 License +*/ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.QRious=e()}(this,function(){"use strict";function t(t,e){var n;return"function"==typeof Object.create?n=Object.create(t):(s.prototype=t,n=new s,s.prototype=null),e&&i(!0,n,e),n}function e(e,n,s,r){var o=this;return"string"!=typeof e&&(r=s,s=n,n=e,e=null),"function"!=typeof n&&(r=s,s=n,n=function(){return o.apply(this,arguments)}),i(!1,n,o,r),n.prototype=t(o.prototype,s),n.prototype.constructor=n,n.class_=e||o.class_,n.super_=o,n}function i(t,e,i){for(var n,s,a=0,h=(i=o.call(arguments,2)).length;a>1&1,n=0;n0;e--)n[e]=n[e]?n[e-1]^_.EXPONENT[v._modN(_.LOG[n[e]]+t)]:n[e-1];n[0]=_.EXPONENT[v._modN(_.LOG[n[0]]+t)]}for(t=0;t<=i;t++)n[t]=_.LOG[n[t]]},_checkBadness:function(){var t,e,i,n,s,r=0,o=this._badness,a=this.buffer,h=this.width;for(s=0;sh*h;)u-=h*h,c++;for(r+=c*v.N4,n=0;n=o-2&&(t=o-2,s>9&&t--);var a=t;if(s>9){for(r[a+2]=0,r[a+3]=0;a--;)e=r[a],r[a+3]|=255&e<<4,r[a+2]=e>>4;r[2]|=255&t<<4,r[1]=t>>4,r[0]=64|t>>12}else{for(r[a+1]=0,r[a+2]=0;a--;)e=r[a],r[a+2]|=255&e<<4,r[a+1]=e>>4;r[1]|=255&t<<4,r[0]=64|t>>4}for(a=t+3-(s<10);a=5&&(i+=v.N1+n[e]-5);for(e=3;et||3*n[e-3]>=4*n[e]||3*n[e+3]>=4*n[e])&&(i+=v.N3);return i},_finish:function(){this._stringBuffer=this.buffer.slice();var t,e,i=0,n=3e4;for(e=0;e<8&&(this._applyMask(e),(t=this._checkBadness())>=1)1&n&&(s[r-1-e+8*r]=1,e<6?s[8+r*e]=1:s[8+r*(e+1)]=1);for(e=0;e<7;e++,n>>=1)1&n&&(s[8+r*(r-7+e)]=1,e?s[6-e+8*r]=1:s[7+8*r]=1)},_interleaveBlocks:function(){var t,e,i=this._dataBlock,n=this._ecc,s=this._eccBlock,r=0,o=this._calculateMaxLength(),a=this._neccBlock1,h=this._neccBlock2,f=this._stringBuffer;for(t=0;t1)for(t=u.BLOCK[n],i=s-7;;){for(e=s-7;e>t-3&&(this._addAlignment(e,i),!(e6)for(t=d.BLOCK[r-7],e=17,i=0;i<6;i++)for(n=0;n<3;n++,e--)1&(e>11?r>>e-12:t>>e)?(s[5-i+o*(2-n+o-11)]=1,s[2-n+o-11+o*(5-i)]=1):(this._setMask(5-i,2-n+o-11),this._setMask(2-n+o-11,5-i))},_isMasked:function(t,e){var i=v._getMaskBit(t,e);return 1===this._mask[i]},_pack:function(){var t,e,i,n=1,s=1,r=this.width,o=r-1,a=r-1,h=(this._dataBlock+this._eccBlock)*(this._neccBlock1+this._neccBlock2)+this._neccBlock2;for(e=0;ee&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,i+=t},_modN:function(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t},N1:3,N2:3,N3:40,N4:10}),p=v,m=f.extend({draw:function(){this.element.src=this.qrious.toDataURL()},reset:function(){this.element.src=""},resize:function(){var t=this.element;t.width=t.height=this.qrious.size}}),g=h.extend(function(t,e,i,n){this.name=t,this.modifiable=Boolean(e),this.defaultValue=i,this._valueTransformer=n},{transform:function(t){var e=this._valueTransformer;return"function"==typeof e?e(t,this):t}}),k=h.extend(null,{abs:function(t){return null!=t?Math.abs(t):null},hasOwn:function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},noop:function(){},toUpperCase:function(t){return null!=t?t.toUpperCase():null}}),w=h.extend(function(t){this.options={},t.forEach(function(t){this.options[t.name]=t},this)},{exists:function(t){return null!=this.options[t]},get:function(t,e){return w._get(this.options[t],e)},getAll:function(t){var e,i=this.options,n={};for(e in i)k.hasOwn(i,e)&&(n[e]=w._get(i[e],t));return n},init:function(t,e,i){"function"!=typeof i&&(i=k.noop);var n,s;for(n in this.options)k.hasOwn(this.options,n)&&(s=this.options[n],w._set(s,s.defaultValue,e),w._createAccessor(s,e,i));this._setAll(t,e,!0)},set:function(t,e,i){return this._set(t,e,i)},setAll:function(t,e){return this._setAll(t,e)},_set:function(t,e,i,n){var s=this.options[t];if(!s)throw new Error("Invalid option: "+t);if(!s.modifiable&&!n)throw new Error("Option cannot be modified: "+t);return w._set(s,e,i)},_setAll:function(t,e,i){if(!t)return!1;var n,s=!1;for(n in t)k.hasOwn(t,n)&&this._set(n,t[n],e,i)&&(s=!0);return s}},{_createAccessor:function(t,e,i){var n={get:function(){return w._get(t,e)}};t.modifiable&&(n.set=function(n){w._set(t,n,e)&&i(n,t)}),Object.defineProperty(e,t.name,n)},_get:function(t,e){return e["_"+t.name]},_set:function(t,e,i){var n="_"+t.name,s=i[n],r=t.transform(null!=e?e:t.defaultValue);return i[n]=r,r!==s}}),M=w,b=h.extend(function(){this._services={}},{getService:function(t){var e=this._services[t];if(!e)throw new Error("Service is not being managed with name: "+t);return e},setService:function(t,e){if(this._services[t])throw new Error("Service is already managed with name: "+t);e&&(this._services[t]=e)}}),B=new M([new g("background",!0,"white"),new g("backgroundAlpha",!0,1,k.abs),new g("element"),new g("foreground",!0,"black"),new g("foregroundAlpha",!0,1,k.abs),new g("level",!0,"L",k.toUpperCase),new g("mime",!0,"image/png"),new g("padding",!0,null,k.abs),new g("size",!0,100,k.abs),new g("value",!0,"")]),y=new b,O=h.extend(function(t){B.init(t,this,this.update.bind(this));var e=B.get("element",this),i=y.getService("element"),n=e&&i.isCanvas(e)?e:i.createCanvas(),s=e&&i.isImage(e)?e:i.createImage();this._canvasRenderer=new c(this,n,!0),this._imageRenderer=new m(this,s,s===e),this.update()},{get:function(){return B.getAll(this)},set:function(t){B.setAll(t,this)&&this.update()},toDataURL:function(t){return this.canvas.toDataURL(t||this.mime)},update:function(){var t=new p({level:this.level,value:this.value});this._canvasRenderer.render(t),this._imageRenderer.render(t)}},{use:function(t){y.setService(t.getName(),t)}});Object.defineProperties(O.prototype,{canvas:{get:function(){return this._canvasRenderer.getElement()}},image:{get:function(){return this._imageRenderer.getElement()}}});var A=O,L=h.extend({getName:function(){}}).extend({createCanvas:function(){},createImage:function(){},getName:function(){return"element"},isCanvas:function(t){},isImage:function(t){}}).extend({createCanvas:function(){return document.createElement("canvas")},createImage:function(){return document.createElement("img")},isCanvas:function(t){return t instanceof HTMLCanvasElement},isImage:function(t){return t instanceof HTMLImageElement}});return A.use(new L),A}); + +//# sourceMappingURL=qrious.min.js.map \ No newline at end of file diff --git a/js/script.js b/js/script.js new file mode 100644 index 0000000..85d437d --- /dev/null +++ b/js/script.js @@ -0,0 +1,112 @@ +(function ($) { + console.log('© Theme-Vexo | https://github.com/yanm1ng/hexo-theme-vexo') + var app = $('.app-body') + var header = $('.header') + var banner = document.getElementById('article-banner') || false + var about = document.getElementById('about-banner') || false + var top = $('.scroll-top') + var catalog = $('.catalog-container .toc-main') + var isOpen = false + + $(document).ready(function () { + NProgress.start() + $('#nprogress .bar').css({ + 'background': '#42b983' + }) + $('#nprogress .spinner').hide() + + var fade = { + transform: 'translateY(0)', + opacity: 1 + } + if (banner) { + app.css('transition-delay', '0.15s') + $('#article-banner').children().css(fade) + } + if (about) { + $('.author').children().css(fade) + } + app.css(fade) + }) + + window.onload = function () { + setTimeout(function () { + NProgress.done() + }, 200) + } + + $('.menu').on('click', function () { + if (!header.hasClass('fixed-header') || isOpen) { + header.toggleClass('fixed-header') + isOpen = !isOpen + } + $('.menu-mask').toggleClass('open') + }) + + $('#tag-cloud a').on('click', function () { + var list = $('.tag-list') + var name = $(this).data('name').replace(/[\ \'\/\+\#]/gi, "\\$&") + var maoH = list.find('#' + name).offset().top + $('html,body').animate({ + scrollTop: maoH - header.height() + }, 500) + }) + + $('#category-cloud a').on('click', function () { + var list = $('.category-list') + var name = $(this).data('name').replace(/[\ \'\/\+\#]/gi, "\\$&") + var maoH = list.find('#' + name).offset().top + $('html,body').animate({ + scrollTop: maoH - header.height() + }, 500) + }) + + $('.reward-btn').on('click', function () { + $('.money-code').fadeToggle() + }) + + $('.arrow-down').on('click', function () { + $('html, body').animate({ + scrollTop: banner.offsetHeight - header.height() + }, 500) + }) + + $('.toc-nav a').on('click', function (e) { + e.preventDefault() + var catalogTarget = e.currentTarget + // var scrollTarget = $(catalogTarget.getAttribute('href')) + var scrollTarget = $(decodeURIComponent(catalogTarget.getAttribute('href'))) + var top = scrollTarget.offset().top + if (top > 0) { + $('html,body').animate({ + scrollTop: top - 65 + }, 500) + } + }) + + top.on('click', function () { + $('html, body').animate({ scrollTop: 0 }, 600) + }) + + document.addEventListener('scroll', function () { + var scrollTop = document.documentElement.scrollTop || document.body.scrollTop + var headerH = header.height() + if (banner) { + if (scrollTop > headerH) { + header.addClass('fixed-header') + } else if (scrollTop === 0) { + header.removeClass('fixed-header') + } + } + if (scrollTop > 100) { + top.addClass('opacity') + } else { + top.removeClass('opacity') + } + if (scrollTop > 190) { + catalog.addClass('fixed-toc') + } else { + catalog.removeClass('fixed-toc') + } + }) +})(jQuery) diff --git a/js/search/algolia.js b/js/search/algolia.js deleted file mode 100644 index f0b9f3a..0000000 --- a/js/search/algolia.js +++ /dev/null @@ -1,163 +0,0 @@ -window.addEventListener('load', () => { - const openSearch = () => { - const bodyStyle = document.body.style - bodyStyle.width = '100%' - bodyStyle.overflow = 'hidden' - btf.animateIn(document.getElementById('search-mask'), 'to_show 0.5s') - btf.animateIn(document.querySelector('#algolia-search .search-dialog'), 'titleScale 0.5s') - setTimeout(() => { document.querySelector('#algolia-search .ais-SearchBox-input').focus() }, 100) - - // shortcut: ESC - document.addEventListener('keydown', function f (event) { - if (event.code === 'Escape') { - closeSearch() - document.removeEventListener('keydown', f) - } - }) - } - - const closeSearch = () => { - const bodyStyle = document.body.style - bodyStyle.width = '' - bodyStyle.overflow = '' - btf.animateOut(document.querySelector('#algolia-search .search-dialog'), 'search_close .5s') - btf.animateOut(document.getElementById('search-mask'), 'to_hide 0.5s') - } - - const searchClickFn = () => { - document.querySelector('#search-button > .search').addEventListener('click', openSearch) - } - - const searchClickFnOnce = () => { - document.getElementById('search-mask').addEventListener('click', closeSearch) - document.querySelector('#algolia-search .search-close-button').addEventListener('click', closeSearch) - } - - const cutContent = content => { - if (content === '') return '' - - const firstOccur = content.indexOf('') - - let start = firstOccur - 30 - let end = firstOccur + 120 - let pre = '' - let post = '' - - if (start <= 0) { - start = 0 - end = 140 - } else { - pre = '...' - } - - if (end > content.length) { - end = content.length - } else { - post = '...' - } - - let matchContent = pre + content.substring(start, end) + post - return matchContent - } - - const algolia = GLOBAL_CONFIG.algolia - const isAlgoliaValid = algolia.appId && algolia.apiKey && algolia.indexName - if (!isAlgoliaValid) { - return console.error('Algolia setting is invalid!') - } - - const search = instantsearch({ - indexName: algolia.indexName, - searchClient: algoliasearch(algolia.appId, algolia.apiKey), - searchFunction(helper) { - helper.state.query && helper.search() - }, - }) - - const configure = instantsearch.widgets.configure({ - hitsPerPage: 5 - }) - - const searchBox = instantsearch.widgets.searchBox({ - container: '#algolia-search-input', - showReset: false, - showSubmit: false, - placeholder: GLOBAL_CONFIG.algolia.languages.input_placeholder, - showLoadingIndicator: true - }) - - const hits = instantsearch.widgets.hits({ - container: '#algolia-hits', - templates: { - item(data) { - const link = data.permalink ? data.permalink : (GLOBAL_CONFIG.root + data.path) - const result = data._highlightResult - const content = result.contentStripTruncate - ? cutContent(result.contentStripTruncate.value) - : result.contentStrip - ? cutContent(result.contentStrip.value) - : result.content - ? cutContent(result.content.value) - : '' - return ` - - ${result.title.value || 'no-title'} - -

    ${content}

    ` - }, - empty: function (data) { - return ( - '
    ' + - GLOBAL_CONFIG.algolia.languages.hits_empty.replace(/\$\{query}/, data.query) + - '
    ' - ) - } - } - }) - - const stats = instantsearch.widgets.stats({ - container: '#algolia-info > .algolia-stats', - templates: { - text: function (data) { - const stats = GLOBAL_CONFIG.algolia.languages.hits_stats - .replace(/\$\{hits}/, data.nbHits) - .replace(/\$\{time}/, data.processingTimeMS) - return ( - `
    ${stats}` - ) - } - } - }) - - const powerBy = instantsearch.widgets.poweredBy({ - container: '#algolia-info > .algolia-poweredBy', - }) - - const pagination = instantsearch.widgets.pagination({ - container: '#algolia-pagination', - totalPages: 5, - templates: { - first: '', - last: '', - previous: '', - next: '' - } - }) - - - search.addWidgets([configure,searchBox,hits,stats,powerBy,pagination]) // add the widgets to the instantsearch instance - - search.start() - - searchClickFn() - searchClickFnOnce() - - window.addEventListener('pjax:complete', () => { - getComputedStyle(document.querySelector('#algolia-search .search-dialog')).display === 'block' && closeSearch() - searchClickFn() - }) - - window.pjax && search.on('render', () => { - window.pjax.refresh(document.getElementById('algolia-hits')) - }) -}) diff --git a/js/search/local-search.js b/js/search/local-search.js deleted file mode 100644 index 6c1ca7d..0000000 --- a/js/search/local-search.js +++ /dev/null @@ -1,188 +0,0 @@ -window.addEventListener('load', () => { - let loadFlag = false - let dataObj = [] - const $searchMask = document.getElementById('search-mask') - - const openSearch = () => { - const bodyStyle = document.body.style - bodyStyle.width = '100%' - bodyStyle.overflow = 'hidden' - btf.animateIn($searchMask, 'to_show 0.5s') - btf.animateIn(document.querySelector('#local-search .search-dialog'), 'titleScale 0.5s') - setTimeout(() => { document.querySelector('#local-search-input input').focus() }, 100) - if (!loadFlag) { - search() - loadFlag = true - } - // shortcut: ESC - document.addEventListener('keydown', function f (event) { - if (event.code === 'Escape') { - closeSearch() - document.removeEventListener('keydown', f) - } - }) - } - - const closeSearch = () => { - const bodyStyle = document.body.style - bodyStyle.width = '' - bodyStyle.overflow = '' - btf.animateOut(document.querySelector('#local-search .search-dialog'), 'search_close .5s') - btf.animateOut($searchMask, 'to_hide 0.5s') - } - - const searchClickFn = () => { - document.querySelector('#search-button > .search').addEventListener('click', openSearch) - } - - const searchClickFnOnce = () => { - document.querySelector('#local-search .search-close-button').addEventListener('click', closeSearch) - $searchMask.addEventListener('click', closeSearch) - if (GLOBAL_CONFIG.localSearch.preload) dataObj = fetchData(GLOBAL_CONFIG.localSearch.path) - } - - // check url is json or not - const isJson = url => { - const reg = /\.json$/ - return reg.test(url) - } - - const fetchData = async (path) => { - let data = [] - const response = await fetch(path) - if (isJson(path)) { - data = await response.json() - } else { - const res = await response.text() - const t = await new window.DOMParser().parseFromString(res, 'text/xml') - const a = await t - data = [...a.querySelectorAll('entry')].map(item =>{ - return { - title: item.querySelector('title').textContent, - content: item.querySelector('content') && item.querySelector('content').textContent, - url: item.querySelector('url').textContent - } - }) - } - if (response.ok) { - const $loadDataItem = document.getElementById('loading-database') - $loadDataItem.nextElementSibling.style.display = 'block' - $loadDataItem.remove() - } - return data - } - - const search = () => { - if (!GLOBAL_CONFIG.localSearch.preload) { - dataObj = fetchData(GLOBAL_CONFIG.localSearch.path) - } - - const $input = document.querySelector('#local-search-input input') - const $resultContent = document.getElementById('local-search-results') - const $loadingStatus = document.getElementById('loading-status') - - $input.addEventListener('input', function () { - const keywords = this.value.trim().toLowerCase().split(/[\s]+/) - if (keywords[0] !== '') $loadingStatus.innerHTML = '' - - $resultContent.innerHTML = '' - let str = '
    ' - if (keywords.length <= 0) return - let count = 0 - // perform local searching - dataObj.then(data => { - data.forEach(data => { - let isMatch = true - let dataTitle = data.title ? data.title.trim().toLowerCase() : '' - const dataContent = data.content ? data.content.trim().replace(/<[^>]+>/g, '').toLowerCase() : '' - const dataUrl = data.url.startsWith('/') ? data.url : GLOBAL_CONFIG.root + data.url - let indexTitle = -1 - let indexContent = -1 - let firstOccur = -1 - // only match articles with not empty titles and contents - if (dataTitle !== '' || dataContent !== '') { - keywords.forEach((keyword, i) => { - indexTitle = dataTitle.indexOf(keyword) - indexContent = dataContent.indexOf(keyword) - if (indexTitle < 0 && indexContent < 0) { - isMatch = false - } else { - if (indexContent < 0) { - indexContent = 0 - } - if (i === 0) { - firstOccur = indexContent - } - } - }) - } else { - isMatch = false - } - - // show search results - if (isMatch) { - if (firstOccur >= 0) { - // cut out 130 characters - // let start = firstOccur - 30 < 0 ? 0 : firstOccur - 30 - // let end = firstOccur + 50 > dataContent.length ? dataContent.length : firstOccur + 50 - let start = firstOccur - 30 - let end = firstOccur + 100 - let pre = '' - let post = '' - - if (start < 0) { - start = 0 - } - - if (start === 0) { - end = 100 - } else { - pre = '...' - } - - if (end > dataContent.length) { - end = dataContent.length - } else { - post = '...' - } - - let matchContent = dataContent.substring(start, end) - - // highlight all keywords - keywords.forEach(keyword => { - const regS = new RegExp(keyword, 'gi') - matchContent = matchContent.replace(regS, '' + keyword + '') - dataTitle = dataTitle.replace(regS, '' + keyword + '') - }) - - str += '
    ' + dataTitle + '' - count += 1 - - if (dataContent !== '') { - str += '

    ' + pre + matchContent + post + '

    ' - } - } - str += '
    ' - } - }) - if (count === 0) { - str += '
    ' + GLOBAL_CONFIG.localSearch.languages.hits_empty.replace(/\$\{query}/, this.value.trim()) + - '
    ' - } - str += '
    ' - $resultContent.innerHTML = str - if (keywords[0] !== '') $loadingStatus.innerHTML = '' - window.pjax && window.pjax.refresh($resultContent) - }) - }) - } - - searchClickFn() - searchClickFnOnce() - - // pjax - window.addEventListener('pjax:complete', () => { - !btf.isHidden($searchMask) && closeSearch() - searchClickFn() - }) -}) diff --git a/js/tw_cn.js b/js/tw_cn.js deleted file mode 100644 index ec9d37d..0000000 --- a/js/tw_cn.js +++ /dev/null @@ -1,100 +0,0 @@ -/* eslint-disable no-undef */ -document.addEventListener('DOMContentLoaded', function () { - const translate = GLOBAL_CONFIG.translate - const snackbarData = GLOBAL_CONFIG.Snackbar - const defaultEncoding = translate.defaultEncoding // 網站默認語言,1: 繁體中文, 2: 簡體中文 - const translateDelay = translate.translateDelay // 延遲時間,若不在前, 要設定延遲翻譯時間, 如100表示100ms,默認為0 - const msgToTraditionalChinese = translate.msgToTraditionalChinese // 此處可以更改為你想要顯示的文字 - const msgToSimplifiedChinese = translate.msgToSimplifiedChinese // 同上,但兩處均不建議更改 - let currentEncoding = defaultEncoding - const targetEncodingCookie = 'translate-chn-cht' - let targetEncoding = - saveToLocal.get(targetEncodingCookie) === undefined - ? defaultEncoding - : Number(saveToLocal.get('translate-chn-cht')) - let translateButtonObject - const isSnackbar = GLOBAL_CONFIG.Snackbar !== undefined - - function translateText (txt) { - if (txt === '' || txt == null) return '' - if (currentEncoding === 1 && targetEncoding === 2) return Simplized(txt) - else if (currentEncoding === 2 && targetEncoding === 1) { return Traditionalized(txt) } else return txt - } - function translateBody (fobj) { - let objs - if (typeof fobj === 'object') objs = fobj.childNodes - else objs = document.body.childNodes - for (let i = 0; i < objs.length; i++) { - const obj = objs.item(i) - if ( - '||BR|HR|'.indexOf('|' + obj.tagName + '|') > 0 || - obj === translateButtonObject - ) { continue } - if (obj.title !== '' && obj.title != null) { obj.title = translateText(obj.title) } - if (obj.alt !== '' && obj.alt != null) obj.alt = translateText(obj.alt) - if (obj.placeholder !== '' && obj.placeholder != null) obj.placeholder = translateText(obj.placeholder) - if ( - obj.tagName === 'INPUT' && - obj.value !== '' && - obj.type !== 'text' && - obj.type !== 'hidden' - ) { obj.value = translateText(obj.value) } - if (obj.nodeType === 3) obj.data = translateText(obj.data) - else translateBody(obj) - } - } - function translatePage () { - if (targetEncoding === 1) { - currentEncoding = 1 - targetEncoding = 2 - translateButtonObject.innerHTML = msgToTraditionalChinese - saveToLocal.set(targetEncodingCookie, targetEncoding, 2) - translateBody() - if (isSnackbar) btf.snackbarShow(snackbarData.cht_to_chs) - } else if (targetEncoding === 2) { - currentEncoding = 2 - targetEncoding = 1 - translateButtonObject.innerHTML = msgToSimplifiedChinese - saveToLocal.set(targetEncodingCookie, targetEncoding, 2) - translateBody() - if (isSnackbar) btf.snackbarShow(snackbarData.chs_to_cht) - } - } - function JTPYStr () { - return '万与丑专业丛东丝丢两严丧个丬丰临为丽举么义乌乐乔习乡书买乱争于亏云亘亚产亩亲亵亸亿仅从仑仓仪们价众优伙会伛伞伟传伤伥伦伧伪伫体余佣佥侠侣侥侦侧侨侩侪侬俣俦俨俩俪俭债倾偬偻偾偿傥傧储傩儿兑兖党兰关兴兹养兽冁内冈册写军农冢冯冲决况冻净凄凉凌减凑凛几凤凫凭凯击凼凿刍划刘则刚创删别刬刭刽刿剀剂剐剑剥剧劝办务劢动励劲劳势勋勐勚匀匦匮区医华协单卖卢卤卧卫却卺厂厅历厉压厌厍厕厢厣厦厨厩厮县参叆叇双发变叙叠叶号叹叽吁后吓吕吗吣吨听启吴呒呓呕呖呗员呙呛呜咏咔咙咛咝咤咴咸哌响哑哒哓哔哕哗哙哜哝哟唛唝唠唡唢唣唤唿啧啬啭啮啰啴啸喷喽喾嗫呵嗳嘘嘤嘱噜噼嚣嚯团园囱围囵国图圆圣圹场坂坏块坚坛坜坝坞坟坠垄垅垆垒垦垧垩垫垭垯垱垲垴埘埙埚埝埯堑堕塆墙壮声壳壶壸处备复够头夸夹夺奁奂奋奖奥妆妇妈妩妪妫姗姜娄娅娆娇娈娱娲娴婳婴婵婶媪嫒嫔嫱嬷孙学孪宁宝实宠审宪宫宽宾寝对寻导寿将尔尘尧尴尸尽层屃屉届属屡屦屿岁岂岖岗岘岙岚岛岭岳岽岿峃峄峡峣峤峥峦崂崃崄崭嵘嵚嵛嵝嵴巅巩巯币帅师帏帐帘帜带帧帮帱帻帼幂幞干并广庄庆庐庑库应庙庞废庼廪开异弃张弥弪弯弹强归当录彟彦彻径徕御忆忏忧忾怀态怂怃怄怅怆怜总怼怿恋恳恶恸恹恺恻恼恽悦悫悬悭悯惊惧惨惩惫惬惭惮惯愍愠愤愦愿慑慭憷懑懒懔戆戋戏戗战戬户扎扑扦执扩扪扫扬扰抚抛抟抠抡抢护报担拟拢拣拥拦拧拨择挂挚挛挜挝挞挟挠挡挢挣挤挥挦捞损捡换捣据捻掳掴掷掸掺掼揸揽揿搀搁搂搅携摄摅摆摇摈摊撄撑撵撷撸撺擞攒敌敛数斋斓斗斩断无旧时旷旸昙昼昽显晋晒晓晔晕晖暂暧札术朴机杀杂权条来杨杩杰极构枞枢枣枥枧枨枪枫枭柜柠柽栀栅标栈栉栊栋栌栎栏树栖样栾桊桠桡桢档桤桥桦桧桨桩梦梼梾检棂椁椟椠椤椭楼榄榇榈榉槚槛槟槠横樯樱橥橱橹橼檐檩欢欤欧歼殁殇残殒殓殚殡殴毁毂毕毙毡毵氇气氢氩氲汇汉污汤汹沓沟没沣沤沥沦沧沨沩沪沵泞泪泶泷泸泺泻泼泽泾洁洒洼浃浅浆浇浈浉浊测浍济浏浐浑浒浓浔浕涂涌涛涝涞涟涠涡涢涣涤润涧涨涩淀渊渌渍渎渐渑渔渖渗温游湾湿溃溅溆溇滗滚滞滟滠满滢滤滥滦滨滩滪漤潆潇潋潍潜潴澜濑濒灏灭灯灵灾灿炀炉炖炜炝点炼炽烁烂烃烛烟烦烧烨烩烫烬热焕焖焘煅煳熘爱爷牍牦牵牺犊犟状犷犸犹狈狍狝狞独狭狮狯狰狱狲猃猎猕猡猪猫猬献獭玑玙玚玛玮环现玱玺珉珏珐珑珰珲琎琏琐琼瑶瑷璇璎瓒瓮瓯电画畅畲畴疖疗疟疠疡疬疮疯疱疴痈痉痒痖痨痪痫痴瘅瘆瘗瘘瘪瘫瘾瘿癞癣癫癯皑皱皲盏盐监盖盗盘眍眦眬着睁睐睑瞒瞩矫矶矾矿砀码砖砗砚砜砺砻砾础硁硅硕硖硗硙硚确硷碍碛碜碱碹磙礼祎祢祯祷祸禀禄禅离秃秆种积称秽秾稆税稣稳穑穷窃窍窑窜窝窥窦窭竖竞笃笋笔笕笺笼笾筑筚筛筜筝筹签简箓箦箧箨箩箪箫篑篓篮篱簖籁籴类籼粜粝粤粪粮糁糇紧絷纟纠纡红纣纤纥约级纨纩纪纫纬纭纮纯纰纱纲纳纴纵纶纷纸纹纺纻纼纽纾线绀绁绂练组绅细织终绉绊绋绌绍绎经绐绑绒结绔绕绖绗绘给绚绛络绝绞统绠绡绢绣绤绥绦继绨绩绪绫绬续绮绯绰绱绲绳维绵绶绷绸绹绺绻综绽绾绿缀缁缂缃缄缅缆缇缈缉缊缋缌缍缎缏缐缑缒缓缔缕编缗缘缙缚缛缜缝缞缟缠缡缢缣缤缥缦缧缨缩缪缫缬缭缮缯缰缱缲缳缴缵罂网罗罚罢罴羁羟羡翘翙翚耢耧耸耻聂聋职聍联聩聪肃肠肤肷肾肿胀胁胆胜胧胨胪胫胶脉脍脏脐脑脓脔脚脱脶脸腊腌腘腭腻腼腽腾膑臜舆舣舰舱舻艰艳艹艺节芈芗芜芦苁苇苈苋苌苍苎苏苘苹茎茏茑茔茕茧荆荐荙荚荛荜荞荟荠荡荣荤荥荦荧荨荩荪荫荬荭荮药莅莜莱莲莳莴莶获莸莹莺莼萚萝萤营萦萧萨葱蒇蒉蒋蒌蓝蓟蓠蓣蓥蓦蔷蔹蔺蔼蕲蕴薮藁藓虏虑虚虫虬虮虽虾虿蚀蚁蚂蚕蚝蚬蛊蛎蛏蛮蛰蛱蛲蛳蛴蜕蜗蜡蝇蝈蝉蝎蝼蝾螀螨蟏衅衔补衬衮袄袅袆袜袭袯装裆裈裢裣裤裥褛褴襁襕见观觃规觅视觇览觉觊觋觌觍觎觏觐觑觞触觯詟誉誊讠计订讣认讥讦讧讨让讪讫训议讯记讱讲讳讴讵讶讷许讹论讻讼讽设访诀证诂诃评诅识诇诈诉诊诋诌词诎诏诐译诒诓诔试诖诗诘诙诚诛诜话诞诟诠诡询诣诤该详诧诨诩诪诫诬语诮误诰诱诲诳说诵诶请诸诹诺读诼诽课诿谀谁谂调谄谅谆谇谈谊谋谌谍谎谏谐谑谒谓谔谕谖谗谘谙谚谛谜谝谞谟谠谡谢谣谤谥谦谧谨谩谪谫谬谭谮谯谰谱谲谳谴谵谶谷豮贝贞负贠贡财责贤败账货质贩贪贫贬购贮贯贰贱贲贳贴贵贶贷贸费贺贻贼贽贾贿赀赁赂赃资赅赆赇赈赉赊赋赌赍赎赏赐赑赒赓赔赕赖赗赘赙赚赛赜赝赞赟赠赡赢赣赪赵赶趋趱趸跃跄跖跞践跶跷跸跹跻踊踌踪踬踯蹑蹒蹰蹿躏躜躯车轧轨轩轪轫转轭轮软轰轱轲轳轴轵轶轷轸轹轺轻轼载轾轿辀辁辂较辄辅辆辇辈辉辊辋辌辍辎辏辐辑辒输辔辕辖辗辘辙辚辞辩辫边辽达迁过迈运还这进远违连迟迩迳迹适选逊递逦逻遗遥邓邝邬邮邹邺邻郁郄郏郐郑郓郦郧郸酝酦酱酽酾酿释里鉅鉴銮錾钆钇针钉钊钋钌钍钎钏钐钑钒钓钔钕钖钗钘钙钚钛钝钞钟钠钡钢钣钤钥钦钧钨钩钪钫钬钭钮钯钰钱钲钳钴钵钶钷钸钹钺钻钼钽钾钿铀铁铂铃铄铅铆铈铉铊铋铍铎铏铐铑铒铕铗铘铙铚铛铜铝铞铟铠铡铢铣铤铥铦铧铨铪铫铬铭铮铯铰铱铲铳铴铵银铷铸铹铺铻铼铽链铿销锁锂锃锄锅锆锇锈锉锊锋锌锍锎锏锐锑锒锓锔锕锖锗错锚锜锞锟锠锡锢锣锤锥锦锨锩锫锬锭键锯锰锱锲锳锴锵锶锷锸锹锺锻锼锽锾锿镀镁镂镃镆镇镈镉镊镌镍镎镏镐镑镒镕镖镗镙镚镛镜镝镞镟镠镡镢镣镤镥镦镧镨镩镪镫镬镭镮镯镰镱镲镳镴镶长门闩闪闫闬闭问闯闰闱闲闳间闵闶闷闸闹闺闻闼闽闾闿阀阁阂阃阄阅阆阇阈阉阊阋阌阍阎阏阐阑阒阓阔阕阖阗阘阙阚阛队阳阴阵阶际陆陇陈陉陕陧陨险随隐隶隽难雏雠雳雾霁霉霭靓静靥鞑鞒鞯鞴韦韧韨韩韪韫韬韵页顶顷顸项顺须顼顽顾顿颀颁颂颃预颅领颇颈颉颊颋颌颍颎颏颐频颒颓颔颕颖颗题颙颚颛颜额颞颟颠颡颢颣颤颥颦颧风飏飐飑飒飓飔飕飖飗飘飙飚飞飨餍饤饥饦饧饨饩饪饫饬饭饮饯饰饱饲饳饴饵饶饷饸饹饺饻饼饽饾饿馀馁馂馃馄馅馆馇馈馉馊馋馌馍馎馏馐馑馒馓馔馕马驭驮驯驰驱驲驳驴驵驶驷驸驹驺驻驼驽驾驿骀骁骂骃骄骅骆骇骈骉骊骋验骍骎骏骐骑骒骓骔骕骖骗骘骙骚骛骜骝骞骟骠骡骢骣骤骥骦骧髅髋髌鬓魇魉鱼鱽鱾鱿鲀鲁鲂鲄鲅鲆鲇鲈鲉鲊鲋鲌鲍鲎鲏鲐鲑鲒鲓鲔鲕鲖鲗鲘鲙鲚鲛鲜鲝鲞鲟鲠鲡鲢鲣鲤鲥鲦鲧鲨鲩鲪鲫鲬鲭鲮鲯鲰鲱鲲鲳鲴鲵鲶鲷鲸鲹鲺鲻鲼鲽鲾鲿鳀鳁鳂鳃鳄鳅鳆鳇鳈鳉鳊鳋鳌鳍鳎鳏鳐鳑鳒鳓鳔鳕鳖鳗鳘鳙鳛鳜鳝鳞鳟鳠鳡鳢鳣鸟鸠鸡鸢鸣鸤鸥鸦鸧鸨鸩鸪鸫鸬鸭鸮鸯鸰鸱鸲鸳鸴鸵鸶鸷鸸鸹鸺鸻鸼鸽鸾鸿鹀鹁鹂鹃鹄鹅鹆鹇鹈鹉鹊鹋鹌鹍鹎鹏鹐鹑鹒鹓鹔鹕鹖鹗鹘鹚鹛鹜鹝鹞鹟鹠鹡鹢鹣鹤鹥鹦鹧鹨鹩鹪鹫鹬鹭鹯鹰鹱鹲鹳鹴鹾麦麸黄黉黡黩黪黾龙历志制一台皋准复猛钟注范签' - } - function FTPYStr () { - return '萬與醜專業叢東絲丟兩嚴喪個爿豐臨為麗舉麼義烏樂喬習鄉書買亂爭於虧雲亙亞產畝親褻嚲億僅從侖倉儀們價眾優夥會傴傘偉傳傷倀倫傖偽佇體餘傭僉俠侶僥偵側僑儈儕儂俁儔儼倆儷儉債傾傯僂僨償儻儐儲儺兒兌兗黨蘭關興茲養獸囅內岡冊寫軍農塚馮衝決況凍淨淒涼淩減湊凜幾鳳鳧憑凱擊氹鑿芻劃劉則剛創刪別剗剄劊劌剴劑剮劍剝劇勸辦務勱動勵勁勞勢勳猛勩勻匭匱區醫華協單賣盧鹵臥衛卻巹廠廳曆厲壓厭厙廁廂厴廈廚廄廝縣參靉靆雙發變敘疊葉號歎嘰籲後嚇呂嗎唚噸聽啟吳嘸囈嘔嚦唄員咼嗆嗚詠哢嚨嚀噝吒噅鹹呱響啞噠嘵嗶噦嘩噲嚌噥喲嘜嗊嘮啢嗩唕喚呼嘖嗇囀齧囉嘽嘯噴嘍嚳囁嗬噯噓嚶囑嚕劈囂謔團園囪圍圇國圖圓聖壙場阪壞塊堅壇壢壩塢墳墜壟壟壚壘墾坰堊墊埡墶壋塏堖塒塤堝墊垵塹墮壪牆壯聲殼壺壼處備複夠頭誇夾奪奩奐奮獎奧妝婦媽嫵嫗媯姍薑婁婭嬈嬌孌娛媧嫻嫿嬰嬋嬸媼嬡嬪嬙嬤孫學孿寧寶實寵審憲宮寬賓寢對尋導壽將爾塵堯尷屍盡層屭屜屆屬屢屨嶼歲豈嶇崗峴嶴嵐島嶺嶽崠巋嶨嶧峽嶢嶠崢巒嶗崍嶮嶄嶸嶔崳嶁脊巔鞏巰幣帥師幃帳簾幟帶幀幫幬幘幗冪襆幹並廣莊慶廬廡庫應廟龐廢廎廩開異棄張彌弳彎彈強歸當錄彠彥徹徑徠禦憶懺憂愾懷態慫憮慪悵愴憐總懟懌戀懇惡慟懨愷惻惱惲悅愨懸慳憫驚懼慘懲憊愜慚憚慣湣慍憤憒願懾憖怵懣懶懍戇戔戲戧戰戩戶紮撲扡執擴捫掃揚擾撫拋摶摳掄搶護報擔擬攏揀擁攔擰撥擇掛摯攣掗撾撻挾撓擋撟掙擠揮撏撈損撿換搗據撚擄摑擲撣摻摜摣攬撳攙擱摟攪攜攝攄擺搖擯攤攖撐攆擷擼攛擻攢敵斂數齋斕鬥斬斷無舊時曠暘曇晝曨顯晉曬曉曄暈暉暫曖劄術樸機殺雜權條來楊榪傑極構樅樞棗櫪梘棖槍楓梟櫃檸檉梔柵標棧櫛櫳棟櫨櫟欄樹棲樣欒棬椏橈楨檔榿橋樺檜槳樁夢檮棶檢欞槨櫝槧欏橢樓欖櫬櫚櫸檟檻檳櫧橫檣櫻櫫櫥櫓櫞簷檁歡歟歐殲歿殤殘殞殮殫殯毆毀轂畢斃氈毿氌氣氫氬氳彙漢汙湯洶遝溝沒灃漚瀝淪滄渢溈滬濔濘淚澩瀧瀘濼瀉潑澤涇潔灑窪浹淺漿澆湞溮濁測澮濟瀏滻渾滸濃潯濜塗湧濤澇淶漣潿渦溳渙滌潤澗漲澀澱淵淥漬瀆漸澠漁瀋滲溫遊灣濕潰濺漵漊潷滾滯灩灄滿瀅濾濫灤濱灘澦濫瀠瀟瀲濰潛瀦瀾瀨瀕灝滅燈靈災燦煬爐燉煒熗點煉熾爍爛烴燭煙煩燒燁燴燙燼熱煥燜燾煆糊溜愛爺牘犛牽犧犢強狀獷獁猶狽麅獮獰獨狹獅獪猙獄猻獫獵獼玀豬貓蝟獻獺璣璵瑒瑪瑋環現瑲璽瑉玨琺瓏璫琿璡璉瑣瓊瑤璦璿瓔瓚甕甌電畫暢佘疇癤療瘧癘瘍鬁瘡瘋皰屙癰痙癢瘂癆瘓癇癡癉瘮瘞瘺癟癱癮癭癩癬癲臒皚皺皸盞鹽監蓋盜盤瞘眥矓著睜睞瞼瞞矚矯磯礬礦碭碼磚硨硯碸礪礱礫礎硜矽碩硤磽磑礄確鹼礙磧磣堿镟滾禮禕禰禎禱禍稟祿禪離禿稈種積稱穢穠穭稅穌穩穡窮竊竅窯竄窩窺竇窶豎競篤筍筆筧箋籠籩築篳篩簹箏籌簽簡籙簀篋籜籮簞簫簣簍籃籬籪籟糴類秈糶糲粵糞糧糝餱緊縶糸糾紆紅紂纖紇約級紈纊紀紉緯紜紘純紕紗綱納紝縱綸紛紙紋紡紵紖紐紓線紺絏紱練組紳細織終縐絆紼絀紹繹經紿綁絨結絝繞絰絎繪給絢絳絡絕絞統綆綃絹繡綌綏絛繼綈績緒綾緓續綺緋綽緔緄繩維綿綬繃綢綯綹綣綜綻綰綠綴緇緙緗緘緬纜緹緲緝縕繢緦綞緞緶線緱縋緩締縷編緡緣縉縛縟縝縫縗縞纏縭縊縑繽縹縵縲纓縮繆繅纈繚繕繒韁繾繰繯繳纘罌網羅罰罷羆羈羥羨翹翽翬耮耬聳恥聶聾職聹聯聵聰肅腸膚膁腎腫脹脅膽勝朧腖臚脛膠脈膾髒臍腦膿臠腳脫腡臉臘醃膕齶膩靦膃騰臏臢輿艤艦艙艫艱豔艸藝節羋薌蕪蘆蓯葦藶莧萇蒼苧蘇檾蘋莖蘢蔦塋煢繭荊薦薘莢蕘蓽蕎薈薺蕩榮葷滎犖熒蕁藎蓀蔭蕒葒葤藥蒞蓧萊蓮蒔萵薟獲蕕瑩鶯蓴蘀蘿螢營縈蕭薩蔥蕆蕢蔣蔞藍薊蘺蕷鎣驀薔蘞藺藹蘄蘊藪槁蘚虜慮虛蟲虯蟣雖蝦蠆蝕蟻螞蠶蠔蜆蠱蠣蟶蠻蟄蛺蟯螄蠐蛻蝸蠟蠅蟈蟬蠍螻蠑螿蟎蠨釁銜補襯袞襖嫋褘襪襲襏裝襠褌褳襝褲襇褸襤繈襴見觀覎規覓視覘覽覺覬覡覿覥覦覯覲覷觴觸觶讋譽謄訁計訂訃認譏訐訌討讓訕訖訓議訊記訒講諱謳詎訝訥許訛論訩訟諷設訪訣證詁訶評詛識詗詐訴診詆謅詞詘詔詖譯詒誆誄試詿詩詰詼誠誅詵話誕詬詮詭詢詣諍該詳詫諢詡譸誡誣語誚誤誥誘誨誑說誦誒請諸諏諾讀諑誹課諉諛誰諗調諂諒諄誶談誼謀諶諜謊諫諧謔謁謂諤諭諼讒諮諳諺諦謎諞諝謨讜謖謝謠謗諡謙謐謹謾謫譾謬譚譖譙讕譜譎讞譴譫讖穀豶貝貞負貟貢財責賢敗賬貨質販貪貧貶購貯貫貳賤賁貰貼貴貺貸貿費賀貽賊贄賈賄貲賃賂贓資賅贐賕賑賚賒賦賭齎贖賞賜贔賙賡賠賧賴賵贅賻賺賽賾贗讚贇贈贍贏贛赬趙趕趨趲躉躍蹌蹠躒踐躂蹺蹕躚躋踴躊蹤躓躑躡蹣躕躥躪躦軀車軋軌軒軑軔轉軛輪軟轟軲軻轤軸軹軼軤軫轢軺輕軾載輊轎輈輇輅較輒輔輛輦輩輝輥輞輬輟輜輳輻輯轀輸轡轅轄輾轆轍轔辭辯辮邊遼達遷過邁運還這進遠違連遲邇逕跡適選遜遞邐邏遺遙鄧鄺鄔郵鄒鄴鄰鬱郤郟鄶鄭鄆酈鄖鄲醞醱醬釅釃釀釋裏钜鑒鑾鏨釓釔針釘釗釙釕釷釺釧釤鈒釩釣鍆釹鍚釵鈃鈣鈈鈦鈍鈔鍾鈉鋇鋼鈑鈐鑰欽鈞鎢鉤鈧鈁鈥鈄鈕鈀鈺錢鉦鉗鈷缽鈳鉕鈽鈸鉞鑽鉬鉭鉀鈿鈾鐵鉑鈴鑠鉛鉚鈰鉉鉈鉍鈹鐸鉶銬銠鉺銪鋏鋣鐃銍鐺銅鋁銱銦鎧鍘銖銑鋌銩銛鏵銓鉿銚鉻銘錚銫鉸銥鏟銃鐋銨銀銣鑄鐒鋪鋙錸鋱鏈鏗銷鎖鋰鋥鋤鍋鋯鋨鏽銼鋝鋒鋅鋶鐦鐧銳銻鋃鋟鋦錒錆鍺錯錨錡錁錕錩錫錮鑼錘錐錦鍁錈錇錟錠鍵鋸錳錙鍥鍈鍇鏘鍶鍔鍤鍬鍾鍛鎪鍠鍰鎄鍍鎂鏤鎡鏌鎮鎛鎘鑷鐫鎳鎿鎦鎬鎊鎰鎔鏢鏜鏍鏰鏞鏡鏑鏃鏇鏐鐔钁鐐鏷鑥鐓鑭鐠鑹鏹鐙鑊鐳鐶鐲鐮鐿鑔鑣鑞鑲長門閂閃閆閈閉問闖閏闈閑閎間閔閌悶閘鬧閨聞闥閩閭闓閥閣閡閫鬮閱閬闍閾閹閶鬩閿閽閻閼闡闌闃闠闊闋闔闐闒闕闞闤隊陽陰陣階際陸隴陳陘陝隉隕險隨隱隸雋難雛讎靂霧霽黴靄靚靜靨韃鞽韉韝韋韌韍韓韙韞韜韻頁頂頃頇項順須頊頑顧頓頎頒頌頏預顱領頗頸頡頰頲頜潁熲頦頤頻頮頹頷頴穎顆題顒顎顓顏額顳顢顛顙顥纇顫顬顰顴風颺颭颮颯颶颸颼颻飀飄飆飆飛饗饜飣饑飥餳飩餼飪飫飭飯飲餞飾飽飼飿飴餌饒餉餄餎餃餏餅餑餖餓餘餒餕餜餛餡館餷饋餶餿饞饁饃餺餾饈饉饅饊饌饢馬馭馱馴馳驅馹駁驢駔駛駟駙駒騶駐駝駑駕驛駘驍罵駰驕驊駱駭駢驫驪騁驗騂駸駿騏騎騍騅騌驌驂騙騭騤騷騖驁騮騫騸驃騾驄驏驟驥驦驤髏髖髕鬢魘魎魚魛魢魷魨魯魴魺鮁鮃鯰鱸鮋鮓鮒鮊鮑鱟鮍鮐鮭鮚鮳鮪鮞鮦鰂鮜鱠鱭鮫鮮鮺鯗鱘鯁鱺鰱鰹鯉鰣鰷鯀鯊鯇鮶鯽鯒鯖鯪鯕鯫鯡鯤鯧鯝鯢鯰鯛鯨鯵鯴鯔鱝鰈鰏鱨鯷鰮鰃鰓鱷鰍鰒鰉鰁鱂鯿鰠鼇鰭鰨鰥鰩鰟鰜鰳鰾鱈鱉鰻鰵鱅鰼鱖鱔鱗鱒鱯鱤鱧鱣鳥鳩雞鳶鳴鳲鷗鴉鶬鴇鴆鴣鶇鸕鴨鴞鴦鴒鴟鴝鴛鴬鴕鷥鷙鴯鴰鵂鴴鵃鴿鸞鴻鵐鵓鸝鵑鵠鵝鵒鷳鵜鵡鵲鶓鵪鶤鵯鵬鵮鶉鶊鵷鷫鶘鶡鶚鶻鶿鶥鶩鷊鷂鶲鶹鶺鷁鶼鶴鷖鸚鷓鷚鷯鷦鷲鷸鷺鸇鷹鸌鸏鸛鸘鹺麥麩黃黌黶黷黲黽龍歷誌製壹臺臯準復勐鐘註範籤' - } - function Traditionalized (cc) { - let str = '' - const ss = JTPYStr() - const tt = FTPYStr() - for (let i = 0; i < cc.length; i++) { - if (cc.charCodeAt(i) > 10000 && ss.indexOf(cc.charAt(i)) !== -1) { str += tt.charAt(ss.indexOf(cc.charAt(i))) } else str += cc.charAt(i) - } - return str - } - function Simplized (cc) { - let str = '' - const ss = JTPYStr() - const tt = FTPYStr() - for (let i = 0; i < cc.length; i++) { - if (cc.charCodeAt(i) > 10000 && tt.indexOf(cc.charAt(i)) !== -1) { str += ss.charAt(tt.indexOf(cc.charAt(i))) } else str += cc.charAt(i) - } - return str - } - function translateInitialization () { - translateButtonObject = document.getElementById('translateLink') - if (translateButtonObject) { - if (currentEncoding !== targetEncoding) { - setTimeout(translateBody, translateDelay) - if (targetEncoding === 1) translateButtonObject.innerHTML = msgToSimplifiedChinese - else translateButtonObject.innerHTML = msgToTraditionalChinese - } - translateButtonObject.addEventListener('click', translatePage, false) - } - } - translateInitialization() - document.addEventListener('pjax:complete', translateInitialization) -}) diff --git a/js/utils.js b/js/utils.js deleted file mode 100644 index a1be368..0000000 --- a/js/utils.js +++ /dev/null @@ -1,278 +0,0 @@ -const btf = { - debounce: function (func, wait, immediate) { - let timeout - return function () { - const context = this - const args = arguments - const later = function () { - timeout = null - if (!immediate) func.apply(context, args) - } - const callNow = immediate && !timeout - clearTimeout(timeout) - timeout = setTimeout(later, wait) - if (callNow) func.apply(context, args) - } - }, - - throttle: function (func, wait, options) { - let timeout, context, args - let previous = 0 - if (!options) options = {} - - const later = function () { - previous = options.leading === false ? 0 : new Date().getTime() - timeout = null - func.apply(context, args) - if (!timeout) context = args = null - } - - const throttled = function () { - const now = new Date().getTime() - if (!previous && options.leading === false) previous = now - const remaining = wait - (now - previous) - context = this - args = arguments - if (remaining <= 0 || remaining > wait) { - if (timeout) { - clearTimeout(timeout) - timeout = null - } - previous = now - func.apply(context, args) - if (!timeout) context = args = null - } else if (!timeout && options.trailing !== false) { - timeout = setTimeout(later, remaining) - } - } - - return throttled - }, - - sidebarPaddingR: () => { - const innerWidth = window.innerWidth - const clientWidth = document.body.clientWidth - const paddingRight = innerWidth - clientWidth - if (innerWidth !== clientWidth) { - document.body.style.paddingRight = paddingRight + 'px' - } - }, - - snackbarShow: (text, showAction = false, duration = 2000) => { - const { position, bgLight, bgDark } = GLOBAL_CONFIG.Snackbar - const bg = document.documentElement.getAttribute('data-theme') === 'light' ? bgLight : bgDark - Snackbar.show({ - text: text, - backgroundColor: bg, - showAction: showAction, - duration: duration, - pos: position, - customClass: 'snackbar-css' - }) - }, - - diffDate: (d, more = false) => { - const dateNow = new Date() - const datePost = new Date(d) - const dateDiff = dateNow.getTime() - datePost.getTime() - const minute = 1000 * 60 - const hour = minute * 60 - const day = hour * 24 - const month = day * 30 - - let result - if (more) { - const monthCount = dateDiff / month - const dayCount = dateDiff / day - const hourCount = dateDiff / hour - const minuteCount = dateDiff / minute - - if (monthCount > 12) { - result = datePost.toLocaleDateString().replace(/\//g, '-') - } else if (monthCount >= 1) { - result = parseInt(monthCount) + ' ' + GLOBAL_CONFIG.date_suffix.month - } else if (dayCount >= 1) { - result = parseInt(dayCount) + ' ' + GLOBAL_CONFIG.date_suffix.day - } else if (hourCount >= 1) { - result = parseInt(hourCount) + ' ' + GLOBAL_CONFIG.date_suffix.hour - } else if (minuteCount >= 1) { - result = parseInt(minuteCount) + ' ' + GLOBAL_CONFIG.date_suffix.min - } else { - result = GLOBAL_CONFIG.date_suffix.just - } - } else { - result = parseInt(dateDiff / day) - } - return result - }, - - loadComment: (dom, callback) => { - if ('IntersectionObserver' in window) { - const observerItem = new IntersectionObserver((entries) => { - if (entries[0].isIntersecting) { - callback() - observerItem.disconnect() - } - }, { threshold: [0] }) - observerItem.observe(dom) - } else { - callback() - } - }, - - scrollToDest: (pos, time = 500) => { - const currentPos = window.pageYOffset - if (currentPos > pos) pos = pos - 70 - - if ('scrollBehavior' in document.documentElement.style) { - window.scrollTo({ - top: pos, - behavior: 'smooth' - }) - return - } - - let start = null - pos = +pos - window.requestAnimationFrame(function step (currentTime) { - start = !start ? currentTime : start - const progress = currentTime - start - if (currentPos < pos) { - window.scrollTo(0, ((pos - currentPos) * progress / time) + currentPos) - } else { - window.scrollTo(0, currentPos - ((currentPos - pos) * progress / time)) - } - if (progress < time) { - window.requestAnimationFrame(step) - } else { - window.scrollTo(0, pos) - } - }) - }, - - animateIn: (ele, text) => { - ele.style.display = 'block' - ele.style.animation = text - }, - - animateOut: (ele, text) => { - ele.addEventListener('animationend', function f () { - ele.style.display = '' - ele.style.animation = '' - ele.removeEventListener('animationend', f) - }) - ele.style.animation = text - }, - - getParents: (elem, selector) => { - for (; elem && elem !== document; elem = elem.parentNode) { - if (elem.matches(selector)) return elem - } - return null - }, - - siblings: (ele, selector) => { - return [...ele.parentNode.children].filter((child) => { - if (selector) { - return child !== ele && child.matches(selector) - } - return child !== ele - }) - }, - - /** - * @param {*} selector - * @param {*} eleType the type of create element - * @param {*} options object key: value - */ - wrap: (selector, eleType, options) => { - const creatEle = document.createElement(eleType) - for (const [key, value] of Object.entries(options)) { - creatEle.setAttribute(key, value) - } - selector.parentNode.insertBefore(creatEle, selector) - creatEle.appendChild(selector) - }, - - unwrap: el => { - const elParentNode = el.parentNode - if (elParentNode !== document.body) { - elParentNode.parentNode.insertBefore(el, elParentNode) - elParentNode.parentNode.removeChild(elParentNode) - } - }, - - isHidden: ele => ele.offsetHeight === 0 && ele.offsetWidth === 0, - - getEleTop: ele => { - let actualTop = ele.offsetTop - let current = ele.offsetParent - - while (current !== null) { - actualTop += current.offsetTop - current = current.offsetParent - } - - return actualTop - }, - - loadLightbox: ele => { - const service = GLOBAL_CONFIG.lightbox - - if (service === 'mediumZoom') { - const zoom = mediumZoom(ele) - zoom.on('open', e => { - const photoBg = document.documentElement.getAttribute('data-theme') === 'dark' ? '#121212' : '#fff' - zoom.update({ - background: photoBg - }) - }) - } - - if (service === 'fancybox') { - ele.forEach(i => { - if (i.parentNode.tagName !== 'A') { - const dataSrc = i.dataset.lazySrc || i.src - const dataCaption = i.title || i.alt || '' - btf.wrap(i, 'a', { href: dataSrc, 'data-fancybox': 'gallery', 'data-caption': dataCaption, 'data-thumb': dataSrc }) - } - }) - - if (!window.fancyboxRun) { - Fancybox.bind('[data-fancybox]', { - Hash: false, - Thumbs: { - autoStart: false - } - }) - window.fancyboxRun = true - } - } - }, - - initJustifiedGallery: function (selector) { - selector.forEach(function (i) { - if (!btf.isHidden(i)) { - fjGallery(i, { - itemSelector: '.fj-gallery-item', - rowHeight: 220, - gutter: 4, - onJustify: function () { - this.$container.style.opacity = '1' - } - }) - } - }) - }, - - updateAnchor: (anchor) => { - if (anchor !== window.location.hash) { - if (!anchor) anchor = location.pathname - const title = GLOBAL_CONFIG_SITE.title - window.history.replaceState({ - url: location.href, - title: title - }, title, anchor) - } - } -} diff --git a/link/index.html b/link/index.html deleted file mode 100644 index 6b2883d..0000000 --- a/link/index.html +++ /dev/null @@ -1,185 +0,0 @@ -link | Bluecode - - - - - - - - - -

    Comment
    Announcement
    还没想好说什么
    Recent Post
    Info
    Article :
    2
    Run time :
    Total Count :
    1.4k
    UV :
    PV :
    Last Push :
    访客地图
    \ No newline at end of file diff --git a/tags/github/index.html b/tags/github/index.html deleted file mode 100644 index 489853e..0000000 --- a/tags/github/index.html +++ /dev/null @@ -1,158 +0,0 @@ -Tag: github | Bluecode - - - - - - - -
    Tag - github
    2022
    利用GitHub自动化部署Blog
    利用GitHub自动化部署Blog
    Announcement
    还没想好说什么
    Recent Post
    Info
    Article :
    2
    Run time :
    Total Count :
    1.4k
    UV :
    PV :
    Last Push :
    访客地图
    \ No newline at end of file diff --git a/tags/hexo/index.html b/tags/hexo/index.html deleted file mode 100644 index 74e380d..0000000 --- a/tags/hexo/index.html +++ /dev/null @@ -1,158 +0,0 @@ -Tag: hexo | Bluecode - - - - - - - -
    Tag - hexo
    2022
    利用GitHub自动化部署Blog
    利用GitHub自动化部署Blog
    Announcement
    还没想好说什么
    Recent Post
    Info
    Article :
    2
    Run time :
    Total Count :
    1.4k
    UV :
    PV :
    Last Push :
    访客地图
    \ No newline at end of file diff --git a/tags/index.html b/tags/index.html index 4171ec8..f8f16d5 100644 --- a/tags/index.html +++ b/tags/index.html @@ -1,185 +1,247 @@ -tags | Bluecode - - - - - - - - - - + + + + + + + + - if (!itemStr) { - return undefined + + + + + - if (now.getTime() > item.expiry) { - localStorage.removeItem(key) - return undefined - } - return item.value - } - } - win.getScript = url => new Promise((resolve, reject) => { - const script = document.createElement('script') - script.src = url - script.async = true - script.onerror = reject - script.onload = script.onreadystatechange = function() { - const loadState = this.readyState - if (loadState && loadState !== 'loaded' && loadState !== 'complete') return - script.onload = script.onreadystatechange = null - resolve() - } - document.head.appendChild(script) - }) - win.activateDarkMode = function () { - document.documentElement.setAttribute('data-theme', 'dark') - if (document.querySelector('meta[name="theme-color"]') !== null) { - document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d') - } - } - win.activateLightMode = function () { - document.documentElement.setAttribute('data-theme', 'light') - if (document.querySelector('meta[name="theme-color"]') !== null) { - document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff') - } - } - const t = saveToLocal.get('theme') - if (t === 'dark') activateDarkMode() - else if (t === 'light') activateLightMode() + + + + +
    + +
    + +
    +
    + + + Bluecode + + + + - const detectApple = () => { - if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){ - document.documentElement.classList.add('apple') - } +
    + +
    + +
    +
    + +
    +

    Tags

    + +
    +
    +
    + +
    + +
    + +

    Comment
    Announcement
    还没想好说什么
    Recent Post
    Info
    Article :
    2
    Run time :
    Total Count :
    1.4k
    UV :
    PV :
    Last Push :
    访客地图
    +
    + +
    +
    + +
    -function panguInit () { - if (false){ - GLOBAL_CONFIG_SITE.isPost && panguFn() - } else { - panguFn() + + -document.addEventListener('DOMContentLoaded', panguInit)
    + - if (typeof Valine === 'function') initValine() - else getScript('https://cdn.jsdelivr.net/npm/valine/dist/Valine.min.js').then(initValine) -} -if ('Valine' === 'Valine' || !false) { - if (false) btf.loadComment(document.getElementById('vcomment'),loadValine) - else setTimeout(loadValine, 0) -} else { - function loadOtherComment () { - loadValine() - } -}
    \ No newline at end of file + + + + + \ No newline at end of file