revamp sidebar

This commit is contained in:
yequari 2024-04-24 23:22:05 -07:00
parent 9b337ea6f9
commit bb021ab88c
6 changed files with 106 additions and 18 deletions

View File

@ -57,3 +57,7 @@ menu:
icon: aero-chat.svg icon: aero-chat.svg
url: xmpp:yequari@cardgameson.motorcycles url: xmpp:yequari@cardgameson.motorcycles
weight: 40 weight: 40
caches:
getresource:
dir: :cacheDir/:project
maxAge: 0

View File

@ -0,0 +1,13 @@
{{ range first 1 (where .Site.RegularPages.ByDate.Reverse "Section" "blog") }}
{{ $d1 := time.ParseDuration "-168h" }}
{{ $t1 := time.Now.Add $d1 }}
{{ $t2 := time.AsTime .PublishDate }}
{{ if $t2.After $t1 }}
<div id="avatar-frame" class="online">
{{ else }}
<div id="avatar-frame" class="busy">
{{ end }}
{{ end }}
<span class="gloss"></span>
<img class="u-photo" width="100px" src="/images/avatar.jpg">
</div>

View File

@ -1,15 +1,19 @@
<section> <section>
<div id="avatar-frame" class="online"> <!-- <div id="avatar-frame" class="online"> -->
<span class="gloss"></span> <!-- <span class="gloss"></span> -->
<img class="u-photo" width="100px" src="/images/avatar.jpg"> <!-- <img class="u-photo" width="100px" src="/images/avatar.jpg"> -->
</div> <!-- </div> -->
{{ partial "avatar.html" . }}
<p class="about-me">
I'm yequari. I like programming, tabletop games, and the Transformers.
</p>
</section> </section>
<section> <section>
<h1>current status</h1> <!-- <div id="statuscafe"><div id="statuscafe-username"></div><div id="statuscafe-content"></div></div><script src="https://status.cafe/current-status.js?name=yequari" defer></script> -->
<div id="statuscafe"><div id="statuscafe-username"></div><div id="statuscafe-content"></div></div><script src="https://status.cafe/current-status.js?name=yequari" defer></script> {{ partial "statuscafe.html" .}}
</section> </section>
<section> <section>
<h1>Social</h1> <!-- <h1>Social</h1> -->
<ul class="social"> <ul class="social">
{{ range site.Menus.social }} {{ range site.Menus.social }}
<li class="social"> <li class="social">
@ -26,9 +30,9 @@
{{ end }} {{ end }}
</ul> </ul>
</section> </section>
<section> <!-- <section> -->
<h1><span class="lowercase">yequari</span> says...</h1> <!-- <h1>Quote of the Day</h1> -->
<div id="quote"> <!-- <div id="quote"> -->
<p id="subtitle">.</p> <!-- <p id="subtitle">.</p> -->
</div> <!-- </div> -->
</section> <!-- </section> -->

View File

@ -0,0 +1,36 @@
{{ $data := dict }}
{{ $url := "https://status.cafe/users/yequari/status.json" }}
{{ with resources.GetRemote $url }}
{{ with .Err }}
{{ errorf "%s" . }}
{{ else }}
<div id="statuscafe">
{{ $data = .Content | transform.Unmarshal }}
{{ $length := len $data.content }}
{{ if eq $length 0 }}
No status
{{ else }}
{{ $timestrs := strings.Split $data.timeAgo " " }}
{{ $timeamt := index $timestrs 0 }}
{{ $timeunit := index $timestrs 1 }}
{{ $timeunit = strings.Substr $timeunit 0 1 }}
{{ $url = "https://status.cafe/users/yequari/badge.png" }}
{{ with resources.GetRemote $url}}
<div id="statuscafe-username">
<a href="https://status.cafe/users/yequari"><img src="{{ .RelPermalink }}" alt="Status Cafe Profile"/></a>
</div>
{{ end }}
<div id="statuscafe-timeago">
🕗{{ $timeamt }}{{ $timeunit }}
</div>
<div id="statuscafe-content">
<p>
{{ $data.content }}
</p>
</div>
</div>
{{ end }}
{{ end }}
{{ else }}
{{ errorf "Unable to get remote resource %q" $url }}
{{ end }}

View File

@ -7,8 +7,8 @@
<title>{{ .Page.Title }}</title> <title>{{ .Page.Title }}</title>
<link rel="stylesheet" href="/css/main.css"> <link rel="stylesheet" href="/css/main.css">
<link rel="icon" type="image/png" href="/favicon.png"> <link rel="icon" type="image/png" href="/favicon.png">
<script src="/js/avatar.js" defer></script> <!-- <script src="/js/avatar.js" defer></script> -->
<script src="/js/quotes.js" defer></script> <!-- <script src="/js/quotes.js" defer></script> -->
<link rel="webmention" href="https://webmention.io/yequari.com/webmention" /> <link rel="webmention" href="https://webmention.io/yequari.com/webmention" />
<link rel="pingback" href="https://webmention.io/yequari.com/xmlrpc" /> <link rel="pingback" href="https://webmention.io/yequari.com/xmlrpc" />
<script src="/js/webmention.js" async></script> <script src="/js/webmention.js" async></script>

View File

@ -157,7 +157,7 @@ ul.social {
} }
li.social { li.social {
padding: 0; padding: 5px 0;
} }
img.social { img.social {
@ -271,7 +271,7 @@ nav li a:hover, nav li a:active {
.sidebar { .sidebar {
flex: 0 1 20%; flex: 0 1 20%;
border-right: 1px solid black; border-right: 1px solid black;
padding: 0 15px; padding: 0 25px;
} }
.sidebar h1 { .sidebar h1 {
@ -279,10 +279,14 @@ nav li a:hover, nav li a:active {
padding-bottom: 5px; padding-bottom: 5px;
} }
.sidebar p.about-me {
text-align: center;
}
.sidebar #avatar-frame { .sidebar #avatar-frame {
width: fit-content; width: fit-content;
height: 100px; height: 100px;
margin: 0 auto; margin: 0 auto 25px auto;
padding: 8px 8px; padding: 8px 8px;
border: 1px solid #cccccf; border: 1px solid #cccccf;
border-radius: 16px/24px; border-radius: 16px/24px;
@ -295,6 +299,33 @@ nav li a:hover, nav li a:active {
border-radius: 5px; border-radius: 5px;
} }
#statuscafe {
display: flex;
flex-flow: row wrap;
justify-content: space-between;
/* border: 1px solid #CCCCCC; */
}
#statuscafe p {
line-height: 1.5;
margin: 5px 0;
color: var(--secondary-text);
font-style: italic;
}
#statuscafe #statuscafe-timeago {
flex: 1 1 50%;
text-align: right;
}
#statuscafe #statuscafe-username {
flex: 1 1 50%;
}
#statuscafe #statuscafe-content {
flex: 1 1 100%;
}
.online { .online {
background: linear-gradient(#D6FFDB00 0%, #D6FFDB 30%, #66FF00 100%); background: linear-gradient(#D6FFDB00 0%, #D6FFDB 30%, #66FF00 100%);
box-shadow: 0 5px 10px #66FF00; box-shadow: 0 5px 10px #66FF00;