fix map styles

This commit is contained in:
Maciej Jur 2024-07-23 20:15:15 +02:00
parent 9ecc3f62cf
commit 1761d75ddc
Signed by: kamov
GPG key ID: 191CBFF5F72ECAFD
8 changed files with 63 additions and 22 deletions

2
Cargo.lock generated
View file

@ -725,7 +725,7 @@ dependencies = [
[[package]] [[package]]
name = "hauchiwa" name = "hauchiwa"
version = "0.0.2" version = "0.0.3"
dependencies = [ dependencies = [
"camino", "camino",
"chrono", "chrono",

View file

@ -43,10 +43,8 @@ where
// link rel="sitemap" href="/sitemap.xml"; // link rel="sitemap" href="/sitemap.xml";
link rel="stylesheet" href="/styles.css"; link rel="stylesheet" href="/styles.css";
link rel="stylesheet" href="/static/css/reveal.css"; link rel="stylesheet" href="/reveal.css";
link rel="stylesheet" href="/static/css/leaflet.css"; link rel="stylesheet" href="/leaflet.css";
link rel="stylesheet" href="/static/css/MarkerCluster.css";
link rel="stylesheet" href="/static/css/MarkerCluster.Default.css";
link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"; link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png";
link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"; link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png";
link rel="icon" href="/favicon.ico" sizes="any"; link rel="icon" href="/favicon.ico" sizes="any";
@ -165,6 +163,24 @@ where
) )
} }
fn full<'s, 'p, 'html>(
sack: &'s Sack,
main: impl Renderable + 'p,
title: String,
) -> impl Renderable + 'html
where
's: 'html,
'p: 'html,
{
let main = maud_move!(
(navbar())
(main)
);
bare(sack, main, title)
}
fn page<'s, 'p, 'html>( fn page<'s, 'p, 'html>(
sack: &'s Sack, sack: &'s Sack,
main: impl Renderable + 'p, main: impl Renderable + 'p,
@ -174,18 +190,13 @@ where
's: 'html, 's: 'html,
'p: 'html, 'p: 'html,
{ {
maud_move!( let main = maud_move!(
(Raw("<!DOCTYPE html>")) (navbar())
html lang="en" { (main)
(head(sack, title)) (footer(sack))
);
body { bare(sack, main, title)
(navbar())
(main)
(footer(sack))
}
}
)
} }
pub(crate) fn to_list(sack: &Sack, list: Vec<LinkDate>, title: String) -> String { pub(crate) fn to_list(sack: &Sack, list: Vec<LinkDate>, title: String) -> String {
@ -212,15 +223,13 @@ pub(crate) fn map<'s, 'html>(sack: &'s Sack) -> impl Renderable + 'html
where where
's: 'html, 's: 'html,
{ {
page( full(
sack, sack,
maud!( maud!(
main { div #map style="height: 100%; width: 100%" {}
div #map style="height: 100%; width: 100%" {}
script type="module" { script type="module" {
(Raw("import 'photos';")) (Raw("import 'photos';"))
}
} }
), ),
String::from("Map"), String::from("Map"),

View file

@ -0,0 +1,31 @@
@use 'leaflet.css';
@use 'MarkerCluster.css';
@use 'MarkerCluster-Default.css';
.leaflet-marker-photo {
border: 2px solid #fff;
box-shadow: 3px 3px 10px #888;
div {
width: 100%;
height: 100%;
background-size: cover;
background-position: center center;
background-repeat: no-repeat;
}
b {
position: absolute;
top: -7px;
right: -11px;
color: #555;
background-color: #fff;
border-radius: 8px;
height: 12px;
min-width: 12px;
line-height: 12px;
text-align: center;
padding: 3px;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
}

View file

@ -0,0 +1 @@
@use 'reveal.css';