diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..a0c8f52 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,31 @@ +name: build and deploy +on: + push: + branches: + - master +jobs: + build-and-deploy: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + persist-credentials: false + + - name: Setup Hugo + uses: peaceiris/actions-hugo@v2 + with: + hugo-version: 'latest' + extended: true + + - name: Install and Build + run: | + npm install + npm run build + + - name: Deploy + uses: JamesIves/github-pages-deploy-action@v4 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages + FOLDER: ./public \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..018818b --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +node_modules +.DS_Store +dist +dist-ssr +*.local +public diff --git a/.hugo_build.lock b/.hugo_build.lock new file mode 100644 index 0000000..e69de29 diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..e8cb64c --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,30 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Launch Chrome", + "request": "launch", + "type": "chrome", + "url": "http://localhost:5173/", + "webRoot": "${workspaceFolder}" + }, + { + "name": "Current TS File", + "type": "node", + "request": "launch", + "args": [ + "${relativeFile}" + ], + "runtimeArgs": [ + "--nolazy", + "-r", + "ts-node/register" + ], + "sourceMaps": true, + "cwd": "${workspaceRoot}", + "protocol": "inspector", + "console": "integratedTerminal", + "internalConsoleOptions": "neverOpen" + } + ] +} \ No newline at end of file diff --git a/README.md b/README.md index c0b6c80..af8d93c 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,87 @@ -# New Website -Basically a new website design for Interactive+ +# 形随意动官网2022 -## Design-Theory -- [x] Multi-language system -- [x] Dynamic control over news, slides, members display. -- [x] Charming layout and color selection +## 说明 +都2022年了,是时候进行现代化改造了! -## Authors -Create by Meteoroid -Code Review by Windy +基于以下原因,首先选择了Hugo作为底层框架: +- 要部署在Github Pages上,且方便SEO优化 +- 方便进行文章编辑生成,最好是基于markdown,不用再加入后台管理 +- 完善的多语言支持 +- 生态丰富,社区活跃 +在此基础上,我们还想加入更多的现代特性,比如tailwind, react, vue,这就需要联动其他的打包工具。 +这里我们选择了Vite,Webpack不符合我们的现代化目标。 + +随着Github Action的普及,也是时候开始CI/CD了。这里实现的是,无需手动上传build后产出,就能自动打包并部署到Github Pages上。 + + +## 环境 +- hugo-extended,该版本支持scss +- vite + +hugo在生成静态网页时,会处理html中的scss: +- 对模板中的scss进行默认处理 +- 对自定义localscss进行自定义处理(见配置文件) + +vite用于对tailwind(调用postcss),和其他现代框架进行处理 + +## 快速参与 +### 说明 +master分支放的是项目代码,gh-pages分支是自动打包后产物 + +如果你使用windows,请手动去github上master分支下载最新的vite-hugo-plugin(或确保版本>3.0.5)并替换node_modules里的 + +### 打包产物快速启动 +npx http-server -p 8888 + + +## 一些细节 +1. vite支持scss(sass),但是本项目还是采用hugo将scss转化css后引入的方式(即不使用vite进行转换)。 +原因是vite自带postcss-import,当在html中引入scss文件时, + ``` + + ``` + 会自动内联样式。一旦样式增加会导致体积不可控。 + 另一个写法: + ``` + + ``` + 这个写法也能用,但是并没有充分利用hugo或者vite的特性,还得额外在`package.json`配置`sass`的监听才能转换成css,过于复杂。 + ``` + "dev:sass": "sass --watch localscss:static/css" + ``` + + 最终选择了用hugo的特性,实例可见`layouts\shortcodes\display_members.html` + + 参考文档:https://gohugo.io/hugo-pipes/introduction/ +2. 本项目基础主题用的是loveit,位于themes文件夹,如果想修改,请将需要修改的文件按原相对路径放置到项目根目录中,就像本项目这样,不应直接改动原主题 + +## 参考链接 +推荐在参与开发前浏览以下链接 + +主要参考 + +https://cloud.tencent.com/developer/article/1932812 +https://functional.style/hugo/general/tailwind/ +https://github.com/cromozooom/playground-hugo/tree/q69810554 +https://medium.com/gumgum-tech/faster-development-experience-with-vite-hugo-and-preact-c08cbcfce5fb +https://zhuanlan.zhihu.com/p/568764664 +https://stackoverflow.com/questions/47749732/hugo-include-node-module-in-static-js + +次要参考 +https://juejin.cn/post/6854573220306255880 +https://stackoverflow.com/questions/37261016/npm-plugin-onchange-does-not-recognize-scss-files-changes + + + + + +## 更新记录: +2022.10.1 Wey +- [x] 迁移到Hugo上,并进行现代化改造,加入CI/CD -## Update: 2018.7.9 流星 - [x] \(index.html\)Header,Banner,Section-One完工 - [x] \(index.html\)同时将布局策略改为Flex和padding和margin,放弃传统position @@ -74,4 +144,4 @@ Code Review by Windy --- 2018.7.20 秋风 -- [x] \(index.html\) 增加首页语言检测跳转 +- [x] \(index.html\) 增加首页语言检测跳转 \ No newline at end of file diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..00e77bd --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,6 @@ +--- +title: "{{ replace .Name "-" " " | title }}" +date: {{ .Date }} +draft: true +--- + diff --git a/assets/alifont/iconfont.css b/assets/alifont/iconfont.css new file mode 100644 index 0000000..f477d34 --- /dev/null +++ b/assets/alifont/iconfont.css @@ -0,0 +1,19 @@ +@font-face { + font-family: "iconfont"; /* Project id 3687800 */ + src: url('iconfont.woff2') format('woff2'), + url('iconfont.woff') format('woff'), + url('iconfont.ttf') format('truetype'); +} + +.iconfont { + font-family: "iconfont" !important; + font-size: 16px; + font-style: normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.icon-xiangxiajiantou:before { + content: "\e65e"; +} + diff --git a/assets/alifont/iconfont.ttf b/assets/alifont/iconfont.ttf new file mode 100644 index 0000000..2bb58c8 Binary files /dev/null and b/assets/alifont/iconfont.ttf differ diff --git a/assets/alifont/iconfont.woff b/assets/alifont/iconfont.woff new file mode 100644 index 0000000..b0bb493 Binary files /dev/null and b/assets/alifont/iconfont.woff differ diff --git a/assets/alifont/iconfont.woff2 b/assets/alifont/iconfont.woff2 new file mode 100644 index 0000000..a6b1c02 Binary files /dev/null and b/assets/alifont/iconfont.woff2 differ diff --git a/assets/css/_core/_base.scss b/assets/css/_core/_base.scss new file mode 100644 index 0000000..fedc412 --- /dev/null +++ b/assets/css/_core/_base.scss @@ -0,0 +1,65 @@ +@tailwind base; +@tailwind components; +@tailwind utilities; + +html { + font-family: var(--global-font-family); + font-weight: var(--global-font-weight); + font-display: swap; + font-size: var(--global-font-size); + line-height: var(--global-line-height); + width:100%; + + scroll-behavior: smooth; + + main [id] { + scroll-margin-top: calc(var(--header-height) + .5rem); + } + + h1 { + line-height: 125%; + } +} + +/* scrollbar, only support webkit */ +::-webkit-scrollbar { + width: .5rem; + height: .5rem; +} + +::-webkit-scrollbar-thumb { + background-color: $scrollbar-color; + + &:hover { + background-color: $scrollbar-hover-color; + } +} + +::selection { + background-color: $selection-color; + + [theme=dark] & { + background-color: $selection-color-dark; + } +} + +body { + background-color: $global-background-color; + color: $global-font-color; + @include overflow-wrap(break-word); + scrollbar-color: auto; + + &[theme=dark] { + color: $global-font-color-dark; + background-color: $global-background-color-dark; + } +} + +@include link(true, true); + +@import "../_partial/mask"; +@import "../_partial/img"; +@import "../_partial/icon"; +@import "../_partial/details"; +@import "../_partial/fixed-button"; +@import "../_partial/cookieconsent"; diff --git a/assets/css/_core/_header.scss b/assets/css/_core/_header.scss new file mode 100644 index 0000000..e71b411 --- /dev/null +++ b/assets/css/_core/_header.scss @@ -0,0 +1,522 @@ +header { + width: 100%; + z-index: 150; + // background-color: $header-background-color; + background-color: inherit; + @include transition(box-shadow 0.3s ease); + + // [theme="dark"] & { + // // background-color: $header-background-color-dark; + // } + + .logo { + min-height: 1.5em; + height: 1.5em; + vertical-align: text-bottom; + } + + .logo, + .header-title-pre { + padding-right: 0.25rem; + } + + .header-title-post { + padding-left: 0.25rem; + } + + // &:hover { + // @include box-shadow(0 0 1.5rem 0 rgba(0, 0, 0, .1)); + // // box-shadow: none !important; + // } + +} + + +.header-wrapper { + display: flex; + justify-content: space-between; + align-items: center; + box-sizing: border-box; + width: 100%; +} + +.header-title { + font-family: var(--header-title-font-family); + font-weight: 400; + font-size: 1.25rem; + // margin-right: .5rem; + min-width: 10%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + @include flex(1 0 0); +} + + +.menu .menu-item { + position: relative; +} + +.language-select { + position: absolute; + opacity: 0; + left: 0; + top: 0; + width: 100%; + height: 100%; + + &:hover { + cursor: pointer; + } +} + +.search { + position: relative; + background-color: inherit; + + input { + color: transparent; + box-sizing: border-box; + height: 2.5rem; + width: 2.5rem; + @include border-radius(0.5rem); + border: none; + outline: none; + background-color: inherit; + vertical-align: baseline !important; + @include transition(width 0.3s ease); + } + + @include placeholder(transparent); + + .search-button { + margin: 0; + position: absolute; + left: auto; + right: 1rem; + } + + .search-toggle { + left: 0.5rem; + right: auto; + } + + .search-loading { + display: none; + } + + .search-clear { + display: none; + } + + .open &, + &.mobile { + input { + color: $global-font-color; + background-color: $search-background-color; + padding: 0 2rem 0 2rem; + } + + [theme="dark"] & { + input { + color: $global-font-color-dark; + background-color: $search-background-color-dark; + } + + @include placeholder($global-font-secondary-color-dark); + } + + @include placeholder($global-font-secondary-color); + + .search-button { + color: $global-font-secondary-color; + + [theme="dark"] & { + color: $global-font-secondary-color-dark; + } + } + + .search-clear:hover { + color: #ff6b6b; + } + + .search-toggle:hover { + cursor: default; + } + } +} + +.theme-switch i { + @include transform(rotate(225deg)); +} + +#header-desktop { + display: block; + position: fixed; + height: var(--header-height); + line-height: var(--header-height); + + [data-header-desktop="normal"] & { + position: static; + } + + .header-wrapper { + // padding: 0 2rem 0 10vh; + padding-left: 1.5rem; + padding-right: 1.5rem; + + .header-title { + font-size: var(--header-title-font-size); + } + + .menu { + overflow: hidden; + white-space: nowrap; + + .menu-inner { + float: right; + } + + .menu-item { + margin: 0 0.5rem; + + &.delimiter { + border-left: 1.5px solid $global-font-color; + + [theme="dark"] & { + border-left-color: $global-border-color-dark; + } + } + + // 原来是.language但是不够通用 + &:last-child { + margin-right: 0; + } + + &.search { + margin: 0 -0.5rem 0 0; + } + } + + a.active { + font-weight: 900; + color: $header-hover-color; + + [theme="dark"] & { + color: $header-hover-color-dark; + } + } + } + } + + &.open .header-wrapper .menu .menu-item.search { + margin: 0 0.25rem 0 0.5rem; + + input { + width: 24rem; + } + } +} + +#header-mobile { + display: none; + position: fixed; + height: var(--header-height); + line-height: var(--header-height); + + [data-header-mobile="normal"] & { + position: static; + } + + .header-container { + padding: 0; + margin: 0; + + .header-wrapper { + padding: 0 1rem; + font-size: 1.125rem; + @include transition(margin-top 0.3s ease); + + .header-title { + font-size: var(--header-title-font-size); + max-width: 80%; + } + + .menu-toggle { + // line-height: 4rem; + cursor: pointer; + @include transition(width 0.3s ease); + + display: flex; + // margin-right: 16px; + align-self: stretch; + align-items: center; + flex-wrap: nowrap; + // span { + // display: block; + // background: $global-font-color; + // width: 1.5rem; + // height: 2px; + // @include border-radius(3px); + // @include transition(all 0.3s ease-in-out); + + // [theme=dark] & { + // background: $global-font-color-dark; + // } + // } + + // span:nth-child(1) { + // margin-bottom: .5rem; + // } + + // span:nth-child(3) { + // margin-top: .5rem; + // } + + // &.active { + // span:nth-child(1) { + // @include transform(rotate(45deg) translate(.4rem, .5rem)); + // } + + // span:nth-child(2) { + // opacity: 0 + // } + + // span:nth-child(3) { + // @include transform(rotate(-45deg) translate(.4rem, -.5rem)); + // } + // } + } + + // & .active{ + // background: #ff6b6b; + // } + } + + .menu { + text-align: center; + background: $header-background-color; + border-top: 2px solid $global-border-color; + display: none; + padding-top: 0.5rem; + @include box-shadow(0 0.125rem 0.25rem rgba(0, 0, 0, 0.1)); + + // transition: height .35s ease; + // height: auto; + // max-height: 0; + transform-origin: center top; + + .search-wrapper { + display: flex; + justify-content: space-between; + align-items: center; + box-sizing: border-box; + padding: calc((var(--header-height) - 2.5rem) / 2) 1rem; + line-height: 2.5rem; + } + + .search { + flex-grow: 10; + + .algolia-autocomplete, + input { + width: 100%; + } + } + + .search-button { + top: 0; + } + + .search-cancel { + display: none; + margin-left: 0.75rem; + } + + .menu-item { + display: block; + line-height: 2.5rem; + } + + &.active { + display: block; + background: $header-background-color; + } + + [theme="dark"] & { + background: $header-background-color-dark; + border-top-color: $global-border-color-dark; + } + } + } + + &.open { + .header-wrapper { + margin-top: -var(--header-height); + } + + .menu { + padding-top: 0; + border-top: none; + + .menu-item { + display: none; + } + + .search-cancel { + display: inline; + } + } + } +} + +.search-dropdown { + position: fixed; + z-index: 200; + top: var(--header-height); + @include box-shadow(0 0.125rem 0.25rem rgba(0, 0, 0, 0.1)); + + &.desktop { + right: 2rem; + width: 30rem; + } + + &.mobile { + right: 0; + width: 100%; + } + + .dropdown-menu { + right: 0 !important; + background-color: $global-background-color; + + [theme="dark"] & { + background-color: $global-background-color-dark; + } + + .suggestions { + overflow-y: auto; + max-height: calc(100vh - var(--header-height)); + + .suggestion { + padding: 0.75rem 1rem; + + .suggestion-title { + display: inline-block; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-size: 1rem; + font-weight: bold; + max-width: 75%; + } + + .suggestion-date { + font-size: 0.875rem; + float: right; + text-align: right; + color: $global-font-secondary-color; + + [theme="dark"] & { + color: $global-font-secondary-color-dark; + } + } + + .suggestion-context { + line-height: 1.25rem; + @include box(vertical); + -webkit-line-clamp: 2; + overflow: hidden; + text-overflow: ellipsis; + @include overflow-wrap(break-word); + color: $global-font-secondary-color; + + [theme="dark"] & { + color: $global-font-secondary-color-dark; + } + } + + em { + font-style: normal; + background-color: $selection-color; + + [theme="dark"] & { + background-color: $selection-color-dark; + } + } + + &.cursor { + background: darken($code-background-color, 5%); + + [theme="dark"] & { + background: lighten($code-background-color-dark, 5%); + } + } + + &:hover { + cursor: pointer; + } + } + } + + .search-empty { + padding: 1rem; + text-align: center; + + .search-query { + font-weight: bold; + + [theme="dark"] & { + color: #ddd; + } + } + } + + .search-footer { + padding: 0.5rem 1rem; + float: right; + font-size: 0.8rem; + color: $global-font-secondary-color; + + [theme="dark"] { + color: $global-font-secondary-color-dark; + } + + @include link(false, false); + + a { + font-size: 1rem; + } + } + } +} + +// @keyframes openanim{ +// 0%{ +// // transform: scaleY(0); +// height:0; +// } +// 100%{ +// // transform: scaleY(1); +// height: auto; +// } +// } + +.header { + @include transition(all 0.3s ease); + z-index: 997; + background-color: #fff; + + [theme="dark"] & { + background-color: $header-background-color-dark; + } +} + +.header.header-scrolled { + // box-shadow: 0px 2px 20px rgba(1, 41, 112, 0.1); + background-color: $header-background-color; + + [theme="dark"] & { + background-color: $header-background-color-dark; + } +} diff --git a/assets/css/_core/_media.scss b/assets/css/_core/_media.scss new file mode 100644 index 0000000..f5f0d5c --- /dev/null +++ b/assets/css/_core/_media.scss @@ -0,0 +1,83 @@ +// @media only screen and (max-width: 1440px) { +// .page { +// width: 56%; +// } +// } + +// @media only screen and (max-width: 1200px) { +// .page { +// width: 52%; +// } + +// // #header-desktop .header-wrapper { +// // padding-right: 1rem; +// // } + +// .search-dropdown.desktop { +// right: 1rem; +// } +// } + +@media only screen and (max-width: 960px) { + #toc-auto { + display: none; + } + + #toc-static { + display: block; + } + + .page { + width: 90%; + } + + // #header-desktop .header-wrapper { + // padding-left: 1rem; + // } +} + +@media only screen and (max-width: 950px) { + #header-desktop { + display: none; + } + + #header-mobile { + display: block; + } +} + +@media only screen and (max-width: 800px) { + + body.blur { + overflow: hidden; + } + + .page { + width: 100%; + + [data-header-mobile] & { + padding-top: var(--header-height); + } + + [data-header-mobile=normal] & { + padding-top: 0; + } + + .categories-card { + .card-item { + width: 100%; + } + } + } + + .copyright { + .copyright-line { + .icp-splitter { + display: none; + } + .icp-br { + display: block; + } + } + } +} diff --git a/assets/css/_core/_variables.scss b/assets/css/_core/_variables.scss new file mode 100644 index 0000000..ae693fc --- /dev/null +++ b/assets/css/_core/_variables.scss @@ -0,0 +1,30 @@ +:root { + // ========== Global ========== // + // Font and Line Height + --global-font-family: #{inspect($global-font-family)}; + --global-font-size: #{$global-font-size}; + --global-font-weight: #{$global-font-weight}; + --global-line-height: #{$global-line-height}; + // ========== Global ========== // + + // ========== Header ========== // + // Height of the header + --header-height: #{$header-height}; + + // Font family and size of the header title + --header-title-font-family: #{inspect($header-title-font-family)}; + --header-title-font-size: #{$header-title-font-size}; + // ========== Header ========== // + + // ========== Single Content ========== // + // Font size of the TOC + --toc-title-font-size: #{$toc-title-font-size}; + --toc-content-font-size: #{$toc-content-font-size}; + // ========== Single Content ========== // + + // ========== Code ========== // + // Font family and size of the code + --code-font-family: #{inspect($code-font-family)}; + --code-font-size: #{$code-font-size}; + // ========== Code ========== // +} diff --git a/assets/css/_custom.scss b/assets/css/_custom.scss new file mode 100644 index 0000000..439afd2 --- /dev/null +++ b/assets/css/_custom.scss @@ -0,0 +1,54 @@ +// ============================== +// Custom style +// 自定义样式 +// ============================== + +@import 'scrollbar'; + +.img-fluid { + max-width: 100%; + height: auto; +} + +section { + padding: 60px 0; + overflow: hidden; + line-height: normal; + + .section-container{ + padding: 0 1.75rem 0; + } + + .section-text-tittle { + font-size: 2.4rem; + color: $home-section-title-color; + + [theme=dark] & { + color: $global-font-color-dark; + } + } + + .section-text-little-tittle { + font-size: 1.4rem; + } + + h1{ + margin: 0.67em 0; + } + + .container{ + max-width: 960px; + margin-left: auto; + margin-right: auto; + } +} + + +.section--intro{ + margin:0 auto 0; + max-width: 960px; +} + +.text-primary { + color: $light-blue; +} \ No newline at end of file diff --git a/assets/css/_page/_home.scss b/assets/css/_page/_home.scss new file mode 100644 index 0000000..33ddd0b --- /dev/null +++ b/assets/css/_page/_home.scss @@ -0,0 +1,181 @@ +.home { + .home-profile { + // @include transform(translateY( 16vh)); + padding: 0 0 .5rem; + text-align: center; + + .home-avatar { + padding: .5rem; + + img { + display: inline-block; + width: 8rem; + height: auto; + margin: 0 auto; + @include border-radius(100%); + @include box-shadow(0 0 0 .3618em rgba(0, 0, 0, .05)); + @include transition(all 0.4s ease); + + &:hover { + position: relative; + // @include transform(translateY(-.75rem)); + } + } + } + + .home-title { + font-size: 1.25rem; + font-weight: bold; + margin: 0; + padding: .5rem; + } + + .home-subtitle { + font-size: 1rem; + font-weight: normal; + margin: 0; + padding: .5rem; + } + + .links { + padding: .5rem; + font-size: 1.5rem; + + a * { + vertical-align: text-bottom; + } + + img { + height: 1.5rem; + padding: 0 .25rem; + } + } + + .home-disclaimer { + font-size: 1rem; + line-height: 1.5rem; + font-weight: normal; + margin: 0; + padding: .5rem; + color: $global-font-secondary-color; + + [theme=dark] & { + color: $global-font-secondary-color-dark; + } + } + } +} + +.home[data-home=posts] { + .home-profile { + // @include transform(translateY(0)); + padding-top: 0rem; + } + + .home-avatar img { + width: 6rem; + } + + .summary { + padding-top: 1rem; + padding-bottom: .8rem; + color: $global-font-color; + border-bottom: 1px dashed $global-border-color; + + [theme=dark] & { + color: $global-font-color-dark; + border-bottom: 1px dashed $global-border-color-dark; + } + + .featured-image-preview { + width: 100%; + padding: 30% 0 0; + position: relative; + margin: 0.6rem auto; + @include transition(transform 0.4s ease); + + img { + position: absolute; + width: 100%; + height: 100%; + left: 0; + top: 0; + + &.lazyloaded { + @include object-fit(cover); + } + } + + &:hover { + @include transform(scale(1.01)); + } + } + + .single-title { + font-size: 1.25rem; + line-height: 140%; + margin: 0.4rem 0; + } + + .content { + @include box(vertical); + -webkit-line-clamp: 3; + margin-top: .3rem; + width: 100%; + overflow: hidden; + text-overflow: ellipsis; + @include overflow-wrap(break-word); + color: $global-font-secondary-color; + + [theme=dark] & { + color: $global-font-secondary-color-dark; + } + + h2, + h3, + h4, + h5, + h6, + p { + font-size: 1rem; + line-height: 1.5; + display: inline; + + &::after { + content: "\A"; + white-space: pre; + } + } + + h2 { + font-size: 1.125rem; + } + + @include link(false, true); + + b, strong { + color: $global-font-secondary-color; + + [theme=dark] & { + color: $global-font-secondary-color-dark; + } + } + } + + .post-footer { + margin-top: .4rem; + display: flex; + justify-content: space-between; + align-items: center; + font-size: .875rem; + + @include link(false, false); + + .post-tags { + padding: 0; + + @include link(true, true); + } + } + } +} diff --git a/assets/css/_page/_index.scss b/assets/css/_page/_index.scss new file mode 100644 index 0000000..6ea2ed2 --- /dev/null +++ b/assets/css/_page/_index.scss @@ -0,0 +1,22 @@ +.page { + position: relative; + max-width: 800px; + // width: 80%; + margin: 0 auto; + + [data-header-desktop] & { + padding-top: var(--header-height); + } + + [data-header-desktop=normal] & { + padding-top: 0; + } + + @include blur; +} + +@import "_single"; +@import "_special"; +@import "_archive"; +@import "_home"; +@import "_404"; diff --git a/assets/css/_page/_single.scss b/assets/css/_page/_single.scss new file mode 100644 index 0000000..957aea0 --- /dev/null +++ b/assets/css/_page/_single.scss @@ -0,0 +1,349 @@ +@import "../_partial/_single/toc"; + +.single { + .single-title { + margin: 2rem 0 .5rem; + font-size: 1.6rem; + font-weight: bold; + line-height: 140%; + } + + .single-subtitle { + margin: .5rem 0; + font-size: 1.2rem; + font-weight: normal; + line-height: 100%; + } + + .post-meta { + font-size: .875rem; + color: $global-font-secondary-color; + + span { + display: inline-block; + } + + [theme=dark] & { + color: $global-font-secondary-color-dark; + } + + @include link(false, true); + + .author { + font-size: 1.05rem; + } + } + + .featured-image { + margin: .5rem 0 1rem 0; + + img { + display: block; + max-width: 100%; + height: auto; + margin: 0 auto; + overflow: hidden; + } + + img.lazyloaded { + width: 100%; + } + } + + .content { + > h2 { + font-size: 1.5rem; + + & code { + font-size: 1.25rem; + } + } + + > h3 { + font-size: 1.375rem; + + & code { + font-size: 1.125rem; + } + } + + > h4 { + font-size: 1.25rem; + + & code { + font-size: 1rem; + } + } + + > h5 { + font-size: 1.125rem; + } + + > h6 { + font-size: 1rem; + } + + h2, + h3, + h4, + h5, + h6 { + font-weight: bold; + margin: 1.2rem 0; + + [theme=dark] & { + font-weight: bolder; + } + } + + > h2, + > h3, + > h4, + > h5, + > h6 { + > .header-mark::before { + content: "|"; + margin-right: .3125rem; + color: $single-link-color; + + [theme=dark] & { + color: $single-link-color-dark; + } + } + } + + > h2 > .header-mark::before { + content: "#"; + } + + p { + margin: 1rem 0; + } + + b, strong { + font-weight: bold; + + [theme=dark] & { + color: #ddd; + } + } + + @include link(false, false); + + a { + @include overflow-wrap(break-word); + + [theme=dark] & b, [theme=dark] & strong { + color: $single-link-color-dark; + } + } + + [theme=dark] a:hover b, [theme=dark] a:hover strong { + color: $single-link-hover-color-dark; + } + + ul, ol { + margin: .5rem 0; + padding-left: 2.5rem; + } + + ul { + list-style-type: disc; + } + + ruby { + background: $code-background-color; + + rt { + color: $global-font-secondary-color; + } + + [theme=dark] & { + background: $code-background-color-dark; + + rt { + color: $global-font-secondary-color-dark; + } + } + } + + .table-wrapper { + overflow-x: auto; + + &::-webkit-scrollbar { + background-color: $table-background-color; + + [theme=dark] & { + background-color: $table-background-color-dark; + } + } + + > table { + width: 100%; + max-width: 100%; + margin: .625rem 0; + border-spacing: 0; + background: $table-background-color; + border-collapse: collapse; + + [theme=dark] & { + background: $table-background-color-dark; + } + + thead { + background: $table-thead-color; + + [theme=dark] & { + background-color: $table-thead-color-dark; + } + } + + th, td { + padding: .3rem 1rem; + border: 1px solid darken($table-thead-color, 2%); + + [theme=dark] & { + border-color: darken($table-thead-color-dark, 2%); + } + } + } + } + + img { + max-width: 100%; + min-height: 1em; + } + + figure { + margin: .5rem; + text-align: center; + + .image-caption:not(:empty) { + min-width: 20%; + max-width: 80%; + display: inline-block; + padding: .5rem; + margin: 0 auto; + font-size: .875rem; + color: #969696; + } + + img { + display: block; + width: 100%; + height: auto; + margin: 0 auto; + overflow: hidden; + } + } + + blockquote { + display: block; + border-left: .5rem solid $blockquote-color; + background-color: rgba($blockquote-color, .2); + padding: .25rem .75rem; + margin: 1rem 0; + + [theme=dark] & { + border-left-color: $blockquote-color-dark; + background-color: rgba($blockquote-color-dark, .2); + } + } + + .footnotes { + color: $global-font-secondary-color; + + [theme=dark] & { + color: $global-font-secondary-color-dark; + } + + p { + margin: .25rem 0; + } + } + + @import "../_partial/_single/code"; + @import "../_partial/_single/instagram"; + @import "../_partial/_single/admonition"; + @import "../_partial/_single/echarts"; + @import "../_partial/_single/mapbox"; + @import "../_partial/_single/music"; + @import "../_partial/_single/bilibili"; + + hr { + margin: 1rem 0; + position: relative; + border-top: 1px dashed $global-border-color; + border-bottom: none; + + [theme=dark] & { + border-top: 1px dashed $global-border-color-dark; + } + } + + kbd { + display: inline-block; + padding: .25rem; + background-color: $global-background-color; + border: 1px solid $global-border-color; + border-bottom-color: $global-border-color; + @include border-radius(3px); + @include box-shadow(inset 0 -1px 0 $global-border-color); + font-size: .8rem; + font-family: var(--code-font-family); + color: $code-color; + + [theme=dark] & { + background-color: $global-background-color-dark; + border: 1px solid $global-border-color-dark; + border-bottom-color: $global-border-color-dark; + @include box-shadow(inset 0 -1px 0 $global-border-color-dark); + color: $code-color-dark; + } + } + + .version { + height: 1.25em; + vertical-align: text-bottom; + } + + .person-mention.h-card { + display: inline-block; + img { + vertical-align: -12%; + max-height: 1.1em; + margin-right: 0ex; + border-radius: 50%; + } + } + } + + @import "../_partial/_single/footer"; + @import "../_partial/_single/comment"; +} + +.typeit { + .highlight { + padding: .375rem; + font-size: .875rem; + font-family: var(--code-font-family); + font-weight: bold; + word-break: break-all; + white-space: pre-wrap; + } + + --ti-cursor-font-family: var(--global-font-family); + --ti-cursor-font-size: var(--global-font-size); + --ti-cursor-font-weight: var(--global-font-weight); + --ti-cursor-line-height: var(--global-line-height); + --ti-cursor-color: $global-font-secondary-color; + --ti-cursor-margin-left: 0; + + [theme=dark] & { + --ti-cursor-color: $global-font-secondary-color-dark; + } +} + +.lg-toolbar .lg-icon::after { + color: #999; +} diff --git a/assets/css/_page/_special.scss b/assets/css/_page/_special.scss new file mode 100644 index 0000000..436d8d9 --- /dev/null +++ b/assets/css/_page/_special.scss @@ -0,0 +1,5 @@ +.special { + .single-title, .single-subtitle { + text-align: right; + } +} diff --git a/assets/css/_variables.scss b/assets/css/_variables.scss new file mode 100644 index 0000000..c3b8dbb --- /dev/null +++ b/assets/css/_variables.scss @@ -0,0 +1,360 @@ +// ============================== +// Variables +// ============================== + +@font-face { + font-family: Emoji; + src: local("Apple Color Emoji"), local("Segoe UI Emoji"), local("Segoe UI Symbol"), local("Noto Color Emoji"); + unicode-range: U+1F000-1F644, U+203C-3299; +} + +// ========== Global ========== // +// Font and Line Height +$global-font-family: system-ui, -apple-system, Segoe UI, Roboto, Emoji, Helvetica, Arial, sans-serif !default; +$global-font-size: 16px !default; +$global-font-weight: 400 !default; +$global-line-height: 1.5rem !default; + +// Color of the background +$global-background-color: #fff !default; +$global-background-color-dark: #292a2d !default; + +// Color of the text +$global-font-color: #161209 !default; +$global-font-color-dark: #a9a9b3 !default; + +// Color of the secondary text +$global-font-secondary-color: #a9a9b3 !default; +$global-font-secondary-color-dark: #5d5d5f !default; + +// Color of the link +$global-link-color: #161209 !default; +$global-link-color-dark: #a9a9b3 !default; + +// Color of the hover link +$global-link-hover-color: #717171 !default; +$global-link-hover-color-dark: #fff !default; + +// Color of the border +$global-border-color: #f0f0f0 !default; +$global-border-color-dark: #363636 !default; +// ========== Global ========== // + +// ========== Scrollbar ========== // +// Color of the scrollbar +$scrollbar-color: #87878d !default; + +// Color of the hover scrollbar +$scrollbar-hover-color: #a9a9b3 !default; +// ========== Scrollbar ========== // + +// ========== Selection ========== // +// Color of the selected text +$selection-color: rgba(53, 166, 247, 0.25) !default; +$selection-color-dark: rgba(50, 112, 194, 0.4) !default; +// ========== Selection ========== // + +// ========== Header ========== // +// Height of the header +$header-height: 3.5rem !default; + +// Font family and size of the header title +$header-title-font-family: $global-font-family !default; +$header-title-font-size: 1.25rem !default; + +// Color of the header background +$header-background-color: #f8f9fa !default; +$header-background-color-dark: #252627 !default; + +// Color of the hover header item +$header-hover-color: #161209 !default; +$header-hover-color-dark: #fff !default; + +// Color of the search background +$search-background-color: #e9e9e9 !default; +$search-background-color-dark: #363636 !default; +// ========== Header ========== // + +// ========== Single Content ========== // +// Font size of the TOC +$toc-title-font-size: 1.2rem !default; +$toc-content-font-size: 1rem !default; + +// Color of the single link +$single-link-color: hsl(211, 100%, 40%) !default; +$single-link-color-dark: hsl(211, 100%, 61%) !default; + +// Color of the hover single link +$single-link-hover-color: hsl(211, 100%, 61%) !default; +$single-link-hover-color-dark: hsl(196, 91%, 86%) !default; + +// Color of the table background +$table-background-color: #fff !default; +$table-background-color-dark: #272c34 !default; + +// Color of the table thead +$table-thead-color: #ededed !default; +$table-thead-color-dark: #20252b !default; + +// Color of the blockquote +$blockquote-color: hsl(211, 91%, 86%) !default; +$blockquote-color-dark: hsl(211, 100%, 61%) !default; +// ========== Single Content ========== // + +// ========== Pagination ========== // +// Color of the link in pagination +$pagination-link-color: #007bff !default; +$pagination-link-color-dark: #a9a9b3 !default; + +// Color of the hover link in pagination +$pagination-link-hover-color: #000 !default; +$pagination-link-hover-color-dark: #fff !default; +// ========== Pagination ========== // + +// ========== Code ========== // +// Font family and size of the code +$code-font-family: "Source Code Pro", Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !default; +$code-font-size: .875rem !default; + +// Color of the code +$code-color: #E74C3C !default; +$code-color-dark: #E5BF78 !default; + +// Color of the code background +$code-background-color: #f5f5f5 !default; +$code-background-color-dark: #272C34 !default; + +$code-info-color: #9c9c9c !default; +$code-info-color-dark: #b1b0b0 !default; + +// Code type list +$code-type-list: + "language-bash" "Bash", + "language-c" "C", + "language-cs" "C#", + "language-cpp" "C++", + "language-clojure" "Clojure", + "language-coffeescript" "CoffeeScript", + "language-css" "CSS", + "language-dart" "Dart", + "language-diff" "Diff", + "language-erlang" "Erlang", + "language-go" "Go", + "language-go-html-template" "Go HTML Template", + "language-groovy" "Groovy", + "language-haskell" "Haskell", + "language-html" "HTML", + "language-http" "HTTP", + "language-xml" "XML", + "language-java" "Java", + "language-js" "JavaScript", + "language-javascript" "JavaScript", + "language-json" "JSON", + "language-kotlin" "Kotlin", + "language-latex" "LaTeX", + "language-less" "Less", + "language-lisp" "Lisp", + "language-lua" "Lua", + "language-makefile" "Makefile", + "language-markdown" "Markdown", + "language-matlab" "Matlab", + "language-objectivec" "Objective-C", + "language-php" "PHP", + "language-perl" "Perl", + "language-powershell" "PowerShell", + "language-posh" "PowerShell", + "language-pwsh" "PowerShell", + "language-python" "Python", + "language-r" "R", + "language-ruby" "Ruby", + "language-rust" "Rust", + "language-scala" "Scala", + "language-scss" "Scss", + "language-shell" "Shell", + "language-sql" "SQL", + "language-swift" "Swift", + "language-tex" "TeX", + "language-toml" "TOML", + "language-ts" "TypeScript", + "language-typescript" "TypeScript", + "language-vue" "Vue", + "language-yml" "YAML", + "language-yaml" "YAML", + !default; + +// Color map of the code highlight +$code-highlight-color-map: ( + /* Parentheses */ "p": #a9a9b3, + /* Keyword */ "k": #b501a9, + /* KeywordConstant */ "kc": #b501a9, + /* KeywordDeclaration */ "kd": #b501a9, + /* KeywordNamespace */ "kn": #b501a9, + /* KeywordPseudo */ "kp": #b501a9, + /* KeywordReserved */ "kr": #b501a9, + /* KeywordType */ "kt": #b501a9, + /* Name */ "n": #333333, + /* NameAttribute */ "na": #2b77fa, + /* NameBuiltin */ "nb": #f74840, + /* NameBuiltinPseudo */ "bp": #f74840, + /* NameClass */ "nc": #cb8100, + /* NameConstant */ "no": #2b77fa, + /* NameDecorator */ "nd": #0086c1, + /* NameEntity */ "ni": #2b77fa, + /* NameException */ "ne": #2b77fa, + /* NameFunction */ "nf": #2b77fa, + /* NameFunctionMagic */ "fm": #1ccad6, + /* NameLabel */ "nl": #2b77fa, + /* NameNamespace */ "nn": #2b77fa, + /* NameOther */ "nx": #333333, + /* NameProperty */ "py": #2b77fa, + /* NameTag */ "nt": #2b77fa, + /* NameVariable */ "nv": #2b77fa, + /* NameVariableClass */ "vc": #2b77fa, + /* NameVariableGlobal */ "vg": #2b77fa, + /* NameVariableInstance */ "vi": #2b77fa, + /* NameVariableMagic */ "vm": #2b77fa, + /* Literal */ "l": #2aa198, + /* LiteralDate */ "ld": #2aa198, + /* LiteralString */ "s": #24a443, + /* LiteralStringAffix */ "sa": #24a443, + /* LiteralStringBacktick */ "sb": #24a443, + /* LiteralStringChar */ "sc": #24a443, + /* LiteralStringDelimiter */ "dl": #24a443, + /* LiteralStringDoc */ "sd": #24a443, + /* LiteralStringDouble */ "s2": #24a443, + /* LiteralStringEscape */ "se": #24a443, + /* LiteralStringHeredoc */ "sh": #24a443, + /* LiteralStringInterpol */ "si": #24a443, + /* LiteralStringOther */ "sx": #24a443, + /* LiteralStringRegex */ "sr": #24a443, + /* LiteralStringSingle */ "s1": #24a443, + /* LiteralStringSymbol */ "ss": #24a443, + /* LiteralNumber */ "m": #e2893c, + /* LiteralNumberBin */ "mb": #e2893c, + /* LiteralNumberFloat */ "mf": #e2893c, + /* LiteralNumberHex */ "mh": #e2893c, + /* LiteralNumberInteger */ "mi": #e2893c, + /* LiteralNumberIntegerLong */ "il": #e2893c, + /* LiteralNumberOct */ "mo": #e2893c, + /* Operator */ "o": #f19b04, + /* OperatorWord */ "ow": #b501a9, + /* Comment */ "c": #a0a1a8, + /* CommentHashbang */ "ch": #a0a1a8, + /* CommentMultiline */ "cm": #a0a1a8, + /* CommentSingle */ "c1": #a0a1a8, + /* CommentSpecial */ "cs": #a0a1a8, + /* CommentPreproc */ "cp": #a0a1a8, + /* CommentPreprocFile */ "cpf": #a0a1a8, + /* Generic */ "g": #e72d40, + /* GenericDeleted */ "gd": #e72d40, + /* GenericEmph */ "ge": #e72d40, + /* GenericError */ "gr": #e72d40, + /* GenericHeading */ "gh": #e72d40, + /* GenericInserted */ "gi": #e72d40, + /* GenericOutput */ "go": #e72d40, + /* GenericPrompt */ "gp": #e72d40, + /* GenericStrong */ "gs": #e72d40, + /* GenericSubheading */ "gu": #e72d40, + /* GenericTraceback */ "gt": #e72d40, + /* TextWhitespace */ "w": #bbbbbb, +) !default; +$code-highlight-color-map-dark: ( + /* Parentheses */ "p": #a9a9b3, + /* Keyword */ "k": #d371e3, + /* KeywordConstant */ "kc": #d371e3, + /* KeywordDeclaration */ "kd": #d371e3, + /* KeywordNamespace */ "kn": #d371e3, + /* KeywordPseudo */ "kp": #d371e3, + /* KeywordReserved */ "kr": #d371e3, + /* KeywordType */ "kt": #d371e3, + /* Name */ "n": #a9b2c0, + /* NameAttribute */ "na": #41b0f5, + /* NameBuiltin */ "nb": #19b9c4, + /* NameBuiltinPseudo */ "bp": #ecbf6f, + /* NameClass */ "nc": #ecbf6f, + /* NameConstant */ "no": #41b0f5, + /* NameDecorator */ "nd": #ecbf6f, + /* NameEntity */ "ni": #41b0f5, + /* NameException */ "ne": #41b0f5, + /* NameFunction */ "nf": #41b0f5, + /* NameFunctionMagic */ "fm": #19b9c4, + /* NameLabel */ "nl": #41b0f5, + /* NameNamespace */ "nn": #41b0f5, + /* NameOther */ "nx": #a9a9b3, + /* NameProperty */ "py": #41b0f5, + /* NameTag */ "nt": #41b0f5, + /* NameVariable */ "nv": #41b0f5, + /* NameVariableClass */ "vc": #41b0f5, + /* NameVariableGlobal */ "vg": #41b0f5, + /* NameVariableInstance */ "vi": #41b0f5, + /* NameVariableMagic */ "vm": #41b0f5, + /* Literal */ "l": #2aa198, + /* LiteralDate */ "ld": #2aa198, + /* LiteralString */ "s": #8cc570, + /* LiteralStringAffix */ "sa": #8cc570, + /* LiteralStringBacktick */ "sb": #8cc570, + /* LiteralStringChar */ "sc": #8cc570, + /* LiteralStringDelimiter */ "dl": #8cc570, + /* LiteralStringDoc */ "sd": #8cc570, + /* LiteralStringDouble */ "s2": #8cc570, + /* LiteralStringEscape */ "se": #8cc570, + /* LiteralStringHeredoc */ "sh": #8cc570, + /* LiteralStringInterpol */ "si": #8cc570, + /* LiteralStringOther */ "sx": #8cc570, + /* LiteralStringRegex */ "sr": #8cc570, + /* LiteralStringSingle */ "s1": #8cc570, + /* LiteralStringSymbol */ "ss": #8cc570, + /* LiteralNumber */ "m": #db985c, + /* LiteralNumberBin */ "mb": #db985c, + /* LiteralNumberFloat */ "mf": #db985c, + /* LiteralNumberHex */ "mh": #db985c, + /* LiteralNumberInteger */ "mi": #db985c, + /* LiteralNumberIntegerLong */ "il": #db985c, + /* LiteralNumberOct */ "mo": #db985c, + /* Operator */ "o": #ecbf6f, + /* OperatorWord */ "ow": #d371e3, + /* Comment */ "c": #7e848f, + /* CommentHashbang */ "ch": #7e848f, + /* CommentMultiline */ "cm": #7e848f, + /* CommentSingle */ "c1": #7e848f, + /* CommentSpecial */ "cs": #7e848f, + /* CommentPreproc */ "cp": #7e848f, + /* CommentPreprocFile */ "cpf": #7e848f, + /* Generic */ "g": #f16372, + /* GenericDeleted */ "gd": #f16372, + /* GenericEmph */ "ge": #f16372, + /* GenericError */ "gr": #f16372, + /* GenericHeading */ "gh": #f16372, + /* GenericInserted */ "gi": #f16372, + /* GenericOutput */ "go": #f16372, + /* GenericPrompt */ "gp": #f16372, + /* GenericStrong */ "gs": #f16372, + /* GenericSubheading */ "gu": #f16372, + /* GenericTraceback */ "gt": #f16372, + /* TextWhitespace */ "w": #bbbbbb, +) !default; +// ========== Code ========== // + +// ========== Admonition ========== // +// Color list of admonition [$type $color $background-color, ... ] +$admonition-color-list: + "note" #448aff rgba(68, 138, 255, 0.1), + "abstract" #00b0ff rgba(0, 176, 255, 0.1), + "info" #00b8d4 rgba(83, 211, 230, 0.1), + "tip" #00bfa5 rgba(0, 191, 165, 0.1), + "success" #00c853 rgba(0, 200, 83, 0.1), + "question" #64dd17 rgba(100, 221, 23, 0.1), + "warning" #ff9100 rgba(255, 145, 0, 0.1), + "failure" #ff5252 rgba(255, 82, 82, 0.1), + "danger" #ff1744 rgba(68, 138, 255, 0.1), + "bug" #f50057 rgba(255, 23, 68, 0.1), + "example" #651fff rgba(101, 31, 255, 0.1), + "quote" #9e9e9e rgba(159, 159, 159, 0.1), + !default; +// ========== Admonition ========== // + + + +$home-text-title-color:hsl(218, 100%, 19%); +$home-section-title-color:hsl(218, 100%, 5%); +$light-blue:#007bff; \ No newline at end of file diff --git a/assets/css/scrollbar.scss b/assets/css/scrollbar.scss new file mode 100644 index 0000000..caac79e --- /dev/null +++ b/assets/css/scrollbar.scss @@ -0,0 +1,43 @@ + +/* +::-webkit-scrollbar — 整个滚动条. +::-webkit-scrollbar-button — 滚动条上的按钮 (上下箭头). +::-webkit-scrollbar-thumb — 滚动条上的滚动滑块. +::-webkit-scrollbar-track — 滚动条轨道. +::-webkit-scrollbar-track-piece — 滚动条没有滑块的轨道部分. +::-webkit-scrollbar-corner — 当同时有垂直滚动条和水平滚动条时交汇的部分. +::-webkit-resizer — 某些元素的corner部分的部分样式(例:textarea的可拖动按钮). +*/ + +/* 滚动条上的滚动滑块. */ + +// ::-webkit-scrollbar-thumb:horizontal { +// /*水平滚动条的样式*/ +// background-color: rgb(224, 224, 224); +// border-radius: 0px; +// } + +// ::-webkit-scrollbar-thumb:vertical { +// /*垂直滚动条的样式*/ +// height: 8px; +// border-radius: 4px; +// } + + ::-webkit-scrollbar-thumb { + /*滚动条的hover样式*/ + border-radius: 100px; + background: var(--color-scrollbar, rgba(179, 179, 179, .5)); + } + + /* 滚动条没有滑块的轨道部分. */ + // ::-webkit-scrollbar-track-piece { + // background-color: #fff; /*滚动条的背景颜色*/ + // border-radius: 0; /*滚动条的圆角宽度*/ + // } + + /* 整个滚动条. */ + ::-webkit-scrollbar { + width: 8px; + background: transparent; + border-radius: 100px; + } \ No newline at end of file diff --git a/assets/js/main.js b/assets/js/main.js new file mode 100644 index 0000000..a3f5f07 --- /dev/null +++ b/assets/js/main.js @@ -0,0 +1,244 @@ +(function () { + "use strict"; + + /** + * Easy selector helper function + */ + const select = (el, all = false) => { + el = el.trim(); + if (all) { + return [...document.querySelectorAll(el)]; + } else { + return document.querySelector(el); + } + }; + // debugger + /** + * Easy event listener function + */ + const on = (type, el, listener, all = false) => { + if (all) { + select(el, all).forEach((e) => e.addEventListener(type, listener)); + } else { + select(el, all).addEventListener(type, listener); + } + }; + + /** + * Easy on scroll event listener + */ + const onscroll = (el, listener) => { + el.addEventListener("scroll", listener); + }; + + // /** + // * Navbar links active state on scroll + // */ + // let navbarlinks = select("#navbar .scrollto", true); + // const navbarlinksActive = () => { + // let position = window.scrollY + 200; + // navbarlinks.forEach((navbarlink) => { + // if (!navbarlink.hash) return; + // let section = select(navbarlink.hash); + // if (!section) return; + // if ( + // position >= section.offsetTop && + // position <= section.offsetTop + section.offsetHeight + // ) { + // navbarlink.classList.add("active"); + // } else { + // navbarlink.classList.remove("active"); + // } + // }); + // }; + // window.addEventListener("load", navbarlinksActive); + // onscroll(document, navbarlinksActive); + + /** + * Scrolls to an element with header offset + */ + const scrollto = (el) => { + let header = select("#header"); + let offset = header.offsetHeight; + + if (!header.classList.contains("header-scrolled")) { + offset -= 10; + } + + let elementPos = select(el).offsetTop; + window.scrollTo({ + top: elementPos - offset, + behavior: "smooth", + }); + }; + + /** + * Toggle .header-scrolled class to #header when page is scrolled + */ + let selectHeader = select("#header"); + if (selectHeader) { + const headerScrolled = () => { + if (window.scrollY > 32) { + selectHeader.classList.add("header-scrolled"); + } else { + selectHeader.classList.remove("header-scrolled"); + } + }; + window.addEventListener("load", headerScrolled); + onscroll(document, headerScrolled); + } + + + + /** + * Scroll with ofset on page load with hash links in the url + */ + window.addEventListener("load", () => { + if (window.location.hash) { + if (select(window.location.hash)) { + scrollto(window.location.hash); + } + } + }); + + // /** + // * Clients Slider + // */ + // new Swiper(".clients-slider", { + // speed: 400, + // loop: true, + // autoplay: { + // delay: 5000, + // disableOnInteraction: false, + // }, + // slidesPerView: "auto", + // pagination: { + // el: ".swiper-pagination", + // type: "bullets", + // clickable: true, + // }, + // breakpoints: { + // 320: { + // slidesPerView: 2, + // spaceBetween: 40, + // }, + // 480: { + // slidesPerView: 3, + // spaceBetween: 60, + // }, + // 640: { + // slidesPerView: 4, + // spaceBetween: 80, + // }, + // 992: { + // slidesPerView: 6, + // spaceBetween: 120, + // }, + // }, + // }); + + /** + * Porfolio isotope and filter + */ + // window.addEventListener("load", () => { + // let portfolioContainer = select(".portfolio-container"); + // if (portfolioContainer) { + // let portfolioIsotope = new Isotope(portfolioContainer, { + // itemSelector: ".portfolio-item", + // layoutMode: "fitRows", + // }); + + // let portfolioFilters = select("#portfolio-flters li", true); + + // on( + // "click", + // "#portfolio-flters li", + // function (e) { + // e.preventDefault(); + // portfolioFilters.forEach(function (el) { + // el.classList.remove("filter-active"); + // }); + // this.classList.add("filter-active"); + + // portfolioIsotope.arrange({ + // filter: this.getAttribute("data-filter"), + // }); + // aos_init(); + // }, + // true + // ); + // } + // }); + + // /** + // * Initiate portfolio lightbox + // */ + // const portfolioLightbox = GLightbox({ + // selector: ".portfokio-lightbox", + // }); + + // /** + // * Portfolio details slider + // */ + // new Swiper(".portfolio-details-slider", { + // speed: 400, + // autoplay: { + // delay: 5000, + // disableOnInteraction: false, + // }, + // pagination: { + // el: ".swiper-pagination", + // type: "bullets", + // clickable: true, + // }, + // }); + + // /** + // * Testimonials slider + // */ + // new Swiper(".testimonials-slider", { + // speed: 600, + // loop: true, + // autoplay: { + // delay: 5000, + // disableOnInteraction: false, + // }, + // slidesPerView: "auto", + // pagination: { + // el: ".swiper-pagination", + // type: "bullets", + // clickable: true, + // }, + // breakpoints: { + // 320: { + // slidesPerView: 1, + // spaceBetween: 40, + // }, + + // 1200: { + // slidesPerView: 3, + // }, + // }, + // }); + + /** + * Animation on scroll + */ + function aos_init() { + AOS.init({ + duration: 1000, + easing: "ease-in-out", + once: true, + mirror: false, + offset:-20 + }); + } + window.addEventListener("load", () => { + aos_init(); + }); + + // /** + // * Initiate Pure Counter + // */ + // new PureCounter(); +})(); diff --git a/assets/js/theme.js b/assets/js/theme.js new file mode 100644 index 0000000..972289f --- /dev/null +++ b/assets/js/theme.js @@ -0,0 +1,1098 @@ +"use strict"; + +function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure undefined"); } + +function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e2) { throw _e2; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e3) { didErr = true; err = _e3; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; } + +function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } + +function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } + +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } + +function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); } + +function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } + +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } + +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a 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); } } + +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } + +var Util = /*#__PURE__*/function () { + function Util() { + _classCallCheck(this, Util); + } + + _createClass(Util, [{ + key: "forEach", + value: function forEach(elements, handler) { + elements = elements || []; + + for (var i = 0; i < elements.length; i++) { + handler(elements[i]); + } + } + }, { + key: "getScrollTop", + value: function getScrollTop() { + return document.documentElement && document.documentElement.scrollTop || document.body.scrollTop; + } + }, { + key: "isMobile", + value: function isMobile() { + return window.matchMedia('only screen and (max-width: 680px)').matches; + } + }, { + key: "isTocStatic", + value: function isTocStatic() { + return window.matchMedia('only screen and (max-width: 960px)').matches; + } + }, { + key: "animateCSS", + value: function animateCSS(element, animation, reserved, callback) { + var _element$classList; + + if (!Array.isArray(animation)) animation = [animation]; + + (_element$classList = element.classList).add.apply(_element$classList, ['animate__animated'].concat(_toConsumableArray(animation))); + + var handler = function handler() { + var _element$classList2; + + (_element$classList2 = element.classList).remove.apply(_element$classList2, ['animate__animated'].concat(_toConsumableArray(animation))); + + element.removeEventListener('animationend', handler); + if (typeof callback === 'function') callback(); + }; + + if (!reserved) element.addEventListener('animationend', handler, false); + } + }]); + + return Util; +}(); + +var Theme = /*#__PURE__*/function () { + function Theme() { + _classCallCheck(this, Theme); + + this.config = window.config; + this.data = this.config.data; + this.isDark = document.body.getAttribute('theme') === 'dark'; + this.util = new Util(); + this.newScrollTop = this.util.getScrollTop(); + this.oldScrollTop = this.newScrollTop; + this.scrollEventSet = new Set(); + this.resizeEventSet = new Set(); + this.switchThemeEventSet = new Set(); + this.clickMaskEventSet = new Set(); + if (window.objectFitImages) objectFitImages(); + } + + _createClass(Theme, [{ + key: "initRaw", + value: function initRaw() { + var _this = this; + + this.util.forEach(document.querySelectorAll('[data-raw]'), function ($raw) { + $raw.innerHTML = _this.data[$raw.id]; + }); + } + }, { + key: "initSVGIcon", + value: function initSVGIcon() { + this.util.forEach(document.querySelectorAll('[data-svg-src]'), function ($icon) { + fetch($icon.getAttribute('data-svg-src')).then(function (response) { + return response.text(); + }).then(function (svg) { + var $temp = document.createElement('div'); + $temp.insertAdjacentHTML('afterbegin', svg); + var $svg = $temp.firstChild; + $svg.setAttribute('data-svg-src', $icon.getAttribute('data-svg-src')); + $svg.classList.add('icon'); + var $titleElements = $svg.getElementsByTagName('title'); + if ($titleElements.length) $svg.removeChild($titleElements[0]); + $icon.parentElement.replaceChild($svg, $icon); + }).catch(function (err) { + console.error(err); + }); + }); + } + }, { + key: "initTwemoji", + value: function initTwemoji() { + if (this.config.twemoji) twemoji.parse(document.body); + } + }, { + key: "initMenuMobile", + value: function initMenuMobile() { + var $menuToggleMobile = document.getElementById('menu-toggle-mobile'); + var $menuMobile = document.getElementById('menu-mobile'); + var $header = document.getElementById('header'); + $menuToggleMobile.addEventListener('click', function () { + document.body.classList.toggle('blur'); + $menuToggleMobile.classList.toggle('active'); + $menuMobile.classList.toggle('active'); + $header.classList.toggle('header--active'); + }, false); + + this._menuMobileOnClickMask = this._menuMobileOnClickMask || function () { + $menuToggleMobile.classList.remove('active'); + $menuMobile.classList.remove('active'); + $header.classList.toggle('header--active'); + }; + + this.clickMaskEventSet.add(this._menuMobileOnClickMask); + } + }, { + key: "initSwitchTheme", + value: function initSwitchTheme() { + var _this2 = this; + + this.util.forEach(document.getElementsByClassName('theme-switch'), function ($themeSwitch) { + $themeSwitch.addEventListener('click', function () { + if (document.body.getAttribute('theme') === 'dark') document.body.setAttribute('theme', 'light');else document.body.setAttribute('theme', 'dark'); + _this2.isDark = !_this2.isDark; + window.localStorage && localStorage.setItem('theme', _this2.isDark ? 'dark' : 'light'); + + var _iterator = _createForOfIteratorHelper(_this2.switchThemeEventSet), + _step; + + try { + for (_iterator.s(); !(_step = _iterator.n()).done;) { + var event = _step.value; + event(); + } + } catch (err) { + _iterator.e(err); + } finally { + _iterator.f(); + } + }, false); + }); + } + }, { + key: "initSearch", + value: function initSearch() { + var _this3 = this; + + var searchConfig = this.config.search; + var isMobile = this.util.isMobile(); + if (!searchConfig || isMobile && this._searchMobileOnce || !isMobile && this._searchDesktopOnce) return; + var maxResultLength = searchConfig.maxResultLength ? searchConfig.maxResultLength : 10; + var snippetLength = searchConfig.snippetLength ? searchConfig.snippetLength : 50; + var highlightTag = searchConfig.highlightTag ? searchConfig.highlightTag : 'em'; + var suffix = isMobile ? 'mobile' : 'desktop'; + var $header = document.getElementById("header-".concat(suffix)); + var $searchInput = document.getElementById("search-input-".concat(suffix)); + var $searchToggle = document.getElementById("search-toggle-".concat(suffix)); + var $searchLoading = document.getElementById("search-loading-".concat(suffix)); + var $searchClear = document.getElementById("search-clear-".concat(suffix)); + + if (isMobile) { + this._searchMobileOnce = true; + $searchInput.addEventListener('focus', function () { + document.body.classList.add('blur'); + $header.classList.add('open'); + }, false); + document.getElementById('search-cancel-mobile').addEventListener('click', function () { + $header.classList.remove('open'); + document.body.classList.remove('blur'); + document.getElementById('menu-toggle-mobile').classList.remove('active'); + document.getElementById('menu-mobile').classList.remove('active'); + $searchLoading.style.display = 'none'; + $searchClear.style.display = 'none'; + _this3._searchMobile && _this3._searchMobile.autocomplete.setVal(''); + }, false); + $searchClear.addEventListener('click', function () { + $searchClear.style.display = 'none'; + _this3._searchMobile && _this3._searchMobile.autocomplete.setVal(''); + }, false); + + this._searchMobileOnClickMask = this._searchMobileOnClickMask || function () { + $header.classList.remove('open'); + $searchLoading.style.display = 'none'; + $searchClear.style.display = 'none'; + _this3._searchMobile && _this3._searchMobile.autocomplete.setVal(''); + }; + + this.clickMaskEventSet.add(this._searchMobileOnClickMask); + } else { + this._searchDesktopOnce = true; + $searchToggle.addEventListener('click', function () { + document.body.classList.add('blur'); + $header.classList.add('open'); + $searchInput.focus(); + }, false); + $searchClear.addEventListener('click', function () { + $searchClear.style.display = 'none'; + _this3._searchDesktop && _this3._searchDesktop.autocomplete.setVal(''); + }, false); + + this._searchDesktopOnClickMask = this._searchDesktopOnClickMask || function () { + $header.classList.remove('open'); + $searchLoading.style.display = 'none'; + $searchClear.style.display = 'none'; + _this3._searchDesktop && _this3._searchDesktop.autocomplete.setVal(''); + }; + + this.clickMaskEventSet.add(this._searchDesktopOnClickMask); + } + + $searchInput.addEventListener('input', function () { + if ($searchInput.value === '') $searchClear.style.display = 'none';else $searchClear.style.display = 'inline'; + }, false); + + var initAutosearch = function initAutosearch() { + var autosearch = autocomplete("#search-input-".concat(suffix), { + hint: false, + autoselect: true, + dropdownMenuContainer: "#search-dropdown-".concat(suffix), + clearOnSelected: true, + cssClasses: { + noPrefix: true + }, + debug: true + }, { + name: 'search', + source: function source(query, callback) { + $searchLoading.style.display = 'inline'; + $searchClear.style.display = 'none'; + + var finish = function finish(results) { + $searchLoading.style.display = 'none'; + $searchClear.style.display = 'inline'; + callback(results); + }; + + if (searchConfig.type === 'lunr') { + var search = function search() { + if (lunr.queryHandler) query = lunr.queryHandler(query); + var results = {}; + + _this3._index.search(query).forEach(function (_ref) { + var ref = _ref.ref, + metadata = _ref.matchData.metadata; + var matchData = _this3._indexData[ref]; + var uri = matchData.uri, + title = matchData.title, + context = matchData.content; + if (results[uri]) return; + var position = 0; + Object.values(metadata).forEach(function (_ref2) { + var content = _ref2.content; + + if (content) { + var matchPosition = content.position[0][0]; + if (matchPosition < position || position === 0) position = matchPosition; + } + }); + position -= snippetLength / 5; + + if (position > 0) { + position += context.substr(position, 20).lastIndexOf(' ') + 1; + context = '...' + context.substr(position, snippetLength); + } else { + context = context.substr(0, snippetLength); + } + + Object.keys(metadata).forEach(function (key) { + title = title.replace(new RegExp("(".concat(key, ")"), 'gi'), "<".concat(highlightTag, ">$1").concat(highlightTag, ">")); + context = context.replace(new RegExp("(".concat(key, ")"), 'gi'), "<".concat(highlightTag, ">$1").concat(highlightTag, ">")); + }); + results[uri] = { + 'uri': uri, + 'title': title, + 'date': matchData.date, + 'context': context + }; + }); + + return Object.values(results).slice(0, maxResultLength); + }; + + if (!_this3._index) { + fetch(searchConfig.lunrIndexURL).then(function (response) { + return response.json(); + }).then(function (data) { + var indexData = {}; + _this3._index = lunr(function () { + var _this4 = this; + + if (searchConfig.lunrLanguageCode) this.use(lunr[searchConfig.lunrLanguageCode]); + this.ref('objectID'); + this.field('title', { + boost: 50 + }); + this.field('tags', { + boost: 20 + }); + this.field('categories', { + boost: 20 + }); + this.field('content', { + boost: 10 + }); + this.metadataWhitelist = ['position']; + data.forEach(function (record) { + indexData[record.objectID] = record; + + _this4.add(record); + }); + }); + _this3._indexData = indexData; + finish(search()); + }).catch(function (err) { + console.error(err); + finish([]); + }); + } else finish(search()); + } else if (searchConfig.type === 'algolia') { + _this3._algoliaIndex = _this3._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex); + + _this3._algoliaIndex.search(query, { + offset: 0, + length: maxResultLength * 8, + attributesToHighlight: ['title'], + attributesToSnippet: ["content:".concat(snippetLength)], + highlightPreTag: "<".concat(highlightTag, ">"), + highlightPostTag: "".concat(highlightTag, ">") + }).then(function (_ref3) { + var hits = _ref3.hits; + var results = {}; + hits.forEach(function (_ref4) { + var uri = _ref4.uri, + date = _ref4.date, + title = _ref4._highlightResult.title, + content = _ref4._snippetResult.content; + if (results[uri] && results[uri].context.length > content.value) return; + results[uri] = { + uri: uri, + title: title.value, + date: date, + context: content.value + }; + }); + finish(Object.values(results).slice(0, maxResultLength)); + }).catch(function (err) { + console.error(err); + finish([]); + }); + } + }, + templates: { + suggestion: function suggestion(_ref5) { + var title = _ref5.title, + date = _ref5.date, + context = _ref5.context; + return "
信息共享, 项目协作, 团队联盟, 技术支持
-
- 在这里, 了解关于互联网的一点一滴
-近期要闻 -
在这里, 了解关于互联网的一点一滴
-After 2 times of re-organization, our team has been more productive and efficient
+经历2次重组后, 形随意动团队变得更加精炼和有效率
+随着这次新冠疫情的形势在全球范围内愈发严重,越来越多的人开始意识到这次疫情并非像2003年非典那样简单。同时,形随意动也在持续关注着这次疫情的发展动态。那么,作为一个团队,我们在应对这次新型冠状病毒疫情这方面,又可以做些什么呢?
-一次偶然的机会,我们在推特上了解到了Folding@home项目,一个基于分布式计算的蛋白质分析平台。我们完全可以通过这个平台,参与到本次抗击疫情的研究当中来。那么,这究竟是一个什么样的项目呢?
+--- +weight: 4 +title: "应对Covid-19, 我们做了什么" +date: 2020-04-30T21:57:40+08:00 +lastmod: 2020-04-30T21:57:40+08:00 +draft: false +author: "Zhe_Learn" +description: "应对Covid-19, 我们做了什么" +images: [] +# resources: +# - name: "featured-image" +# src: "featured-image.png" +categories: ["News"] + +lightgallery: true +--- + +随着这次新冠疫情的形势在全球范围内愈发严重,越来越多的人开始意识到这次疫情并非像2003年非典那样简单。同时,形随意动也在持续关注着这次疫情的发展动态。那么,作为一个团队,我们在应对这次新型冠状病毒疫情这方面,又可以做些什么呢? + +一次偶然的机会,我们在推特上了解到了Folding@home项目,一个基于分布式计算的蛋白质分析平台。我们完全可以通过这个平台,参与到本次抗击疫情的研究当中来。那么,这究竟是一个什么样的项目呢?
要了解这个项目,首先我们需要简单了解一下什么是“分布式计算”。与使用昂贵且难以维护的超级计算机不同,许多大学或组织都有自己的分布式计算项目。其原理是由任务分发服务器将大量的运算内容拆分成许多小的运算单元,并根据参与者计算机类型的不同分发给全球范围内合适的个人闲置电脑进行部分的模拟和运算。运算结束后个人电脑将运算的结果上传给接收服务器,经过拼接即可得到完整的运算结果。简单来说,就是集合世界各地参与者的设备,代替超级计算机来进行复杂的运算。同时,得益于分布式计算大众参与的特殊性质,计算结果和稀缺资源可以共享,由全世界的科学组织用于研究和学习。
而Folding@home正是由斯坦福大学化学系于2000年10月启动的分布式计算项目,致力于通过分子动力学模拟帮助研究人员了解蛋白质的工作方式。蛋白质是一个生物体系的网络基础,可以说它们是一个个纳米级计算机。在蛋白质实现它的生物功能之前,它们会把自己装配起来——或者说是折叠。虽然蛋白质的折叠对所有的生物来说是最基本的和最明确的事实,但它的折叠过程对人类而言仍然是个未解之谜。而如果蛋白质没有正确的折叠则会带来严重的后果,例如阿兹海默症,疯牛病等等。因此,深入了解蛋白质折叠与错误折叠的关系对于这些疾病的致病机制的阐明以及治疗方法的寻找将大有帮助。
Folding@home的研究囊括许多难以治疗的疾病,例如上文提到的疯牛病,阿兹海默氏症等等,以及最近肆虐全球的新冠肺炎,Covid-19。Folding @ home通过计算机模拟获得的数据集帮助科学家们寻找静态X光图像上无法发现的潜在药物靶点,以及验证研究人员设计的药物如何干扰病毒增殖。
形随意动团队在这次疫情期间组织了多位有空闲算力的成员积极参与了这一项目。截至2020年4月3日7:30,形随意动团队已完成对143个Work Unit的运算,全球排名9358 of 247332。我们将会持续参与这一项目,为中国抗疫、全球抗疫,乃至战胜更多人类流行病献一份力。
-另外,如果你同样想参与到这个项目中来,不妨看看我们在哔哩哔哩平台上发布的最新一期【科普速递】节目《如何在线抗疫 | 分布式计算与新冠病毒》,更生动地让你理解什么是分布式计算和Folding @ home,手把手教你参与到Folding @ home项目当中。 -
另外,如果你同样想参与到这个项目中来,不妨看看我们在哔哩哔哩平台上发布的最新一期【科普速递】节目《如何在线抗疫 | 分布式计算与新冠病毒》,更生动地让你理解什么是分布式计算和Folding @ home,手把手教你参与到Folding @ home项目当中。
diff --git a/content/posts/20200430covoid19/index.zh-cn.md b/content/posts/20200430covoid19/index.zh-cn.md new file mode 100644 index 0000000..ba980f8 --- /dev/null +++ b/content/posts/20200430covoid19/index.zh-cn.md @@ -0,0 +1,25 @@ +--- +weight: 4 +title: "应对Covid-19, 我们做了什么" +date: 2020-04-30T21:57:40+08:00 +lastmod: 2020-04-30T21:57:40+08:00 +draft: false +author: "Zhe_Learn" +description: "应对Covid-19, 我们做了什么" +images: [] +# resources: +# - name: "featured-image" +# src: "featured-image.png" +categories: ["News"] + +lightgallery: true +--- + +> 随着这次新冠疫情的形势在全球范围内愈发严重,越来越多的人开始意识到这次疫情并非像2003年非典那样简单。同时,形随意动也在持续关注着这次疫情的发展动态。那么,作为一个团队,我们在应对这次新型冠状病毒疫情这方面,又可以做些什么呢? + +一次偶然的机会,我们在推特上了解到了Folding@home项目,一个基于分布式计算的蛋白质分析平台。我们完全可以通过这个平台,参与到本次抗击疫情的研究当中来。那么,这究竟是一个什么样的项目呢?
+要了解这个项目,首先我们需要简单了解一下什么是“分布式计算”。与使用昂贵且难以维护的超级计算机不同,许多大学或组织都有自己的分布式计算项目。其原理是由任务分发服务器将大量的运算内容拆分成许多小的运算单元,并根据参与者计算机类型的不同分发给全球范围内合适的个人闲置电脑进行部分的模拟和运算。运算结束后个人电脑将运算的结果上传给接收服务器,经过拼接即可得到完整的运算结果。简单来说,就是集合世界各地参与者的设备,代替超级计算机来进行复杂的运算。同时,得益于分布式计算大众参与的特殊性质,计算结果和稀缺资源可以共享,由全世界的科学组织用于研究和学习。
+而Folding@home正是由斯坦福大学化学系于2000年10月启动的分布式计算项目,致力于通过分子动力学模拟帮助研究人员了解蛋白质的工作方式。蛋白质是一个生物体系的网络基础,可以说它们是一个个纳米级计算机。在蛋白质实现它的生物功能之前,它们会把自己装配起来——或者说是折叠。虽然蛋白质的折叠对所有的生物来说是最基本的和最明确的事实,但它的折叠过程对人类而言仍然是个未解之谜。而如果蛋白质没有正确的折叠则会带来严重的后果,例如阿兹海默症,疯牛病等等。因此,深入了解蛋白质折叠与错误折叠的关系对于这些疾病的致病机制的阐明以及治疗方法的寻找将大有帮助。
+Folding@home的研究囊括许多难以治疗的疾病,例如上文提到的疯牛病,阿兹海默氏症等等,以及最近肆虐全球的新冠肺炎,Covid-19。Folding @ home通过计算机模拟获得的数据集帮助科学家们寻找静态X光图像上无法发现的潜在药物靶点,以及验证研究人员设计的药物如何干扰病毒增殖。
+形随意动团队在这次疫情期间组织了多位有空闲算力的成员积极参与了这一项目。截至2020年4月3日7:30,形随意动团队已完成对143个Work Unit的运算,全球排名9358 of 247332。我们将会持续参与这一项目,为中国抗疫、全球抗疫,乃至战胜更多人类流行病献一份力。
+另外,如果你同样想参与到这个项目中来,不妨看看我们在哔哩哔哩平台上发布的最新一期【科普速递】节目《如何在线抗疫 | 分布式计算与新冠病毒》,更生动地让你理解什么是分布式计算和Folding @ home,手把手教你参与到Folding @ home项目当中。
diff --git a/content/team/index.en.md b/content/team/index.en.md new file mode 100644 index 0000000..400f189 --- /dev/null +++ b/content/team/index.en.md @@ -0,0 +1,84 @@ +--- +title: "Interactive+ Introduction" +showtitle: false +date: 2019-08-02T11:04:49+08:00 +draft: false +description: "about" + +lightgallery: true + +--- +This article describes how Interactive+ were founded earlier, what we do now and what we are going to do in the future!
+| Domain | +Level | +Usage | +
|---|---|---|
| interactiveplus.org | +Major | +Official Web Page Hosting, Interactive+ related services | +
| xsyds.cn | +Secondary | +Member Web Page Hosting, Server IP Address Record | +
| xsydsoft.com | +Secondary | +Email Domain, Spare Domain | +
| blueairhost.xyz | +Secondary | +BlueAirHost Designated Domain | +
+- email: windy@xsydsoft.com
+- QQ: 1745500559
+
+## Partners
+[Lanza,Inc](https://www.lanzainc.xyz/)
\ No newline at end of file
diff --git a/content/team/index.zh-cn.md b/content/team/index.zh-cn.md
new file mode 100644
index 0000000..97ac7c5
--- /dev/null
+++ b/content/team/index.zh-cn.md
@@ -0,0 +1,85 @@
+---
+title: "团队介绍"
+showtitle: false
+date: 2019-08-02T11:04:49+08:00
+draft: false
+description: "关于 LoveIt"
+
+lightgallery: true
+
+---
+本篇文章简要介绍形随意动的前身由来, 我们做什么和我们未来要做什么!
+| 域名 | +级别 | +用途 | +
|---|---|---|
| interactiveplus.org | +首级域名 | +官网首页, 形随意动相关服务 | +
| xsyds.cn | +次级域名 | +成员个人网站空间域名, 服务器IP地址记录域名 | +
| xsydsoft.com | +次级域名 | +邮箱域名, 备用域名 | +
| blueairhost.xyz | +次级域名 | +BlueAirHost专用域名 | +
+- 邮箱:windy@xsydsoft.com
+- QQ:1745500559
+
+## 友情链接
+[Lanza,Inc](https://www.lanzainc.xyz/)
\ No newline at end of file
diff --git a/data/home.en.json b/data/home.en.json
new file mode 100644
index 0000000..a3d5967
--- /dev/null
+++ b/data/home.en.json
@@ -0,0 +1,7 @@
+{
+ "section1Title":"Technology leads to innovation, Digital Science drives transformation",
+ "section1SubTitle":"Traditional ways of operating commerce are being totally subverted by new technologies, while getting mixed and re-innovated in a new way at the same time.",
+ "section2Title":"Simplify the complexity of programming, and push innovations forward",
+ "section2SubTitle":"Interactive+ strives to make cross-platform apps and has developed cross-platform frameworks such as EasyCrossPlatform and BoostPHP to make programming simpler本篇文章简要介绍形随意动的前身由来, 我们做什么和我们未来要做什么!
-磨而不磷, 契而不舍, 上善若水, 宁静致远.
-形随意动致力于将技术应用于实践中, 让编程变得更加简单, 高效.
-"我们渴望创新的力量,也从未忘记最初的梦想" 这是我在2016年5月11日, 随意发现的一段话.
-你的一生的最高成就,一生的最美辉煌,一生的最大苦难,不过是这个大宇宙亿亿角落里的几千万亿银河系上第三悬臂几亿个中太阳系里地球上的76亿之一而已. 所以我们决定, 我们不管将来到达了何种高度, 形随意动的最终目标是为了推动人类的进步.
-形随意动内部从未缺乏过创新的力量, 形随意动内部缺乏的是坚持当初自己的理想, 并且为之努力的精神. 有多少人一个语言还未学透, 便去钻研其他语言, 又有多少人被游戏, 被爱情, 被其他的东西给分散了注意力, 转而放弃了当初的热血和激情. 此篇文章不只是为了给大家看, 也是时刻警醒我们自己:
-莫忘初心, 方得始终. 并且要契而不舍的追求自己的理想. 意味着我们要时刻提醒自己, 也许编程到精通非常的枯燥无谓, 但是越过一道山丘, 则是柳暗花明又一村.
-形随意动致力于用一个符合时代的方法传递出不属于这个时代的精神. 我们的理念是所有行业都需要服务于推动社会文明的进程. 而我们擅长于计算机, 我们也相信通过开源, 我们能尽自己微小的力量帮助整个世界一份力.
-形随意动尊重隐私, 深挖安全, 官网全部采用TLS1.1-1.3 Compatible, 开启HSTS技术, 并于2018年6月使部分产品开启DNSSEC.
-主要语言: PHP, HTML/CSS/JS, C++/C#, MySQL
-钻研方向: PHP/数据库高并发实践, C++跨平台, 游戏开发, 人工智能
-形随意动创立初衷是因为有着相同爱好的人聚集到了一起, 希望以他们的联合开发一些强大的APP. 但是随着时间的推移, 形随意动越来越多的想帮助这个社会, 让更多的人看到可能的一线社会推进的曙光.
-This article describes how Interactive+ were founded earlier, what we do now and what we are going to do in the future!
-Determination, Passion, Respect, Intergrity, Honesty
-InterActive+ aims to bring technology into practice and make programming more simple and productive.
-"We eagerly want the power of innovation, but we have never forgot our initial dreams" This is what I discover on May 11, 2016.
-The best achievement, the most beautiful sceneries and the most suffering things is only a tiny little part of this universe. So we decide, wherever we achieve in the future, our final goal is to fuel the development of the human beings.
-We have never been lack of the power of innovation inside our group, but we may give up our amibitions and stop fighting for it. How many people does not fully understand one programming language and goes to another?
-We can never lose our passion, and this article is not only for you who are supporting us, but also for ourselves to always get power and fuel ourselves, and finally we will achieve our greatest height.
-InterActive+ strives to use a method that is appropriate for this time to convey a better message that does not belong to this time. We believe that every industry must be able to push the society forward to be meaningful. Since we are good at Computer Science, we hope to improve this world by open-sourcing.
-InterActive+ respects privacy and digs deep into cyber-security. Our websites are TLS1.1-1.3 Compatible and have HSTS functionality enabled. Parts of our websites even use DNSSEC.
-Major languages: PHP, HTML/CSS/JS, C++/C#, MySQL
-Area of study: PHP/Database High Concurrency, C++ Cross-Platform, Game-Development, AI
-We found Interactive+ because we share the same hobby and hope to develop powerful APPs together. With the flow of time, we are more and more eager to help the society and let people see the light of hope that even in small villages, people will be able to access city-like services.
-关于我们升级官网的动机, 新官网背后的技术
-形随意动官网 2019Alpha 上线了!
-此项目由流星立项, 由流星,秋风,葫芦娃三人合作开发. 流星负责前端Layout, 秋风辅助Code-Review和架构设计, 葫芦娃负责双语版本翻译.
-代码约于2个星期之内完成, 翻译约为2个星期内完成
-新网页采用 Bootstrap 4 + jQuery 3 + FontAwesome 4 + CustomJS 作为前端技术栈实现.
-如同介绍中所说, 新官网是我们从自造轮子进击商业轮子的一次新的尝试. 它不仅让我们学会使用各种各样的框架, 更让我们对框架的实现方法拥有更深刻的理解, 然后我们从这些经验中就可以更新自己的框架.
-本次官网自己发展的技术有:
-This article is about our motivations towards this update and the technologies behind this action.
-Interactive+ launched its 2019 Alpha website!
-This project is set up by Meteoroid, code-reviewed and architecture-designed by Windy, translated by Calabash.
-The code was finished in about 2 weeks and the translation was finished in about 2 weeks.
-The new website utilizes Bootstrap 4 + jQuery 3 + FontAwesome 4 + CustomJS as technology stack to implement the front-end.
-As the introduction says, those new frameworks we utilize help us to improve our skills on commercial standard frameworks. Besides that, it helped us to have a deeper understanding of how great frameworks worked, so that we can improve on our own frameworks.
-This time, the technologies that we have improved:
-这个暑假咱们工作室做了许多比较有意义的事情.
-首先流星策划了新版的形随意动官网, 我和他共同完成了此项目.
-工期大约是1个月左右, 新版官网内置双语引擎, 数据完全由JS静态文件承载(可以Github上直接放网页, 懒得配服务器了, 这也是我做新版官网的原因之一), 同时通过JS热加载, 在网页完成加载后继续加载, 可以有效地减缓网页加载的延迟时间.
-项目代码在 Github 上的 InteractivePlus/interactiveplus.github.io/ 上
-由于工作室内部项目凌乱, 没有统一的用户管理系统(一大部分原因归结于秋风每次写完最新版本OPENAPI, 上线没几天就闲没人用或者bug多, 亦或者是架构零散, 就下架了.), 且内部一直想联合一起做一个学校/公司管理系统, 所以我牵头建立了这个项目. (当然了, 也主要是我一个人在肝)
-此项目目前后端API已测试完毕(9月25日), 后端文档长达2000+字. 系统支持中英双引擎, 并且可以对语言支持进行横向拓展, 而且还支持后期制作插件(已经把插件支持做好了!), 附带完整的密码找回, 邮箱更改绑定, 第三方登录, 第三方授权验证, 用户删除功能.
-对了, 不足的是船歌大佬指出的OAuth2.0支持的问题, 目前准备后期做OAuth2.0插件解决.
-盘点完毕~
\ No newline at end of file diff --git a/dynamicData/articles/2_WhatDoWeDoDuringSummer2018_EN.html b/dynamicData/articles/2_WhatDoWeDoDuringSummer2018_EN.html deleted file mode 100644 index 32121e2..0000000 --- a/dynamicData/articles/2_WhatDoWeDoDuringSummer2018_EN.html +++ /dev/null @@ -1,18 +0,0 @@ -We had a wonderful summer together in 2018, and made something amazing.
-First of all, Meteoroid planned the new version of the site, and I finished the project with him.
-The project took us about 1 month to finish. The new official site includes a multi-lang engine. Data in this website are carried by Javascript static files(so that we can just host it on github, and it no longer requires me to update it to the server, which is one of the reasons that motivates me to write this new version). Since we utilized JS dynamic loading, the contents will be loaded after the actual page is loaded, thus efficiently decreases the time needed for loading the website.
-The project sourcecode can be found on Github repository InteractivePlus/interactiveplus.github.io/
-Because the projects in our studio are messed up, and there is no unified user management system(a lot of reason is because everytime I finish writing a new version of OPENAPI, I will stop the server due to user amount issues or code structure issues.), we decided to do a unified user management system for our studio.
-Another reason is that we have long been desired to create a school/business management system, so we started this system(I started this project, and do the majority of the work)
-The backend API had finished testing(Sept. 25), The backend document is more than 2000 words. The system supports Mandarin and English, and is capable of extending horizontally with more than 2 languages. It also includes a plugin support(for backend), a complimentary password recovery, third-party login, third-party auth, user deleting functionality.
-O, Something that we did not finish is the support of OAuth2.0 suggested by Chuange, our solution is to develop a plugin that supports this feature, but it has been pushed for later.
-I think that's it.
\ No newline at end of file diff --git a/dynamicData/articles/3_InteractivePlusRecruit_CN.html b/dynamicData/articles/3_InteractivePlusRecruit_CN.html deleted file mode 100644 index ecea2a4..0000000 --- a/dynamicData/articles/3_InteractivePlusRecruit_CN.html +++ /dev/null @@ -1,39 +0,0 @@ -从现在起, 和我们一起成为未来的一部分吧.
-形随意动从2013年成立到如今已经有6个年头了, 在2020新年之际, 我们愿意以自己的热诚接待新人. 招新对于新成员和工作室是共赢的局面: 工作室有更多有能力的人参与项目开发, 新成员同时在开发过程中成长并掌握最新的前后端技术.
-程序
-至少掌握以下一种技能: C#, C++, C, Rust, Basic, Java, Kotlin, 前端(HTML/CSS/JS/TS), Python, PHP, NodeJS, Go, Bash
-必须掌握 Github / Git 使用方法
-并提交一个个人作品或github地址.
-视觉设计
-至少掌握以下一种技能: Photoshop, Illustrator, CoralDraw
-并提交一个个人作品.
-视频/建模
-至少掌握以下一种技能: Maya, 3DS MAX, ZBrush, After Effects, Premiere
-并提交一个个人作品或B站地址
-发送内容: 个人简历(能力, 作品/github/B站地址) + 联系QQ
-发送到: QQ 1745500559
-或发送到: windy[AT]xsydsoft.com (将[AT]替换为@)
-任何招新问题, 欢迎联系上面的联系方式
-From now on, be a part of the future.
-InterActive+ was established 6 years ago by 2013. As we are reaching the year of 2020, we are eager to expand our team sizes and welcome new members of this team. This will be a win-win for both the new member and the studio. The member will learn to practice industry-level pipelining and the studio will get more power on making new projects.
-Programmer
-Must manage one of the following skills: C#, C++, C, Rust, Java, Kotlin, Front-End(HTML/CSS/JS/TS), Python, PHP, NodeJS, Go, Bash
-Must manage usage of Github / Git client
-and submit a github address or a personal app via file.
-Visual Designer
-Must manage one of the following skills: Photoshop, Illustrator, CoralDraw
-and submit a personal work.
-Video/Modeling
-Must manage one of the following skills: Maya, 3DS MAX, ZBrush, After Effects, Premiere
-and submit a personal work or youtube address
-Sending content: Personal resume(ability, personal work/github/youtube address) + Contact Number/Telegram/Slack/Snapchat
-To: windy[AT]xsydsoft.com (Replace [AT] with @)
-For any recruit questions, you are welcome to contact us.
-| 域名 | -级别 | -用途 | -
|---|---|---|
| interactiveplus.org | -首级域名 | -官网首页, 形随意动相关服务 | -
| xsyds.cn | -次级域名 | -成员个人网站空间域名, 服务器IP地址记录域名 | -
| xsydsoft.com | -次级域名 | -邮箱域名, 备用域名 | -
| blueairhost.xyz | -次级域名 | -BlueAirHost专用域名 | -
| Domain | -Level | -Usage | -
|---|---|---|
| interactiveplus.org | -Major | -Official Web Page Hosting, Interactive+ related services | -
| xsyds.cn | -Secondary | -Member Web Page Hosting, Server IP Address Record | -
| xsydsoft.com | -Secondary | -Email Domain, Spare Domain | -
| blueairhost.xyz | -Secondary | -BlueAirHost Designated Domain | -
Sharing of Infomation, Project Collaboration, Tech Support
-
- Learn every bit of the Internet here.
-Recent News -
Learn every bit of the Internet here.
-| {{ $col }} | + {{ end }} +
{{ . }}
+ {{ end }} +]*>(?s)(.*).*` "$1" $content -}}
+ {{- if .Get "code-link" -}}
+ {{- /* parsing code links */ -}}
+ {{- $content = replaceRE `(]*>)([^<>]*)\[([^<>]+)\]\(([^<>]+)\)([^<>]*)()` "$1$2$6$3$1$5$6" $content -}}
+ {{- end -}}
+ {{- /* split multiline string */ -}}
+ {{- $content = split $content "\n" -}}
+ {{- $classList = $classList | append "highlight" -}}
+{{- else -}}
+ {{- $content = $content | .Page.RenderString -}}
+{{- end -}}
+
+{{- /* trim the newline */ -}}
+{{- $id := dict "Content" $content "Scratch" .Page.Scratch | partial "function/id.html" -}}
+{{- $key := .Get "group" | string | default $id -}}
+{{- $typeitMap := (.Page.Scratch.Get "this").typeitMap | default dict -}}
+{{- $group := index $typeitMap $key -}}
+{{- $group = $group | default slice | append $id -}}
+{{- dict $key $group | merge $typeitMap | .Page.Scratch.SetInMap "this" "typeitMap" -}}
+
+{{- $attrs := printf `id="%v"` $id -}}
+{{- with $classList -}}
+ {{- $attrs = delimit $classList " " | printf `%v class="%v"` $attrs -}}
+{{- end -}}
+
+",t+=r(e[1]),t+="
\n"}),t}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i,a=function(){function e(e,t){for(var n=0;n"+b(a)+"
"}return{empty:a.empty&&k.templatify(a.empty),header:a.header&&k.templatify(a.header),footer:a.footer&&k.templatify(a.footer),suggestion:a.suggestion||c}}function g(a){return/^[_a-zA-Z0-9-]+$/.test(a)}var h="aaDataset",i="aaValue",j="aaDatum",k=c(4),l=c(3),m=c(18),n=c(19),o=c(8);d.extractDatasetName=function(a){return l.element(a).data(h)},d.extractValue=function(a){return l.element(a).data(i)},d.extractDatum=function(a){var b=l.element(a).data(j);return"string"==typeof b&&(b=JSON.parse(b)),b},k.mixin(d.prototype,o,{_render:function(a,b){function c(){var b=[].slice.call(arguments,0);return b=[{query:a,isEmpty:!0}].concat(b),n.templates.empty.apply(this,b)}function d(){function a(a){var b,c=m.suggestion.replace("%PREFIX%",f.cssClasses.prefix).replace("%SUGGESTION%",f.cssClasses.suggestion);return b=l.element(c).attr({role:"option",id:["option",Math.floor(1e8*Math.random())].join("-")}).append(n.templates.suggestion.apply(this,[a].concat(e))),b.data(h,n.name),b.data(i,n.displayFn(a)||void 0),b.data(j,JSON.stringify(a)),b.children().each(function(){l.element(this).css(f.css.suggestionChild)}),b}var c,d,e=[].slice.call(arguments,0),f=this,g=m.suggestions.replace("%PREFIX%",this.cssClasses.prefix).replace("%SUGGESTIONS%",this.cssClasses.suggestions);return c=l.element(g).css(this.css.suggestions),d=k.map(b,a),c.append.apply(c,d),c}function e(){var b=[].slice.call(arguments,0);return b=[{query:a,isEmpty:!g}].concat(b),n.templates.header.apply(this,b)}function f(){var b=[].slice.call(arguments,0);return b=[{query:a,isEmpty:!g}].concat(b),n.templates.footer.apply(this,b)}if(this.$el){var g,n=this,o=[].slice.call(arguments,2);if(this.$el.empty(),g=b&&b.length,this._isEmpty=!g,!g&&this.templates.empty)this.$el.html(c.apply(this,o)).prepend(n.templates.header?e.apply(this,o):null).append(n.templates.footer?f.apply(this,o):null);else if(g)this.$el.html(d.apply(this,o)).prepend(n.templates.header?e.apply(this,o):null).append(n.templates.footer?f.apply(this,o):null);else if(b&&!Array.isArray(b))throw new TypeError("suggestions must be an array");this.$menu&&this.$menu.addClass(this.cssClasses.prefix+(g?"with":"without")+"-"+this.name).removeClass(this.cssClasses.prefix+(g?"without":"with")+"-"+this.name),this.trigger("rendered",a)}},getRoot:function(){return this.$el},update:function(a){function b(b){if(!this.canceled&&a===this.query){var c=[].slice.call(arguments,1);this.cacheSuggestions(a,b,c),this._render.apply(this,[a,b].concat(c))}}if(this.query=a,this.canceled=!1,this.shouldFetchFromCache(a))b.apply(this,[this.cachedSuggestions].concat(this.cachedRenderExtraArgs));else{var c=this,d=function(){c.canceled||c.source(a,b.bind(c))};if(this.debounce){var e=function(){c.debounceTimeout=null,d()};clearTimeout(this.debounceTimeout),this.debounceTimeout=setTimeout(e,this.debounce)}else d()}},cacheSuggestions:function(a,b,c){this.cachedQuery=a,this.cachedSuggestions=b,this.cachedRenderExtraArgs=c},shouldFetchFromCache:function(a){return this.cache&&this.cachedQuery===a&&this.cachedSuggestions&&this.cachedSuggestions.length},clearCachedSuggestions:function(){delete this.cachedQuery,delete this.cachedSuggestions,delete this.cachedRenderExtraArgs},cancel:function(){this.canceled=!0},clear:function(){this.$el&&(this.cancel(),this.$el.empty(),this.trigger("rendered",""))},isEmpty:function(){return this._isEmpty},destroy:function(){this.clearCachedSuggestions(),this.$el=null}}),a.exports=d},function(a,b){"use strict";a.exports={wrapper:'',dropdown:'',dataset:'',suggestions:'',suggestion:''}},function(a,b,c){"use strict";var d=c(4),e={wrapper:{position:"relative",display:"inline-block"},hint:{position:"absolute",top:"0",left:"0",borderColor:"transparent",boxShadow:"none",opacity:"1"},input:{position:"relative",verticalAlign:"top",backgroundColor:"transparent"},inputWithNoHint:{position:"relative",verticalAlign:"top"},dropdown:{position:"absolute",top:"100%",left:"0",zIndex:"100",display:"none"},suggestions:{display:"block"},suggestion:{whiteSpace:"nowrap",cursor:"pointer"},suggestionChild:{whiteSpace:"normal"},ltr:{left:"0",right:"auto"},rtl:{left:"auto",right:"0"},defaultClasses:{root:"algolia-autocomplete",prefix:"aa",noPrefix:!1,dropdownMenu:"dropdown-menu",input:"input",hint:"hint",suggestions:"suggestions",suggestion:"suggestion",cursor:"cursor",dataset:"dataset",empty:"empty"},appendTo:{wrapper:{position:"absolute",zIndex:"100",display:"none"},input:{},inputWithNoHint:{},dropdown:{display:"block"}}};d.isMsie()&&d.mixin(e.input,{backgroundImage:"url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)"}),d.isMsie()&&d.isMsie()<=7&&d.mixin(e.input,{marginTop:"-1px"}),a.exports=e},function(a,b,c){"use strict";a.exports={hits:c(21),popularIn:c(24)}},function(a,b,c){"use strict";var d=c(4),e=c(22),f=c(23),g=function(){function a(a,d){return window.Promise.resolve().then(function(){return b.length&&(e=a.search(b),b=[]),e}).then(function(a){if(a)return c=a.results,c[d]})}var b=[],c=[],e=window.Promise.resolve();return function(c,e){return function(f,g){a(c.as,b.push({indexName:c.indexName,query:f,params:e})-1).then(function(a){a&&g(a.hits,a)}).catch(function(a){d.error(a.message)})}}}();a.exports=function(a,b){var c=f(a.as._ua);if(c&&c[0]>=3&&c[1]>20){var d="autocomplete.js "+e;a.as._ua.indexOf(d)===-1&&(a.as._ua+="; "+d)}return g(a,b)}},function(a,b){a.exports="0.38.1"},function(a,b){"use strict";a.exports=function(a){var b=a.match(/Algolia for JavaScript \((\d+\.)(\d+\.)(\d+)\)/)||a.match(/Algolia for vanilla JavaScript (\d+\.)(\d+\.)(\d+)/);if(b)return[b[1],b[2],b[3]]}},function(a,b,c){"use strict";var d=c(4),e=c(22),f=c(23);a.exports=function(a,b,c,g){function h(h,i){a.search(h,b,function(a,h){if(a)return void d.error(a.message);if(h.hits.length>0){var l=h.hits[0],m=d.mixin({hitsPerPage:0},c);delete m.source,delete m.index;var n=f(k.as._ua);return n&&n[0]>=3&&n[1]>20&&(b.additionalUA="autocomplete.js "+e),void k.search(j(l),m,function(a,b){if(a)return void d.error(a.message);var c=[];if(g.includeAll){var e=g.allTitle||"All departments";c.push(d.mixin({facet:{value:e,count:b.nbHits}},d.cloneDeep(l)))}d.each(b.facets,function(a,b){d.each(a,function(a,e){c.push(d.mixin({facet:{facet:b,value:e,count:a}},d.cloneDeep(l)))})});for(var f=1;f=a)}}for(var h=this.__startIndex;h t.unconstrainedWidth?null:d:null;i.setStyle("width",f)}var g=i.getBoundingRect();o.width=g.width;var y=(i.style.margin||0)+2.1;o.height=g.height+y,o.y-=(o.height-c)/2}}}function rM(t){return"center"===t.position}function oM(t){var e,n,i=t.getData(),r=[],o=!1,a=(t.get("minShowLabelAngle")||0)*eM,s=i.getLayout("viewRect"),l=i.getLayout("r"),u=s.width,h=s.x,c=s.y,p=s.height;function d(t){t.ignore=!0}i.each((function(t){var s=i.getItemGraphicEl(t),c=s.shape,p=s.getTextContent(),f=s.getTextGuideLine(),g=i.getItemModel(t),y=g.getModel("label"),v=y.get("position")||g.get(["emphasis","label","position"]),m=y.get("distanceToLabelLine"),x=y.get("alignTo"),_=Er(y.get("edgeDistance"),u),b=y.get("bleedMargin"),w=g.getModel("labelLine"),S=w.get("length");S=Er(S,u);var M=w.get("length2");if(M=Er(M,u),Math.abs(c.endAngle-c.startAngle)0?"right":"left":k>0?"left":"right"}var B=Math.PI,F=0,G=y.get("rotate");if(j(G))F=G*(B/180);else if("center"===v)F=0;else if("radial"===G||!0===G){F=k<0?-A+B:-A}else if("tangential"===G&&"outside"!==v&&"outer"!==v){var W=Math.atan2(k,L);W<0&&(W=2*B+W),L>0&&(W=B+W),F=W-B}if(o=!!F,p.x=I,p.y=T,p.rotation=F,p.setStyle({verticalAlign:"middle"}),P){p.setStyle({align:D});var H=p.states.select;H&&(H.x+=p.x,H.y+=p.y)}else{var Y=p.getBoundingRect().clone();Y.applyTransform(p.getComputedTransform());var U=(p.style.margin||0)+2.1;Y.y-=U/2,Y.height+=U,r.push({label:p,labelLine:f,position:v,len:S,len2:M,minTurnAngle:w.get("minTurnAngle"),maxSurfaceAngle:w.get("maxSurfaceAngle"),surfaceNormal:new Ji(k,L),linePoints:C,textAlign:D,labelDistance:m,labelAlignTo:x,edgeDistance:_,bleedMargin:b,rect:Y,unconstrainedWidth:Y.width,labelStyleWidth:p.style.width})}s.setTextConfig({inside:P})}})),!o&&t.get("avoidLabelOverlap")&&function(t,e,n,i,r,o,a,s){for(var l=[],u=[],h=Number.MAX_VALUE,c=-Number.MAX_VALUE,p=0;p