From 1091773e9f811bd9cd3b996913234f7f92184b8c Mon Sep 17 00:00:00 2001 From: RGBCube Date: Fri, 5 Jan 2024 23:21:55 +0300 Subject: [PATCH] Make CSS simpler again --- src/errors/not_found/mod.rs | 4 +++- src/errors/not_found/not-found.css | 4 ---- src/page/cube/cube.css | 25 ++++++------------------- src/page/page.css | 10 ++-------- src/page/text/text.css | 10 +++++++++- src/routes/index/index.css | 10 +--------- 6 files changed, 21 insertions(+), 42 deletions(-) diff --git a/src/errors/not_found/mod.rs b/src/errors/not_found/mod.rs index 7b5b6d4..f39817e 100644 --- a/src/errors/not_found/mod.rs +++ b/src/errors/not_found/mod.rs @@ -22,7 +22,9 @@ pub fn handler( asset::Css::Shared("not-found.css"), array::from_fn(|_| { (html! { - .frame { "404" } + .frame { + a href="/" { "404" } + } .square .black {} .square .magenta {} .square .magenta {} diff --git a/src/errors/not_found/not-found.css b/src/errors/not_found/not-found.css index 0c4845a..1f798ed 100644 --- a/src/errors/not_found/not-found.css +++ b/src/errors/not_found/not-found.css @@ -1,7 +1,3 @@ -html { - font-weight: bold; -} - .face { display: grid; grid-template-columns: repeat(2, 1fr); diff --git a/src/page/cube/cube.css b/src/page/cube/cube.css index 63bd393..4917b3f 100644 --- a/src/page/cube/cube.css +++ b/src/page/cube/cube.css @@ -1,28 +1,11 @@ html { - font-size: 450%; + font-size: min(9vw, 9vh, 4.5em); overscroll-behavior: none; } -@media screen and (max-width: 400px) { - html { - font-size: 200%; - } -} - -@media screen and (max-width: 800px) and (min-width: 400px) { - html { - font-size: 300%; - } -} - a { - /* Black on a white background. */ - color: black; -} - -a:hover { - /* The frame changes color only. */ color: black; + font-weight: bold; } .frame { @@ -36,6 +19,10 @@ a:hover { user-select: none; } +.frame:hover { + background-color: yellow; +} + .scene { height: 100%; width: 100%; diff --git a/src/page/page.css b/src/page/page.css index 73a2177..f127262 100644 --- a/src/page/page.css +++ b/src/page/page.css @@ -2,14 +2,14 @@ font-display: block; font-family: "BaiJam"; font-weight: normal; - src: url("/assets/BaiJamjureeMedium.woff2"); + src: url("/assets/BaiJamjureeMedium.woff2") format("woff2"); } @font-face { font-display: block; font-family: "BaiJam"; font-weight: bold; - src: url("/assets/BaiJamjureeBold.woff2"); + src: url("/assets/BaiJamjureeBold.woff2") format("woff2"); } html { @@ -25,11 +25,5 @@ html { } a { - color: yellow; - font-weight: bold; text-decoration-line: none; -} - -a:hover { - font-style: italic; } \ No newline at end of file diff --git a/src/page/text/text.css b/src/page/text/text.css index e73dd6d..2535611 100644 --- a/src/page/text/text.css +++ b/src/page/text/text.css @@ -26,7 +26,7 @@ nav { nav a { color: black; - font-style: normal; + font-weight: bold; margin-right: .6em; } @@ -34,6 +34,14 @@ nav a:last-child { margin-right: 0; } +a { + color: yellow; +} + +a:hover { + font-style: italic; +} + footer { margin-bottom: 3em; } \ No newline at end of file diff --git a/src/routes/index/index.css b/src/routes/index/index.css index 6131dc0..6efc8b4 100644 --- a/src/routes/index/index.css +++ b/src/routes/index/index.css @@ -1,11 +1,3 @@ -a:hover { - font-style: normal; -} - -.frame:hover { - background-color: yellow; -} - .face::after { z-index: -1; @@ -71,4 +63,4 @@ a:hover { .left::after { background: linear-gradient(to bottom, cyan, blue); mask-image: linear-gradient(to left, blue, transparent); -} +} \ No newline at end of file