diff options
author | mayx | 2025-04-09 14:26:40 +0000 |
---|---|---|
committer | mayx | 2025-04-09 14:26:40 +0000 |
commit | 78d65eae30c61e1ed82142dc68309caf5bad2309 (patch) | |
tree | d290348f2d2ea897e44117e0eafe556987e4bcba | |
parent | 7a450f5ec27d2e8682ab6e3516dce274f9362ba9 (diff) |
Update 4 files
- /css/gitalk.css - /assets/css/style.scss - /_layouts/default.html - /_layouts/post.html
-rw-r--r-- | _layouts/default.html | 3 | ||||
-rw-r--r-- | _layouts/post.html | 2 | ||||
-rw-r--r-- | assets/css/style.scss | 79 | ||||
-rw-r--r-- | css/gitalk.css | 27 |
4 files changed, 107 insertions, 4 deletions
diff --git a/_layouts/default.html b/_layouts/default.html index 2fb3fc3..a22d752 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -50,9 +50,6 @@ } </script> <script src="//instant.page/5.2.0" type="module" integrity="sha384-jnZyxPjiipYXnSU0ygqeac2q7CVYMbh84q0uHVRRxEtvFPiQYbXWUorga2aqZJ0z"></script> - <style> - .backToTop{display:none;width:18px;line-height:1.2;padding:5px 0;background-color:#000;color:#fff;font-size:12px;text-align:center;position:fixed;_position:absolute;right:10px;bottom:100px;_bottom:"auto";cursor:pointer;opacity:.6;filter:Alpha(opacity=60);} - </style> </head> <body> diff --git a/_layouts/post.html b/_layouts/post.html index 04a2a4c..b60072f 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -75,7 +75,7 @@ layout: default {% include toc.html html=content sanitize=true h_max=3 %} -{% if post.layout == "encrypt" %} {{content}} {% else %} <style>.post-content h1{text-indent:-8px;border-bottom: 1px solid #e5e5e5;}.post-content h2{text-indent:-6px;border-bottom: 1px solid #e5e5e5;}.post-content h3{text-indent:-5px;}.post-content h4{text-indent:-4px;}.post-content h5{text-indent:-3px;}.post-content h6{text-indent:-2px;}h1 .octicon,h2 .octicon,h3 .octicon,h4 .octicon,h5 .octicon,h6 .octicon{visibility:hidden;}h1:hover .octicon,h2:hover .octicon,h3:hover .octicon,h4:hover .octicon,h5:hover .octicon,h6:hover .octicon{visibility:visible;}.octicon{fill:currentColor;padding:0;margin-left:-16px;vertical-align:middle;}</style> <main class="post-content" role="main">{% include anchor_headings.html html=content beforeHeading=true anchorBody="<svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>" %}</main> {% endif %} +{% if post.layout == "encrypt" %} {{content}} {% else %} <main class="post-content" role="main">{% include anchor_headings.html html=content beforeHeading=true anchorBody="<svg class='octicon' viewBox='0 0 16 16' version='1.1' width='16' height='32' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>" %}</main> {% endif %} {% if page.tags %} <small style="display: block">tags: {% for tag in page.tags %}<a href="/search.html?keyword={{ tag | url_encode }}"><em>{{ tag }}</em></a>{% unless forloop.last %} - {% endunless %}{% endfor %} <span style="float: right;"><a href="{% if site.github %}{{ site.github.repository_url }}{% else %}https://gitlab.com/mayx/mayx.gitlab.io{% endif %}/tree/master/{{ page.path }}">查看原始文件</a></span></small> diff --git a/assets/css/style.scss b/assets/css/style.scss new file mode 100644 index 0000000..7b3c924 --- /dev/null +++ b/assets/css/style.scss @@ -0,0 +1,79 @@ +--- +--- + +@import "{{ site.theme }}"; + +.backToTop { + display: none; + width: 18px; + line-height: 1.2; + padding: 5px 0; + background-color: #000; + color: #fff; + font-size: 12px; + text-align: center; + position: fixed; + _position: absolute; + right: 10px; + bottom: 100px; + _bottom: "auto"; + cursor: pointer; + opacity: .6; + filter: Alpha(opacity=60); +} + +.post-content { + font-size: 15px; + line-height: 1.6; +} + +.post-content h1 { + text-indent: -8px; + border-bottom: 1px solid #e5e5e5; +} + +.post-content h2 { + text-indent: -6px; + border-bottom: 1px solid #e5e5e5; +} + +.post-content h3 { + text-indent: -5px; +} + +.post-content h4 { + text-indent: -4px; +} + +.post-content h5 { + text-indent: -3px; +} + +.post-content h6 { + text-indent: -2px; +} + +h1 .octicon, +h2 .octicon, +h3 .octicon, +h4 .octicon, +h5 .octicon, +h6 .octicon { + visibility: hidden; +} + +h1:hover .octicon, +h2:hover .octicon, +h3:hover .octicon, +h4:hover .octicon, +h5:hover .octicon, +h6:hover .octicon { + visibility: visible; +} + +.octicon { + fill: currentColor; + padding: 0; + margin-left: -16px; + vertical-align: middle; +} \ No newline at end of file diff --git a/css/gitalk.css b/css/gitalk.css index 365cad0..52ce950 100644 --- a/css/gitalk.css +++ b/css/gitalk.css @@ -875,6 +875,33 @@ .gt-container .gt-btn-login { margin-right: 0; } +.gt-btn-login::after { + content: "如果不想登录,请点击上方评论数跳转至对应ISSUE进行评论"; + position: absolute; + top: 100%; + left: 50%; + transform: translateX(-50%); + background: #333; + color: #fff; + padding: 8px 12px; + border-radius: 4px; + font-size: 12px; + white-space: nowrap; + opacity: 0; + visibility: hidden; + transition: opacity 0.2s, visibility 0.2s; + z-index: 10; +} +.gt-btn-login:hover::after { + opacity: 1; + visibility: visible; +} +.gt-btn-login::after { + margin-top: 8px; +} +.gt-btn-login::after { + box-shadow: 0 2px 8px rgba(0,0,0,0.15); +} .gt-container .gt-btn-preview { background-color: #fff; color: #6190e8; |