Skip to content

Commit

Permalink
deploy: f3f3638
Browse files Browse the repository at this point in the history
  • Loading branch information
MR-Addict committed Jan 14, 2024
1 parent 1a6feb0 commit 18faada
Show file tree
Hide file tree
Showing 21 changed files with 216 additions and 85 deletions.
4 changes: 3 additions & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,9 @@
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded "><a href="intro.html"><strong aria-hidden="true">1.</strong> Intro</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li class="chapter-item expanded "><a href="ignore-embeds.html"><strong aria-hidden="true">3.</strong> Ignore Embeds</a></li><li class="chapter-item expanded "><a href="global-configuration.html"><strong aria-hidden="true">4.</strong> Global Configuration</a></li><li class="chapter-item expanded "><a href="third-party/intro.html"><strong aria-hidden="true">5.</strong> Third Party Apps</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="third-party/gist.html"><strong aria-hidden="true">5.1.</strong> Gist</a></li><li class="chapter-item "><a href="third-party/youtube.html"><strong aria-hidden="true">5.2.</strong> Youtube</a></li><li class="chapter-item "><a href="third-party/bilibili.html"><strong aria-hidden="true">5.3.</strong> Bilibili</a></li><li class="chapter-item "><a href="third-party/codesandbox.html"><strong aria-hidden="true">5.4.</strong> Codesandbox</a></li><li class="chapter-item "><a href="third-party/stackblitz.html"><strong aria-hidden="true">5.5.</strong> Stackblitz</a></li><li class="chapter-item "><a href="third-party/codepen.html"><strong aria-hidden="true">5.6.</strong> Codepen</a></li></ol></li><li class="chapter-item expanded "><a href="local/intro.html"><strong aria-hidden="true">6.</strong> Local Apps</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="local/scroll-to-top.html"><strong aria-hidden="true">6.1.</strong> Scroll to Top</a></li><li class="chapter-item "><a href="local/announcement-banner.html"><strong aria-hidden="true">6.2.</strong> Announcement Banner</a></li></ol></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>

<!-- Track and set sidebar scroll position -->
Expand Down
35 changes: 27 additions & 8 deletions css/chrome.css
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,14 @@ pre > .buttons button {
/* On mobile, make it easier to tap buttons. */
padding: 0.3rem 1rem;
}

.sidebar-resize-indicator {
/* Hide resize indicator on devices with limited accuracy */
display: none;
}
}
pre > code {
display: block;
padding: 1rem;
}

Expand Down Expand Up @@ -422,22 +428,35 @@ ul#searchresults span.teaser em {
position: absolute;
cursor: col-resize;
width: 0;
right: 0;
right: calc(var(--sidebar-resize-indicator-width) * -1);
top: 0;
bottom: 0;
display: flex;
align-items: center;
}

.sidebar-resize-handle .sidebar-resize-indicator {
width: 100%;
height: 12px;
background-color: var(--icons);
margin-inline-start: var(--sidebar-resize-indicator-space);
}

[dir=rtl] .sidebar .sidebar-resize-handle {
left: calc(var(--sidebar-resize-indicator-width) * -1);
right: unset;
}
[dir=rtl] .sidebar .sidebar-resize-handle { right: unset; left: 0; }
.js .sidebar .sidebar-resize-handle {
cursor: col-resize;
width: 5px;
width: calc(var(--sidebar-resize-indicator-width) - var(--sidebar-resize-indicator-space));
}
/* sidebar-hidden */
#sidebar-toggle-anchor:not(:checked) ~ .sidebar {
transform: translateX(calc(0px - var(--sidebar-width)));
transform: translateX(calc(0px - var(--sidebar-width) - var(--sidebar-resize-indicator-width)));
z-index: -1;
}
[dir=rtl] #sidebar-toggle-anchor:not(:checked) ~ .sidebar {
transform: translateX(var(--sidebar-width));
transform: translateX(calc(var(--sidebar-width) + var(--sidebar-resize-indicator-width)));
}
.sidebar::-webkit-scrollbar {
background: var(--sidebar-bg);
Expand All @@ -448,15 +467,15 @@ ul#searchresults span.teaser em {

/* sidebar-visible */
#sidebar-toggle-anchor:checked ~ .page-wrapper {
transform: translateX(var(--sidebar-width));
transform: translateX(calc(var(--sidebar-width) + var(--sidebar-resize-indicator-width)));
}
[dir=rtl] #sidebar-toggle-anchor:checked ~ .page-wrapper {
transform: translateX(calc(0px - var(--sidebar-width)));
transform: translateX(calc(0px - var(--sidebar-width) - var(--sidebar-resize-indicator-width)));
}
@media only screen and (min-width: 620px) {
#sidebar-toggle-anchor:checked ~ .page-wrapper {
transform: none;
margin-inline-start: var(--sidebar-width);
margin-inline-start: calc(var(--sidebar-width) + var(--sidebar-resize-indicator-width));
}
[dir=rtl] #sidebar-toggle-anchor:checked ~ .page-wrapper {
transform: none;
Expand Down
2 changes: 1 addition & 1 deletion css/print.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
}

