Skip to content

Commit ec7ad26

Browse files
authored
feat: アラートを閉じるボタンを実装 (#77)
1 parent c728d75 commit ec7ad26

File tree

3 files changed

+13
-3
lines changed

3 files changed

+13
-3
lines changed

static/scripts/docs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ document.addEventListener("DOMContentLoaded", ()=>{
633633
const t = document.querySelector("#page-overview > ul");
634634
t && setUpOnPageNavigation(t),
635635
setUpCollapsingSidebar(document.querySelector("nav.folding"));
636-
//alertClose(document.querySelector("button.close"));
636+
alertClose(document.getElementById("closeAlertButton"));
637637
for (const n of document.querySelectorAll("div.tooltip-context"))
638638
setUpTooltip(n);
639639
const e = document.querySelector(".page-end-buttons a.previous")

static/styles/docs-cn.css renamed to static/styles/custom.css

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,12 @@ p {
1111

1212
.alert-content {
1313
margin: 1em 2em;
14-
}
14+
}
15+
16+
.alert > button {
17+
position: absolute;
18+
top: 1em;
19+
right: 0.25em;
20+
background: none;
21+
border: none;
22+
}

templates/base_template.html.j2

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<link rel="manifest" href="/assets/site.webmanifest">
2828
<link rel="stylesheet" href="/styles/default.css?bust=20230913?d=2023-09-16">
2929
<link rel="stylesheet" href="/styles/docs.css?bust=20230915?d=2023-09-16">
30-
<link rel="stylesheet" href="/styles/docs-cn.css">
30+
<link rel="stylesheet" href="/styles/custom.css">
3131
<link rel="preload" href="/assets/fonts/HKGrotesk-Regular.woff2" as="font">
3232
<link rel="preload" href="/assets/fonts/HKGrotesk-Bold.woff2" as="font">
3333
<link rel="preload" href="/assets/fonts/HKGrotesk-SemiBold.woff2" as="font">
@@ -44,6 +44,8 @@
4444
<br />
4545
<span><b>Warning:</b> This site provides an unofficial translation of the <a href="https://typst.app/docs/">Typst v0.12.0 documentation</a> by the Japanese Community. Please note that there may be some inaccuracies, untranslated sections or outdated information. We highly recommend referring to <a href="https://typst.app/docs/">the latest official documentation</a> as well. If you find any errors in the content, <a href="https://github.com/typst-jp/typst-jp.github.io">please let us know through our GitHub repository.</a> If you are interested in our community, feel free to join <a href="https://discord.gg/9xF7k4aAuH">our unofficial Discord server, “Kumihan Club.”</a></span>
4646
</div>
47+
<button id="closeAlertButton" class="close"><img alt="Close" src="/assets/icons/16-close-dark.svg"
48+
width="16" height="16"></button>
4749
</div>
4850
<header class="boring">
4951
<div><a href="/docs" class="logo-box"><svg width="91" height="35" viewBox="0 0 91 35" role="img"

0 commit comments

Comments
 (0)