Re-do a bunch of the styles for the Nethack page
This commit is contained in:
parent
9e11021ae3
commit
5606feeca1
6 changed files with 38 additions and 28 deletions
|
@ -2,9 +2,6 @@
|
||||||
title: "Nethack"
|
title: "Nethack"
|
||||||
description: In which I play way too much of a silly command line Rogue-like game.
|
description: In which I play way too much of a silly command line Rogue-like game.
|
||||||
date: 2022-04-13T08:43:46-07:00
|
date: 2022-04-13T08:43:46-07:00
|
||||||
draft: false
|
|
||||||
type: simple
|
|
||||||
rss_ignore: true
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Every so often I get hooked on [this game][nethack]. It's a command line
|
Every so often I get hooked on [this game][nethack]. It's a command line
|
||||||
|
|
|
@ -5,12 +5,13 @@
|
||||||
--logentry-foreground-color: var(--tag-text-color);
|
--logentry-foreground-color: var(--tag-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
ol.logfile {
|
.logfile {
|
||||||
margin-block-start: 0;
|
margin-block-start: 0;
|
||||||
|
margin-inline-start: 0;
|
||||||
padding-inline-start: 0;
|
padding-inline-start: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logentry {
|
.logfile > li {
|
||||||
align-items: first baseline;
|
align-items: first baseline;
|
||||||
color: var(--logentry-foreground-color);
|
color: var(--logentry-foreground-color);
|
||||||
background-color: var(--logentry-background-color);
|
background-color: var(--logentry-background-color);
|
||||||
|
@ -19,20 +20,21 @@ ol.logfile {
|
||||||
grid-template-columns: 32px auto auto;
|
grid-template-columns: 32px auto auto;
|
||||||
row-gap: 1rem;
|
row-gap: 1rem;
|
||||||
margin-block-start: 2rem;
|
margin-block-start: 2rem;
|
||||||
|
margin-inline-start: 0;
|
||||||
padding: 3rem;
|
padding: 3rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logentry .date {
|
.logfile > li > .date {
|
||||||
grid-column-start: 2;
|
grid-column-start: 2;
|
||||||
grid-row-start: 1;
|
grid-row-start: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logentry h4.date {
|
.logfile > li > h4.date {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logentry .character-descriptor {
|
.logfile > li > .character-descriptor {
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
@ -42,37 +44,37 @@ ol.logfile {
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logentry p {
|
.logfile > li > p {
|
||||||
grid-column-start: 2;
|
grid-column-start: 2;
|
||||||
grid-column-end: 4;
|
grid-column-end: 4;
|
||||||
grid-row-start: 2;
|
grid-row-start: 2;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logentry .stats {
|
.logfile > li > table.stats {
|
||||||
|
border: 0;
|
||||||
grid-column-start: 2;
|
grid-column-start: 2;
|
||||||
grid-column-end: 4;
|
grid-column-end: 4;
|
||||||
grid-row-start: 3;
|
grid-row-start: 3;
|
||||||
}
|
margin-block-end: 0;
|
||||||
|
|
||||||
.logentry table.stats {
|
|
||||||
border: 0;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
-webkit-border-horizontal-spacing: 0;
|
-webkit-border-horizontal-spacing: 0;
|
||||||
-webkit-border-vertical-spacing: 0;
|
-webkit-border-vertical-spacing: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logentry table.stats td {
|
.logfile > li > table.stats > tbody > tr > td {
|
||||||
|
border: 0;
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
|
|
||||||
.logentry table.stats td.score,
|
.logfile > li > table.stats > tbody > tr > td.score,
|
||||||
.logentry table.stats td.hp,
|
.logfile > li > table.stats > tbody > tr > td.hp,
|
||||||
.logentry table.stats td.level {
|
.logfile > li > table.stats > tbody > tr > td.level {
|
||||||
width: 16rem;
|
width: 16rem;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
|
@ -2,6 +2,13 @@
|
||||||
{{ partial "single_main.html" . }}
|
{{ partial "single_main.html" . }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
|
||||||
|
{{ define "styles" }}
|
||||||
|
{{- range .Resources.Match "*.css" -}}
|
||||||
|
{{- $stylesheet := . | fingerprint "md5" }}
|
||||||
|
<link rel="stylesheet" href="{{ $stylesheet.RelPermalink }}"></script>
|
||||||
|
{{- end -}}
|
||||||
|
{{ end }}
|
||||||
|
|
||||||
{{ define "scripts" }}
|
{{ define "scripts" }}
|
||||||
{{- if .HasShortcode "figures/railroad" -}}
|
{{- if .HasShortcode "figures/railroad" -}}
|
||||||
{{- with partial "resources/railroad_utils.html" . -}}
|
{{- with partial "resources/railroad_utils.html" . -}}
|
||||||
|
@ -11,10 +18,10 @@
|
||||||
|
|
||||||
{{- if .HasShortcode "figures/p5" -}}
|
{{- if .HasShortcode "figures/p5" -}}
|
||||||
{{- with partial "secure_asset.html" "scripts/lib/p5-1.5.0.js" -}}
|
{{- with partial "secure_asset.html" "scripts/lib/p5-1.5.0.js" -}}
|
||||||
<script defer src="{{ .Secure.Permalink }}"></script>
|
<script defer src="{{ .Secure.RelPermalink }}"></script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- with partial "secure_asset.html" "scripts/sketch-utils.js" -}}
|
{{- with partial "secure_asset.html" "scripts/sketch-utils.js" -}}
|
||||||
<script defer src="{{ .Secure.Permalink }}"></script>
|
<script defer src="{{ .Secure.RelPermalink }}"></script>
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
|
|
@ -9,10 +9,12 @@
|
||||||
She was {{ .death.cause }}.</p>
|
She was {{ .death.cause }}.</p>
|
||||||
<table class="stats">
|
<table class="stats">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="began">Began {{ time.Format "January 2, 2006" .start_date }}</td>
|
{{- $startDate := time.Format "January, 02 2006" .start_date -}}
|
||||||
|
{{- $startDatetime := time.Format "2006-01-02" .start_date -}}
|
||||||
|
<td class="began">Began <time class="nobreak" datetime="{{ $startDatetime }}">{{ $startDate }}</time></td>
|
||||||
<td class="score">{{ .score | lang.FormatNumber 0 }} points</td>
|
<td class="score">{{ .score | lang.FormatNumber 0 }} points</td>
|
||||||
<td class="level">Level {{ .character.max_level }}</td>
|
<td class="level">Level {{ .character.max_level }}</td>
|
||||||
<td class="hp">{{ cond (gt .character.hp.n 0) (printf "%s / %s" .character.hp.n .character.hp.max)
|
<td class="hp">{{ cond (gt .character.hp.n 0) (printf "%s / %s" .character.hp.n .character.hp.max)
|
||||||
.character.hp.max }} hp</td>
|
.character.hp.max }} hp</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -3,6 +3,8 @@
|
||||||
{{ range $nethack_data }}
|
{{ range $nethack_data }}
|
||||||
{{ $logfile = $logfile | append .logfile }}
|
{{ $logfile = $logfile | append .logfile }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<div class="logentry">
|
<ol class="logfile">
|
||||||
|
<li>
|
||||||
{{ partial "nethack/logentry.html" (index (sort $logfile "score" "desc") 0) }}
|
{{ partial "nethack/logentry.html" (index (sort $logfile "score" "desc") 0) }}
|
||||||
</div>
|
</li>
|
||||||
|
</ol>
|
||||||
|
|
|
@ -4,11 +4,11 @@
|
||||||
{{ $logfile = $logfile | append .logfile }}
|
{{ $logfile = $logfile | append .logfile }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<ol class="logfile">
|
<ol class="logfile">
|
||||||
{{ range first 10 (sort $logfile "end_date" "desc") }}
|
{{ range sort $logfile "end_date" "desc" }}
|
||||||
{{ if ne .death.cause "quit" }}
|
{{ if ne .death.cause "quit" }}
|
||||||
<li class="logentry">
|
<li>
|
||||||
{{ partial "nethack/logentry.html" .}}
|
{{ partial "nethack/logentry.html" .}}
|
||||||
</li>
|
</li>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ end }}
|
{{ end }}
|
||||||
</ol>
|
</ol>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue