Add commissions and statistics button to the main art page

This commit is contained in:
Joshua Goins 2025-01-16 18:35:43 -05:00
parent 17d5684d7f
commit 748873e068
9 changed files with 59 additions and 9 deletions

BIN
assets/commissions.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 75 KiB

BIN
assets/stats.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -1,5 +1,5 @@
--- ---
title: "Stats" title: "Statistics"
layout: "art-stats" layout: "art-stats"
show_detail_pane: false show_detail_pane: false
--- ---

View file

@ -1,5 +1,5 @@
{ {
"commissions": true, "commissions": false,
"featured": [ "featured": [
"altswimsuit", "altswimsuit",
"commission-midnighto51", "commission-midnighto51",

View file

@ -819,10 +819,10 @@ model-viewer {
margin: 5px; margin: 5px;
border: 1px solid var(--border-color); border: 1px solid var(--border-color);
border-radius: 5px; border-radius: 5px;
display: inline-grid;
text-decoration: none; text-decoration: none;
background-color: var(--background-tertiary); background-color: var(--background-tertiary);
box-shadow: var(--shadow); box-shadow: var(--shadow);
position: relative;
p { p {
margin: 0; margin: 0;
@ -874,3 +874,20 @@ model-viewer {
#character-container { #character-container {
display: grid; display: grid;
} }
.commission-button-text {
position: absolute;
bottom: 0;
right: 0;
background-color: var(--background-primary);
padding: 10px;
font-weight: bold;
}
#commission-open {
color: green;
}
#commission-closed {
color: red;
}

View file

@ -8,13 +8,13 @@
{{ $.Scratch.Set "header-name" "Most Drawn Characters" }} {{ $.Scratch.Set "header-name" "Most Drawn Characters" }}
{{ partial "fake-heading.html" $ }} {{ partial "fake-heading.html" $ }}
<ol> <div id="character-container" class="generic-con">
{{ range first 10 (index site.Taxonomies "characters").ByCount }} {{ range first 4 (index site.Taxonomies "characters").ByCount }}
{{ $year := .Page.Title }} {{ $year := .Page.Title }}
{{ $num := .Count }} {{ $num := .Count }}
<a class="character" href="/art/characters/{{ urlize $year }}"><img class="gallery-img" width=256 height=256 src="{{ $.Site.Params.image_host }}/chars/{{ urlize $year }}.jpg"/><span>{{ $year }}<br>({{ $num }} artworks)</span></a> <a class="character" href="/art/characters/{{ urlize $year }}"><img class="gallery-img" width=256 height=256 src="{{ $.Site.Params.image_host }}/chars/{{ urlize $year }}.jpg"/><span>{{ $year }}<br>({{ $num }} artworks)</span></a>
{{ end }} {{ end }}
</ol> </div>
{{ $.Scratch.Set "header-name" "# of Artworks by Year" }} {{ $.Scratch.Set "header-name" "# of Artworks by Year" }}
{{ partial "fake-heading.html" $ }} {{ partial "fake-heading.html" $ }}

View file

@ -62,6 +62,21 @@
{{ .Scratch.Set "link" .RelPermalink }} {{ .Scratch.Set "link" .RelPermalink }}
{{ partial "art-fancy-button" . }} {{ partial "art-fancy-button" . }}
{{ end }} {{ end }}
{{ with $.Site.GetPage "/commission" }}
{{ .Scratch.Set "title" .Title }}
{{ .Scratch.Set "img" "commissions.png" }}
{{ .Scratch.Set "link" .RelPermalink }}
{{ .Scratch.Set "commissions" true }}
{{ partial "art-fancy-button" . }}
{{ end }}
{{ with $.Site.GetPage "/art/stats" }}
{{ .Scratch.Set "title" .Title }}
{{ .Scratch.Set "img" "stats.png" }}
{{ .Scratch.Set "link" .RelPermalink }}
{{ partial "art-fancy-button" . }}
{{ end }}
</div> </div>
{{ end }} {{ end }}

View file

@ -1,11 +1,23 @@
{{ $img := .Scratch.Get "img" }} {{ $img := .Scratch.Get "img" }}
{{ $title := .Scratch.Get "title" }} {{ $title := .Scratch.Get "title" }}
{{ $link := .Scratch.Get "link" }} {{ $link := .Scratch.Get "link" }}
{{ $commissions := .Scratch.Get "commissions" }}
{{ with resources.Get $img }} {{ with resources.Get $img }}
<a class="art-fancy-button" href="{{ $link }}"> <a class="art-fancy-button" href="{{ $link }}">
<p>{{ $title }}</p> <div style="display: inline-grid">
<img src="{{ .RelPermalink }}" width=400 height=150 /> <p>{{ $title }}</p>
<img src="{{ .RelPermalink }}" width=400 height=150 />
</div>
{{ if $commissions }}
{{ $art_config := index $.Site.Data "art-config" }}
{{ if $art_config.commissions }}
<span class="commission-button-text" id="commission-open">OPEN</span>
{{ else }}
<span class="commission-button-text" id="commission-closed">CLOSED</span>
{{ end }}
{{ end }}
</a> </a>
{{ else }} {{ else }}
<strong>Could not find {{ $img }}!</strong> <strong>Could not find {{ $img }}!</strong>

View file

@ -1,2 +1,8 @@
<a class="art-sidebar-button" href="/art/stats">Statistics</a> <a class="art-sidebar-button" href="/art/stats">Statistics</a>
<a class="art-sidebar-button" href="/commission">Commission Info</a>
{{ $art_config := index $.Site.Data "art-config" }}
{{ if $art_config.commissions }}
<a class="art-sidebar-button" href="/commission">Commissions</a>
{{ else }}
<a class="art-sidebar-button" href="/commission">Commissions (CLOSED)</a>
{{ end }}