From 2baf150e728e29d400b0fd993a9d42d4656be040 Mon Sep 17 00:00:00 2001 From: Mara Date: Wed, 15 Mar 2023 10:07:04 +0100 Subject: [PATCH] rm --- .github/workflows/build.yml | 28 +++ .gitignore | 131 ++++++++++++++ LICENSE | 339 +++++++++++++++++++++++++++++++++++ dist/javascript.js | 1 + dist/styles.css | 1 + gulpfile.js | 22 +++ package.json | 13 ++ src/css/blog.css | 123 +++++++++++++ src/css/grid.css | 186 +++++++++++++++++++ src/css/img-grids-floats.css | 315 ++++++++++++++++++++++++++++++++ src/css/misc.css | 124 +++++++++++++ src/css/snippets.css | 49 +++++ src/js/chirpy.js | 32 ++++ src/js/mathjax.js | 16 ++ src/js/misc.js | 124 +++++++++++++ src/js/url_exist.js | 66 +++++++ src/js/wiki_hover.js | 98 ++++++++++ 17 files changed, 1668 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .gitignore create mode 100644 LICENSE create mode 100644 dist/javascript.js create mode 100644 dist/styles.css create mode 100644 gulpfile.js create mode 100644 package.json create mode 100644 src/css/blog.css create mode 100644 src/css/grid.css create mode 100644 src/css/img-grids-floats.css create mode 100644 src/css/misc.css create mode 100644 src/css/snippets.css create mode 100644 src/js/chirpy.js create mode 100644 src/js/mathjax.js create mode 100644 src/js/misc.js create mode 100644 src/js/url_exist.js create mode 100644 src/js/wiki_hover.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..90a678f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +name: Build + +on: + push: + branches: + - main + +permissions: write-all + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: '14.x' + - run: npm install + - run: npm run gulp + - name: push + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git add dist + git commit -m "Deploy distribition files" + git push diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7e0242f --- /dev/null +++ b/.gitignore @@ -0,0 +1,131 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +**/node_modules/* +package-lock.json \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d159169 --- /dev/null +++ b/LICENSE @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/dist/javascript.js b/dist/javascript.js new file mode 100644 index 0000000..dca7dc7 --- /dev/null +++ b/dist/javascript.js @@ -0,0 +1 @@ +function UrlExists(r,e){let i="",n="";0===e?(i=r.href,n=r.title):1===e&&(i=r.src,n=r.alt),(i=i.match(/index$/)?i.replace(/index$/,""):i).includes("%5C")&&(i=i.replace(/%5C/g,"/")),i=decodeURI(i),0===e?(r.href=i,0===(r.title=n).length&&(n=r.innerText,r.title=n)):1===e&&(r.src=i,r.alt=n);var a=new XMLHttpRequest;a.open("GET",i,!0),a.onload=function(e){if("404"!=a.status)return!0;var t=document.createElement("div");t.innerHTML=n,t.classList.add("not_found"),t.setAttribute("href",i);try{r.parentNode.replaceChild(t,r)}catch(e){}},a.send()}var p_search=/\.{2}\//gi;const not_found=[];for(var ht=document.querySelectorAll("a:not(img)"),i=0;i{e.forEach(e=>{"attributes"===e.type&&chirpy.setAttribute("data-chirpy-theme",mkDocsChirpyTranslator[mkDocs.dataset.mdColorScheme])})});k.observe(mkDocs,{attributes:!0,attributeFilter:["data-md-color-scheme"]})}window.MathJax={tex:{inlineMath:[["\\(","\\)"]],displayMath:[["\\[","\\]"]],processEscapes:!0,processEnvironments:!0},options:{ignoreHtmlClass:".*|",processHtmlClass:"arithmatex"}},document$.subscribe(()=>{MathJax.typesetPromise()});const header_links=document.querySelectorAll('a[href*="#"]');if(header_links)for(i=0;i *:not(.highlight)"),scr=/\^(.*)/gi,i=0;i{e.forEach(e=>{"attributes"===e.type&&t.body.setAttribute("class",mkDocsChirpyTranslator[r.dataset.mdColorScheme])})}).observe(r,{attributes:!0,attributeFilter:["data-md-color-scheme"]})}};var paletteSwitcher1=document.getElementById("__palette_1"),paletteSwitcher2=document.getElementById("__palette_2");const isMermaidPage=document.querySelector(".mermaid"),blogURL=(isMermaidPage&&(paletteSwitcher1.addEventListener("change",function(){location.reload()}),paletteSwitcher2.addEventListener("change",function(){location.reload()})),document.querySelector('meta[name="site_url"]')?document.querySelector('meta[name="site_url"]').content:location.origin);let position=["top","right","bottom","left"];try{const D=tippy(`.md-content a[href^="${blogURL}"]`,{content:"",allowHTML:!0,animation:"scale-subtle",theme:"translucent",followCursor:!0,arrow:!1,placement:position[Math.floor(Math.random()*position.length-1)],onShow(l){fetch(l.reference.href).then(e=>e.text()).then(e=>{e=(new DOMParser).parseFromString(e,"text/html");let t=e.querySelector("article");var r=e.querySelector("h1"),i=(r&&"Index"===r.innerText&&(a=decodeURI(e.querySelector('link[rel="canonical"]').href).split("/").filter(e=>e).pop(),r.innerText=a),t.querySelectorAll("img"));if(i)for(let e=0;e{console.log(e),l.hide(),l.destroy()})}})}catch{console.log("tippy error, ignore it")} \ No newline at end of file diff --git a/dist/styles.css b/dist/styles.css new file mode 100644 index 0000000..ead0598 --- /dev/null +++ b/dist/styles.css @@ -0,0 +1 @@ +.md-typeset hr{margin:0}.md-typeset .post{margin-bottom:1rem;padding:1em;transition:all .3s ease-in-out;left:0;position:relative}.post:hover{left:10px;position:relative;border-radius:5px}[data-md-color-scheme=default] .post:hover{box-shadow:3px 4px 10px #2f2f2f}[data-md-color-scheme=slate] .post:hover{box-shadow:3px 4px 10px #0000009e}.md-typeset .post .post-category{color:gray;font-size:small;float:right;width:100%}.md-typeset .post .post-title{margin:.25rem 0;text-decoration:none;font-size:1.3em}.md-typeset .post .post-info-wrap{display:flex}.md-typeset .post .post-info{width:100%}.md-typeset .post .post-banner{margin-top:-1rem;height:100%;max-height:4rem;border-radius:5px}.md-typeset .post .post-description{margin:0 1rem 0 0}.md-typeset .post .post-extra{margin:.5rem 1rem 0 0;font-size:small;color:#a9a9a9}.md-typeset .post .post-tags{margin:0;text-align:end}.md-typeset .post .post-date{margin:0}.md-typeset .git-revision-date-localized-plugin,.md-typeset .icon-text,.md-typeset .twemoji{vertical-align:middle;display:inline-block}.post-category>.twemoji{vertical-align:sub}.md-typeset .pages>.page{display:none}.md-typeset .pages>.page:target{display:block}.md-typeset .center{text-align:center}.md-typeset .pagination{display:inline-block;margin-top:.5em}.md-typeset .pagination a{color:var(--md-default-fg-color);float:left;padding:0 .5em;margin:0 .1em;text-decoration:none;border-radius:2em}.md-typeset .pagination a.active{background-color:var(--md-primary-fg-color);color:var(--md-primary-bg-color);font-weight:700}.md-typeset .pagination a:hover:not(.active){background-color:var(--md-accent-fg-color);color:var(--md-default-fg-color--light)}.md-grid{margin-left:auto;margin-right:auto;max-width:61rem}.md-typeset .grid:not(.admonition){grid-gap:.4rem;display:grid;margin:1em 0;grid-template-columns:repeat(auto-fit,minmax(16rem,1fr))}.md-typeset .grid.cards>:-webkit-any(ul,ol){display:contents}.md-typeset .grid.cards>:-moz-any(ul,ol){display:contents}.md-typeset .grid.cards>:is(ul,ol){display:contents}.md-typeset .grid.cards>:-webkit-any(ul,ol)>li,.md-typeset .grid>.card{border:.05rem solid var(--md-default-fg-color--lightest);border-radius:.1rem;display:block;margin:0;padding:.8rem;-webkit-transition:border .25s,box-shadow .25s;transition:border .25s,box-shadow .25s}.md-typeset .grid.cards>:-moz-any(ul,ol)>li,.md-typeset .grid>.card{border:.05rem solid var(--md-default-fg-color--lightest);border-radius:.1rem;display:block;margin:0;padding:.8rem;-moz-transition:border .25s,box-shadow .25s;transition:border .25s,box-shadow .25s}.md-typeset .grid.cards>:is(ul,ol)>li,.md-typeset .grid>.card{border:.05rem solid var(--md-default-fg-color--lightest);border-radius:.1rem;display:block;margin:0;padding:.8rem;transition:border .25s,box-shadow .25s}.md-typeset .grid.cards>:-webkit-any(ul,ol)>li:-webkit-any(:focus-within,:hover),.md-typeset .grid>.card:-webkit-any(:focus-within,:hover){border-color:transparent;box-shadow:var(--md-shadow-z2)}.md-typeset .grid.cards>:-moz-any(ul,ol)>li:-moz-any(:focus-within,:hover),.md-typeset .grid>.card:-moz-any(:focus-within,:hover){border-color:transparent;box-shadow:var(--md-shadow-z2)}.md-typeset .grid.cards>:is(ul,ol)>li:is(:focus-within,:hover),.md-typeset .grid>.card:is(:focus-within,:hover){border-color:transparent;box-shadow:var(--md-shadow-z2)}.md-typeset .grid.cards>:-webkit-any(ul,ol)>li>hr,.md-typeset .grid>.card>hr{margin-bottom:1em;margin-top:1em}.md-typeset .grid.cards>:-moz-any(ul,ol)>li>hr,.md-typeset .grid>.card>hr{margin-bottom:1em;margin-top:1em}.md-typeset .grid.cards>:is(ul,ol)>li>hr,.md-typeset .grid>.card>hr{margin-bottom:1em;margin-top:1em}.md-typeset .grid.cards>:-webkit-any(ul,ol)>li>:first-child,.md-typeset .grid>.card>:first-child{margin-top:0}.md-typeset .grid.cards>:-moz-any(ul,ol)>li>:first-child,.md-typeset .grid>.card>:first-child{margin-top:0}.md-typeset .grid.cards>:is(ul,ol)>li>:first-child,.md-typeset .grid>.card>:first-child{margin-top:0}.md-typeset .grid.cards>:-webkit-any(ul,ol)>li>:last-child,.md-typeset .grid>.card>:last-child{margin-bottom:0}.md-typeset .grid.cards>:-moz-any(ul,ol)>li>:last-child,.md-typeset .grid>.card>:last-child{margin-bottom:0}.md-typeset .grid.cards>:is(ul,ol)>li>:last-child,.md-typeset .grid>.card>:last-child{margin-bottom:0}.md-typeset .grid>*{margin-bottom:0;margin-top:0}.md-typeset .grid>:-webkit-any(.admonition,details){margin-bottom:0;margin-top:0}.md-typeset .grid>:-moz-any(.admonition,details){margin-bottom:0;margin-top:0}.md-typeset .grid>:is(.admonition,details){margin-bottom:0;margin-top:0}.md-typeset .grid>.highlight>*,.md-typeset .grid>.highlighttable,.md-typeset .grid>pre{margin-bottom:0;margin-top:0}.md-typeset .grid>.highlight>pre:only-child,.md-typeset .grid>.highlight>pre>code,.md-typeset .grid>.highlighttable,.md-typeset .grid>.highlighttable>tbody,.md-typeset .grid>.highlighttable>tbody>tr,.md-typeset .grid>.highlighttable>tbody>tr>.code,.md-typeset .grid>.highlighttable>tbody>tr>.code>.highlight,.md-typeset .grid>.highlighttable>tbody>tr>.code>.highlight>pre,.md-typeset .grid>.highlighttable>tbody>tr>.code>.highlight>pre>code{height:100%}.md-typeset .grid>.tabbed-set{margin-bottom:0;margin-top:0}.md-typeset .grid.cards>:is(ul,ol)>li>:first-child,.md-typeset .grid>.card>:first-child{background-color:var(--md-accent-fg-color--transparent);border-radius:5px}img,img.image-embed{--coremarg:1%;--extramarg:1%;--defaultwidth:60%;--minwidth:50px;--defaultzoomwidth:100%;--defaultscale:1.5}img[alt*="+side"]{width:20em;min-width:var(--minwidth);float:right;margin:0;margin-left:var(--coremarg)}@media screen and (max-width:59.9375em){img[alt*="+side"]{width:12.5em}}img[alt*="+rside"]{width:20em;min-width:var(--minwidth);float:left;margin:0;margin-right:var(--coremarg)}.image-embed[alt*="+"],.image-embed[alt*="-"]{contain:revert!important}img[alt*="+tape"]{position:relative;float:right;width:var(--defaultwidth);min-width:var(--minwidth);margin:auto;margin-left:var(--coremarg);transform:rotate(2deg)}img[alt*="+tape"]::before::before{content:"";position:absolute;margin:auto;width:30%;height:14%;top:-7%;left:35%;background:rgba(255,234,118,.377);clip-path:polygon(50% 0,100% 0,98% 10%,100% 20%,98% 30%,100% 40%,98% 50%,100% 60%,98% 70%,100% 80%,98% 90%,100% 100%,0 100%,2% 90%,0 80%,2% 70%,0 60%,2% 50%,0 40%,2% 30%,0 20%,2% 10%,0 0)}img[alt*="+pin"]{position:relative;float:right;width:var(--defaultwidth);min-width:var(--minwidth);margin:auto;margin-left:var(--coremarg);-webkit-transform:rotate(0);-moz-transform:rotate(0);-o-transform:rotate(0);-ms-transform:rotate(0);transform:rotate(2deg)}img[alt*="+pin"]::before::before{content:"";position:absolute;width:5px;height:5px;background-color:#4588cc;top:-3%;left:50%;border:solid #369 8px;border-radius:50%;box-shadow:#274d74 -5px 3px 1px}img[alt*="+portrait"]{float:right;position:relative;width:calc(var(--defaultwidth)/ 1.5);min-width:var(--minwidth);vertical-align:top;border:solid 5px;background-color:#000;clip-path:ellipse(40% 45% at 50% 50%)}img[alt*="+landscape"]{position:relative;width:var(--defaultwidth);min-width:var(--minwidth);float:right;border:solid 3px;background-color:#000;clip-path:ellipse(45% 35% at 50% 50%)}img[alt*="+banner"]{display:block;height:100px;overflow:hidden}img[alt*="+banner"]>img{margin-top:-130px}img[alt*="+hr"]{display:block;height:10px;overflow:hidden;border-radius:20px}img[alt*="+hr"]>img{margin-top:-200px}img[alt*="+right"]{position:relative;left:50%}img[alt*="+block"]{display:block}img[alt*="-left"]{float:left;margin:0;margin-right:var(--extramarg)}img[alt*="-right"]{float:right;margin:0;margin-left:var(--extramarg)}img[alt*="-fix"]{position:fixed}img[alt*="-abs"]{position:absolute}img[alt*="-thumb"]{width:6rem}img[alt*="-sm"]{width:13rem}img[alt*="-med"]{width:18rem}img[alt*="-lg"]{width:27rem}img[alt*="-huge"]{width:37rem}img[alt*="-cwidth"]{float:none;margin-left:-10%;width:67rem}img[alt*="-border1"]{border:solid #000 3px}img[alt*="-border2"]{border:solid #fff 3px}img[alt*="-bradius1"]{border-radius:5px}img[alt*="-bradius2"]{border-radius:20px}img[alt*="-bradiustl"]{border-top-left-radius:20px}img[alt*="-bradiusbr"]{border-bottom-right-radius:20px}img[alt*="-bradiustr"]{border-top-right-radius:20px}img[alt*="-bradiusbl"]{border-bottom-left-radius:20px}img[alt*="-bthick"]{border-width:5px}img[alt*="-bthin"]{border-width:1px}img[alt*="-shadow1"]>img{box-shadow:#a9a9a9 -2px 2px 2px}img[alt*="-glow"]{box-shadow:#a9a9a9 0 0 20px}img[alt*="-nofloat"]{display:inline-block;float:none}img[alt*="+pin"]:not(:active):hover,img[alt*="+tape"]:not(:active):hover{transform:scale(1.5) rotate(-2deg)}span[alt*="+grid"]{display:table-cell;vertical-align:middle;padding:3px}.workspace-leaf-content[data-mode=source] img[alt*="+grid"]{width:20em}.not_found{background-color:rgba(211,211,211,.521);display:inline-block;color:grey;border-radius:5px;padding-right:3px;padding-left:3px}[data-md-color-scheme=slate] .not_found{color:#b6b5b5!important;background-color:rgba(231,232,243,.185)}[data-md-color-scheme=slate] .not_found:hover{color:grey;background-color:#d3d3d3;cursor:not-allowed;filter:saturate(200%)}[data-md-color-scheme=default] .not_found:hover{color:grey;background-color:#d3d3d3;cursor:not-allowed;filter:saturate(200%)}[data-md-color-scheme=default] .citation{background-color:rgba(0,0,0,.1)!important}[data-md-color-scheme=slate] .citation{background-color:rgba(0,0,0,.1)!important}.citation{padding:10px;border-radius:5px}.link_citation{font-size:12px;display:flex;float:left}.citation>*{margin:0!important}code{display:inline-block}.md-typeset pre>code{word-break:break-word;white-space:pre-wrap}[data-md-color-scheme=slate] #mkdocs-content-password{background-color:rgba(0,0,0,.11)}[data-md-color-scheme=default] #mkdocs-content-password{background-color:#fff}#mkdocs-content-password{border-radius:5px;height:40px;width:50%;padding-left:10px}#mkdocs-decrypt-button{border-radius:5px;fill:var(--md-default-fg-color--light);height:30px;width:5%}.tippy{overflow:hidden!important;height:5%;border-radius:5px}[data-md-color-scheme=default] .tippy{border:1px solid #f5f5f5}[data-md-color-scheme=slate] .tippy{border:1px solid var(--md-default-fg-color--lightest)}[data-theme~=translucent]{background-color:var(--md-default-bg-color)!important;opacity:.9!important}[data-md-color-scheme=default] .tippy-box *{color:#000}.dark{background-color:var(--md-default-bg-color)}#mynetwork{border:none!important}.card{border:none!important;background-color:transparent!important}.dark#text{color:#fff}.light#text{color:#000}:root{--md-admonition-icon--grid:url('data:image/svg+xml;charset=utf-8,');--md-admonition-icon--infobox:url('data:image/svg+xml;charset=utf-8,')}.md-typeset .admonition.grid,.md-typeset .admonition.infobox,.md-typeset details.grid,.md-typeset details.infobox{border-color:transparent;background-color:transparent}.md-typeset .grid>.admonition-title,.md-typeset .grid>.summary,.md-typeset .infobox>.admonition-title,.md-typeset .infobox>.summary{display:none}.md-typeset .grid>.admonition-title::before,.md-typeset .grid>summary::before,.md-typeset .infobox>.admonition-title::before{background-color:transparent;-webkit-mask-image:var(--md-admonition-icon--grid);mask-image:var(--md-admonition-icon--grid)}.admonition.infobox{float:left;margin-right:.8rem;margin-top:0;width:11.7rem}.md-typeset .admonition.grid{box-shadow:none}.md-typeset .admonition.grid p:not(.admonition-title){display:grid}.md-typeset .admonition.grid .glightbox,.md-typeset .admonition.grid img{display:table-cell;vertical-align:middle;grid-row:2/4} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..0f4bc3f --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,22 @@ +const gulp = require('gulp'); +const concat = require('gulp-concat'); +const uglify = require('gulp-uglify'); +const cleanCSS = require('gulp-clean-css'); +gulp.task('scripts', function() { + return gulp.src(['src/js/url_exist.js', 'src/js/*.js']) + .pipe(concat('javascript.js')) + .pipe(uglify()) + .pipe(gulp.dest('dist')); + } +); + + +gulp.task("styles", function() { + return gulp.src("src/css/*.css") + .pipe(concat("styles.css")) + .pipe(cleanCSS()) + .pipe(gulp.dest("dist")); +}); + + +gulp.task('default', gulp.parallel('scripts', 'styles')); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..7b3d850 --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "name": "Assets", + "version": "1.0.0", + "scripts": { + "gulp": "gulp" + }, + "devDependencies": { + "gulp": "^4.0.2", + "gulp-clean-css": "^4.3.0", + "gulp-concat": "^2.6.1", + "gulp-uglify": "^3.0.2" + } +} diff --git a/src/css/blog.css b/src/css/blog.css new file mode 100644 index 0000000..638acd0 --- /dev/null +++ b/src/css/blog.css @@ -0,0 +1,123 @@ +.md-typeset hr { + margin: 0; +} + +/* post */ +.md-typeset .post { + margin-bottom: 1rem; + padding: 1em; + transition: all 0.3s ease-in-out; + left: 0; + position: relative; +} + +.post:hover { + left: 10px; + position: relative; + border-radius: 5px; +} + +[data-md-color-scheme="default"] .post:hover { + box-shadow: 3px 4px 10px #2f2f2f; +} + +[data-md-color-scheme="slate"] .post:hover { + box-shadow: 3px 4px 10px #0000009e; +} + +.md-typeset .post .post-category { + color: gray; + font-size: small; + float: right; + width: 100%; +} + +.md-typeset .post .post-title { + margin: 0.25rem 0; + text-decoration: none; + font-size: 1.3em; +} + +.md-typeset .post .post-info-wrap { + display: flex; +} + +.md-typeset .post .post-info { + width: 100%; +} + +.md-typeset .post .post-banner { + margin-top: -1rem; + height: 100%; + max-height: 4rem; + border-radius: 5px; +} + +.md-typeset .post .post-description { + margin: 0 1rem 0 0; +} + +.md-typeset .post .post-extra { + margin: 0.5rem 1rem 0 0; + font-size: small; + color: darkgray; +} + +.md-typeset .post .post-tags { + margin: 0; + text-align: end; +} + +.md-typeset .post .post-date { + margin: 0; +} + +.md-typeset .twemoji, +.md-typeset .icon-text, +.md-typeset .git-revision-date-localized-plugin { + vertical-align: middle; + display: inline-block; +} + +.post-category > .twemoji { + vertical-align: sub; +} + +/* page */ +.md-typeset .pages > .page { + display: none; +} + +.md-typeset .pages > .page:target { + display: block; +} + +/* pagination */ +.md-typeset .center { + text-align: center; +} + +.md-typeset .pagination { + display: inline-block; + margin-top: 0.5em; +} + +.md-typeset .pagination a { + color: var(--md-default-fg-color); + float: left; + padding: 0 0.5em; + margin: 0 0.1em; + text-decoration: none; + border-radius: 2em; +} + +.md-typeset .pagination a.active { + background-color: var(--md-primary-fg-color); + color: var(--md-primary-bg-color); + font-weight: bold; +} + +.md-typeset .pagination a:hover:not(.active) { + background-color: var(--md-accent-fg-color); + color: var(--md-default-fg-color--light); +} diff --git a/src/css/grid.css b/src/css/grid.css new file mode 100644 index 0000000..b7cdc7a --- /dev/null +++ b/src/css/grid.css @@ -0,0 +1,186 @@ +.md-grid { + margin-left: auto; + margin-right: auto; + max-width: 61rem; +} + +.md-typeset .grid:not(.admonition) { + grid-gap: 0.4rem; + display: grid; + margin: 1em 0; + grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); +} + +.md-typeset .grid.cards > :-webkit-any(ul, ol) { + display: contents; +} + +.md-typeset .grid.cards > :-moz-any(ul, ol) { + display: contents; +} + +.md-typeset .grid.cards > :is(ul, ol) { + display: contents; +} + +.md-typeset .grid.cards > :-webkit-any(ul, ol) > li, +.md-typeset .grid > .card { + border: 0.05rem solid var(--md-default-fg-color--lightest); + border-radius: 0.1rem; + display: block; + margin: 0; + padding: 0.8rem; + -webkit-transition: border 0.25s, box-shadow 0.25s; + transition: border 0.25s, box-shadow 0.25s; +} + +.md-typeset .grid.cards > :-moz-any(ul, ol) > li, +.md-typeset .grid > .card { + border: 0.05rem solid var(--md-default-fg-color--lightest); + border-radius: 0.1rem; + display: block; + margin: 0; + padding: 0.8rem; + -moz-transition: border 0.25s, box-shadow 0.25s; + transition: border 0.25s, box-shadow 0.25s; +} + +.md-typeset .grid.cards > :is(ul, ol) > li, +.md-typeset .grid > .card { + border: 0.05rem solid var(--md-default-fg-color--lightest); + border-radius: 0.1rem; + display: block; + margin: 0; + padding: 0.8rem; + transition: border 0.25s, box-shadow 0.25s; +} + +.md-typeset + .grid.cards + > :-webkit-any(ul, ol) + > li:-webkit-any(:focus-within, :hover), +.md-typeset .grid > .card:-webkit-any(:focus-within, :hover) { + border-color: transparent; + box-shadow: var(--md-shadow-z2); +} + +.md-typeset + .grid.cards + > :-moz-any(ul, ol) + > li:-moz-any(:focus-within, :hover), +.md-typeset .grid > .card:-moz-any(:focus-within, :hover) { + border-color: transparent; + box-shadow: var(--md-shadow-z2); +} + +.md-typeset .grid.cards > :is(ul, ol) > li:is(:focus-within, :hover), +.md-typeset .grid > .card:is(:focus-within, :hover) { + border-color: transparent; + box-shadow: var(--md-shadow-z2); +} + +.md-typeset .grid.cards > :-webkit-any(ul, ol) > li > hr, +.md-typeset .grid > .card > hr { + margin-bottom: 1em; + margin-top: 1em; +} + +.md-typeset .grid.cards > :-moz-any(ul, ol) > li > hr, +.md-typeset .grid > .card > hr { + margin-bottom: 1em; + margin-top: 1em; +} + +.md-typeset .grid.cards > :is(ul, ol) > li > hr, +.md-typeset .grid > .card > hr { + margin-bottom: 1em; + margin-top: 1em; +} + +.md-typeset .grid.cards > :-webkit-any(ul, ol) > li > :first-child, +.md-typeset .grid > .card > :first-child { + margin-top: 0; +} + +.md-typeset .grid.cards > :-moz-any(ul, ol) > li > :first-child, +.md-typeset .grid > .card > :first-child { + margin-top: 0; +} + +.md-typeset .grid.cards > :is(ul, ol) > li > :first-child, +.md-typeset .grid > .card > :first-child { + margin-top: 0; +} + +.md-typeset .grid.cards > :-webkit-any(ul, ol) > li > :last-child, +.md-typeset .grid > .card > :last-child { + margin-bottom: 0; +} + +.md-typeset .grid.cards > :-moz-any(ul, ol) > li > :last-child, +.md-typeset .grid > .card > :last-child { + margin-bottom: 0; +} + +.md-typeset .grid.cards > :is(ul, ol) > li > :last-child, +.md-typeset .grid > .card > :last-child { + margin-bottom: 0; +} + +.md-typeset .grid > * { + margin-bottom: 0; + margin-top: 0; +} + +.md-typeset .grid > :-webkit-any(.admonition, details) { + margin-bottom: 0; + margin-top: 0; +} + +.md-typeset .grid > :-moz-any(.admonition, details) { + margin-bottom: 0; + margin-top: 0; +} + +.md-typeset .grid > :is(.admonition, details) { + margin-bottom: 0; + margin-top: 0; +} + +.md-typeset .grid > .highlight > *, +.md-typeset .grid > .highlighttable, +.md-typeset .grid > pre { + margin-bottom: 0; + margin-top: 0; +} + +.md-typeset .grid > .highlight > pre:only-child, +.md-typeset .grid > .highlight > pre > code, +.md-typeset .grid > .highlighttable, +.md-typeset .grid > .highlighttable > tbody, +.md-typeset .grid > .highlighttable > tbody > tr, +.md-typeset .grid > .highlighttable > tbody > tr > .code, +.md-typeset .grid > .highlighttable > tbody > tr > .code > .highlight, +.md-typeset .grid > .highlighttable > tbody > tr > .code > .highlight > pre, +.md-typeset + .grid + > .highlighttable + > tbody + > tr + > .code + > .highlight + > pre + > code { + height: 100%; +} + +.md-typeset .grid > .tabbed-set { + margin-bottom: 0; + margin-top: 0; +} + +.md-typeset .grid.cards > :is(ul, ol) > li > :first-child, +.md-typeset .grid > .card > :first-child { + background-color: var(--md-accent-fg-color--transparent); + border-radius: 5px; +} diff --git a/src/css/img-grids-floats.css b/src/css/img-grids-floats.css new file mode 100644 index 0000000..41691fc --- /dev/null +++ b/src/css/img-grids-floats.css @@ -0,0 +1,315 @@ +/* +Image Flags Snippet by Lithou +http://github.com/lithou/sandbox +*/ + +img.image-embed, +img { + --coremarg: 1%; + --extramarg: 1%; + /* This margin is used for any added margin between items */ + --defaultwidth: 60%; + /*This is the default width for core flags such as the "side" and "tape" */ + --minwidth: 50px; + /* This specifies the minimum width that %based width images will go to*/ + --defaultzoomwidth: 100%; + /* this specifies the default width when an image is zoomed in (usually set active which is clicking with mouse) */ + --defaultscale: 1.5; + /* this specifies the default ratio that an image is zoomed in (usually set to hover) */ +} + +/* Core Flags */ + +/*side */ + +img[alt*="+side"] { + width: 20em; + min-width: var(--minwidth); + float: right; + margin: 0px; + margin-left: var(--coremarg); +} + +@media screen and (max-width: 59.9375em) { + img[alt*="+side"] { + width: 12.5em; + } +} + +img[alt*="+rside"] { + width: 20em; + min-width: var(--minwidth); + float: left; + margin: 0px; + margin-right: var(--coremarg); +} + +.image-embed[alt*="+"], +.image-embed[alt*="-"] { + contain: revert !important; +} + +/*tape */ + +img[alt*="+tape"] { + position: relative; + float: right; + width: var(--defaultwidth); + min-width: var(--minwidth); + margin: auto; + margin-left: var(--coremarg); + transform: rotate(2deg); +} + +img[alt*="+tape"]::before::before { + content: ""; + position: absolute; + margin: auto; + width: 30%; + height: 14%; + top: -7%; + left: 35%; + background: rgba(255, 234, 118, 0.377); + /*here you can chosse the scotch tape background*/ + clip-path: polygon( + 50% 0%, + 100% 0%, + 98% 10%, + 100% 20%, + 98% 30%, + 100% 40%, + 98% 50%, + 100% 60%, + 98% 70%, + 100% 80%, + 98% 90%, + 100% 100%, + 0% 100%, + 2% 90%, + 0% 80%, + 2% 70%, + 0% 60%, + 2% 50%, + 0% 40%, + 2% 30%, + 0% 20%, + 2% 10%, + 0% 0% + ); +} + +/* Push Pin */ + +img[alt*="+pin"] { + position: relative; + float: right; + width: var(--defaultwidth); + min-width: var(--minwidth); + margin: auto; + margin-left: var(--coremarg); + -webkit-transform: rotate(0deg); + -moz-transform: rotate(0deg); + -o-transform: rotate(0deg); + -ms-transform: rotate(0deg); + transform: rotate(2deg); +} + +img[alt*="+pin"]::before::before { + content: ""; + position: absolute; + width: 5px; + height: 5px; + background-color: #4588cc; + top: -3%; + left: 50%; + border: solid #336699 8px; + border-radius: 50%; + box-shadow: #274d74 -5px 3px 1px; +} + +/* Portrait and Landscape */ + +img[alt*="+portrait"] { + float: right; + position: relative; + width: calc(var(--defaultwidth) / 1.5); + min-width: var(--minwidth); + vertical-align: top; + border: solid 5px; + background-color: black; + /*this is the "border colour around the image */ + clip-path: ellipse(40% 45% at 50% 50%); +} + +img[alt*="+landscape"] { + position: relative; + width: var(--defaultwidth); + min-width: var(--minwidth); + float: right; + border: solid 3px; + background-color: black; + /* This setting will create a border effect of set color */ + clip-path: ellipse(45% 35% at 50% 50%); +} + +/* Banner and HR */ + +img[alt*="+banner"] { + display: block; + height: 100px; + overflow: hidden; +} + +img[alt*="+banner"] > img { + margin-top: -130px; +} + +img[alt*="+hr"] { + display: block; + height: 10px; + overflow: hidden; + border-radius: 20px; +} + +img[alt*="+hr"] > img { + margin-top: -200px; +} + +/*Custom Core Flags */ + +img[alt*="+right"] { + position: relative; + left: 50%; +} + +img[alt*="+block"] { + display: block; +} + +/* Modifier Flags */ + +/* Orientation and position */ + +img[alt*="-left"] { + float: left; + margin: 0px; + margin-right: var(--extramarg); +} + +img[alt*="-right"] { + float: right; + margin: 0px; + margin-left: var(--extramarg); +} + +img[alt*="-fix"] { + position: fixed; +} + +img[alt*="-abs"] { + position: absolute; +} + +/* Size */ + +img[alt*="-thumb"] { + width: 6rem; +} + +img[alt*="-sm"] { + width: 13rem; +} + +img[alt*="-med"] { + width: 18rem; +} + +img[alt*="-lg"] { + width: 27rem; +} + +img[alt*="-huge"] { + width: 37rem; +} + +img[alt*="-cwidth"] { + float: none; + margin-left: -10%; + width: 67rem; +} + +/* Borders */ + +img[alt*="-border1"] { + border: solid black 3px; +} + +img[alt*="-border2"] { + border: solid white 3px; +} + +img[alt*="-bradius1"] { + border-radius: 5px; +} + +img[alt*="-bradius2"] { + border-radius: 20px; +} + +img[alt*="-bradiustl"] { + border-top-left-radius: 20px; +} + +img[alt*="-bradiusbr"] { + border-bottom-right-radius: 20px; +} + +img[alt*="-bradiustr"] { + border-top-right-radius: 20px; +} + +img[alt*="-bradiusbl"] { + border-bottom-left-radius: 20px; +} + +img[alt*="-bthick"] { + border-width: 5px; +} + +img[alt*="-bthin"] { + border-width: 1px; +} + +/* Shadows */ + +img[alt*="-shadow1"] > img { + box-shadow: darkgrey -2px 2px 2px; +} + +img[alt*="-glow"] { + box-shadow: darkgrey 0px 0px 20px; +} + +img[alt*="-nofloat"] { + display: inline-block; + float: none; +} + +/* zoom and reverse rotate on hover */ + +img[alt*="+tape"]:not(:active):hover, +img[alt*="+pin"]:not(:active):hover { + transform: scale(1.5) rotate(-2deg); +} + +/* Grid View */ + +span[alt*="+grid"] { + display: table-cell; + vertical-align: middle; + padding: 3px; +} + +.workspace-leaf-content[data-mode="source"] img[alt*="+grid"] { + width: 20em; +} diff --git a/src/css/misc.css b/src/css/misc.css new file mode 100644 index 0000000..fda0d90 --- /dev/null +++ b/src/css/misc.css @@ -0,0 +1,124 @@ +.not_found { + background-color: rgba(211, 211, 211, 0.521); + display: inline-block; + color: grey; + border-radius: 5px; + padding-right: 3px; + padding-left: 3px; +} + +[data-md-color-scheme="slate"] .not_found { + color: rgb(182, 181, 181) !important; + background-color: rgba(231, 232, 243, 0.185); +} + +[data-md-color-scheme="slate"] .not_found:hover { + color: grey; + background-color: lightgrey; + cursor: not-allowed; + filter: saturate(200%); +} + +[data-md-color-scheme="default"] .not_found:hover { + color: grey; + background-color: lightgrey; + cursor: not-allowed; + filter: saturate(200%); +} + +[data-md-color-scheme="default"] .citation { + background-color: rgba(0, 0, 0, 0.1) !important; +} + +[data-md-color-scheme="slate"] .citation { + background-color: rgba(0, 0, 0, 0.1) !important; +} + +.citation { + padding: 10px; + border-radius: 5px; +} + +.link_citation { + font-size: 12px; + display: flex; + float: left; +} + +.citation > * { + margin: 0 !important; +} + +code { + display: inline-block; +} + +.md-typeset pre > code { + word-break: break-word; + white-space: pre-wrap; +} + +[data-md-color-scheme="slate"] #mkdocs-content-password { + background-color: rgba(0, 0, 0, 0.11); +} + +[data-md-color-scheme="default"] #mkdocs-content-password { + background-color: white; +} + +#mkdocs-content-password { + border-radius: 5px; + height: 40px; + width: 50%; + padding-left: 10px; +} + +#mkdocs-decrypt-button { + border-radius: 5px; + fill: var(--md-default-fg-color--light); + height: 30px; + width: 5%; +} + +.tippy { + overflow: hidden !important; + height: 5%; + border-radius: 5px; +} + +[data-md-color-scheme="default"] .tippy { + border: 1px solid whitesmoke; +} + +[data-md-color-scheme="slate"] .tippy { + border: 1px solid var(--md-default-fg-color--lightest); +} + +[data-theme~="translucent"] { + background-color: var(--md-default-bg-color) !important; + opacity: 0.9 !important; +} + +[data-md-color-scheme="default"] .tippy-box * { + color: black; +} + +.dark { + background-color: var(--md-default-bg-color); +} + +#mynetwork { + border: none !important; +} +.card { + border: none !important; + background-color: transparent !important; +} + +.dark#text { + color: white; +} + +.light#text { + color: black; +} diff --git a/src/css/snippets.css b/src/css/snippets.css new file mode 100644 index 0000000..acde612 --- /dev/null +++ b/src/css/snippets.css @@ -0,0 +1,49 @@ +:root { + --md-admonition-icon--grid: url('data:image/svg+xml;charset=utf-8,'); + --md-admonition-icon--infobox: url('data:image/svg+xml;charset=utf-8,'); +} + +.md-typeset .admonition.grid, +.md-typeset details.grid, +.md-typeset details.infobox, +.md-typeset .admonition.infobox { + border-color: transparent; + background-color: transparent; +} + +.md-typeset .grid > .admonition-title, +.md-typeset .infobox > .admonition-title, +.md-typeset .grid > .summary, +.md-typeset .infobox > .summary { + display: none; +} + +.md-typeset .grid > .admonition-title::before, +.md-typeset .grid > summary::before, +.md-typeset .infobox > .admonition-title::before { + background-color: transparent; + -webkit-mask-image: var(--md-admonition-icon--grid); + mask-image: var(--md-admonition-icon--grid); +} + +.admonition.infobox { + float: left; + margin-right: 0.8rem; + margin-top: 0; + width: 11.7rem; +} + +.md-typeset .admonition.grid { + box-shadow: none; +} + +.md-typeset .admonition.grid p:not(.admonition-title) { + display: grid; +} + +.md-typeset .admonition.grid .glightbox, +.md-typeset .admonition.grid img { + display: table-cell; + vertical-align: middle; + grid-row: 2 / 4; +} diff --git a/src/js/chirpy.js b/src/js/chirpy.js new file mode 100644 index 0000000..a28a5bf --- /dev/null +++ b/src/js/chirpy.js @@ -0,0 +1,32 @@ +const mkDocsChirpyTranslator = { + default: "light", + slate: "dark", +}; + +const mkDocs = document.querySelector("[data-md-color-scheme]"); +const chirpy = document.querySelector("[data-chirpy-theme]"); + +if (chirpy) { + //if mkdocs attribute at the first chargement is light, switch to light directly + if (mkDocs.getAttribute("data-md-color-scheme") === "default") { + chirpy.setAttribute("data-chirpy-theme", "light"); + } + + // create mutation observer to change chirpyTheme when mkDocs theme changes + const observer = new MutationObserver((mutations) => { + mutations.forEach((mutation) => { + if (mutation.type === "attributes") { + chirpy.setAttribute( + "data-chirpy-theme", + mkDocsChirpyTranslator[mkDocs.dataset.mdColorScheme] + ); + } + }); + }); + + // observe mkDocs theme change + observer.observe(mkDocs, { + attributes: true, + attributeFilter: ["data-md-color-scheme"], + }); +} diff --git a/src/js/mathjax.js b/src/js/mathjax.js new file mode 100644 index 0000000..117b046 --- /dev/null +++ b/src/js/mathjax.js @@ -0,0 +1,16 @@ +window.MathJax = { + tex: { + inlineMath: [["\\(", "\\)"]], + displayMath: [["\\[", "\\]"]], + processEscapes: true, + processEnvironments: true, + }, + options: { + ignoreHtmlClass: ".*|", + processHtmlClass: "arithmatex", + }, +}; + +document$.subscribe(() => { + MathJax.typesetPromise(); +}); diff --git a/src/js/misc.js b/src/js/misc.js new file mode 100644 index 0000000..0aace1f --- /dev/null +++ b/src/js/misc.js @@ -0,0 +1,124 @@ +//patch a href attributes +const header_links = document.querySelectorAll('a[href*="#"]'); +if (header_links) { + for (var i = 0; i < header_links.length; i++) { + const header = header_links[i].getAttribute("href").replace("^.*#", ""); + //replace " " with "-" + let header_fix = header.replace(/\s/g, "-"); + //replace any accent with the corresponding letter + header_fix = header.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); + header_links[i].setAttribute( + "href", + header_links[i].getAttribute("href").replace(header, header_fix) + ); + } +} + +function getHeightWidth(alt) { + const heightXwidthReg = new RegExp("\\d+x\\d+"); + const widthReg = new RegExp("\\d+"); + if (alt.match(heightXwidthReg)) { + var width = parseInt(alt.split("x")[0]); + var height = parseInt(alt.split("x")[1]); + return [width, height]; + } else if (alt.match(widthReg)) { + var width = parseInt(alt.match(widthReg)[0]); + return [width, 0]; + } else { + return [0, 0]; + } +} + +var p_img = /\.+\\/gi; +var img = document.querySelectorAll("img"); +for (var i = 0; i < img.length; i++) { + var regAlt = new RegExp("\\|"); + if (img[i].alt.match(regAlt)) { + const alt = img[i].alt.split("|"); + for (var part of alt) { + if (part.match(new RegExp("\\d+", "g"))) { + var size = getHeightWidth(part); + img[i].width = size[0] > 0 ? size[0] : img[i].width; + img[i].height = size[1] > 0 ? size[1] : img[i].height; + var partReg = new RegExp(`\\${part}`); + img[i].alt = img[i].alt.replace(partReg, ""); + } + } + } +} + +var ht = document.querySelectorAll( + "article.md-content__inner.md-typeset > *:not(.highlight)" +); +var scr = /\^(.*)/gi; +for (var i = 0; i < ht.length; i++) { + const fp = ht[i].innerHTML.match(scr); + if (fp) { + ht[i].innerHTML = ht[i].innerHTML.replace(fp, ""); + } +} +document.innerHTML = ht; + +var cite = document.querySelectorAll(".citation"); +if (cite) { + for (var i = 0; i < cite.length; i++) { + var img = cite[i].innerHTML.match(/!?(\[{2}|\[).*(\]{2}|\))/gi); + if (img) { + for (var j = 0; j < img.length; j++) { + cite[i].innerHTML = cite[i].innerHTML.replace(img[j], ""); + } + if (cite[i].innerText.trim().length < 2) { + cite[i].style.display = "none"; + } + } + } +} + +//get iframe from graph.md +// check if page is graph.md +window.onload = function () { + let frameElement = document.querySelector("iframe"); + if (!frameElement) { + return; + } + let doc = frameElement.contentDocument || frameElement.contentWindow.document; + let css = document.createElement("link"); + css.rel = "stylesheet"; + css.href = "css/template/utils.css"; + css.type = "text/css"; + doc.head.appendChild(css); + const theme = document.querySelector("[data-md-color-scheme]"); + if (theme.getAttribute("data-md-color-scheme") === "default") { + doc.body.setAttribute("class", "light"); + } else { + doc.body.setAttribute("class", "dark"); + } + const observer = new MutationObserver((mutations) => { + mutations.forEach((mutation) => { + if (mutation.type === "attributes") { + doc.body.setAttribute( + "class", + mkDocsChirpyTranslator[theme.dataset.mdColorScheme] + ); + } + }); + }); + observer.observe(theme, { + attributes: true, + attributeFilter: ["data-md-color-scheme"], + }); +}; + +var paletteSwitcher1 = document.getElementById("__palette_1"); +var paletteSwitcher2 = document.getElementById("__palette_2"); + +const isMermaidPage = document.querySelector(".mermaid"); +if (isMermaidPage) { + paletteSwitcher1.addEventListener("change", function () { + location.reload(); + }); + + paletteSwitcher2.addEventListener("change", function () { + location.reload(); + }); +} diff --git a/src/js/url_exist.js b/src/js/url_exist.js new file mode 100644 index 0000000..0511b38 --- /dev/null +++ b/src/js/url_exist.js @@ -0,0 +1,66 @@ +function UrlExists(url, type_url) { + let ref = ""; + let title = ""; + if (type_url === 0) { + ref = url.href; + title = url.title; + } else if (type_url === 1) { + ref = url.src; + title = url.alt; + } + if (ref.match(/index$/)) { + ref = ref.replace(/index$/, ""); + } + if (ref.includes("%5C")) { + ref = ref.replace(/%5C/g, "/"); + } + ref = decodeURI(ref); + if (type_url === 0) { + url.href = ref; + url.title = title; + if (title.length === 0) { + title = url.innerText; + url.title = title; + } + } else if (type_url === 1) { + url.src = ref; + url.alt = title; + } + + var http = new XMLHttpRequest(); + http.open("GET", ref, true); + http.onload = function (e) { + if (http.status == "404") { + const newItem = document.createElement("div"); + newItem.innerHTML = title; + newItem.classList.add("not_found"); + newItem.setAttribute("href", ref); + try { + url.parentNode.replaceChild(newItem, url); + } catch (error) { + // console.log(error) + } + } else { + return true; + } + }; + http.send(); +} + +var p_search = /\.{2}\//gi; +const not_found = []; +var ht = document.querySelectorAll("a:not(img)"); +for (var i = 0; i < ht.length; i++) { + if ( + !ht[i].getElementsByTagName("img").length > 0 && + !ht[i].getElementsByTagName("svg").length > 0 + ) { + var link = UrlExists(ht[i], 0); + } +} + +var p_img = /\.+\\/gi; +var img = document.querySelectorAll("img"); +for (var i = 0; i < img.length; i++) { + var link = UrlExists(img[i], 1); +} diff --git a/src/js/wiki_hover.js b/src/js/wiki_hover.js new file mode 100644 index 0000000..e79b4c0 --- /dev/null +++ b/src/js/wiki_hover.js @@ -0,0 +1,98 @@ +const blogURL = document.querySelector('meta[name="site_url"]') + ? document.querySelector('meta[name="site_url"]').content + : location.origin; +let position = ["top", "right", "bottom", "left"]; +try { + const tip = tippy(`.md-content a[href^="${blogURL}"]`, { + content: "", + allowHTML: true, + animation: "scale-subtle", + theme: "translucent", + followCursor: true, + arrow: false, + placement: position[Math.floor(Math.random() * position.length - 1)], + onShow(instance) { + fetch(instance.reference.href) + .then((response) => response.text()) + .then((html) => { + const parser = new DOMParser(); + const doc = parser.parseFromString(html, "text/html"); + let firstPara = doc.querySelector("article"); + const firstHeader = doc.querySelector("h1"); + if (firstHeader && firstHeader.innerText === "Index") { + const realFileName = decodeURI( + doc.querySelector('link[rel="canonical"]').href + ) + .split("/") + .filter((e) => e) + .pop(); + firstHeader.innerText = realFileName; + } + //broken link in first para + const brokenImage = firstPara.querySelectorAll("img"); + if (brokenImage) { + for (let i = 0; i < brokenImage.length; i++) { + const encodedImage = brokenImage[i]; + encodedImage.src = decodeURI(decodeURI(encodedImage.src)); + //replace broken image with encoded image in first para + encodedImage.src = encodedImage.src.replace( + location.origin, + blogURL + ); + } + } + const element1 = document.querySelector(`[id^="tippy"]`); + if (element1) { + element1.classList.add("tippy"); + } + const partOfText = instance.reference.href.replace(/.*#/, "#"); + if (partOfText.startsWith("#")) { + firstPara = doc.querySelector( + `[id="${partOfText.replace("#", "")}"]` + ); + + if (firstPara.tagName.startsWith("H")) { + firstPara = firstPara.nextElementSibling; + } else { + firstPara = firstPara.innerText + .replaceAll("↩", "") + .replaceAll("¶", ""); + } + if (firstPara.innerText.replace(partOfText).length === 0) { + firstPara = doc.querySelector("div.citation"); + } + + instance.popper.style.height = "auto"; + } else { + const height = Math.floor( + firstPara.innerText.split(" ").length / 100 + ); + if (height < 10 && height > 3) { + instance.popper.style.height = `50%`; + } + if (height < 3) { + instance.popper.style.height = `auto`; + } else if (height > 10) { + instance.popper.style.height = `${height - 5}%`; + } + } + + instance.popper.placement = + position[Math.floor(Math.random() * position.length)]; + if (firstPara.innerText.length > 0) { + instance.setContent(firstPara); + } else { + firstPara = doc.querySelector("article"); + instance.reference.href.replace(/.*#/, "#"); + } + }) + .catch((error) => { + console.log(error); + instance.hide(); + instance.destroy(); + }); + }, + }); +} catch { + console.log("tippy error, ignore it"); +}