Compare commits

...

2 Commits

Author SHA1 Message Date
Bauke eb48cc70c1
Add logo to header and favicon. 2022-10-09 13:37:37 +02:00
Bauke 0cf9dda4fd
Narrow img style to charts. 2022-10-09 13:34:46 +02:00
8 changed files with 32 additions and 6 deletions

14
source/assets/mod.rs Normal file
View File

@ -0,0 +1,14 @@
//! Miscellaneous assets.
use {
async_std::{fs::write, path::PathBuf},
color_eyre::Result,
};
/// Write all misellaneous asset files to where they belong.
pub async fn write_assets(parent: &PathBuf) -> Result<()> {
let logo = include_bytes!("tildes-statistics.png");
write(parent.join("tildes-statistics.png"), logo).await?;
Ok(())
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -6,6 +6,7 @@ use {
};
use crate::{
assets::write_assets,
charts::UserCountChart,
cli::{
Cli, MainSubcommands, MigrateSubcommands, SnapshotSubcommands,
@ -112,6 +113,7 @@ pub async fn run() -> Result<()> {
.render_to_file(&output)
.await?;
generate_css(&output).await?;
write_assets(&output).await?;
if let Some(group) = user_count_group {
let groups =

View File

@ -11,6 +11,7 @@ use {
tracing_subscriber::filter::{EnvFilter, LevelFilter},
};
pub mod assets;
pub mod charts;
pub mod cli;
pub mod group_data;

View File

@ -26,11 +26,6 @@ a:visited {
}
}
img {
display: block;
width: 100%;
}
h1,
h2,
h3,

View File

@ -17,8 +17,15 @@
}
.page-header {
align-items: center;
border-bottom: 4px solid var(--background-2);
display: flex;
padding: var(--large-spacing);
img {
height: 4rem;
margin-right: var(--large-spacing);
}
}
.page-main {
@ -59,6 +66,11 @@
background-color: var(--background-2);
}
}
.chart {
display: block;
width: 100%;
}
}
.page-footer {

View File

@ -6,6 +6,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ page_title }}</title>
<link rel="shortcut icon" href="/tildes-statistics.png" type="image/png">
<link rel="stylesheet" href="/css/modern-normalize.css">
<link rel="stylesheet" href="/css/common.css">
{% block head %}{% endblock %}

View File

@ -6,6 +6,7 @@
{% block body %}
<header class="page-header">
<img src="/tildes-statistics.png" alt="Tildes Statistics Logo">
<h1>Tildes Statistics</h1>
</header>
@ -18,7 +19,7 @@
registered users on Tildes.
</p>
<img src="/charts/user-count.svg" alt="User Count Chart">
<img class="chart" src="/charts/user-count.svg" alt="User Count Chart">
<table>
<thead>