Skip to content

Commit 2ae9dda

Browse files
author
committed
Deployed fcbcf93 with MkDocs version: 1.6.1
1 parent b5d7b7b commit 2ae9dda

5 files changed

Lines changed: 30 additions & 13 deletions

File tree

assets/javascripts/online-compile.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@
6464
function createHeaderButton() {
6565
const a = document.createElement("a");
6666
a.href = "https://godbolt.org/";
67-
a.className = "md-button online-compile-header-button";
67+
a.className = "md-header__button md-icon online-compile-header-button";
6868
a.title = "在线编译(打开 Compiler Explorer)";
6969
a.setAttribute("aria-label", a.title);
70-
a.textContent = "在线编译";
70+
a.innerHTML =
71+
'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" aria-hidden="true">' +
72+
'<path d="M10 17l6-5-6-5v10ZM19 19H5V5h14v14Zm0-16H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2Z"/>' +
73+
"</svg>";
7174

7275
a.addEventListener("click", (e) => {
7376
e.preventDefault();

assets/javascripts/theme-palette.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,11 +208,13 @@
208208
if (cfg?.primary && isHexColor(cfg.primary)) primaryInput.value = cfg.primary;
209209
if (cfg?.accent && isHexColor(cfg.accent)) accentInput.value = cfg.accent;
210210
overlay.hidden = false;
211+
overlay.style.removeProperty("display");
211212
document.documentElement.classList.add("theme-palette-open");
212213
}
213214

214215
function closePanel() {
215216
overlay.hidden = true;
217+
overlay.style.display = "none";
216218
document.documentElement.classList.remove("theme-palette-open");
217219
}
218220

@@ -222,10 +224,16 @@
222224
}
223225

224226
overlay.addEventListener("click", (e) => {
225-
if (e.target === overlay) closePanel();
226-
});
227+
const t = e.target;
228+
if (!(t instanceof Node)) return;
229+
if (t === overlay) closePanel();
230+
if (t instanceof Element && t.closest(".theme-palette-close")) closePanel();
231+
}, { capture: true });
227232

228-
close.addEventListener("click", () => closePanel());
233+
close.addEventListener("click", (e) => {
234+
e.preventDefault();
235+
closePanel();
236+
});
229237
document.addEventListener("keydown", (e) => {
230238
if (!overlay.hidden && e.key === "Escape") closePanel();
231239
});
@@ -265,6 +273,10 @@
265273
const { overlay, open } = createDialog();
266274
document.body.appendChild(overlay);
267275

276+
overlay.hidden = true;
277+
overlay.style.display = "none";
278+
document.documentElement.classList.remove("theme-palette-open");
279+
268280
ensureHeaderButton(() => open());
269281
}
270282

assets/stylesheets/online-compile.css

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,14 @@
22
display: inline-flex;
33
align-items: center;
44
justify-content: center;
5-
margin-right: 0.5rem;
6-
padding: 0.25rem 0.6rem;
7-
font-size: 0.7rem;
8-
line-height: 1.2;
5+
margin-right: 0.25rem;
96
}
107

118
.md-header .online-compile-header-button {
129
white-space: nowrap;
1310
}
11+
12+
.online-compile-header-button svg {
13+
width: 1.2rem;
14+
height: 1.2rem;
15+
}

index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
<div data-md-component="skip">
7979

8080

81-
<a href="#qrcraft" class="md-skip">
81+
<a href="#qtcraft" class="md-skip">
8282
跳转至
8383
</a>
8484

@@ -1605,8 +1605,8 @@
16051605

16061606

16071607

1608-
<h1 id="qrcraft">QrCraft 开发文档<a class="headerlink" href="#qrcraft" title="Permanent link">&para;</a></h1>
1609-
<p>欢迎来到 QrCraft 开发文档。这是一个关于 Qt、C++ 和 QML 开发的学习资源库。</p>
1608+
<h1 id="qtcraft">QtCraft 开发文档<a class="headerlink" href="#qtcraft" title="Permanent link">&para;</a></h1>
1609+
<p>欢迎来到 QtCraft 开发文档。这是一个关于 Qt、C++ 和 QML 开发的学习资源库。</p>
16101610
<h2 id="_1">快速导航<a class="headerlink" href="#_1" title="Permanent link">&para;</a></h2>
16111611
<ul>
16121612
<li><strong><a href="cpp/00-%E7%9B%AE%E5%BD%95/">C++ 基础</a></strong>: 从零开始学习 C++ 语言核心特性。</li>

search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)