diff options
Diffstat
| -rw-r--r-- | crates/zorian/src/assets/base.css | 56 | +39 −17 |
| -rw-r--r-- | crates/zorian/src/controller_web.rs | 35 | +26 −9 |
2 files changed, 65 insertions, 26 deletions
diff --git a/crates/zorian/src/assets/base.css b/crates/zorian/src/assets/base.css index d2ddb6a..3345768 100644 --- a/crates/zorian/src/assets/base.css +++ b/crates/zorian/src/assets/base.css @@ -26,6 +26,25 @@ :root { line-height: 1.4; font-family: 'JetBrains Mono', monospace; + color-scheme: light dark; + + --color-text: #222; + --color-bg: #fff; + --color-border: #222; + --color-code-bg: #818b981f; + --color-license-bg: antiquewhite; + --color-link: #0969da; +} + +@media (prefers-color-scheme: dark) { + :root { + --color-text: #e0e0e0; + --color-bg: #1a1a1a; + --color-border: #555; + --color-code-bg: #ffffff12; + --color-license-bg: #2a2a2a; + --color-link: #58a6ff; + } } html { @@ -35,31 +54,32 @@ html { body { margin: 0 auto; - max-width: 960px; + max-width: 80ch; padding: 1.5em 2em; + color: var(--color-text); + background-color: var(--color-bg); } code { margin: 0; padding: .2em .4em; white-space: break-spaces; - background-color: #818b981f; + background-color: var(--color-code-bg); } -h1, h2, h3, h4, h5, h6 { - margin: 1rem 0; +h1, h2, h3, h4 { + margin: 1.5rem 0 0.5rem; font-weight: 700; line-height: 1.2; text-wrap: balance; } -h1 { - font-size: 2.75rem; -} +h1 { font-size: 2.25rem; line-height: 1.1; } +h2 { font-size: 1.5rem; } +h3 { font-size: 1.15rem; } +h4 { font-size: 1rem; } -h1:first-child { - margin-top: 0; -} +h1:first-child { margin-top: 0; } p, details { margin: 1em 0; @@ -72,11 +92,15 @@ table { th, td { padding: 7px 8px; - border: 2px solid black; + border: 2px solid var(--color-border); text-align: start; vertical-align: top; } +a { + color: var(--color-link); +} + h3 a { color: inherit; text-decoration: none; @@ -86,10 +110,8 @@ h3 a:hover { text-decoration: underline; } -.licenses-list { - list-style-type: none; - margin: 0; - padding: 0; +.license { + margin: 1rem 0; } .license-used-by { @@ -100,7 +122,7 @@ h3 a:hover { max-height: 280px; overflow-y: scroll; white-space: pre-wrap; - background-color: antiquewhite; - border-left: 4px solid black; + background-color: var(--color-license-bg); + border-left: 4px solid var(--color-border); padding: 0.8em 1em; } diff --git a/crates/zorian/src/controller_web.rs b/crates/zorian/src/controller_web.rs index 8e753de..7607315 100644 --- a/crates/zorian/src/controller_web.rs +++ b/crates/zorian/src/controller_web.rs @@ -320,23 +320,40 @@ impl WebController { WebController::layout( "Third Party Licenses", html! { - h1 { "Third Party Licenses" } + h1 { "Licenses" } - p { "This page lists the licenses of the projects used in Zorian." } + h2 { "Zorian" } + + p { + "Zorian is licensed under the " b { "GNU Affero General Public License v3.0 (AGPL-3.0)" } ". " + "This means you are free to use, modify, and distribute the software. " + "If you run a modified version of Zorian as a network service, " + "you must make the source code of your modifications available to its users. " + "The software is provided as-is, without warranty of any kind." + } + + p { + "Source code is available on " + a href="https://github.com/mrdimidium/zorian" { "GitHub" } + ". The full license text is included below." + } + + pre .license-text { (include_str!("../../../LICENSE")) } + + h2 { "Third party licenses" } - h2 { "Overview of licenses:" } ul { @for ov in &data.overview { li { a href=(format!("#{}", ov.id)) { (&ov.name) } " (" (ov.count) ")" } } } - h2 { "All license text:" } @for (i, lic) in data.licenses.iter().enumerate() { - div.license { - @if lic.first_of_kind { - h3 id=(&lic.id) { (&lic.name) } - } + @if lic.first_of_kind { + h3 id=(&lic.id) { (&lic.name) } + } + + section.license { h4 id=(format!("{}-{}", lic.id, i)) { (&lic.name) } p { "Used by:" } @@ -381,7 +398,7 @@ impl WebController { } body { - (content) + article { (content) } } } } |
