aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2023-09-26 13:24:19 +0200
committerAlex Auvolat <alex@adnab.me>2023-09-26 13:24:19 +0200
commitb4de4308953c027e1af43277e716dc756405c9e5 (patch)
tree9ed7f9ce171cf701e15efd83858f92de82186e89
parentfff245eaa5db1289a652da41ff7826bd368d7180 (diff)
downloaddatagengo-b4de4308953c027e1af43277e716dc756405c9e5.tar.gz
datagengo-b4de4308953c027e1af43277e716dc756405c9e5.zip
Add modest amounts of css
-rw-r--r--src/main.rs8
-rw-r--r--static/style.css14
2 files changed, 16 insertions, 6 deletions
diff --git a/src/main.rs b/src/main.rs
index 06c0a07..c882741 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1142,13 +1142,13 @@ fn format_index(batches: &[Batch], kanji_levels: &[(String, String)]) -> Result<
<title>List of batches</title>
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
- <body>"#
+ <body><div class="index_page">"#
)?;
writeln!(f, r#"<p><a href="about.html">About / How-to</a></p><hr />"#)?;
writeln!(f, "<table>")?;
- writeln!(f, "<tr><th>Num</th><th>Level</th><th>Chars</th><th>Examples</th><th>B-1</th><th>B-2</th><th>Ignore</th></tr>")?;
+ writeln!(f, "<tr><th>Num</th><th>Level</th><th>Kanji</th><th>Examples</th><th>Lesson-1</th><th>Lesson-2</th><th>Ignore</th></tr>")?;
for (i, batch) in batches.iter().enumerate() {
writeln!(
f,
@@ -1176,7 +1176,7 @@ fn format_index(batches: &[Batch], kanji_levels: &[(String, String)]) -> Result<
writeln!(f, "<table>")?;
writeln!(
f,
- "<tr><th>Level</th><th>Count</th><th>Chars</th><th>Missing chars</th></tr>"
+ r#"<tr><th>Level</th><th>Count</th><th width="60%">Kanji</th><th>Missing kanji</th></tr>"#
)?;
for (lvl, chars) in kanji_levels.iter() {
if lvl == "N0+" || lvl.ends_with("-10") {
@@ -1196,7 +1196,7 @@ fn format_index(batches: &[Batch], kanji_levels: &[(String, String)]) -> Result<
}
writeln!(f, "</table>")?;
- write!(f, "</body></html>")?;
+ write!(f, "</div></body></html>")?;
f.flush()?;
Ok(())
}
diff --git a/static/style.css b/static/style.css
index 8721461..384388e 100644
--- a/static/style.css
+++ b/static/style.css
@@ -3,12 +3,17 @@ a {
text-decoration: none;
}
-tr:hover {
+tr:nth-child(odd) {
background: #EEE;
}
-td {
+th, td {
vertical-align: top;
+ padding: 3px;
+}
+
+table {
+ border-spacing: 0px;
}
.chars {
@@ -45,6 +50,11 @@ details .chars {
font-size: 3rem;
}
+.index_page {
+ max-width: 1000px;
+ margin: auto;
+}
+
.about_page, .batch_page {
max-width: 800px;
margin: auto;