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]]
name = "hauchiwa"
version = "0.0.2"
version = "0.0.3"
dependencies = [
"camino",
"chrono",

View file

@ -43,10 +43,8 @@ where
// link rel="sitemap" href="/sitemap.xml";
link rel="stylesheet" href="/styles.css";
link rel="stylesheet" href="/static/css/reveal.css";
link rel="stylesheet" href="/static/css/leaflet.css";
link rel="stylesheet" href="/static/css/MarkerCluster.css";
link rel="stylesheet" href="/static/css/MarkerCluster.Default.css";
link rel="stylesheet" href="/reveal.css";
link rel="stylesheet" href="/leaflet.css";
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" 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>(
sack: &'s Sack,
main: impl Renderable + 'p,
@ -174,18 +190,13 @@ where
's: 'html,
'p: 'html,
{
maud_move!(
(Raw("<!DOCTYPE html>"))
html lang="en" {
(head(sack, title))
let main = maud_move!(
(navbar())
(main)
(footer(sack))
);
body {
(navbar())
(main)
(footer(sack))
}
}
)
bare(sack, main, title)
}
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
's: 'html,
{
page(
full(
sack,
maud!(
main {
div #map style="height: 100%; width: 100%" {}
div #map style="height: 100%; width: 100%" {}
script type="module" {
(Raw("import 'photos';"))
}
script type="module" {
(Raw("import 'photos';"))
}
),
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';