#page-wrapper.page-wrapper {
transform: none;
transform: none !important;
margin-inline-start: 0px;
overflow-y: initial;
}
Expand Down
2 changes: 2 additions & 0 deletions css/variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

:root {
--sidebar-width: 300px;
--sidebar-resize-indicator-width: 8px;
--sidebar-resize-indicator-space: 2px;
--page-padding: 15px;
--content-max-width: 750px;
--menu-bar-height: 50px;
Expand Down
9 changes: 6 additions & 3 deletions global-configuration.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded "><a href="intro.html"><strong aria-hidden="true">1.</strong> Intro</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li class="chapter-item expanded "><a href="ignore-embeds.html"><strong aria-hidden="true">3.</strong> Ignore Embeds</a></li><li class="chapter-item expanded "><a href="global-configuration.html" class="active"><strong aria-hidden="true">4.</strong> Global Configuration</a></li><li class="chapter-item expanded "><a href="third-party/intro.html"><strong aria-hidden="true">5.</strong> Third Party Apps</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="third-party/gist.html"><strong aria-hidden="true">5.1.</strong> Gist</a></li><li class="chapter-item "><a href="third-party/youtube.html"><strong aria-hidden="true">5.2.</strong> Youtube</a></li><li class="chapter-item "><a href="third-party/bilibili.html"><strong aria-hidden="true">5.3.</strong> Bilibili</a></li><li class="chapter-item "><a href="third-party/codesandbox.html"><strong aria-hidden="true">5.4.</strong> Codesandbox</a></li><li class="chapter-item "><a href="third-party/stackblitz.html"><strong aria-hidden="true">5.5.</strong> Stackblitz</a></li><li class="chapter-item "><a href="third-party/codepen.html"><strong aria-hidden="true">5.6.</strong> Codepen</a></li></ol></li><li class="chapter-item expanded "><a href="local/intro.html"><strong aria-hidden="true">6.</strong> Local Apps</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="local/scroll-to-top.html"><strong aria-hidden="true">6.1.</strong> Scroll to Top</a></li><li class="chapter-item "><a href="local/announcement-banner.html"><strong aria-hidden="true">6.2.</strong> Announcement Banner</a></li></ol></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>

<!-- Track and set sidebar scroll position -->
Expand Down Expand Up @@ -319,9 +321,10 @@ <h1 id="global-configuration"><a class="header" href="#global-configuration">Glo
<button type="button">X</button>
</div>
<script>
const localData = JSON.parse(localStorage.getItem("announcement-banner"));
const banner = document.querySelector(".announcement-banner");
const name = banner.getAttribute("data-name");
const message = banner.querySelector("p").textContent;
const localData = JSON.parse(localStorage.getItem("mdbook-announcement-banner"));

if (localData && localData.hide === true && localData.name === name) banner.remove();
else {
Expand All @@ -332,7 +335,7 @@ <h1 id="global-configuration"><a class="header" href="#global-configuration">Glo
// add event listener to close button
banner.querySelector("button").addEventListener("click", () => {
banner.remove();
localStorage.setItem("announcement-banner", JSON.stringify({ name, hide: true }));
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ name, hide: true, message }));
});
}
</script>
Expand Down
49 changes: 48 additions & 1 deletion highlight.js

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions ignore-embeds.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded "><a href="intro.html"><strong aria-hidden="true">1.</strong> Intro</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li class="chapter-item expanded "><a href="ignore-embeds.html" class="active"><strong aria-hidden="true">3.</strong> Ignore Embeds</a></li><li class="chapter-item expanded "><a href="global-configuration.html"><strong aria-hidden="true">4.</strong> Global Configuration</a></li><li class="chapter-item expanded "><a href="third-party/intro.html"><strong aria-hidden="true">5.</strong> Third Party Apps</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="third-party/gist.html"><strong aria-hidden="true">5.1.</strong> Gist</a></li><li class="chapter-item "><a href="third-party/youtube.html"><strong aria-hidden="true">5.2.</strong> Youtube</a></li><li class="chapter-item "><a href="third-party/bilibili.html"><strong aria-hidden="true">5.3.</strong> Bilibili</a></li><li class="chapter-item "><a href="third-party/codesandbox.html"><strong aria-hidden="true">5.4.</strong> Codesandbox</a></li><li class="chapter-item "><a href="third-party/stackblitz.html"><strong aria-hidden="true">5.5.</strong> Stackblitz</a></li><li class="chapter-item "><a href="third-party/codepen.html"><strong aria-hidden="true">5.6.</strong> Codepen</a></li></ol></li><li class="chapter-item expanded "><a href="local/intro.html"><strong aria-hidden="true">6.</strong> Local Apps</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="local/scroll-to-top.html"><strong aria-hidden="true">6.1.</strong> Scroll to Top</a></li><li class="chapter-item "><a href="local/announcement-banner.html"><strong aria-hidden="true">6.2.</strong> Announcement Banner</a></li></ol></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>

