This commit is contained in:
krahets
2026-04-03 18:46:15 +08:00
parent 377736b1bd
commit 9d21ca86b0
352 changed files with 46563 additions and 11262 deletions
+253
View File
@@ -0,0 +1,253 @@
(() => {
const ANIMATION_LABEL_PATTERN = /^<\d+>$/;
const AUTO_SLIDE_INITIAL_DELAY_MS = 1000;
const AUTO_SLIDE_INTERVAL_MS = 1500;
const PLAY_LABEL = "播放幻灯片";
const PAUSE_LABEL = "暂停幻灯片";
const SVG_NS = "http://www.w3.org/2000/svg";
const FA_PLAY_PATH =
"M91.2 36.9c-12.4-6.8-27.4-6.5-39.6.7S32 57.9 32 72v368c0 14.1 7.5 27.2 19.6 34.4s27.2 7.5 39.6.7l336-184c12.8-7 20.8-20.5 20.8-35.1s-8-28.1-20.8-35.1z";
const FA_PAUSE_PATH =
"M48 32C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h64c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm224 0c-26.5 0-48 21.5-48 48v352c0 26.5 21.5 48 48 48h64c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z";
const FA_ARROW_LEFT_PATH =
"M9.4 233.4c-12.5 12.5-12.5 32.8 0 45.3l160 160c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288H480c17.7 0 32-14.3 32-32s-14.3-32-32-32H109.3l105.4-105.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-160 160z";
const FA_ARROW_RIGHT_PATH =
"M502.6 278.6c12.5-12.5 12.5-32.8 0-45.3l-160-160c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L402.7 224H32c-17.7 0-32 14.3-32 32s14.3 32 32 32h370.7L297.3 393.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0l160-160z";
const initializedSets = new WeakSet();
const controllers = new Set();
const getCheckedIndex = (inputs) => {
const checkedIndex = inputs.findIndex((input) => input.checked);
return checkedIndex === -1 ? 0 : checkedIndex;
};
const setCheckedIndex = (inputs, index) => {
const normalizedIndex = ((index % inputs.length) + inputs.length) % inputs.length;
inputs[normalizedIndex].checked = true;
return normalizedIndex;
};
const isAnimationSet = (tabbedSet) => {
const labels = Array.from(tabbedSet.querySelectorAll(":scope > .tabbed-labels > label"));
if (labels.length < 2) {
return false;
}
return labels.every((label) => ANIMATION_LABEL_PATTERN.test(label.textContent.trim()));
};
const createSvgIcon = ({ className, path, viewBox, width, height }) => {
const icon = document.createElementNS(SVG_NS, "svg");
const iconPath = document.createElementNS(SVG_NS, "path");
icon.setAttribute("class", className);
icon.setAttribute("aria-hidden", "true");
icon.setAttribute("viewBox", viewBox);
icon.setAttribute("focusable", "false");
if (width) {
icon.setAttribute("width", width);
}
if (height) {
icon.setAttribute("height", height);
}
iconPath.setAttribute("d", path);
icon.append(iconPath);
return { icon, iconPath };
};
const createIconButton = ({ className, ariaLabel, path }) => {
const button = document.createElement("button");
const { icon } = createSvgIcon({
className: "animation-controls__nav-icon",
path,
viewBox: "0 0 512 512",
});
button.type = "button";
button.className = `animation-controls__button ${className}`;
button.setAttribute("aria-label", ariaLabel);
button.append(icon);
return button;
};
const createPlayButton = () => {
const button = document.createElement("button");
const glyph = document.createElement("span");
const { icon, iconPath } = createSvgIcon({
className: "animation-controls__play-icon",
path: FA_PLAY_PATH,
viewBox: "0 0 448 512",
width: "12",
height: "12",
});
const srOnly = document.createElement("span");
button.type = "button";
button.className = "animation-controls__button animation-controls__play";
button.setAttribute("aria-label", PLAY_LABEL);
glyph.className = "animation-controls__play-glyph";
icon.setAttribute("preserveAspectRatio", "xMidYMid meet");
glyph.append(icon);
srOnly.className = "animation-controls__sr-only";
srOnly.textContent = PLAY_LABEL;
button.append(glyph, srOnly);
return { button, srOnly, icon, iconPath };
};
const initAnimationSet = (tabbedSet) => {
if (initializedSets.has(tabbedSet) || !isAnimationSet(tabbedSet)) {
return;
}
const inputs = Array.from(tabbedSet.querySelectorAll(':scope > input[type="radio"]'));
const tabbedContent = tabbedSet.querySelector(":scope > .tabbed-content");
if (inputs.length < 2 || !tabbedContent) {
return;
}
initializedSets.add(tabbedSet);
tabbedSet.dataset.autoSlide = "true";
const controls = document.createElement("div");
controls.className = "animation-controls";
const playControl = createPlayButton();
const playButton = playControl.button;
const nav = document.createElement("div");
nav.className = "animation-controls__nav";
const prevButton = createIconButton({
className: "animation-controls__prev",
ariaLabel: "上一页",
path: FA_ARROW_LEFT_PATH,
});
const pageIndicator = document.createElement("span");
pageIndicator.className = "animation-controls__page";
pageIndicator.setAttribute("aria-live", "polite");
const nextButton = createIconButton({
className: "animation-controls__next",
ariaLabel: "下一页",
path: FA_ARROW_RIGHT_PATH,
});
nav.append(prevButton, pageIndicator, nextButton);
controls.append(playButton, nav);
tabbedContent.insertAdjacentElement("afterend", controls);
const state = {
inputs,
currentIndex: getCheckedIndex(inputs),
intervalId: null,
timeoutId: null,
isPlaying: false,
};
const updatePlayButton = () => {
const label = state.isPlaying ? PAUSE_LABEL : PLAY_LABEL;
playButton.setAttribute("aria-label", label);
playButton.classList.toggle("is-playing", state.isPlaying);
playControl.srOnly.textContent = label;
playControl.icon.setAttribute("viewBox", state.isPlaying ? "0 0 384 512" : "0 0 448 512");
playControl.icon.setAttribute("width", state.isPlaying ? "10" : "12");
playControl.iconPath.setAttribute("d", state.isPlaying ? FA_PAUSE_PATH : FA_PLAY_PATH);
};
const updatePageIndicator = () => {
pageIndicator.textContent = `${state.currentIndex + 1} / ${inputs.length}`;
};
const stop = () => {
if (state.timeoutId !== null) {
window.clearTimeout(state.timeoutId);
state.timeoutId = null;
}
if (state.intervalId !== null) {
window.clearInterval(state.intervalId);
state.intervalId = null;
}
state.isPlaying = false;
updatePlayButton();
};
const syncCurrentIndex = () => {
state.currentIndex = getCheckedIndex(inputs);
};
const moveTo = (index) => {
state.currentIndex = setCheckedIndex(inputs, index);
updatePageIndicator();
};
const step = (delta) => {
moveTo(state.currentIndex + delta);
};
const start = () => {
if (state.isPlaying) {
return;
}
state.isPlaying = true;
updatePlayButton();
state.timeoutId = window.setTimeout(() => {
step(1);
state.timeoutId = null;
state.intervalId = window.setInterval(() => {
step(1);
}, AUTO_SLIDE_INTERVAL_MS);
}, AUTO_SLIDE_INITIAL_DELAY_MS);
};
playButton.addEventListener("click", () => {
if (state.isPlaying) {
stop();
return;
}
syncCurrentIndex();
start();
});
prevButton.addEventListener("click", () => {
syncCurrentIndex();
step(-1);
});
nextButton.addEventListener("click", () => {
syncCurrentIndex();
step(1);
});
inputs.forEach((input, index) => {
input.addEventListener("change", () => {
if (input.checked) {
state.currentIndex = index;
updatePageIndicator();
}
});
});
controllers.add(stop);
updatePlayButton();
updatePageIndicator();
};
const initAutoSlide = () => {
document.querySelectorAll(".tabbed-set").forEach(initAnimationSet);
};
document.addEventListener("visibilitychange", () => {
if (!document.hidden) {
return;
}
controllers.forEach((stop) => stop());
});
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", initAutoSlide, { once: true });
} else {
initAutoSlide();
}
})();
+1 -1
View File
@@ -8,7 +8,7 @@
{% elif config.theme.language == 'en' %}
{% set announcements = 'Welcome to contribute to Chinese-to-English translation! For more details, please refer to <a href="https://github.com/krahets/hello-algo/blob/main/en/CONTRIBUTING.md">CONTRIBUTING.md</a>.' %}
{% elif config.theme.language == 'ja' %}
{% set announcements = '日本語版審閱者を募集しています!詳細<a href="https://github.com/krahets/hello-algo/blob/main/ja/CONTRIBUTING.md">CONTRIBUTING.md</a>参照してください。' %}
{% set announcements = '日本語版のレビュアーを募集しています。詳しく<a href="/ja/chapter_appendix/contribution/">こちら</a>ご覧ください。' %}
{% elif config.theme.language == 'ru' %}
{% set announcements = 'Приглашаем вас участвовать в развитии русской версии! Подробнее <a href="/ru/chapter_appendix/contribution/">здесь</a>.' %}
{% endif %}
+22 -15
View File
@@ -43,28 +43,35 @@
<script>
var giscus = document.querySelector("script[src*=giscus]")
/* Set palette on initial load */
var palette = __md_get("__palette")
if (palette && typeof palette.color === "object") {
var theme = palette.color.scheme === "slate" ? "dark_dimmed" : "light"
giscus.setAttribute("data-theme", theme)
function getGiscusThemeHref() {
var palette = __md_get("__palette")
var isDark = palette && typeof palette.color === "object" && palette.color.scheme === "slate"
var extraStylesheet = document.querySelector("link[href*='stylesheets/extra.css']")
if (!extraStylesheet) {
return isDark ? "noborder_dark" : "light"
}
var filename = isDark ? "giscus-dark.css" : "giscus-light.css"
return new URL(filename, extraStylesheet.href).href
}
/* Set palette on initial load */
giscus.setAttribute("data-theme", getGiscusThemeHref())
/* Register event handlers after documented loaded */
document.addEventListener("DOMContentLoaded", function() {
var ref = document.querySelector("[data-md-component=palette]")
if (!ref) return
ref.addEventListener("change", function() {
var palette = __md_get("__palette")
if (palette && typeof palette.color === "object") {
var theme = palette.color.scheme === "slate" ? "dark_dimmed" : "light"
var theme = getGiscusThemeHref()
/* Instruct Giscus to change theme */
var frame = document.querySelector(".giscus-frame")
frame.contentWindow.postMessage(
{ giscus: { setConfig: { theme } } },
"https://giscus.app"
)
}
/* Instruct Giscus to change theme */
var frame = document.querySelector(".giscus-frame")
if (!frame) return
frame.contentWindow.postMessage(
{ giscus: { setConfig: { theme } } },
"https://giscus.app"
)
})
})
</script>
+178
View File
@@ -0,0 +1,178 @@
.md-typeset .tabbed-set[data-auto-slide="true"] {
margin-bottom: 1.5em;
overflow: hidden;
border-radius: 0.45rem;
background: var(--md-default-bg-color);
box-shadow: 0 0.12rem 0.45rem var(--md-default-fg-color--lightest);
}
.md-typeset .tabbed-set[data-auto-slide="true"] > .tabbed-labels {
display: none;
}
.md-typeset .tabbed-set[data-auto-slide="true"] > .tabbed-content {
margin-top: 0;
margin-bottom: 0;
background: var(--md-default-bg-color);
}
.md-typeset .tabbed-set[data-auto-slide="true"] > .tabbed-content > .tabbed-block > p {
margin: 0;
}
.md-typeset .tabbed-set[data-auto-slide="true"] .animation-figure {
border-radius: 0;
box-shadow: none;
}
.animation-controls {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.55rem;
width: 100%;
margin: 0 auto;
padding: 0.14rem 0.3rem;
border-radius: 0;
background: color-mix(in srgb, var(--md-code-bg-color) 97.5%, var(--md-default-fg-color) 2.5%);
box-sizing: border-box;
}
.animation-controls__nav {
display: flex;
align-items: center;
gap: 0.03rem;
margin-left: auto;
padding-left: 0.36rem;
}
.animation-controls__button {
display: inline-flex;
align-items: center;
justify-content: center;
min-height: 1.64rem;
min-width: 1.64rem;
padding: 0.1rem;
border: 0;
background: transparent;
border-radius: 999px;
color: var(--md-default-fg-color);
cursor: pointer;
transition:
color 0.15s ease,
background-color 0.15s ease;
}
.animation-controls__button:hover,
.animation-controls__button:focus-visible {
background: color-mix(in srgb, var(--md-code-bg-color) 92%, var(--md-default-fg-color) 8%);
color: var(--md-accent-fg-color);
}
.animation-controls__play {
flex: 0 0 auto;
line-height: 0;
}
.animation-controls__play-glyph {
display: inline-flex;
align-items: center;
justify-content: center;
width: 0.72rem;
height: 0.72rem;
flex: 0 0 auto;
overflow: hidden;
}
.animation-controls__play-icon {
display: block;
width: 100%;
height: 100%;
fill: currentColor;
flex: 0 0 auto;
}
.animation-controls__play-glyph .animation-controls__play-icon {
transform: translateX(0.04rem);
}
.animation-controls__play.is-playing .animation-controls__play-glyph {
width: 0.6rem;
}
.animation-controls__play.is-playing .animation-controls__play-glyph .animation-controls__play-icon {
transform: none;
}
.animation-controls__nav-icon {
width: 0.72rem;
height: 0.72rem;
fill: currentColor;
flex: 0 0 auto;
}
.animation-controls__page {
min-width: 2.25rem;
padding: 0 0.01rem;
color: var(--md-typeset-color);
font-size: 0.75rem;
font-variant-numeric: tabular-nums;
line-height: 1;
text-align: center;
}
.animation-controls__sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0 0 0 0);
white-space: nowrap;
border: 0;
}
[data-md-color-scheme="slate"] .animation-controls {
background: color-mix(in srgb, var(--md-code-bg-color) 91%, black 9%);
}
[data-md-color-scheme="slate"] .animation-controls__button:hover,
[data-md-color-scheme="slate"] .animation-controls__button:focus-visible {
background: color-mix(in srgb, var(--md-code-bg-color) 92%, white 8%);
}
[data-md-color-scheme="slate"] .md-typeset .tabbed-set[data-auto-slide="true"] {
background: var(--md-code-bg-color);
box-shadow: 0 0.2rem 0.75rem rgb(0 0 0 / 0.18);
}
[data-md-color-scheme="slate"] .md-typeset .tabbed-set[data-auto-slide="true"] > .tabbed-content {
background: var(--md-code-bg-color);
}
@media screen and (max-width: 44.9375em) {
.animation-controls {
flex-wrap: nowrap;
justify-content: space-between;
gap: 0.32rem;
padding: 0.11rem 0.22rem;
}
.animation-controls__nav {
gap: 0.02rem;
padding-left: 0.16rem;
}
.animation-controls__button {
min-width: 1.48rem;
min-height: 1.48rem;
padding: 0.08rem;
}
.animation-controls__page {
min-width: 2rem;
padding: 0;
font-size: 0.7rem;
}
}
+346 -235
View File
@@ -1,4 +1,4 @@
/* Color Settings */
/* Theme tokens */
/* https://github.com/squidfunk/mkdocs-material/blob/6b5035f5580f97532d664e3d1babf5f320e88ee9/src/assets/stylesheets/main/_colors.scss */
/* https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#custom-colors */
:root>* {
@@ -14,23 +14,23 @@
--md-code-fg-color: #1d1d20;
--md-code-bg-color: #f5f5f5;
--md-accent-fg-color: #999;
--md-admonition-fg-color: #1d1d20;
--md-typeset-color: #1d1d20;
--md-typeset-a-color: #349890;
--md-accent-fg-color: var(--md-typeset-a-color);
--md-typeset-btn-color: #55aea6;
--md-typeset-btn-hover-color: #52bbb1;
--md-admonition-icon--pythontutor: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19.14 7.5A2.86 2.86 0 0 1 22 10.36v3.78A2.86 2.86 0 0 1 19.14 17H12c0 .39.32.96.71.96H17v1.68a2.86 2.86 0 0 1-2.86 2.86H9.86A2.86 2.86 0 0 1 7 19.64v-3.75a2.85 2.85 0 0 1 2.86-2.85h5.25a2.85 2.85 0 0 0 2.85-2.86V7.5h1.18m-4.28 11.79c-.4 0-.72.3-.72.89 0 .59.32.71.72.71a.71.71 0 0 0 .71-.71c0-.59-.32-.89-.71-.89m-10-1.79A2.86 2.86 0 0 1 2 14.64v-3.78A2.86 2.86 0 0 1 4.86 8H12c0-.39-.32-.96-.71-.96H7V5.36A2.86 2.86 0 0 1 9.86 2.5h4.28A2.86 2.86 0 0 1 17 5.36v3.75a2.85 2.85 0 0 1-2.86 2.85H8.89a2.85 2.85 0 0 0-2.85 2.86v2.68H4.86M9.14 5.71c.4 0 .72-.3.72-.89 0-.59-.32-.71-.72-.71-.39 0-.71.12-.71.71s.32.89.71.89Z"/></svg>');
--md-admonition-pythontutor-color: #eee;
--md-admonition-pythontutor-color: var(--md-code-bg-color);
--hello-algo-sidebar-width: 13rem;
}
[data-md-color-scheme="slate"] {
--theme-dark-base: #1E1E1E;
--theme-dark-mantle: #1A1A1A;
--theme-dark-base: #1e1e1e;
--theme-dark-mantle: #1a1a1a;
--theme-dark-crust: #171717;
--hero-starfield-bg-color: var(--theme-dark-base);
@@ -39,27 +39,25 @@
--md-default-fg-color: #adbac7;
--md-default-bg-color: var(--theme-dark-base);
--md-default-bg-color--light: rgb(30 30 30 / 0.8);
--md-body-bg-color: var(--theme-dark-mantle);
--md-body-bg-color: var(--md-default-bg-color);
--md-header-bg-color: rgba(26, 26, 26, 0.8);
--md-code-fg-color: #adbac7;
--md-code-bg-color: var(--theme-dark-crust);
--md-accent-fg-color: #aaa;
--md-admonition-fg-color: #adbac7;
--md-footer-fg-color: #adbac7;
--md-footer-bg-color: var(--theme-dark-mantle);
--md-typeset-color: #adbac7;
--md-typeset-a-color: #52bbb1;
--md-accent-fg-color: var(--md-typeset-a-color);
--md-typeset-btn-color: #52bbb1;
--md-typeset-btn-hover-color: #55aea6;
--md-admonition-pythontutor-color: var(--theme-dark-crust);
--md-footer-fg-color: #adbac7;
--md-footer-bg-color: var(--theme-dark-mantle);
--md-admonition-pythontutor-color: var(--md-code-bg-color);
}
[data-md-color-scheme="slate"][data-md-color-primary="black"],
@@ -67,39 +65,82 @@
--md-typeset-a-color: #52bbb1;
}
[data-md-color-primary="black"] .md-header {
background-color: var(--md-header-bg-color);
/* Base layout */
body {
background-color: var(--md-default-bg-color);
--md-text-font-family: -apple-system, BlinkMacSystemFont,
var(--md-text-font, _), Helvetica, Arial, sans-serif;
--md-code-font-family: var(--md-code-font, _), SFMono-Regular, Consolas, Menlo,
-apple-system, BlinkMacSystemFont, var(--md-text-font, _), monospace;
}
.md-header--shadow,
.md-header--landing {
box-shadow: none;
transition: none;
backdrop-filter: saturate(180%) blur(20px);
/* Gaussian blur */
-webkit-backdrop-filter: saturate(180%) blur(20px);
/* Safari */
background-color: var(--md-header-bg-color);
html:has(body[data-md-color-scheme="slate"]) {
background-color: #1e1e1e;
}
html:has(body[data-md-color-scheme="default"]) {
background-color: #ffffff;
}
@media screen and (min-width: 76.25em) {
.md-grid {
max-width: calc(61rem + 2 * (var(--hello-algo-sidebar-width) - 12.1rem));
}
.md-sidebar--primary,
.md-sidebar--secondary {
width: var(--hello-algo-sidebar-width);
}
[dir="ltr"] .md-sidebar__inner {
padding-right: calc(100% - (var(--hello-algo-sidebar-width) - 0.6rem));
}
[dir="rtl"] .md-sidebar__inner {
padding-left: calc(100% - (var(--hello-algo-sidebar-width) - 0.6rem));
}
}
.md-sidebar--primary .md-sidebar__scrollwrap {
scrollbar-color: var(--md-default-fg-color--lighter) transparent;
}
.md-sidebar--primary .md-sidebar__scrollwrap::-webkit-scrollbar-thumb,
.md-sidebar--primary .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover {
background-color: var(--md-default-fg-color--lighter);
}
/* Banner and footer */
.md-banner {
background-color: var(--md-default-bg-color);
color: var(--md-default-fg-color);
font-size: 0.75rem;
}
.md-banner .banner-svg svg {
margin-right: 0.3rem;
height: 0.63rem;
fill: var(--md-default-fg-color);
}
.md-footer,
.md-footer__inner,
.md-footer-meta,
.md-footer__link,
.md-footer__link:hover {
background-color: var(--md-default-bg-color);
}
.md-footer {
border-top: 0.05rem solid var(--md-default-fg-color--lightest);
}
[data-md-color-scheme="slate"] .md-footer,
[data-md-color-scheme="slate"] .md-footer__inner {
background-color: var(--theme-dark-mantle);
color: var(--md-footer-fg-color);
}
[data-md-color-scheme="slate"] .md-footer-meta {
background-color: var(--theme-dark-crust);
color: var(--md-footer-fg-color);
}
[data-md-color-scheme="slate"] .md-footer__link {
background-color: var(--theme-dark-crust);
color: var(--md-footer-fg-color);
}
[data-md-color-scheme="slate"] .md-footer__inner,
[data-md-color-scheme="slate"] .md-footer-meta,
[data-md-color-scheme="slate"] .md-footer__link,
[data-md-color-scheme="slate"] .md-footer__link:hover {
background-color: var(--theme-dark-base);
color: var(--md-footer-fg-color);
}
[data-md-color-scheme="slate"] .md-footer__title,
@@ -112,40 +153,31 @@
color: var(--md-footer-fg-color);
}
/* https://github.com/squidfunk/mkdocs-material/issues/4832#issuecomment-1374891676 */
.md-nav__link[for] {
color: var(--md-default-fg-color) !important;
}
/* Figure class */
/* Shared content elements */
.animation-figure {
border-radius: 0.3rem;
display: block;
margin: 0 auto;
box-shadow: var(--md-shadow-z2);
box-shadow: 0 0.03rem 0.16rem rgb(0 0 0 / 0.07);
}
/* Cover image class */
.cover-image {
width: 28rem;
height: auto;
border-radius: 0.3rem;
display: block;
margin: 0 auto;
box-shadow: var(--md-shadow-z2);
box-shadow: 0 0.03rem 0.16rem rgb(0 0 0 / 0.07);
}
/* Center Markdown Tables (requires md_in_html extension) */
.center-table {
text-align: center;
}
/* Reset alignment for table cells */
.md-typeset .center-table :is(td, th):not([align]) {
text-align: initial;
}
/* Font size */
.md-typeset {
font-size: 0.75rem;
line-height: 1.5;
@@ -155,7 +187,6 @@
font-size: 0.95em;
}
/* Markdown Header */
/* https://github.com/squidfunk/mkdocs-material/blob/dcab57dd1cced4b77875c1aa1b53467c62709d31/src/assets/stylesheets/main/_typeset.scss */
.md-typeset h1 {
font-weight: 400;
@@ -174,11 +205,6 @@
text-transform: none;
}
.md-typeset a:hover {
color: var(--md-typeset-a-color);
text-decoration: underline;
}
.md-typeset code {
border-radius: 0.2rem;
}
@@ -187,48 +213,61 @@
font-weight: normal;
}
/* font-family setting for Win10 */
body {
--md-text-font-family: -apple-system, BlinkMacSystemFont,
var(--md-text-font, _), Helvetica, Arial, sans-serif;
--md-code-font-family: var(--md-code-font, _), SFMono-Regular, Consolas, Menlo,
-apple-system, BlinkMacSystemFont, var(--md-text-font, _), monospace;
}
/* max height of code block */
/* https://github.com/squidfunk/mkdocs-material/issues/3444 */
.md-typeset pre>code {
max-height: 25rem;
}
/* Make the picture not glare in dark theme */
.md-typeset pre>code:hover {
scrollbar-color: var(--md-default-fg-color--lighter) transparent;
}
.md-typeset pre>code::-webkit-scrollbar-thumb:hover {
background-color: var(--md-default-fg-color--lighter);
}
[data-md-color-scheme="slate"] .md-typeset img,
[data-md-color-scheme="slate"] .md-typeset svg,
[data-md-color-scheme="slate"] .md-typeset video {
filter: brightness(0.85) invert(0.05);
}
/* landing page */
.header-img-div {
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
width: 100%;
/* Default to full width */
.md-typeset a:not(.md-button) {
text-decoration: none;
}
.md-typeset a:not(.md-button):hover,
.md-typeset a:not(.md-button):focus-visible {
color: var(--md-typeset-a-color);
text-decoration: underline;
}
/* Admonitions and tabs */
.md-typeset .admonition-title:before,
.md-typeset summary:before,
.md-typeset summary:after {
top: 50%;
}
.md-typeset .admonition-title:before,
.md-typeset summary:before {
transform: translateY(-50%);
}
.md-typeset summary:after {
transform: translateY(-50%) rotate(0deg);
}
.md-typeset details[open]>summary:after {
transform: translateY(-50%) rotate(90deg);
}
/* Admonition for python tutor */
.md-typeset .admonition.pythontutor,
.md-typeset details.pythontutor {
border-color: var(--md-default-fg-color--lightest);
margin-top: 0;
margin-bottom: 1.5625em;
}
.md-typeset .admonition:focus-within,
.md-typeset details:focus-within {
box-shadow: var(--md-shadow-z1);
background-color: var(--md-code-bg-color);
}
.md-typeset .pythontutor>.admonition-title,
@@ -243,31 +282,18 @@ body {
mask-image: var(--md-admonition-icon--pythontutor);
}
.md-typeset .admonition-title:before,
.md-typeset summary:before {
width: 1.25em;
[data-md-color-scheme="slate"] .md-typeset details.pythontutor[open]> :not(summary),
[data-md-color-scheme="slate"] .md-typeset details.pythontutor[open]> :not(summary) :is(p, li, strong, em, sub, sup, code, a) {
background-color: #f5f5f5;
color: #1d1d20;
}
/* code block tabs */
.md-typeset .tabbed-labels>label {
font-size: 0.61rem;
}
.md-typeset .tabbed-labels--linked>label>a {
padding: .78125em 1.0em .625em;
}
/* header banner */
.md-banner {
background-color: var(--md-code-bg-color);
color: var(--md-default-fg-color);
font-size: 0.75rem;
}
.md-banner .banner-svg svg {
margin-right: 0.3rem;
height: 0.63rem;
fill: var(--md-default-fg-color);
padding: 0.78125em 1em 0.625em;
}
.pythontutor-iframe {
@@ -280,129 +306,80 @@ body {
border: none;
}
/* landing page container */
/* Landing page layout */
.header-img-div {
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
width: 100%;
}
.home-div {
width: 100%;
height: auto;
display: flex;
justify-content: center;
align-items: center;
padding: 3em 2em;
background-color: var(--md-default-bg-color);
color: var(--md-default-fg-color);
font-size: 0.9rem;
padding: 3em 2em;
text-align: center;
}
.home-div--black {
background-color: #101010;
}
.home-div[data-md-color-scheme="default"],
.home-div[data-md-color-scheme="default"] h1,
.home-div[data-md-color-scheme="default"] h2,
.home-div[data-md-color-scheme="default"] h3,
.home-div[data-md-color-scheme="default"] h4,
.home-div[data-md-color-scheme="default"] h5,
.home-div[data-md-color-scheme="default"] h6,
.home-div[data-md-color-scheme="slate"],
.home-div[data-md-color-scheme="slate"] h1,
.home-div[data-md-color-scheme="slate"] h2,
.home-div[data-md-color-scheme="slate"] h3,
.home-div[data-md-color-scheme="slate"] h4,
.home-div[data-md-color-scheme="slate"] h5,
.home-div[data-md-color-scheme="slate"] h6 {
color: var(--md-default-fg-color);
}
.section-content {
width: 100%;
height: auto;
max-width: 70vw;
}
/* rounded button */
.rounded-button {
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 10em;
margin: 0 0.1em;
padding: 0.6em 1.3em;
border: none;
background-color: var(--md-typeset-btn-color);
color: var(--md-primary-fg-color) !important;
text-align: center;
text-decoration: none;
cursor: pointer;
}
.rounded-button:hover {
background-color: var(--md-typeset-btn-hover-color);
}
.rounded-button span {
margin: 0;
margin-bottom: 0.07em;
white-space: nowrap;
}
.rounded-button svg {
fill: var(--md-primary-fg-color);
width: auto;
height: 1.2em;
margin-right: 0.5em;
}
/* device image */
.device-on-hover {
width: auto;
transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}
a:hover .device-on-hover {
filter: drop-shadow(0 0 0.2rem rgba(0, 0, 0, 0.15));
transform: scale(1.01);
}
/* text button */
.reading-media {
display: flex;
justify-content: center;
align-items: flex-end;
height: 32vw;
}
.media-block {
height: 100%;
margin: 0 0.2em;
}
.text-button {
width: auto;
color: var(--md-typeset-btn-color);
text-decoration: none;
text-align: center;
margin: 2.7em auto;
}
.text-button span {
white-space: nowrap;
}
.text-button svg {
display: inline-block;
fill: var(--md-typeset-btn-color);
width: auto;
height: 0.9em;
background-size: cover;
padding-top: 0.17em;
margin-left: 0.15em;
}
a:hover .text-button span {
text-decoration: underline;
}
/* hero image */
.hero-div {
height: min(84vh, 75vw);
width: min(112vh, 100vw);
margin: 0 auto;
margin-top: -2.4rem;
margin: -2.4rem auto 0;
padding: 0;
position: relative;
font-size: min(1.8vh, 2.5vw);
font-weight: normal;
}
.hero-div--en {
font-size: min(1.65vh, 2.3vw);
}
.hero-div--ru {
font-size: min(1.45vh, 2vw);
}
.hero-bg {
height: 100%;
width: 100%;
height: 100%;
object-fit: cover;
position: absolute;
}
/* hover on the planets */
.hero-div>a>img {
width: auto;
position: absolute;
@@ -414,7 +391,6 @@ a:hover .text-button span {
position: absolute;
transform: translateX(-50%) translateY(-50%);
white-space: nowrap;
/* prevent line breaks */
color: white;
}
@@ -424,21 +400,136 @@ a:hover .text-button span {
}
.hero-div>a:hover>span {
text-decoration: underline;
color: var(--md-typeset-btn-color);
text-decoration: underline;
}
.heading-div {
width: 100%;
position: absolute;
transform: translateX(-50%);
left: 50%;
bottom: min(2vh, 3vw);
transform: translateX(-50%);
pointer-events: none;
color: #fff;
}
/* code badge */
/* Landing page CTAs */
.rounded-button {
display: inline-flex;
align-items: center;
justify-content: center;
gap: 0.38em;
margin: 0 0.1em;
padding: 0.72em 1.18em;
border: 1px solid rgb(255 255 255 / 0.24);
border-radius: 10em;
background-color: rgb(24 24 24 / 0.2);
color: rgb(232 241 240) !important;
font-weight: 400;
letter-spacing: 0.01em;
line-height: 1.2;
min-width: 7.2em;
text-align: center;
text-decoration: none;
cursor: pointer;
box-shadow:
0 0.3rem 1rem rgb(0 0 0 / 0.16);
transition:
color 0.15s ease-out,
background-color 0.15s ease-out,
border-color 0.15s ease-out,
box-shadow 0.15s ease-out;
backdrop-filter: saturate(115%) blur(0.18rem);
-webkit-backdrop-filter: saturate(115%) blur(0.18rem);
}
.rounded-button:hover {
background-color: rgb(255 255 255 / 0.2);
border-color: rgb(255 255 255 / 0.34);
color: rgb(244 249 248) !important;
box-shadow:
0 0.4rem 1.2rem rgb(0 0 0 / 0.18);
text-decoration: none;
}
.heading-div .rounded-button:first-of-type {
border-color: rgb(160 223 217 / 0.42);
background-color: rgb(42 104 99 / 0.2);
color: rgb(233 245 243) !important;
}
.heading-div .rounded-button:first-of-type:hover {
background-color: rgb(82 187 177 / 0.28);
border-color: rgb(186 228 223 / 0.38);
color: rgb(242 249 248) !important;
}
.rounded-button span {
margin: 0 0 0.07em;
white-space: nowrap;
}
.rounded-button svg {
width: auto;
height: 1.2em;
margin-right: 0.5em;
fill: currentColor;
}
.reading-media {
display: flex;
justify-content: center;
align-items: flex-end;
height: 32vw;
}
.reading-media+p {
margin-top: 1em !important;
}
.media-block {
height: 100%;
margin: 0 0.2em;
}
.text-button {
width: auto;
margin: 2.7em auto;
color: var(--md-typeset-btn-color);
text-align: center;
text-decoration: none;
}
.text-button span {
white-space: nowrap;
}
.text-button svg {
display: inline-block;
width: auto;
height: 0.9em;
margin-left: 0.15em;
padding-top: 0.17em;
fill: var(--md-typeset-btn-color);
background-size: cover;
}
a:hover .text-button span {
text-decoration: underline;
}
.device-on-hover {
width: auto;
transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}
a:hover .device-on-hover {
filter: drop-shadow(0 0 0.2rem rgba(0, 0, 0, 0.15));
transform: scale(1.01);
}
/* Landing page content blocks */
.code-badge {
width: 100%;
height: auto;
@@ -446,11 +537,10 @@ a:hover .text-button span {
}
.code-badge img {
height: 1.07em;
width: auto;
height: 1.07em;
}
/* brief intro */
.intro-container {
display: flex;
align-items: center;
@@ -467,14 +557,13 @@ a:hover .text-button span {
.intro-text {
flex-grow: 1;
/* fill the space */
display: flex;
flex-direction: column;
justify-content: center;
text-align: left;
align-items: flex-start;
width: fit-content;
margin: 2em;
text-align: left;
}
.intro-text>div {
@@ -483,6 +572,10 @@ a:hover .text-button span {
margin: 0 auto;
}
.intro-text svg path {
fill: var(--md-primary-bg-color);
}
.endor-text {
width: 50%;
}
@@ -492,7 +585,10 @@ a:hover .text-button span {
font-weight: bold;
}
/* contributors table */
.home-div .intro-quote {
color: var(--md-default-fg-color--light) !important;
}
.profile-div {
display: flex;
flex-wrap: wrap;
@@ -507,6 +603,11 @@ a:hover .text-button span {
text-align: center;
}
.profile-cell a:hover b,
.profile-cell a:focus-visible b {
text-decoration: underline;
}
.profile-img {
width: 5em;
border-radius: 50%;
@@ -517,6 +618,14 @@ a:hover .text-button span {
gap: 0.5em;
}
.en-translator-profile-div {
max-width: 40em;
}
.en-translator-profile-div .profile-cell {
flex: 0 0 20%;
}
.translator-profile-cell {
flex: 0 0 auto;
margin: 0.5em 0;
@@ -529,7 +638,37 @@ a:hover .text-button span {
margin: 0 auto;
}
/* Hide navigation */
/* Embedded media */
.video-container {
position: relative;
padding-bottom: 56.25%;
height: 0;
}
.video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.starfield {
position: absolute;
width: 100%;
height: 100%;
z-index: 0;
background-color: var(--hero-starfield-bg-color, transparent);
}
.starfield-origin {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
/* Responsive adjustments */
@media screen and (max-width: 76.25em) {
.section-content {
max-width: 95vw;
@@ -544,7 +683,6 @@ a:hover .text-button span {
}
}
/* mobile devices */
@media screen and (max-width: 60em) {
.home-div {
font-size: 0.75rem;
@@ -582,35 +720,8 @@ a:hover .text-button span {
.profile-cell {
flex: 1 1 30%;
}
}
.video-container {
position: relative;
padding-bottom: 56.25%;
/* 16:9 */
height: 0;
}
.video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
/* starfield */
.starfield {
position: absolute;
width: 100%;
height: 100%;
z-index: 0;
background-color: var(--hero-starfield-bg-color, transparent);
}
.starfield-origin {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.en-translator-profile-div .profile-cell {
flex: 1 1 30%;
}
}
+29
View File
@@ -0,0 +1,29 @@
@import url("https://giscus.app/themes/noborder_dark.css");
.gsc-comment-box-buttons .btn-primary {
border-radius: 999px !important;
}
/* Limit long giscus comments so they don't dominate the page. */
.gsc-comment-content,
.gsc-reply-content {
max-height: 32rem;
overflow-y: auto;
padding-inline-end: 0.5rem;
}
.gsc-comment-content::-webkit-scrollbar,
.gsc-reply-content::-webkit-scrollbar {
width: 0.35rem;
}
.gsc-comment-content::-webkit-scrollbar-thumb,
.gsc-reply-content::-webkit-scrollbar-thumb {
background: rgba(230, 237, 243, 0.24);
border-radius: 999px;
}
.gsc-comment-content::-webkit-scrollbar-track,
.gsc-reply-content::-webkit-scrollbar-track {
background: transparent;
}
+57
View File
@@ -0,0 +1,57 @@
@import url("https://giscus.app/themes/light.css");
main {
--color-border-default: rgba(29, 29, 32, 0.08);
--color-border-muted: rgba(29, 29, 32, 0.05);
--color-accent-fg: #349890;
--color-btn-primary-text: #ffffff;
--color-btn-primary-bg: #52bbb1;
--color-btn-primary-hover-bg: #7acfc7;
--color-btn-primary-border: rgba(52, 152, 144, 0.2);
--color-btn-primary-hover-border: rgba(52, 152, 144, 0.24);
}
.border,
.color-border-primary {
border-color: rgba(29, 29, 32, 0.07) !important;
}
.gsc-comment-box-buttons .btn-primary {
border-radius: 999px !important;
border-color: transparent !important;
background-color: #52bbb1 !important;
color: #ffffff !important;
box-shadow: none !important;
}
.gsc-comment-box-buttons .btn-primary:hover:not(:disabled) {
background-color: #7acfc7 !important;
}
.gsc-comment-box-buttons .btn-primary:disabled {
opacity: 0.62;
}
/* Limit long giscus comments so they don't dominate the page. */
.gsc-comment-content,
.gsc-reply-content {
max-height: 32rem;
overflow-y: auto;
padding-inline-end: 0.5rem;
}
.gsc-comment-content::-webkit-scrollbar,
.gsc-reply-content::-webkit-scrollbar {
width: 0.35rem;
}
.gsc-comment-content::-webkit-scrollbar-thumb,
.gsc-reply-content::-webkit-scrollbar-thumb {
background: rgba(31, 35, 40, 0.22);
border-radius: 999px;
}
.gsc-comment-content::-webkit-scrollbar-track,
.gsc-reply-content::-webkit-scrollbar-track {
background: transparent;
}
-770
View File
@@ -1,770 +0,0 @@
/* Color Settings */
/* https://github.com/squidfunk/mkdocs-material/blob/6b5035f5580f97532d664e3d1babf5f320e88ee9/src/assets/stylesheets/main/_colors.scss */
/* https://squidfunk.github.io/mkdocs-material/setup/changing-the-colors/#custom-colors */
:root>* {
--md-primary-fg-color: #ffffff;
--md-primary-bg-color: #1d1d20;
--md-default-fg-color: #1d1d20;
--md-default-bg-color: #ffffff;
--md-body-bg-color: #22272e;
--md-header-bg-color: rgba(255, 255, 255, 0.6);
--md-code-fg-color: #1d1d20;
--md-code-bg-color: #f5f5f5;
--md-accent-fg-color: #999;
--md-typeset-color: #1d1d20;
--md-typeset-a-color: #349890;
--md-typeset-btn-color: #55aea6;
--md-typeset-btn-hover-color: #52bbb1;
--md-admonition-icon--pythontutor: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19.14 7.5A2.86 2.86 0 0 1 22 10.36v3.78A2.86 2.86 0 0 1 19.14 17H12c0 .39.32.96.71.96H17v1.68a2.86 2.86 0 0 1-2.86 2.86H9.86A2.86 2.86 0 0 1 7 19.64v-3.75a2.85 2.85 0 0 1 2.86-2.85h5.25a2.85 2.85 0 0 0 2.85-2.86V7.5h1.18m-4.28 11.79c-.4 0-.72.3-.72.89 0 .59.32.71.72.71a.71.71 0 0 0 .71-.71c0-.59-.32-.89-.71-.89m-10-1.79A2.86 2.86 0 0 1 2 14.64v-3.78A2.86 2.86 0 0 1 4.86 8H12c0-.39-.32-.96-.71-.96H7V5.36A2.86 2.86 0 0 1 9.86 2.5h4.28A2.86 2.86 0 0 1 17 5.36v3.75a2.85 2.85 0 0 1-2.86 2.85H8.89a2.85 2.85 0 0 0-2.85 2.86v2.68H4.86M9.14 5.71c.4 0 .72-.3.72-.89 0-.59-.32-.71-.72-.71-.39 0-.71.12-.71.71s.32.89.71.89Z"/></svg>');
--md-admonition-pythontutor-color: #eee;
}
[data-md-color-scheme="slate"] {
--theme-dark-base: #1E1E1E;
--theme-dark-mantle: #1A1A1A;
--theme-dark-crust: #171717;
--hero-starfield-bg-color: var(--theme-dark-base);
--md-primary-fg-color: var(--theme-dark-base);
--md-primary-bg-color: #adbac7;
--md-default-fg-color: #adbac7;
--md-default-bg-color: var(--theme-dark-base);
--md-body-bg-color: var(--theme-dark-mantle);
--md-header-bg-color: rgba(26, 26, 26, 0.8);
--md-code-fg-color: #adbac7;
--md-code-bg-color: var(--theme-dark-crust);
--md-accent-fg-color: #aaa;
--md-footer-fg-color: #adbac7;
--md-footer-bg-color: var(--theme-dark-mantle);
--md-typeset-color: #adbac7;
--md-typeset-a-color: #52bbb1;
--md-typeset-btn-color: #52bbb1;
--md-typeset-btn-hover-color: #55aea6;
--md-admonition-pythontutor-color: var(--theme-dark-crust);
}
[data-md-color-scheme="slate"][data-md-color-primary="black"],
[data-md-color-scheme="slate"][data-md-color-primary="white"] {
--md-typeset-a-color: #52bbb1;
}
[data-md-color-scheme="slate"] .md-footer,
[data-md-color-scheme="slate"] .md-footer__inner {
background-color: var(--theme-dark-mantle);
color: var(--md-footer-fg-color);
}
[data-md-color-scheme="slate"] .md-footer-meta {
background-color: var(--theme-dark-crust);
color: var(--md-footer-fg-color);
}
[data-md-color-scheme="slate"] .md-footer__link {
background-color: var(--theme-dark-crust);
color: var(--md-footer-fg-color);
}
[data-md-color-scheme="slate"] .md-footer__link:hover {
background-color: var(--theme-dark-base);
}
[data-md-color-scheme="slate"] .md-footer__title,
[data-md-color-scheme="slate"] .md-footer__direction,
[data-md-color-scheme="slate"] .md-footer__button,
[data-md-color-scheme="slate"] .md-copyright,
[data-md-color-scheme="slate"] .md-copyright a,
[data-md-color-scheme="slate"] .md-social,
[data-md-color-scheme="slate"] .md-social__link {
color: var(--md-footer-fg-color);
}
/* https://github.com/squidfunk/mkdocs-material/issues/4832#issuecomment-1374891676 */
.md-nav__link[for] {
color: var(--md-default-fg-color) !important;
}
/* Figure class */
.animation-figure {
border-radius: 0.3rem;
display: block;
margin: 0 auto;
box-shadow: var(--md-shadow-z2);
}
/* Cover image class */
.cover-image {
width: 28rem;
height: auto;
border-radius: 0.3rem;
display: block;
margin: 0 auto;
box-shadow: var(--md-shadow-z2);
}
/* Center Markdown Tables (requires md_in_html extension) */
.center-table {
text-align: center;
}
/* Reset alignment for table cells */
.md-typeset .center-table :is(td, th):not([align]) {
text-align: initial;
}
/* Font size */
.md-typeset {
font-size: 0.75rem;
line-height: 1.5;
}
.md-typeset pre {
font-size: 0.95em;
}
/* Markdown Header */
/* https://github.com/squidfunk/mkdocs-material/blob/dcab57dd1cced4b77875c1aa1b53467c62709d31/src/assets/stylesheets/main/_typeset.scss */
.md-typeset h1 {
font-weight: 400;
color: var(--md-default-fg-color);
}
.md-typeset h2 {
font-weight: 400;
}
.md-typeset h3 {
font-weight: 500;
}
.md-typeset h5 {
text-transform: none;
}
.md-typeset a:hover {
color: var(--md-typeset-a-color);
text-decoration: underline;
}
.md-typeset code {
border-radius: 0.2rem;
}
.highlight span.filename {
font-weight: normal;
}
/* font-family setting for Win10 */
body {
--md-text-font-family: -apple-system, BlinkMacSystemFont,
var(--md-text-font, _), Helvetica, Arial, sans-serif;
--md-code-font-family: var(--md-code-font, _), SFMono-Regular, Consolas, Menlo,
-apple-system, BlinkMacSystemFont, var(--md-text-font, _), monospace;
}
/* max height of code block */
/* https://github.com/squidfunk/mkdocs-material/issues/3444 */
.md-typeset pre>code {
max-height: 25rem;
}
/* Keep code block scrollbar hover neutral instead of accent-colored */
.md-typeset pre>code:hover {
scrollbar-color: var(--md-default-fg-color--lighter) transparent;
}
.md-typeset pre>code::-webkit-scrollbar-thumb:hover {
background-color: var(--md-default-fg-color--lighter);
}
/* Make the picture not glare in dark theme */
[data-md-color-scheme="slate"] .md-typeset img,
[data-md-color-scheme="slate"] .md-typeset svg,
[data-md-color-scheme="slate"] .md-typeset video {
filter: brightness(0.85) invert(0.05);
}
/* landing page */
.header-img-div {
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto;
width: 100%;
/* Default to full width */
}
/* Admonition for python tutor */
.md-typeset .admonition.pythontutor,
.md-typeset details.pythontutor {
border-color: var(--md-default-fg-color--lightest);
margin-top: 0;
margin-bottom: 1.5625em;
}
.md-typeset .pythontutor>.admonition-title,
.md-typeset .pythontutor>summary {
background-color: var(--md-code-bg-color);
}
.md-typeset .pythontutor>.admonition-title::before,
.md-typeset .pythontutor>summary::before {
background-color: rgb(55, 118, 171);
-webkit-mask-image: var(--md-admonition-icon--pythontutor);
mask-image: var(--md-admonition-icon--pythontutor);
}
/* code block tabs */
.md-typeset .tabbed-labels>label {
font-size: 0.61rem;
}
.md-typeset .tabbed-labels--linked>label>a {
padding: .78125em 1.0em .625em;
}
/* header banner */
.md-banner {
background-color: var(--md-code-bg-color);
color: var(--md-default-fg-color);
font-size: 0.75rem;
}
.md-banner .banner-svg svg {
margin-right: 0.3rem;
height: 0.63rem;
fill: var(--md-default-fg-color);
}
.pythontutor-iframe {
width: 125%;
height: 125%;
max-width: 125% !important;
max-height: 125% !important;
transform: scale(0.8);
transform-origin: top left;
border: none;
}
/* landing page container */
.home-div {
width: 100%;
height: auto;
display: flex;
justify-content: center;
align-items: center;
background-color: var(--md-default-bg-color);
color: var(--md-default-fg-color);
font-size: 0.9rem;
padding: 3em 2em;
text-align: center;
}
.section-content {
width: 100%;
height: auto;
max-width: 70vw;
}
/* rounded button */
.rounded-button {
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 10em;
margin: 0 0.1em;
padding: 0.6em 1.3em;
border: none;
background-color: var(--md-typeset-btn-color);
color: var(--md-primary-fg-color) !important;
text-align: center;
text-decoration: none;
cursor: pointer;
}
.rounded-button:hover {
background-color: var(--md-typeset-btn-hover-color);
}
.rounded-button span {
margin: 0;
margin-bottom: 0.07em;
white-space: nowrap;
}
.rounded-button svg {
fill: var(--md-primary-fg-color);
width: auto;
height: 1.2em;
margin-right: 0.5em;
}
/* device image */
.device-on-hover {
width: auto;
transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}
a:hover .device-on-hover {
filter: drop-shadow(0 0 0.2rem rgba(0, 0, 0, 0.15));
transform: scale(1.01);
}
/* text button */
.reading-media {
display: flex;
justify-content: center;
align-items: flex-end;
height: 32vw;
}
.media-block {
height: 100%;
margin: 0 0.2em;
}
.text-button {
width: auto;
color: var(--md-typeset-btn-color);
text-decoration: none;
text-align: center;
margin: 2.7em auto;
}
.text-button span {
white-space: nowrap;
}
.text-button svg {
display: inline-block;
fill: var(--md-typeset-btn-color);
width: auto;
height: 0.9em;
background-size: cover;
padding-top: 0.17em;
margin-left: 0.15em;
}
a:hover .text-button span {
text-decoration: underline;
}
/* hero image */
.hero-div {
height: min(84vh, 75vw);
width: min(112vh, 100vw);
margin: 0 auto;
margin-top: -2.4rem;
padding: 0;
position: relative;
font-size: min(1.8vh, 2.5vw);
font-weight: normal;
}
.hero-bg {
height: 100%;
width: 100%;
object-fit: cover;
position: absolute;
}
/* hover on the planets */
.hero-div>a>img {
width: auto;
position: absolute;
transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}
.hero-div>a>span {
margin: 0;
position: absolute;
transform: translateX(-50%) translateY(-50%);
white-space: nowrap;
/* prevent line breaks */
color: white;
}
.hero-div>a:hover>img {
filter: brightness(1.15) saturate(1.1) drop-shadow(0 0 0.5rem rgba(255, 255, 255, 0.2));
transform: scale(1.03);
}
.hero-div>a:hover>span {
text-decoration: underline;
color: var(--md-typeset-btn-color);
}
.heading-div {
width: 100%;
position: absolute;
transform: translateX(-50%);
left: 50%;
bottom: min(2vh, 3vw);
pointer-events: none;
color: #fff;
}
/* code badge */
.code-badge {
width: 100%;
height: auto;
margin: 1em auto;
}
.code-badge img {
height: 1.07em;
width: auto;
}
/* brief intro */
.intro-container {
display: flex;
align-items: center;
margin: 2em auto;
}
.intro-image {
flex-shrink: 0;
flex-grow: 0;
width: 50%;
border-radius: 0.5em;
box-shadow: var(--md-shadow-z2);
}
.intro-text {
flex-grow: 1;
/* fill the space */
display: flex;
flex-direction: column;
justify-content: center;
text-align: left;
align-items: flex-start;
width: fit-content;
margin: 2em;
}
.intro-text>div {
align-self: flex-start;
width: auto;
margin: 0 auto;
}
.endor-text {
width: 50%;
}
.intro-quote {
color: var(--md-accent-fg-color);
font-weight: bold;
}
/* contributors table */
.profile-div {
display: flex;
flex-wrap: wrap;
justify-content: center;
max-width: 40em;
margin: 1em auto;
}
.profile-cell {
flex: 1 1 15%;
margin: 1em 0;
text-align: center;
}
.profile-img {
width: 5em;
border-radius: 50%;
margin-bottom: 0.5em;
}
.translator-profile-div {
gap: 0.5em;
}
.translator-profile-cell {
flex: 0 0 auto;
margin: 0.5em 0;
min-width: 8.5em;
}
.giscus-container {
width: 40em;
max-width: 100%;
margin: 0 auto;
}
/* Hide navigation */
@media screen and (max-width: 76.25em) {
.section-content {
max-width: 95vw;
}
.reading-media {
height: 33vw;
}
.contrib-image {
width: 100%;
}
}
/* mobile devices */
@media screen and (max-width: 60em) {
.home-div {
font-size: 0.75rem;
}
.hero-div {
margin-top: -4rem;
}
.intro-container {
flex-direction: column;
}
.intro-text {
width: auto;
order: 2;
margin: 0 auto;
}
.endor-text {
width: auto;
margin: 0 auto;
}
.intro-image {
width: 100%;
order: 1;
margin-bottom: 1em;
}
.text-button {
margin: 0.7em auto;
}
.profile-cell {
flex: 1 1 30%;
}
}
.video-container {
position: relative;
padding-bottom: 56.25%;
/* 16:9 */
height: 0;
}
.video-container iframe {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
/* starfield */
.starfield {
position: absolute;
width: 100%;
height: 100%;
z-index: 0;
background-color: var(--hero-starfield-bg-color, transparent);
}
.starfield-origin {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
/* Zensical-specific adjustments merged into the main stylesheet. */
:root>* {
--md-accent-fg-color: var(--md-typeset-a-color);
--md-admonition-pythontutor-color: var(--md-code-bg-color);
--hello-algo-sidebar-width: 13rem;
}
[data-md-color-scheme="slate"] {
--md-accent-fg-color: var(--md-typeset-a-color);
--md-admonition-pythontutor-color: var(--md-code-bg-color);
--md-body-bg-color: var(--md-default-bg-color);
--md-default-bg-color--light: rgb(30 30 30 / 0.8);
}
[data-md-color-scheme="slate"] .md-typeset details.pythontutor[open]> :not(summary),
[data-md-color-scheme="slate"] .md-typeset details.pythontutor[open]> :not(summary) :is(p, li, strong, em, sub, sup, code, a) {
background-color: #f5f5f5;
color: #1d1d20;
}
body {
background-color: var(--md-default-bg-color);
}
html:has(body[data-md-color-scheme="slate"]) {
background-color: #1e1e1e;
}
html:has(body[data-md-color-scheme="default"]) {
background-color: #ffffff;
}
.home-div[data-md-color-scheme="default"],
.home-div[data-md-color-scheme="default"] h1,
.home-div[data-md-color-scheme="default"] h2,
.home-div[data-md-color-scheme="default"] h3,
.home-div[data-md-color-scheme="default"] h4,
.home-div[data-md-color-scheme="default"] h5,
.home-div[data-md-color-scheme="default"] h6 {
color: var(--md-default-fg-color);
}
.home-div[data-md-color-scheme="slate"],
.home-div[data-md-color-scheme="slate"] h1,
.home-div[data-md-color-scheme="slate"] h2,
.home-div[data-md-color-scheme="slate"] h3,
.home-div[data-md-color-scheme="slate"] h4,
.home-div[data-md-color-scheme="slate"] h5,
.home-div[data-md-color-scheme="slate"] h6 {
color: var(--md-default-fg-color);
}
.home-div .intro-quote {
color: var(--md-default-fg-color--light) !important;
}
.reading-media+p {
margin-top: 1em !important;
}
.md-typeset .admonition-title:before,
.md-typeset summary:before,
.md-typeset summary:after {
top: 50%;
}
.md-typeset .admonition-title:before,
.md-typeset summary:before {
transform: translateY(-50%);
}
.md-typeset summary:after {
transform: translateY(-50%) rotate(0deg);
}
.md-typeset details[open]>summary:after {
transform: translateY(-50%) rotate(90deg);
}
.md-nav__link[for] {
color: inherit !important;
}
.md-nav__link[for].md-nav__link--active {
color: var(--md-accent-fg-color) !important;
}
@media screen and (min-width: 76.25em) {
.md-grid {
max-width: calc(61rem + 2 * (var(--hello-algo-sidebar-width) - 12.1rem));
}
.md-sidebar--primary,
.md-sidebar--secondary {
width: var(--hello-algo-sidebar-width);
}
[dir="ltr"] .md-sidebar__inner {
padding-right: calc(100% - (var(--hello-algo-sidebar-width) - 0.6rem));
}
[dir="rtl"] .md-sidebar__inner {
padding-left: calc(100% - (var(--hello-algo-sidebar-width) - 0.6rem));
}
}
.md-sidebar--primary .md-sidebar__scrollwrap {
scrollbar-color: var(--md-default-fg-color--lighter) transparent;
}
.md-sidebar--primary .md-sidebar__scrollwrap::-webkit-scrollbar-thumb,
.md-sidebar--primary .md-sidebar__scrollwrap::-webkit-scrollbar-thumb:hover {
background-color: var(--md-default-fg-color--lighter);
}
.md-footer,
.md-footer__inner,
.md-footer-meta,
.md-footer__link,
.md-footer__link:hover {
background-color: var(--md-default-bg-color);
}
.md-footer {
border-top: 0.05rem solid var(--md-default-fg-color--lightest);
}
[data-md-color-scheme="slate"] .md-footer,
[data-md-color-scheme="slate"] .md-footer__inner,
[data-md-color-scheme="slate"] .md-footer-meta,
[data-md-color-scheme="slate"] .md-footer__link,
[data-md-color-scheme="slate"] .md-footer__link:hover {
background-color: var(--md-default-bg-color);
}
.md-banner {
background-color: var(--md-default-bg-color);
}
.md-typeset .admonition.pythontutor,
.md-typeset details.pythontutor,
.md-typeset .pythontutor>.admonition-title,
.md-typeset .pythontutor>summary {
background-color: var(--md-code-bg-color);
}
.md-typeset .pythontutor>.admonition-title::before,
.md-typeset .pythontutor>summary::before,
.md-typeset .pythontutor>summary::after {
top: 50%;
}
.md-typeset .pythontutor>.admonition-title::before,
.md-typeset .pythontutor>summary::before {
transform: translateY(-50%);
}
.md-typeset .pythontutor>summary::after {
transform: translateY(-50%) rotate(0deg);
}
.md-typeset details[open].pythontutor>summary::after {
transform: translateY(-50%) rotate(90deg);
}
.md-typeset a:not(.md-button) {
text-decoration: none;
}
.md-typeset a:not(.md-button):hover,
.md-typeset a:not(.md-button):focus-visible {
text-decoration: underline;
}
-20
View File
@@ -1,20 +0,0 @@
[project]
extra_css = [
"stylesheets/extra.css",
]
[project.theme]
features = [
"content.action.edit",
"content.code.annotate",
"content.code.copy",
"content.tabs.link",
"content.tooltips",
"navigation.indexes",
"navigation.top",
"navigation.tracking",
"search.highlight",
"search.share",
"search.suggest",
"toc.follow",
]