diff --git a/docs/index.md b/docs/index.md index afdd33719..80e7bdf3a 100644 --- a/docs/index.md +++ b/docs/index.md @@ -4,18 +4,17 @@ glightbox: false hide: - footer - toc + - edit --- -

- -
+
-

《 Hello 算法 》

+

《 Hello 算法 》

-

动画图解、一键运行的数据结构与算法教程

+

动画图解、一键运行的数据结构与算法教程

@@ -85,7 +84,7 @@ hide:

动画图解

- +

内容清晰易懂
学习曲线平滑

@@ -102,7 +101,7 @@ hide:

一键运行

- +

十余种编程语言
代码可直接运行

@@ -117,7 +116,7 @@ hide:

互助学习

- +

欢迎讨论与提问
读者间携手共进

diff --git a/overrides/partials/LICENSE b/overrides/partials/LICENSE new file mode 100644 index 000000000..98d7a71b5 --- /dev/null +++ b/overrides/partials/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2016-2023 Martin Donath + +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. \ No newline at end of file diff --git a/overrides/partials/actions.html b/overrides/partials/actions.html new file mode 100644 index 000000000..86eace6ea --- /dev/null +++ b/overrides/partials/actions.html @@ -0,0 +1,32 @@ + +{% if page.edit_url %} + + + {% if "content.action.edit" in features and "edit" not in page.meta.hide %} +
+ {% set icon = config.theme.icon.edit or "material/file-edit-outline" %} + {% include ".icons/" ~ icon ~ ".svg" %} + + {% endif %} + + + {% if "content.action.view" in features %} + {% if "/blob/" in page.edit_url %} + {% set part = "blob" %} + {% else %} + {% set part = "edit" %} + {% endif %} + + {% set icon = config.theme.icon.view or "material/file-eye-outline" %} + {% include ".icons/" ~ icon ~ ".svg" %} + + {% endif %} +{% endif %} \ No newline at end of file diff --git a/overrides/partials/content.html b/overrides/partials/content.html index dc2639dc7..38323c9ae 100644 --- a/overrides/partials/content.html +++ b/overrides/partials/content.html @@ -1,25 +1,3 @@ - - {% if "material/tags" in config.plugins and tags %} {% include "partials/tags.html" %} @@ -28,14 +6,6 @@ {% include "partials/actions.html" %} - -{% if "\x3ch1" not in page.content %} -

{{ page.title | d(config.site_name, true)}}

-{% endif %} - {{ page.content }} diff --git a/overrides/stylesheets/extra.css b/overrides/stylesheets/extra.css index e56731cda..08e4af7b2 100644 --- a/overrides/stylesheets/extra.css +++ b/overrides/stylesheets/extra.css @@ -15,7 +15,10 @@ --md-admonition-fg-color: #1d1d20; --md-typeset-color: #1d1d20; - --md-typeset-a-color: #2aa996; + --md-typeset-a-color: #349890; + + --md-typeset-btn-color: #55aea6; + --md-typeset-btn-hover-color: #52bbb1; } [data-md-color-scheme="slate"] { @@ -35,7 +38,10 @@ --md-footer-fg-color: #adbac7; --md-typeset-color: #adbac7; - --md-typeset-a-color: #21c8b8 !important; + --md-typeset-a-color: #52bbb1 !important; + + --md-typeset-btn-color: #52bbb1; + --md-typeset-btn-hover-color: #55aea6; } /* https://github.com/squidfunk/mkdocs-material/issues/4832#issuecomment-1374891676 */ @@ -99,10 +105,6 @@ text-transform: none; } -.md-typeset svg { - fill: var(--md-primary-bg-color); -} - /* font-family setting for Win10 */ body { --md-text-font-family: -apple-system, BlinkMacSystemFont, @@ -125,12 +127,11 @@ body { } /* landing page */ -.responsive-div { +.header-img-div { display: flex; align-items: center; justify-content: center; - margin-left: auto; - margin-right: auto; + margin: 0 auto; width: 100%; /* Default to full width */ } @@ -143,22 +144,20 @@ body { padding: 9px 18px; /* Padding around the text */ margin: 0.15em 0; border: none; /* Removes default border */ - background-color: #52bbb1; /* Background color */ - color: #1d1d20 !important; /* Text color */ + background-color: var(--md-typeset-btn-color); /* Background color */ + color: var(--md-primary-fg-color) !important; /* Text color */ font-size: 0.85em; /* Font size */ text-align: center; /* Center the text */ text-decoration: none; /* Remove underline from anchor text */ cursor: pointer; /* Pointer cursor on hover */ - transition: background-color 0.3s; /* Smooth transition for background color */ - box-shadow: var(--md-shadow-z1); } .rounded-button:hover { - background-color: #399188; /* Darker shade on hover */ + background-color: var(--md-typeset-btn-hover-color); } .rounded-button svg { - fill: #1d1d20; /* Fill SVG icon with text color */ + fill: var(--md-primary-fg-color); /* Fill SVG icon with text color */ width: 1.2em; height: auto; margin-right: 0.5em; /* Add some space between the SVG icon and the text */