<!-- Track and set sidebar scroll position -->
Expand Down Expand Up @@ -312,9 +314,10 @@ <h1 id="ignore-embeds"><a class="header" href="#ignore-embeds">Ignore Embeds</a>
<button type="button">X</button>
</div>
<script>
const localData = JSON.parse(localStorage.getItem("announcement-banner"));
const banner = document.querySelector(".announcement-banner");
const name = banner.getAttribute("data-name");
const message = banner.querySelector("p").textContent;
const localData = JSON.parse(localStorage.getItem("mdbook-announcement-banner"));

if (localData && localData.hide === true && localData.name === name) banner.remove();
else {
Expand All @@ -325,7 +328,7 @@ <h1 id="ignore-embeds"><a class="header" href="#ignore-embeds">Ignore Embeds</a>
// add event listener to close button
banner.querySelector("button").addEventListener("click", () => {
banner.remove();
localStorage.setItem("announcement-banner", JSON.stringify({ name, hide: true }));
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ name, hide: true, message }));
});
}
</script>
Expand Down
9 changes: 6 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded "><a href="intro.html" class="active"><strong aria-hidden="true">1.</strong> Intro</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li class="chapter-item expanded "><a href="ignore-embeds.html"><strong aria-hidden="true">3.</strong> Ignore Embeds</a></li><li class="chapter-item expanded "><a href="global-configuration.html"><strong aria-hidden="true">4.</strong> Global Configuration</a></li><li class="chapter-item expanded "><a href="third-party/intro.html"><strong aria-hidden="true">5.</strong> Third Party Apps</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="third-party/gist.html"><strong aria-hidden="true">5.1.</strong> Gist</a></li><li class="chapter-item "><a href="third-party/youtube.html"><strong aria-hidden="true">5.2.</strong> Youtube</a></li><li class="chapter-item "><a href="third-party/bilibili.html"><strong aria-hidden="true">5.3.</strong> Bilibili</a></li><li class="chapter-item "><a href="third-party/codesandbox.html"><strong aria-hidden="true">5.4.</strong> Codesandbox</a></li><li class="chapter-item "><a href="third-party/stackblitz.html"><strong aria-hidden="true">5.5.</strong> Stackblitz</a></li><li class="chapter-item "><a href="third-party/codepen.html"><strong aria-hidden="true">5.6.</strong> Codepen</a></li></ol></li><li class="chapter-item expanded "><a href="local/intro.html"><strong aria-hidden="true">6.</strong> Local Apps</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="local/scroll-to-top.html"><strong aria-hidden="true">6.1.</strong> Scroll to Top</a></li><li class="chapter-item "><a href="local/announcement-banner.html"><strong aria-hidden="true">6.2.</strong> Announcement Banner</a></li></ol></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>

