hello-algo/stylesheets/extra.css

537 lines
11 KiB
CSS
Raw Normal View History

2023-02-08 14:54:41 +08:00
/* 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 > * {
2023-09-12 03:15:25 +08:00
--md-primary-fg-color: #ffffff;
--md-primary-bg-color: #1d1d20;
--md-default-fg-color: #1d1d20;
--md-default-bg-color: #ffffff;
2024-02-08 03:34:53 +08:00
--md-body-bg-color: #22272e;
--md-header-bg-color: rgba(255, 255, 255, 0.6);
2023-09-12 03:25:18 +08:00
--md-code-fg-color: #1d1d20;
2024-01-04 04:56:58 +08:00
--md-code-bg-color: #f5f5f5;
2023-09-12 03:25:18 +08:00
2023-09-12 03:15:25 +08:00
--md-accent-fg-color: #999;
2023-02-08 14:54:41 +08:00
2023-09-12 03:15:25 +08:00
--md-admonition-fg-color: #1d1d20;
2023-02-08 14:54:41 +08:00
2023-09-12 03:15:25 +08:00
--md-typeset-color: #1d1d20;
2023-12-06 22:28:53 +08:00
--md-typeset-a-color: #349890;
--md-typeset-btn-color: #55aea6;
--md-typeset-btn-hover-color: #52bbb1;
2024-01-04 04:56:58 +08:00
--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>');
2024-01-04 15:23:24 +08:00
--md-admonition-pythontutor-color: #eee;
2023-02-08 14:54:41 +08:00
}
[data-md-color-scheme="slate"] {
2023-09-12 03:15:25 +08:00
--md-primary-fg-color: #22272e;
--md-primary-bg-color: #adbac7;
--md-default-fg-color: #adbac7;
--md-default-bg-color: #22272e;
2024-02-08 03:34:53 +08:00
--md-body-bg-color: #22272e;
--md-header-bg-color: rgba(34, 39, 46, 0.8);
2023-09-12 03:25:18 +08:00
--md-code-fg-color: #adbac7;
2024-01-04 04:56:58 +08:00
--md-code-bg-color: #1d2126;
2023-02-08 14:54:41 +08:00
2023-09-12 03:25:18 +08:00
--md-accent-fg-color: #aaa;
2023-02-08 14:54:41 +08:00
2023-09-12 03:15:25 +08:00
--md-admonition-fg-color: #adbac7;
--md-footer-fg-color: #adbac7;
--md-typeset-color: #adbac7;
2024-02-08 03:34:53 +08:00
--md-typeset-a-color: #52bbb1;
2023-12-06 22:28:53 +08:00
--md-typeset-btn-color: #52bbb1;
--md-typeset-btn-hover-color: #55aea6;
2024-01-04 15:23:24 +08:00
--md-admonition-pythontutor-color: #30363f;
2023-02-08 14:54:41 +08:00
}
2024-02-08 03:34:53 +08:00
[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-primary="black"] .md-header {
background-color: var(--md-header-bg-color);
}
.md-header {
box-shadow: none;
transition: none;
backdrop-filter: saturate(180%) blur(20px); /* Gaussian blur */
2024-02-08 03:45:27 +08:00
-webkit-backdrop-filter: saturate(180%) blur(20px); /* Safari */
2024-02-08 03:34:53 +08:00
background-color: var(--md-header-bg-color);
}
2023-02-08 14:54:41 +08:00
/* https://github.com/squidfunk/mkdocs-material/issues/4832#issuecomment-1374891676 */
.md-nav__link[for] {
2023-09-12 03:15:25 +08:00
color: var(--md-default-fg-color) !important;
2023-02-08 14:54:41 +08:00
}
2023-11-09 05:13:54 +08:00
/* Figure class */
.animation-figure {
2024-02-07 21:39:15 +08:00
border-radius: 0.3rem;
2023-11-09 05:13:54 +08:00
display: block;
margin: 0 auto;
2023-12-28 22:35:06 +08:00
box-shadow: var(--md-shadow-z2);
2023-11-09 05:13:54 +08:00
}
/* Cover image class */
.cover-image {
width: 28rem;
height: auto;
border-radius: 0.3rem;
display: block;
margin: 0 auto;
2024-01-15 01:12:10 +08:00
box-shadow: var(--md-shadow-z2);
2023-11-09 05:13:54 +08:00
}
2023-02-08 14:54:41 +08:00
/* Center Markdown Tables (requires md_in_html extension) */
.center-table {
2023-03-07 01:16:02 +08:00
text-align: center;
2023-02-08 14:54:41 +08:00
}
2023-03-07 01:16:02 +08:00
/* Reset alignment for table cells */
2023-09-12 03:15:25 +08:00
.md-typeset .center-table :is(td, th):not([align]) {
2023-03-07 01:16:02 +08:00
text-align: initial;
2023-02-08 14:54:41 +08:00
}
2023-03-07 01:16:02 +08:00
/* Font size */
.md-typeset {
font-size: 0.75rem;
line-height: 1.5;
}
.md-typeset pre {
font-size: 0.95em;
}
2023-02-08 14:54:41 +08:00
/* 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;
}
2023-10-06 13:31:31 +08:00
.md-typeset h5 {
text-transform: none;
}
2024-01-23 19:20:03 +08:00
.md-typeset a:hover {
color: var(--md-typeset-a-color);
text-decoration: underline;
}
2024-01-04 04:56:58 +08:00
.md-typeset code {
border-radius: 0.2rem;
}
.highlight span.filename {
font-weight: normal;
}
2023-02-08 14:54:41 +08:00
/* font-family setting for Win10 */
body {
2023-09-12 03:15:25 +08:00
--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;
2023-02-08 14:54:41 +08:00
}
/* max height of code block */
/* https://github.com/squidfunk/mkdocs-material/issues/3444 */
.md-typeset pre > code {
2023-03-07 01:16:02 +08:00
max-height: 25rem;
2023-02-08 14:54:41 +08:00
}
2023-09-12 03:15:25 +08:00
/* 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);
}
2023-12-05 16:21:11 +08:00
/* landing page */
2023-12-06 22:28:53 +08:00
.header-img-div {
2023-12-05 16:21:11 +08:00
display: flex;
align-items: center;
justify-content: center;
2023-12-06 22:28:53 +08:00
margin: 0 auto;
2023-12-05 16:21:11 +08:00
width: 100%; /* Default to full width */
}
2023-12-05 20:32:48 +08:00
2024-01-04 04:56:58 +08:00
/* Admonition for python tutor */
.md-typeset .admonition.pythontutor,
.md-typeset details.pythontutor {
2024-01-04 15:23:24 +08:00
border-color: var(--md-default-fg-color--lightest);
2024-01-07 03:26:32 +08:00
margin-top: 0;
margin-bottom: 1.5625em;
2024-01-04 04:56:58 +08:00
}
2024-01-04 15:23:24 +08:00
.md-typeset .admonition:focus-within,
.md-typeset details:focus-within {
2024-01-04 04:56:58 +08:00
box-shadow: var(--md-shadow-z1);
}
.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);
2024-01-04 15:23:24 +08:00
mask-image: var(--md-admonition-icon--pythontutor);
}
.md-typeset .admonition-title:before,
.md-typeset summary:before {
width: 1.25em;
2024-01-04 04:56:58 +08:00
}
2024-01-09 04:42:07 +08:00
2024-03-25 22:43:19 +08:00
/* code block tabs */
.md-typeset .tabbed-labels>label {
2024-03-31 03:53:09 +08:00
font-size: 0.545rem;
2024-03-25 22:43:19 +08:00
}
2024-02-23 17:03:55 +08:00
/* header banner */
.md-banner {
background-color: var(--md-code-bg-color);
color: var(--md-default-fg-color);
font-size: 0.75rem;
}
2024-02-23 17:59:37 +08:00
.md-banner .banner-svg svg {
2024-02-23 17:03:55 +08:00
margin-right: 0.3rem;
height: 0.63rem;
fill: var(--md-default-fg-color);
}
2024-01-09 04:42:07 +08:00
.pythontutor-iframe {
width: 125%;
height: 125%;
max-width: 125% !important;
max-height: 125% !important;
transform: scale(0.8);
transform-origin: top left;
border: none;
}
2024-01-22 19:05:45 +08:00
/* 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;
2024-01-24 16:58:27 +08:00
padding: 3em 2em;
2024-01-22 19:05:45 +08:00
text-align: center;
}
.section-content {
width: 100%;
height: auto;
max-width: 70vw;
}
2024-01-23 19:20:03 +08:00
/* rounded button */
.rounded-button {
display: inline-flex;
align-items: center;
justify-content: center;
border-radius: 10em;
2024-01-22 19:05:45 +08:00
margin: 0 0.1em;
2024-01-24 16:58:27 +08:00
padding: 0.6em 1.3em;
2024-01-23 19:20:03 +08:00
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);
}
2024-01-24 16:58:27 +08:00
.rounded-button span {
2024-01-23 19:20:03 +08:00
margin: 0;
2024-01-24 16:58:27 +08:00
margin-bottom: 0.07em;
white-space: nowrap;
2024-01-23 19:20:03 +08:00
}
.rounded-button svg {
fill: var(--md-primary-fg-color);
width: auto;
height: 1.2em;
margin-right: 0.5em;
}
2024-02-07 21:39:15 +08:00
/* 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.02);
}
2024-01-23 19:20:03 +08:00
/* text button */
2024-02-07 21:39:15 +08:00
.reading-media {
2024-01-23 19:20:03 +08:00
display: flex;
justify-content: center;
2024-02-07 21:39:15 +08:00
align-items: flex-end;
height: 32vw;
}
.media-block {
height: 100%;
margin: 0 0.2em;
2024-01-23 19:20:03 +08:00
}
.text-button {
2024-02-07 21:39:15 +08:00
width: auto;
2024-01-23 19:20:03 +08:00
color: var(--md-typeset-btn-color);
text-decoration: none;
2024-02-07 21:39:15 +08:00
text-align: center;
margin: 2.7em auto;
2024-01-23 19:20:03 +08:00
}
2024-01-24 16:58:27 +08:00
.text-button span {
white-space: nowrap;
}
2024-01-23 19:20:03 +08:00
.text-button svg {
display: inline-block;
fill: var(--md-typeset-btn-color);
width: auto;
height: 0.9em;
background-size: cover;
padding-top: 0.17em;
2024-02-07 21:39:15 +08:00
margin-left: 0.15em;
}
a:hover .text-button span {
text-decoration: underline;
2024-01-22 19:05:45 +08:00
}
/* hero image */
2024-02-29 20:54:40 +08:00
.hero-div {
2024-01-22 19:05:45 +08:00
height: min(84vh, 75vw);
width: min(112vh, 100vw);
margin: 0 auto;
margin-top: -2.4rem;
padding: 0;
position: relative;
2024-01-24 16:58:27 +08:00
font-size: min(1.8vh, 2.5vw);
2024-01-28 22:31:13 +08:00
font-weight: normal;
2024-01-22 19:05:45 +08:00
}
.hero-bg {
height: 100%;
width: 100%;
object-fit: cover;
position: absolute;
}
/* hover on the planets */
2024-02-29 20:54:40 +08:00
.hero-div > a > img {
2024-01-22 19:05:45 +08:00
width: auto;
position: absolute;
transition: transform 0.3s ease-in-out, filter 0.3s ease-in-out;
}
2024-02-29 20:54:40 +08:00
.hero-div > a > span {
2024-01-22 19:05:45 +08:00
margin: 0;
position: absolute;
transform: translateX(-50%) translateY(-50%);
2024-01-22 23:36:00 +08:00
white-space: nowrap; /* prevent line breaks */
2024-01-28 22:31:13 +08:00
color: white;
2024-01-22 19:05:45 +08:00
}
2024-02-29 20:54:40 +08:00
.hero-div > a:hover > img {
2024-01-22 23:36:00 +08:00
filter: brightness(1.15) saturate(1.1)
drop-shadow(0 0 0.5rem rgba(255, 255, 255, 0.2));
2024-01-22 19:05:45 +08:00
transform: scale(1.03);
}
2024-02-29 20:54:40 +08:00
.hero-div > a:hover > span {
2024-01-23 19:20:03 +08:00
text-decoration: underline;
2024-01-22 19:05:45 +08:00
color: var(--md-typeset-btn-color);
}
2024-02-29 20:54:40 +08:00
.heading-div {
width: 100%;
position: absolute;
transform: translateX(-50%);
left: 50%;
bottom: min(2vh, 3vw);
pointer-events: none;
color: #fff;
}
2024-01-23 00:20:55 +08:00
/* code badge */
.code-badge {
width: 100%;
height: auto;
2024-01-28 22:31:13 +08:00
margin: 1em auto;
2024-01-23 00:20:55 +08:00
}
.code-badge img {
height: 1.07em;
width: auto;
}
2024-01-22 19:05:45 +08:00
/* brief intro */
.intro-container {
display: flex;
align-items: center;
margin: 2em auto;
}
.intro-image {
flex-shrink: 0;
flex-grow: 0;
width: 55%;
border-radius: 0.5em;
box-shadow: var(--md-shadow-z2);
}
.intro-text {
2024-01-22 23:36:00 +08:00
flex-grow: 1; /* fill the space */
2024-01-22 19:05:45 +08:00
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;
}
2024-01-22 22:58:46 +08:00
.endor-text {
width: 50%;
}
2024-01-22 19:05:45 +08:00
.intro-quote {
color: var(--md-accent-fg-color);
font-weight: bold;
}
/* contributors table */
.profile-div {
display: flex;
2024-01-22 22:58:46 +08:00
flex-wrap: wrap;
justify-content: center;
2024-02-08 03:34:53 +08:00
max-width: 40em;
2024-01-22 19:05:45 +08:00
margin: 1em auto;
}
.profile-cell {
2024-01-22 23:36:00 +08:00
flex: 1; /* even distribution */
2024-01-22 19:05:45 +08:00
flex-basis: 15%;
2024-01-22 22:58:46 +08:00
margin: 1em 0.5em;
text-align: center;
2024-01-22 19:05:45 +08:00
}
.profile-img {
width: 5em;
border-radius: 50%;
2024-01-22 22:58:46 +08:00
margin-bottom: 0.5em;
2024-01-22 19:05:45 +08:00
}
2024-01-22 22:58:46 +08:00
.giscus-container {
2024-02-04 22:41:53 +08:00
width: 40em;
2024-01-22 22:58:46 +08:00
max-width: 100%;
margin: 0 auto;
2024-01-22 19:05:45 +08:00
}
/* Hide navigation */
@media screen and (max-width: 76.25em) {
.section-content {
max-width: 95vw;
}
2024-02-07 21:39:15 +08:00
.reading-media {
height: 33vw;
}
2024-02-08 03:34:53 +08:00
.contrib-image {
width: 100%;
}
}
/* Hide table of contents */
@media screen and (max-width: 60em) {
.home-div {
font-size: 0.75rem;
}
2024-01-22 19:05:45 +08:00
.intro-container {
2024-01-22 23:36:00 +08:00
flex-direction: column;
2024-01-22 19:05:45 +08:00
}
.intro-text {
width: auto;
order: 2;
margin: 0 auto;
}
2024-01-22 22:58:46 +08:00
.endor-text {
width: auto;
margin: 0 auto;
}
2024-01-22 19:05:45 +08:00
.intro-image {
2024-01-22 23:36:00 +08:00
width: 100%;
2024-01-22 19:05:45 +08:00
order: 1;
margin-bottom: 1em;
}
2024-02-08 03:34:53 +08:00
.text-button {
margin: 0.7em auto;
2024-01-22 19:05:45 +08:00
}
}
2024-03-10 20:46:48 +08:00
.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%;
}