Преглед на файлове

serve: rotate .dtstart to the left

master
Astro преди 12 месеца
родител
ревизия
53051b2f37
  1. 18
      ticker-serve/src/index.rs
  2. 12
      ticker-serve/static/style.css

18
ticker-serve/src/index.rs

@ -99,7 +99,14 @@ fn render_index(app_state: &AppState) -> String {
</h2>
{ day.events.iter().map(|e| html!(
<article class="event" style={ format!("border-left: 1.5rem solid {}", &config.calendars.get(&e.calendar).map(|o| &o.color[..]).unwrap_or("white")) }>
<article class="event"
style={ format!("border-left: 1.5rem solid {}", &config.calendars.get(&e.calendar).map(|o| &o.color[..]).unwrap_or("white")) }
>
<p class="dtstart"
title={ format!("{}", e.dtstart.format("%c")) }
>
{ text!("{}", &e.dtstart.format("%H:%S")) }
</p>
{ match &e.url {
None => html!(
<h3>{ text!("{}", &e.summary) }</h3>
@ -113,14 +120,9 @@ fn render_index(app_state: &AppState) -> String {
),
} }
<p class="dtstart" title={ format!("{}", e.dtstart.format("%c")) }>
{ text!("{}", &e.dtstart.format("%H:%S")) }
</p>
{ e.location.as_ref().map(|location| html!(
<p class="location">
{ text!("{}", location) }
</p>
)) }
{ text!("{}", e.location.as_ref().unwrap_or(&"".to_owned())) }
</p>
</article>
)) }
</div>)

12
ticker-serve/static/style.css

@ -72,11 +72,17 @@ h3 a {
}
.dtstart {
margin-right: 1.3em;
position: absolute;
transform: translate(-2.5rem, 2.5rem) rotate(270deg);
transform-origin: top left;
color: #F7F7F7;
font-weight: 500;
font-size: 85%;
line-height: 1.5rem;
}
.dtstart, .location {
.location {
line-height: 1.1em;
display: inline;
min-height: 1.1em;
}
footer {

Зареждане…
Отказ
Запис