<!-- Track and set sidebar scroll position -->
Expand Down Expand Up @@ -300,9 +302,10 @@ <h1 id="mdbook-embedify"><a class="header" href="#mdbook-embedify">Mdbook Embedi
<button type="button">X</button>
</div>
<script>
const localData = JSON.parse(localStorage.getItem("announcement-banner"));
const banner = document.querySelector(".announcement-banner");
const name = banner.getAttribute("data-name");
const message = banner.querySelector("p").textContent;
const localData = JSON.parse(localStorage.getItem("mdbook-announcement-banner"));

if (localData && localData.hide === true && localData.name === name) banner.remove();
else {
Expand All @@ -313,7 +316,7 @@ <h1 id="mdbook-embedify"><a class="header" href="#mdbook-embedify">Mdbook Embedi
// add event listener to close button
banner.querySelector("button").addEventListener("click", () => {
banner.remove();
localStorage.setItem("announcement-banner", JSON.stringify({ name, hide: true }));
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ name, hide: true, message }));
});
}
</script>
Expand Down
9 changes: 6 additions & 3 deletions intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@
<div class="sidebar-scrollbox">
<ol class="chapter"><li class="chapter-item expanded "><a href="intro.html" class="active"><strong aria-hidden="true">1.</strong> Intro</a></li><li class="chapter-item expanded "><a href="usage.html"><strong aria-hidden="true">2.</strong> Usage</a></li><li class="chapter-item expanded "><a href="ignore-embeds.html"><strong aria-hidden="true">3.</strong> Ignore Embeds</a></li><li class="chapter-item expanded "><a href="global-configuration.html"><strong aria-hidden="true">4.</strong> Global Configuration</a></li><li class="chapter-item expanded "><a href="third-party/intro.html"><strong aria-hidden="true">5.</strong> Third Party Apps</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="third-party/gist.html"><strong aria-hidden="true">5.1.</strong> Gist</a></li><li class="chapter-item "><a href="third-party/youtube.html"><strong aria-hidden="true">5.2.</strong> Youtube</a></li><li class="chapter-item "><a href="third-party/bilibili.html"><strong aria-hidden="true">5.3.</strong> Bilibili</a></li><li class="chapter-item "><a href="third-party/codesandbox.html"><strong aria-hidden="true">5.4.</strong> Codesandbox</a></li><li class="chapter-item "><a href="third-party/stackblitz.html"><strong aria-hidden="true">5.5.</strong> Stackblitz</a></li><li class="chapter-item "><a href="third-party/codepen.html"><strong aria-hidden="true">5.6.</strong> Codepen</a></li></ol></li><li class="chapter-item expanded "><a href="local/intro.html"><strong aria-hidden="true">6.</strong> Local Apps</a><a class="toggle"><div></div></a></li><li><ol class="section"><li class="chapter-item "><a href="local/scroll-to-top.html"><strong aria-hidden="true">6.1.</strong> Scroll to Top</a></li><li class="chapter-item "><a href="local/announcement-banner.html"><strong aria-hidden="true">6.2.</strong> Announcement Banner</a></li></ol></li></ol>
</div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle"></div>
<div id="sidebar-resize-handle" class="sidebar-resize-handle">
<div class="sidebar-resize-indicator"></div>
</div>
</nav>

<!-- Track and set sidebar scroll position -->
Expand Down Expand Up @@ -300,9 +302,10 @@ <h1 id="mdbook-embedify"><a class="header" href="#mdbook-embedify">Mdbook Embedi
<button type="button">X</button>
</div>
<script>
const localData = JSON.parse(localStorage.getItem("announcement-banner"));
const banner = document.querySelector(".announcement-banner");
const name = banner.getAttribute("data-name");
const message = banner.querySelector("p").textContent;
const localData = JSON.parse(localStorage.getItem("mdbook-announcement-banner"));

if (localData && localData.hide === true && localData.name === name) banner.remove();
else {
Expand All @@ -313,7 +316,7 @@ <h1 id="mdbook-embedify"><a class="header" href="#mdbook-embedify">Mdbook Embedi
// add event listener to close button
banner.querySelector("button").addEventListener("click", () => {
banner.remove();
localStorage.setItem("announcement-banner", JSON.stringify({ name, hide: true }));
localStorage.setItem("mdbook-announcement-banner", JSON.stringify({ name, hide: true, message }));
});
}
</script>
Expand Down
Loading

0 comments on commit 18faada

Please sign in to comment.