mirror of
1
Fork 0

profile responsiveness, accessibility tweaks

This commit is contained in:
f0x 2023-05-10 20:18:50 +02:00
parent 1f9c41a63f
commit 86471e010a
2 changed files with 84 additions and 95 deletions

View File

@ -27,22 +27,18 @@ main.profile {
padding: 0.5rem; padding: 0.5rem;
border-radius: $br; border-radius: $br;
display: grid; .column-split {
grid-template-rows: auto auto; display: flex;
grid-template-columns: 35fr 65fr; flex-wrap: wrap;
grid-template-areas: gap: 1rem;
"header header" }
"about toots";
gap: 1rem;
} }
main.profile .header { main.profile .header {
grid-area: header;
background: $bg-accent; background: $bg-accent;
border-radius: $br; border-radius: $br;
overflow: hidden; overflow: hidden;
margin-bottom: 1rem;
.header-image { .header-image {
position: relative; position: relative;
@ -165,7 +161,6 @@ main.profile {
} }
&.pinned { &.pinned {
margin: 0 1rem;
display: grid; display: grid;
grid-template-columns: auto 1fr; grid-template-columns: auto 1fr;
gap: 1rem; gap: 1rem;
@ -178,29 +173,12 @@ main.profile {
} }
main.profile .toots { main.profile .toots {
grid-area: toots; flex: 65 25rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
gap: 0.4rem; gap: 0.4rem;
.col-header {
margin: 0;
background: $gray4;
border-top-left-radius: $br;
border-top-right-radius: $br;
padding: 0.75rem;
}
.toot { .toot {
padding-top: 0.75rem;
box-shadow: none;
border: none;
.contentgrid {
padding: 0 0.75rem;
}
.info { .info {
padding: 0.3rem 0.75rem; padding: 0.3rem 0.75rem;
} }
@ -212,7 +190,7 @@ main.profile .toots {
} }
main.profile .about-user { main.profile .about-user {
grid-area: about; flex: 35 14rem;
border-radius: $br; border-radius: $br;
overflow: hidden; overflow: hidden;
@ -237,10 +215,6 @@ main.profile .about-user {
&:first-child { &:first-child {
border-top: 0.1rem solid $gray2; border-top: 0.1rem solid $gray2;
} }
b {
color: $fg-accent;
}
} }
} }

View File

@ -26,7 +26,7 @@
<img src="{{.account.Header}}" alt="" /> <img src="{{.account.Header}}" alt="" />
{{ end }} {{ end }}
</div> </div>
<div class="basic-info"> <div class="basic-info" aria-hidden="true">
<a class="avatar" href="{{.account.Avatar}}"> <a class="avatar" href="{{.account.Avatar}}">
<img src="{{.account.Avatar}}" alt=""> <img src="{{.account.Avatar}}" alt="">
</a> </a>
@ -50,77 +50,92 @@
<i class="rss-icon fa fa-rss-square" aria-hidden="true"></i> <i class="rss-icon fa fa-rss-square" aria-hidden="true"></i>
</a> --> </a> -->
</div> </div>
<div class="sr-only">
Profile for
{{if .account.DisplayName}}{{.account.DisplayName}}{{else}}{{.account.Username}}{{end}}.
Username @{{.account.Username}}, {{acctInstance .account.Acct}}
</div>
</div> </div>
<div class="about-user"> <div class="column-split">
<div class="col-header">
<h3>About</h3>
</div>
<div class="fields"> <section class="about-user">
{{ range .account.Fields }} <div class="col-header">
<div class="field"> <h3>About</h3>
<b>{{.Name}}</b>
<span>{{.Value}}</span>
</div> </div>
{{ end }}
</div>
<div class="bio"> <div class="fields">
{{ if .account.Note }} {{ range .account.Fields }}
{{emojify .account.Emojis (noescape .account.Note)}} <div class="field">
{{else}} <b>{{.Name}}</b>
This GoToSocial user hasn't written a bio yet! <span>{{.Value}}</span>
{{end}} </div>
</div> {{ end }}
</div>
<div class="accountstats"> <div class="bio">
<b>Joined</b><time datetime="{{.account.CreatedAt}}">{{.account.CreatedAt | timestampVague}}</time> {{ if .account.Note }}
<b>Posts</b><span>{{.account.StatusesCount}}</span> {{emojify .account.Emojis (noescape .account.Note)}}
<b>Followed by</b><span>{{.account.FollowersCount}}</span> {{else}}
<b>Following</b><span>{{.account.FollowingCount}}</span> This GoToSocial user hasn't written a bio yet!
</div> {{end}}
</div> </div>
<div class="toots"> <div class="sr-only" role="group">
{{ if .pinned_statuses }} <span>Joined on {{.account.CreatedAt | timestampVague}}.</span>
<div class="col-header pinned"> <span>{{.account.StatusesCount}} post{{if .account.StatusesCount | eq 1 | not}}s{{end}}.</span>
<h3>Pinned posts</h3> <span>Followed by {{.account.FollowersCount}}.</span>
<a href="#recent">jump to recent</a> <span>Following {{.account.FollowingCount}}.</span>
</div> </div>
<section class="thread">
{{ range .pinned_statuses }}
<article class="toot expanded" id="{{.ID}}">
{{ template "status.tmpl" .}}
</article>
{{ end }}
</section>
{{ end }}
<div class="col-header" id="recent"> <div class="accountstats" aria-hidden="true">
<h3>Recent posts</h3> <b>Joined</b><time datetime="{{.account.CreatedAt}}">{{.account.CreatedAt | timestampVague}}</time>
</div> <b>Posts</b><span>{{.account.StatusesCount}}</span>
<b>Followed by</b><span>{{.account.FollowersCount}}</span>
<section class="thread"> <b>Following</b><span>{{.account.FollowingCount}}</span>
{{ if not .statuses }} </div>
<div data-nosnippet class="nothinghere">Nothing here!</div>
{{ else }}
{{ range .statuses }}
<article class="toot expanded" id="{{.ID}}">
{{ template "status.tmpl" .}}
</article>
{{ end }}
{{ end }}
</section> </section>
<div class="backnextlinks"> <section class="toots">
{{ if .show_back_to_top }} {{ if .pinned_statuses }}
<a href="/@{{ .account.Username }}">Back to top</a> <div class="col-header pinned">
<h3>Pinned posts</h3>
<a href="#recent">jump to recent</a>
</div>
<section class="thread">
{{ range .pinned_statuses }}
<article class="toot expanded" id="{{.ID}}">
{{ template "status.tmpl" .}}
</article>
{{ end }}
</section>
{{ end }} {{ end }}
{{ if .statuses_next }}
<a href="{{ .statuses_next }}" class="next">Show older</a> <div class="col-header">
{{ end }} <h3 id="recent" tabindex="-1">Recent posts</h3>
</div> </div>
<section class="thread">
{{ if not .statuses }}
<div data-nosnippet class="nothinghere">Nothing here!</div>
{{ else }}
{{ range .statuses }}
<article class="toot expanded" id="{{.ID}}">
{{ template "status.tmpl" .}}
</article>
{{ end }}
{{ end }}
</section>
<div class="backnextlinks">
{{ if .show_back_to_top }}
<a href="/@{{ .account.Username }}">Back to top</a>
{{ end }}
{{ if .statuses_next }}
<a href="{{ .statuses_next }}" class="next">Show older</a>
{{ end }}
</div>
</section>
</div> </div>
</main> </main>