mirror of
https://github.com/squidfunk/mkdocs-material.git
synced 2024-11-23 23:21:00 +01:00
Merge branch 'master' into feature/material-v9
This commit is contained in:
commit
e0dce6cc1d
16
CHANGELOG
16
CHANGELOG
@ -1,3 +1,19 @@
|
||||
mkdocs-material-8.5.11 (2022-11-30)
|
||||
|
||||
* Let it snow, see https://twitter.com/squidfunk/status/1597939243090788352
|
||||
|
||||
mkdocs-material-8.5.10+insiders-4.26.6 (2022-11-28)
|
||||
|
||||
* Fixed #4683: Tags plugin crashes when a tag is empty
|
||||
|
||||
mkdocs-material-8.5.10+insiders-4.26.5 (2022-11-27)
|
||||
|
||||
* Fixed #4632: Post excerpt title link doesn't point to top of the page
|
||||
|
||||
mkdocs-material-8.5.10+insiders-4.26.4 (2022-11-27)
|
||||
|
||||
* Fixed redundant file extension when using privacy plugin
|
||||
|
||||
mkdocs-material-8.5.10+insiders-4.26.3 (2022-11-15)
|
||||
|
||||
* Fixed #4637: Attachments w/o titles in related links error in blog plugin
|
||||
|
1
docs/.meta.yml
Normal file
1
docs/.meta.yml
Normal file
@ -0,0 +1 @@
|
||||
ᴴₒᴴₒᴴₒ: true
|
@ -2,6 +2,10 @@
|
||||
|
||||
## Material for MkDocs
|
||||
|
||||
### 8.5.11 <small>_ November 30, 2022</small> { id="8.5.11" }
|
||||
|
||||
- Let it snow, see https://twitter.com/squidfunk/status/1597939243090788352
|
||||
|
||||
### 8.5.10 <small>_ November 11, 2022</small> { id="8.5.10" }
|
||||
|
||||
- Adjusted CSS to better allow for custom primary and accent colors
|
||||
|
@ -1,6 +1,7 @@
|
||||
---
|
||||
template: home.html
|
||||
title: Material for MkDocs
|
||||
ᴴₒᴴₒᴴₒ: false
|
||||
---
|
||||
|
||||
Welcome to Material for MkDocs.
|
||||
|
@ -2,6 +2,18 @@
|
||||
|
||||
## Material for MkDocs Insiders
|
||||
|
||||
### 4.26.6 <small>_ November 28, 2022</small> { id="4.26.6" }
|
||||
|
||||
- Fixed #4683: Tags plugin crashes when a tag is empty
|
||||
|
||||
### 4.26.5 <small>_ November 27, 2022</small> { id="4.26.5" }
|
||||
|
||||
- Fixed #4632: Post excerpt title link doesn't point to top of the page
|
||||
|
||||
### 4.26.4 <small>_ November 27, 2022</small> { id="4.26.4" }
|
||||
|
||||
- Fixed redundant file extension when using privacy plugin
|
||||
|
||||
### 4.26.3 <small>_ November 15, 2022</small> { id="4.26.3" }
|
||||
|
||||
- Fixed #4637: Attachments w/o titles in related links error in blog plugin
|
||||
|
@ -136,9 +136,6 @@ contents:
|
||||
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
|
||||
```
|
||||
|
||||
1. At some point, GitLab renamed `master` to `main`. If your default branch
|
||||
is named `master`, you can safely remove `main`, vice versa.
|
||||
|
||||
=== "Insiders"
|
||||
|
||||
``` yaml
|
||||
|
@ -103,6 +103,18 @@
|
||||
"uniqueItems": true,
|
||||
"minItems": 1
|
||||
},
|
||||
"hooks": {
|
||||
"title": "Hooks",
|
||||
"markdownDescription": "https://www.mkdocs.org/user-guide/configuration/#hooks",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"title": "Path to Python file",
|
||||
"markdownDescription": "https://www.mkdocs.org/user-guide/configuration/#hooks",
|
||||
"pattern": "\\.py$"
|
||||
},
|
||||
"uniqueItems": true,
|
||||
"minItems": 1
|
||||
},
|
||||
"strict": {
|
||||
"title": "Strict mode",
|
||||
"markdownDescription": "https://www.mkdocs.org/user-guide/configuration/#strict",
|
||||
|
@ -9819,7 +9819,6 @@
|
||||
"simple/aparat",
|
||||
"simple/apollographql",
|
||||
"simple/apostrophe",
|
||||
"simple/appannie",
|
||||
"simple/appian",
|
||||
"simple/apple",
|
||||
"simple/applearcade",
|
||||
@ -9991,6 +9990,7 @@
|
||||
"simple/burton",
|
||||
"simple/buymeacoffee",
|
||||
"simple/buzzfeed",
|
||||
"simple/bvg",
|
||||
"simple/byjus",
|
||||
"simple/byte",
|
||||
"simple/bytedance",
|
||||
@ -10152,6 +10152,7 @@
|
||||
"simple/css3",
|
||||
"simple/cssmodules",
|
||||
"simple/csswizardry",
|
||||
"simple/cts",
|
||||
"simple/cucumber",
|
||||
"simple/curl",
|
||||
"simple/curseforge",
|
||||
@ -10181,7 +10182,6 @@
|
||||
"simple/dataiku",
|
||||
"simple/datastax",
|
||||
"simple/dataverse",
|
||||
"simple/dataversioncontrol",
|
||||
"simple/datocms",
|
||||
"simple/datto",
|
||||
"simple/dazn",
|
||||
@ -11570,6 +11570,7 @@
|
||||
"simple/smugmug",
|
||||
"simple/snapchat",
|
||||
"simple/snapcraft",
|
||||
"simple/sncf",
|
||||
"simple/snowflake",
|
||||
"simple/snowpack",
|
||||
"simple/snyk",
|
||||
|
2
docs/schema/plugins/external/redirects.json
vendored
2
docs/schema/plugins/external/redirects.json
vendored
@ -17,7 +17,7 @@
|
||||
{
|
||||
"title": "Internal redirect",
|
||||
"markdownDescription": "https://github.com/datarobot/mkdocs-redirects#using",
|
||||
"pattern": "\\.md$"
|
||||
"pattern": "\\.md(#\\S+)?$"
|
||||
},
|
||||
{
|
||||
"title": "External redirect",
|
||||
|
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m7.834 10.525 2.958 8.975-8.873-8.975zm8.325 0h5.862l-8.793 8.974zm-1.02-.401-3.169 9.691-3.17-9.691 3.17-3.231zM9.328 2.796h5.326L11.99 5.43zm6.7 6.712L12.75 6.213l3.027-3.043 6.305 6.338zM11.25 6.232 7.999 9.508h-6.08L8.211 3.17zm4.634-4.447-.006-.006H8.121C5.414 4.529 2.706 7.279 0 10.03l12 12.192c4-4.064 8.001-8.127 12-12.192l-8.115-8.244"/></svg>
|
Before Width: | Height: | Size: 422 B |
1
material/.icons/simple/bvg.svg
Normal file
1
material/.icons/simple/bvg.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.25 1.11c3.647 0 6.478 2.886 6.73 6.447.151 2.21-.535 4.019-2.158 5.674l-3.601 3.655-.154.157-.078.079-.214.217-.214.217a18348.219 18348.219 0 0 1-4.951 5.019c-.074.074-.323.302-.576.315h-.023c-.272 0-.534-.24-.6-.315l-4.89-4.958-.129-.13-.257-.261-.214-.218A5994.604 5994.604 0 0 1 2.2 13.23C.554 11.576-.13 9.768.02 7.557.27 3.997 3.103 1.11 6.75 1.11c2.353 0 3.704 1.416 5.25 3.027 1.536-1.61 2.897-3.027 5.25-3.027zm-4.02 6.48c-.26 0-.446.174-.511.48l-.6 3.092c-.043.294-.097.642-.12.87a5.71 5.71 0 0 0-.12-.87l-.663-3.093c-.065-.36-.283-.48-.534-.48-.392 0-.577.35-.479.763l1.013 4.193c.098.414.305.642.784.642.414 0 .664-.228.762-.686l.948-4.214c.087-.425-.153-.697-.48-.697zm2.995-.033c-1.274 0-2.101.85-2.101 2.832 0 1.884.37 2.787 2.003 2.787 1.013 0 1.48-.348 1.48-1.143v-1.634c0-.337-.107-.479-.412-.479h-.904c-.294 0-.436.142-.436.414 0 .25.163.392.436.392h.305v1.568a1.015 1.015 0 0 1-.35.044c-.73 0-1.077-.349-1.077-1.873 0-1.634.414-2.004 1.035-2.004.468 0 .697.163.925.163a.439.439 0 0 0 .294-.762c-.305-.24-.925-.305-1.198-.305Zm-8.091.065H7.056a.42.42 0 0 0-.436.414v4.716c0 .283.185.37.436.37h.99c1.406 0 1.721-.784 1.732-1.655 0-.556-.272-1.177-1.056-1.22.719-.153.904-.664.904-1.242 0-.718-.196-1.383-1.492-1.383zm-.185 3.018c.686 0 .74.37.74.86v.02c-.002.45-.074.852-.664.852h-.37v-1.733h.294zm.022-2.265c.577 0 .664.207.664.762v.071l-.001.03c-.01.325-.087.682-.718.682h-.25V8.374h.305z"/></svg>
|
After Width: | Height: | Size: 1.5 KiB |
1
material/.icons/simple/cts.svg
Normal file
1
material/.icons/simple/cts.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19.489 15.344c.05 0 .09.04.09.09v3.776c0 .05-.04.09-.09.09H16.44a.09.09 0 0 1-.075-.04.09.09 0 0 1-.007-.086l1.603-3.776a.09.09 0 0 1 .083-.055h1.444zm.97-7.892c1.083 0 2.183.358 3.272 1.065a.09.09 0 0 1 .03.12l-.86 1.537a.09.09 0 0 1-.13.033c-.803-.522-1.615-.786-2.412-.786-.6 0-1.312.13-1.312.746 0 .188.074.454.427.647.27.147.704.314 1.326.51.61.19 1.047.338 1.302.439.255.1.564.26.918.472.66.402.98 1.053.98 1.994 0 .944-.337 1.68-1.03 2.25-.604.494-1.36.776-2.253.838a.09.09 0 0 1-.097-.09v-1.762a.09.09 0 0 1 .078-.09c.22-.03.404-.097.55-.195a.694.694 0 0 0 .333-.6c0-.248-.15-.477-.45-.68-.286-.195-.703-.38-1.24-.548a14.265 14.265 0 0 1-1.22-.43 6.806 6.806 0 0 1-.956-.519c-.72-.448-1.07-1.094-1.07-1.975 0-.884.346-1.585 1.058-2.143.707-.553 1.633-.833 2.755-.833zm-15.786 0a.09.09 0 0 1 .096.09v2.106a.09.09 0 0 1-.076.09 2.662 2.662 0 0 0-1.38.668c-.52.471-.785 1.134-.785 1.971 0 .837.264 1.498.786 1.963.5.458 1.155.708 1.832.7.87 0 1.666-.416 2.368-1.238a.09.09 0 0 1 .068-.032.09.09 0 0 1 .068.03l1.393 1.566a.09.09 0 0 1-.004.124c-1.204 1.212-2.52 1.826-3.91 1.826-1.43 0-2.658-.459-3.644-1.362C.5 15.05 0 13.854 0 12.395S.506 9.733 1.503 8.82a5.097 5.097 0 0 1 3.17-1.367ZM16.831 4.7c.05 0 .09.04.09.09v2.13c0 .05-.04.09-.09.09h-3.417a.06.06 0 0 0-.06.06v8.545c0 .05-.04.09-.09.09h-2.51a.09.09 0 0 1-.09-.09V7.072a.06.06 0 0 0-.06-.06H7.186a.09.09 0 0 1-.09-.09V4.79a.09.09 0 0 1 .09-.09z"/></svg>
|
After Width: | Height: | Size: 1.5 KiB |
@ -1 +0,0 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M.291 4.508a.269.269 0 0 0-.201.094.304.304 0 0 0-.09.226v11.14a.309.309 0 0 0 .09.227c.025.03.055.054.09.07a.266.266 0 0 0 .111.024h3.92c1.552 0 2.886-.58 3.988-1.734a6.74 6.74 0 0 0 .783-.99l2.584 5.744c.066.122.156.183.274.183h.162c.118 0 .21-.06.275-.183l2.631-5.811c.234.389.515.757.86 1.102 1.145 1.142 2.532 1.714 4.16 1.714 1.55 0 2.868-.53 3.955-1.591.151-.154.156-.3.015-.444l-1.27-1.361c-.13-.141-.271-.146-.423-.016-.608.525-1.335.787-2.182.787-.91 0-1.67-.324-2.285-.974-.614-.65-.883-1.434-.883-2.354 0-.929.267-1.723.875-2.384.607-.662 1.366-.993 2.278-.993.845.001 1.578.28 2.197.836.13.13.267.13.408 0l1.27-1.328c.151-.154.145-.304-.02-.459-1.107-1.017-2.418-1.525-3.935-1.525-1.628 0-3.016.573-4.16 1.728a5.58 5.58 0 0 0-1.315 2.069l-2.467 5.63h-.1l-2.66-6.073c-.004-.01-.012-.012-.016-.021a5.615 5.615 0 0 0-1.084-1.596C7.02 5.094 5.82 4.625 4.211 4.508H.29zm2.217 2.474h1.54c.902 0 1.652.329 2.245.985.593.656.89 1.462.89 2.416.001.963-.296 1.773-.89 2.43-.594.656-1.342.984-2.244.984H2.508V6.982z"/></svg>
|
Before Width: | Height: | Size: 1.1 KiB |
1
material/.icons/simple/sncf.svg
Normal file
1
material/.icons/simple/sncf.svg
Normal file
@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M2.093 5.76c4.628 0 14.881.633 21.698 4.934.21.135.25.27.173.519-.039.115-2.151 6.74-2.151 6.74-.096.287-.25.287-.423.287H.384c-.25 0-.384-.172-.384-.384V6.182c0-.25.173-.384.46-.384.423 0 .96-.038 1.633-.038zm.288 6.355c-.384.941.71 1.517 1.67 1.959.788.345 1.345.71 1.133 1.113-.134.346-.71.5-1.478.5-.672 0-1.517-.212-2.19-.519l-.383.845c.5.211 1.478.519 2.342.557 1.594.038 2.65-.346 3.073-1.229.426-.976-.575-1.51-1.518-1.963l-.092-.045-.138-.066c-.787-.345-1.305-.557-1.17-.94.133-.461.92-.634 1.631-.596.346 0 .595.039.922.135l.25-.807c-.346-.077-.634-.096-1.057-.096-1.42-.038-2.688.346-2.995 1.152Zm13.595-1.21c-1.344 0-2.554.461-3.284 1.268 0 .038-.038.038-.077.038-.038 0-.038 0-.038-.038l.384-1.19h-1.133l-1.267 3.82c-.384-1.113-1.21-2.63-2.19-3.82H7.163l-.883 2.803c.442.345.576.595.73.921 0 0 0 .039.038.039 0 0 .038 0 .038-.039 0-.038.788-2.419.788-2.419a14.506 14.506 0 0 1 2.016 4.167h1.267l.634-1.997s0-.039.038-.039c0 0 .039 0 .039.039.172 1.229 1.44 2.074 3.225 2.074 1.133 0 2.19-.308 2.439-.423l.672-2.112h2.573l.25-.807h-2.612l.461-1.363h3.072l.288-.845h-4.34l-1.44 4.551c-.326.077-.71.096-1.094.096-.845 0-1.555-.211-1.94-.672a1.467 1.467 0 0 1-.326-1.267c.173-1.152 1.306-1.901 2.823-1.901.326 0 .634 0 .96.077l.327-.884c-.346-.076-.807-.076-1.23-.076z"/></svg>
|
After Width: | Height: | Size: 1.3 KiB |
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -16,5 +16,5 @@
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
{{ super() }}
|
||||
<script src="{{ 'assets/javascripts/custom.a42114f4.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/custom.83b17dfb.min.js' | url }}"></script>
|
||||
{% endblock %}
|
||||
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
8
material/assets/javascripts/bundle.cef3dc0e.min.js.map
Normal file
8
material/assets/javascripts/bundle.cef3dc0e.min.js.map
Normal file
File diff suppressed because one or more lines are too long
18
material/assets/javascripts/extra/bundle.f719a234.min.js
vendored
Normal file
18
material/assets/javascripts/extra/bundle.f719a234.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
material/assets/stylesheets/extra.c2715e54.min.css
vendored
Normal file
1
material/assets/stylesheets/extra.c2715e54.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1
material/assets/stylesheets/extra.c2715e54.min.css.map
Normal file
1
material/assets/stylesheets/extra.c2715e54.min.css.map
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
material/assets/stylesheets/main.47fa6176.min.css
vendored
Normal file
1
material/assets/stylesheets/main.47fa6176.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -22,7 +22,7 @@
|
||||
<link rel="canonical" href="{{ page.canonical_url }}">
|
||||
{% endif %}
|
||||
<link rel="icon" href="{{ config.theme.favicon | url }}">
|
||||
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-8.5.10">
|
||||
<meta name="generator" content="mkdocs-{{ mkdocs_version }}, mkdocs-material-8.5.11">
|
||||
{% endblock %}
|
||||
{% block htmltitle %}
|
||||
{% if page.meta and page.meta.title %}
|
||||
@ -34,7 +34,7 @@
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% block styles %}
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.38cbebe6.min.css' | url }}">
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/main.47fa6176.min.css' | url }}">
|
||||
{% if config.theme.palette %}
|
||||
{% set palette = config.theme.palette %}
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/palette.2505c338.min.css' | url }}">
|
||||
@ -243,10 +243,14 @@
|
||||
</script>
|
||||
{% endblock %}
|
||||
{% block scripts %}
|
||||
<script src="{{ 'assets/javascripts/bundle.58485186.min.js' | url }}"></script>
|
||||
<script src="{{ 'assets/javascripts/bundle.cef3dc0e.min.js' | url }}"></script>
|
||||
{% for path in config.extra_javascript %}
|
||||
<script src="{{ path | url }}"></script>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
{% if page.meta and page.meta.ᴴₒᴴₒᴴₒ %}
|
||||
<link rel="stylesheet" href="{{ 'assets/stylesheets/extra.c2715e54.min.css' | url }}">
|
||||
<script src="{{ 'assets/javascripts/extra/bundle.f719a234.min.js' | url }}" defer></script>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
|
648
package-lock.json
generated
648
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "mkdocs-material",
|
||||
"version": "8.5.10",
|
||||
"version": "8.5.11",
|
||||
"description": "Documentation that simply works",
|
||||
"keywords": [
|
||||
"mkdocs",
|
||||
@ -47,7 +47,7 @@
|
||||
"lunr": "^2.3.9",
|
||||
"lunr-languages": "^1.10.0",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"rxjs": "^7.5.7",
|
||||
"rxjs": "^7.6.0",
|
||||
"unfetch": "^4.2.0",
|
||||
"url-polyfill": "^1.1.12"
|
||||
},
|
||||
@ -60,16 +60,16 @@
|
||||
"@types/fuzzaldrin-plus": "^0.6.2",
|
||||
"@types/html-minifier": "^4.0.2",
|
||||
"@types/lunr": "^2.3.4",
|
||||
"@types/node": "^18.11.9",
|
||||
"@types/node": "^18.11.11",
|
||||
"@types/resize-observer-browser": "^0.1.7",
|
||||
"@types/sass": "^1.43.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.44.0",
|
||||
"@typescript-eslint/parser": "^5.44.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.45.1",
|
||||
"@typescript-eslint/parser": "^5.45.1",
|
||||
"autoprefixer": "^10.4.13",
|
||||
"chokidar": "^3.5.3",
|
||||
"cssnano": "5.1.0",
|
||||
"esbuild": "^0.15.15",
|
||||
"eslint": "^8.28.0",
|
||||
"esbuild": "^0.15.18",
|
||||
"eslint": "^8.29.0",
|
||||
"eslint-plugin-eslint-comments": "^3.2.0",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
"eslint-plugin-jsdoc": "^39.6.4",
|
||||
@ -90,8 +90,8 @@
|
||||
"preact": "^10.11.3",
|
||||
"rimraf": "^3.0.2",
|
||||
"sass": "^1.56.1",
|
||||
"simple-icons": "^7.21.0",
|
||||
"stylelint": "^14.15.0",
|
||||
"simple-icons": "^8.0.0",
|
||||
"stylelint": "^14.16.0",
|
||||
"stylelint-config-rational-order": "^0.1.2",
|
||||
"stylelint-config-recommended": "^9.0.0",
|
||||
"stylelint-config-standard-scss": "^6.1.0",
|
||||
|
@ -107,15 +107,21 @@ export function mountMermaid(
|
||||
mermaid$.subscribe(() => {
|
||||
el.classList.add("mermaid") // Hack: mitigate https://bit.ly/3CiN6Du
|
||||
const id = `__mermaid_${sequence++}`
|
||||
|
||||
/* Create host element to replace code block */
|
||||
const host = h("div", { class: "mermaid" })
|
||||
mermaid.mermaidAPI.render(id, el.textContent, (svg: string) => {
|
||||
const text = el.textContent
|
||||
|
||||
/* Render and inject diagram */
|
||||
mermaid.mermaidAPI.render(id, text, (svg: string, fn: Function) => {
|
||||
|
||||
/* Create a shadow root and inject diagram */
|
||||
const shadow = host.attachShadow({ mode: "closed" })
|
||||
shadow.innerHTML = svg
|
||||
|
||||
/* Replace code block with diagram */
|
||||
/* Replace code block with diagram and bind functions */
|
||||
el.replaceWith(host)
|
||||
fn?.(shadow)
|
||||
})
|
||||
})
|
||||
|
||||
|
104
src/assets/javascripts/extra/bundle.ts
Normal file
104
src/assets/javascripts/extra/bundle.ts
Normal file
@ -0,0 +1,104 @@
|
||||
/*
|
||||
* Copyright (c) 2016-2022 Martin Donath <martin.donath@squidfunk.com>
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to
|
||||
* deal in the Software without restriction, including without limitation the
|
||||
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
* sell copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
* IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import {
|
||||
NEVER,
|
||||
ReplaySubject,
|
||||
delay,
|
||||
distinctUntilChanged,
|
||||
filter,
|
||||
finalize,
|
||||
fromEvent,
|
||||
interval,
|
||||
merge,
|
||||
mergeMap,
|
||||
of,
|
||||
repeat,
|
||||
switchMap,
|
||||
take,
|
||||
takeUntil,
|
||||
tap,
|
||||
withLatestFrom
|
||||
} from "rxjs"
|
||||
|
||||
/* ----------------------------------------------------------------------------
|
||||
* Script
|
||||
* ------------------------------------------------------------------------- */
|
||||
|
||||
/* Append container for instances */
|
||||
const container = document.createElement("div")
|
||||
document.body.appendChild(container)
|
||||
|
||||
/* Append button next to palette toggle */
|
||||
const header = document.querySelector(".md-header__title")
|
||||
if (header) {
|
||||
const button = document.createElement("button")
|
||||
button.className = "md-header__button md-icon ᴴₒᴴₒᴴₒ__button"
|
||||
if (header.parentElement)
|
||||
header.insertAdjacentElement("afterend", button)
|
||||
|
||||
/* Toggle animation */
|
||||
const on$ = new ReplaySubject<boolean>(1)
|
||||
on$
|
||||
.pipe(
|
||||
distinctUntilChanged()
|
||||
)
|
||||
.subscribe(on => {
|
||||
sessionStorage.setItem("ᴴₒᴴₒᴴₒ", `${on}`)
|
||||
button.hidden = !on
|
||||
})
|
||||
|
||||
/* Load state from session storage */
|
||||
on$.next(JSON.parse(sessionStorage.getItem("ᴴₒᴴₒᴴₒ") || "true"))
|
||||
fromEvent(button, "click")
|
||||
.pipe(
|
||||
withLatestFrom(on$)
|
||||
)
|
||||
.subscribe(([, on]) => on$.next(!on))
|
||||
|
||||
/* Generate instances */
|
||||
interval(250)
|
||||
.pipe(
|
||||
takeUntil(on$.pipe(filter(on => !on))),
|
||||
take(75),
|
||||
repeat({ delay: () => on$.pipe(filter(on => on)) }),
|
||||
mergeMap(() => {
|
||||
const instance = document.createElement("div")
|
||||
instance.className = "ᴴₒᴴₒᴴₒ"
|
||||
instance.ariaHidden = "true"
|
||||
container.appendChild(instance)
|
||||
return merge(NEVER, of(instance))
|
||||
.pipe(
|
||||
finalize(() => instance.remove()),
|
||||
takeUntil(on$.pipe(filter(on => !on))),
|
||||
switchMap(el => fromEvent(el, "click")
|
||||
.pipe(
|
||||
tap(() => el.classList.add("ᴴₒᴴₒᴴₒ--ᵍₒᵗ꜀ᴴₐ")),
|
||||
delay(1000),
|
||||
tap(() => el.classList.remove("ᴴₒᴴₒᴴₒ--ᵍₒᵗ꜀ᴴₐ"))
|
||||
)
|
||||
)
|
||||
)
|
||||
})
|
||||
)
|
||||
.subscribe()
|
||||
}
|
105
src/assets/stylesheets/extra.scss
Normal file
105
src/assets/stylesheets/extra.scss
Normal file
@ -0,0 +1,105 @@
|
||||
////
|
||||
/// Copyright (c) 2016-2022 Martin Donath <martin.donath@squidfunk.com>
|
||||
///
|
||||
/// Permission is hereby granted, free of charge, to any person obtaining a
|
||||
/// copy of this software and associated documentation files (the "Software"),
|
||||
/// to deal in the Software without restriction, including without limitation
|
||||
/// the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
/// and/or sell copies of the Software, and to permit persons to whom the
|
||||
/// Software is furnished to do so, subject to the following conditions:
|
||||
///
|
||||
/// The above copyright notice and this permission notice shall be included in
|
||||
/// all copies or substantial portions of the Software.
|
||||
///
|
||||
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
/// FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
/// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
/// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
/// DEALINGS
|
||||
////
|
||||
|
||||
/* stylelint-disable */
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Keyframes
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// The actual magic
|
||||
@keyframes ᴴₒᴴₒᴴₒ {
|
||||
0% {
|
||||
transform: translate3d(var(--left-start), 0, 0);
|
||||
}
|
||||
100% {
|
||||
transform: translate3d(var(--left-end), 110vh, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Rules
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
// Adapted from Alvaro Monotoro, https://codepen.io/alvaromontoro/pen/GRNmdzB
|
||||
.ᴴₒᴴₒᴴₒ {
|
||||
--size: 1vw;
|
||||
|
||||
position: fixed;
|
||||
top: -5vh;
|
||||
z-index: 10;
|
||||
width: var(--size);
|
||||
height: var(--size);
|
||||
background: white;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 50%;
|
||||
cursor: pointer;
|
||||
transition: opacity 1s;
|
||||
opacity: 1;
|
||||
|
||||
// Generate instances
|
||||
@for $i from 1 through 75 {
|
||||
&:not(&--gotcha):nth-child(#{$i}) {
|
||||
--size: #{random(5) * 0.1}vw;
|
||||
--left-start: #{random(20) - 10}vw;
|
||||
--left-end: #{random(20) - 10}vw;
|
||||
|
||||
left: #{random(100)}vw;
|
||||
animation: ᴴₒᴴₒᴴₒ #{10 + random(10)}s linear infinite both;
|
||||
animation-delay: -#{random(10)}s;
|
||||
}
|
||||
}
|
||||
|
||||
// Blur every 5th instances
|
||||
&:nth-child(5n) {
|
||||
filter: blur(2px);
|
||||
}
|
||||
|
||||
// An instance was clicked
|
||||
&--ᵍₒᵗ꜀ᴴₐ {
|
||||
opacity: 0;
|
||||
}
|
||||
|
||||
// Toggle button
|
||||
&__button {
|
||||
display: block;
|
||||
}
|
||||
|
||||
// Toggle button enabled
|
||||
&__button::after {
|
||||
display: block;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
margin: 0 auto;
|
||||
background-color: currentcolor;
|
||||
mask-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m20.79 13.95-2.33.62-2-1.13v-2.88l2-1.13 2.33.62.52-1.93-1.77-.47.46-1.77-1.93-.52-.62 2.33-2 1.13L13 7.38V5.12l1.71-1.71L13.29 2 12 3.29 10.71 2 9.29 3.41 11 5.12v2.26L8.5 8.82l-2-1.13-.58-2.33L4 5.88l.47 1.77-1.77.47.52 1.93 2.33-.62 2 1.13v2.89l-2 1.13-2.33-.62-.52 1.93 1.77.47L4 18.12l1.93.52.62-2.33 2-1.13L11 16.62v2.26l-1.71 1.71L10.71 22 12 20.71 13.29 22l1.41-1.41-1.7-1.71v-2.26l2.5-1.45 2 1.13.62 2.33 1.88-.51-.47-1.77 1.77-.47-.51-1.93M9.5 10.56 12 9.11l2.5 1.45v2.88L12 14.89l-2.5-1.45v-2.88Z"/></svg>');
|
||||
mask-position: center;
|
||||
mask-repeat: no-repeat;
|
||||
mask-size: contain;
|
||||
content: "";
|
||||
}
|
||||
|
||||
// Toggle button disabled
|
||||
&__button[hidden]::after {
|
||||
mask-image: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11 5.12 9.29 3.41 10.71 2 12 3.29 13.29 2l1.42 1.41L13 5.12v2.26l2.45 1.44 2-1.13.62-2.33 1.93.52-.46 1.77 1.77.47-.52 1.93-2.33-.62-2 1.13v2.7L14.5 11.3v-.74l-1.76-1.02-2.01-2.01.27-.15V5.12m7.46 9.45-1.59-.9 2.68 2.68 1.75-.47-.51-1.93-2.33.62M13 16.62v2.26l1.7 1.71L13.29 22 12 20.71 10.71 22l-1.42-1.41L11 18.88v-2.26l-2.45-1.44-2 1.13-.62 2.33L4 18.12l.47-1.76-1.77-.47.52-1.93 2.33.62 2-1.13v-2.89l-2-1.13-2.33.62-.52-1.93 1.77-.47L4 5.89 1.11 3l1.28-1.27 19.72 19.73-1.27 1.27L14.1 16l-1.1.62m-1-1.73.63-.39-3.13-3.11v2.05l2.5 1.45Z"/></svg>');
|
||||
}
|
||||
}
|
@ -424,5 +424,17 @@
|
||||
<script src="{{ path | url }}"></script>
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
|
||||
<!-- ᴴₒᴴₒᴴₒ -->
|
||||
{% if page.meta and page.meta.ᴴₒᴴₒᴴₒ %}
|
||||
<link
|
||||
rel="stylesheet"
|
||||
href="{{ 'assets/stylesheets/extra.css' | url }}"
|
||||
/>
|
||||
<script
|
||||
src="{{ 'assets/javascripts/extra/bundle.js' | url }}"
|
||||
defer
|
||||
></script>
|
||||
{% endif %}
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user