Improve general accessibility #2

merged
opened by vielle.dev targeting main

Listing changes from top of commit to bottom:

  • Prettier code formatting.
  • Remove unneeded !importants
  • Move around where margins are placed to be a little more sane
  • Add a max-width to <p> tags of 60ch. This is a comfortable reading width in general and is ~= to the manual reading width from before. Also remove the manual <br> and <pre> linebreaks as they make formatting a bit weird and inconsistent on mobile
  • Add a max-width of 40ch to hr instead of a width of 40%. It'll be full width for smaller screens (instead of small and piddly), and wont blow out to be massive on larger screens. 40ch looks pretty alright with the 60ch character width.
  • Move the <pre> to only cover the ascii art so that paragraphs are consistent.
  • Wrap the <pre> and intro paragraph in <header> bc ✨accessibility✨
  • Wrap the main content in <main> bc ✨accessibility✨
  • Wrap each part in <section>. Why? You guessed it: ✨accessibility✨
  • Make the user list an ordered list and add some Loading placeholder text. This is hidden by the
Changed files
+195 -189
+193 -186
index.html
···
-
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
-
-
<meta name="title" content="girl on the moon :: atproto" />
-
<meta name="description" content="girl on the moon PDS" />
-
<meta name="author" content="girlonthemoon.xyz" />
-
<meta property="og:title" content="girl on the moon :: atproto" />
-
<meta property="og:description" content="girl on the moon PDS" />
-
<meta property="og:type" content="website" />
-
<meta property="og:url" content="https://katproto.girlonthemoon.xyz" />
-
<meta property="og:image" content="https://stash.4-walls.net/pics/pochacco.jpg" />
-
-
<link rel="canonical" href="https://katproto.girlonthemoon.xyz" />
-
<link rel="icon" type="image/png" sizes="64x64" href="https://stash.4-walls.net/pics/pochacco_favicon.png" />
-
-
<script src="https://stash.4-walls.net/katproto_demo/katproto_users.js"></script>
-
-
<title>katproto</title>
-
-
<style>
-
@import url(https://fonts.bunny.net/css?family=victor-mono:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i);
-
-
:root {
-
--font: "Victor Mono", monospace;
-
--main-color: #ff69b4;
-
}
-
-
body {
-
font-family: var(--font) !important;
-
counter-reset: Span-count;
-
font-size: .9rem;
-
}
-
-
pre {
-
font-family: var(--font) !important;
-
margin: 0 !important;
-
padding: 0 !important;
-
}
-
-
.nosc {
-
font-family: var(--font) !important;
-
font-size: .9rem;
-
}
-
-
div[aria-label] {
-
margin: 0 !important;
-
padding: 0 !important;
-
}
-
-
pre h1 {
-
color: var(--main-color);
-
margin: 0 0 0 1rem;
-
padding: 0 !important;
-
font-style: italic;
-
}
-
-
h2 {
-
color: var(--main-color);
-
padding: 0 !important;
-
font-style: italic;
-
}
-
-
a {
-
text-underline-offset: 4px;
-
color: var(--main-color);
-
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
-
}
-
-
dfn, i {
-
color: var(--main-color);
-
}
-
-
a:hover {
-
text-decoration: none;
-
text-shadow: none;
-
}
-
-
hr {
-
border: 1px dashed var(--main-color);
-
width: 40%;
-
margin: 1rem 1rem 1rem 0;
-
padding: 0;
-
}
-
-
#not-pre {
-
margin: 0 0 0 1rem;
-
}
-
-
#list-users {
-
font-family: var(--font);
-
font-size: .9rem;
-
margin: 0 !important;
-
padding: 0 !important;
-
}
-
-
.user-count {
-
counter-increment: Span-count;
-
display: inline-block;
-
margin-bottom: .5rem;
-
}
-
-
.user-count:before {
-
content: counter(Span-count) ". ";
-
}
-
</style>
-
</head>
-
-
<body>
-
-
<pre>
-
<div aria-label="ASCII text art of pochacco" role="img">
-
,8,
-
d8b
-
888
-
__ , 888
-
d88888b. -.\,- 888
-
`Y8888b."```"-888
-
/`" `8\
-
| |
-
| |
-
| |
-
__ / O _ O \
-
/` '.\ '-' /
-
\ .'. .;
-
'. .' `"""""""` \
-
`\ /.-.|
-
`| |` |
-
| \___/
-
;-.._______..-;
-
jgs / | \
-
\___,---'---,___/
-
</div>
-
<h1 id="katproto">katproto</h1>
-
this is an at protocol <dfn>personal data server</dfn> (aka, an atproto PDS).
-
more specifically, it's <a href="https://girlonthemoon.xyz/">kat</a>'s PDS!
-
</pre>
-
-
<div id="not-pre">
-
<hr>
-
-
<h2 id="users">users</h2>
-
-
<div id="list-users">
-
</div>
-
-
<hr>
-
-
<noscript>
-
<span class="nosc">sorry, to see the dynamic list of users, you must have javascript enabled!</span>
-
<hr>
-
</noscript>
-
-
<script>
-
async function printUsers() {
-
document.getElementById("list-users").innerHTML = await getKatprotoUsers();
-
}
-
printUsers();
-
</script>
-
-
<h2 id="status">status</h2>
-
-
<p>Current status: <span id="current-status">Loading...</span></p>
-
-
<p>off-site status page in case the PDS goes down; in other words,<br>
-
this page will remain up even when the PDS is down.</p>
-
-
<p><a href="https://uptime.4-walls.net/status/katproto">status page</a></p>
-
-
<hr>
-
-
<h2 id="credits">credits</h2>
-
-
<p>
-
PDS: <a href="https://github.com/bluesky-social/pds">github.com/bluesky-social/pds</a><br>
-
dynamic user list: <a href="https://tangled.org/@vielle.dev/server-config/blob/master/landing/landing.ts">most of the code here</a><br>
-
</p>
-
-
<hr>
-
-
<h2 id="source">source</h2>
-
-
<p>
-
index page: <a href="https://tangled.org/@katproto.girlonthemoon.xyz/katproto_index">tangled.org/@katproto.girlonthemoon.xyz/katproto_index</a>
-
</p>
-
</div>
-
</html>
···
+
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
+
+
<meta name="title" content="girl on the moon :: atproto" />
+
<meta name="description" content="girl on the moon PDS" />
+
<meta name="author" content="girlonthemoon.xyz" />
+
<meta property="og:title" content="girl on the moon :: atproto" />
+
<meta property="og:description" content="girl on the moon PDS" />
+
<meta property="og:type" content="website" />
+
<meta property="og:url" content="https://katproto.girlonthemoon.xyz" />
+
<meta
+
property="og:image"
+
content="https://stash.4-walls.net/pics/pochacco.jpg"
+
/>
+
+
<link rel="canonical" href="https://katproto.girlonthemoon.xyz" />
+
<link
+
rel="icon"
+
type="image/png"
+
sizes="64x64"
+
href="https://stash.4-walls.net/pics/pochacco_favicon.png"
+
/>
+
+
<script src="https://stash.4-walls.net/katproto_demo/katproto_users.js"></script>
+
+
<title>katproto</title>
+
+
<style>
+
@import url(https://fonts.bunny.net/css?family=victor-mono:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i);
+
+
:root {
+
--font: "Victor Mono", monospace;
+
--main-color: #ff69b4;
+
}
+
+
body {
+
font-family: var(--font);
+
font-size: 0.9rem;
+
margin: 0 0 0 1rem;
+
}
+
+
pre {
+
font-family: var(--font);
+
margin: 0;
+
padding: 0;
+
}
+
+
h1 {
+
color: var(--main-color);
+
margin: 1rem 0 0 0;
+
font-style: italic;
+
}
+
+
h2 {
+
color: var(--main-color);
+
font-style: italic;
+
}
+
+
p {
+
max-width: 60ch;
+
}
+
+
a {
+
text-underline-offset: 4px;
+
color: var(--main-color);
+
text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.1);
+
}
+
+
dfn,
+
i {
+
color: var(--main-color);
+
}
+
+
a:hover {
+
text-decoration: none;
+
text-shadow: none;
+
}
+
+
hr {
+
border: 1px dashed var(--main-color);
+
max-width: 40ch;
+
margin: 1rem 1rem 1rem 0;
+
padding: 0;
+
}
+
</style>
+
</head>
+
<body>
+
<header>
+
<div aria-label="ASCII text art of pochacco" role="img">
+
<pre>
+
+
,8,
+
d8b
+
888
+
__ , 888
+
d88888b. -.\,- 888
+
`Y8888b."```"-888
+
/`" `8\
+
| |
+
| |
+
| |
+
__ / O _ O \
+
/` '.\ '-' /
+
\ .'. .;
+
'. .' `"""""""` \
+
`\ /.-.|
+
`| |` |
+
| \___/
+
;-.._______..-;
+
jgs / | \
+
\___,---'---,___/
+
</pre
+
>
+
</div>
+
<h1 id="katproto">katproto</h1>
+
<p>
+
this is an at protocol <dfn>personal data server</dfn> (aka, an atproto
+
PDS). more specifically, it's
+
<a href="https://girlonthemoon.xyz/">kat</a>'s PDS!
+
</p>
+
</header>
+
+
<hr />
+
+
<main>
+
<section>
+
<h2 id="users">users</h2>
+
<ol id="list-users">
+
<!-- this is _not great_ but im lazy and its still a marked improvement
+
looks kinda cool imo, ngl -->
+
Loading...
+
</ol>
+
<noscript>
+
<span class="nosc">
+
sorry, to see the dynamic list of users, you must have javascript
+
enabled!
+
</span>
+
<style>
+
#list-users {
+
display: none;
+
}
+
</style>
+
</noscript>
+
<script>
+
async function printUsers() {
+
document.getElementById("list-users").innerHTML =
+
await getKatprotoUsers();
+
}
+
printUsers();
+
</script>
+
</section>
+
+
<hr />
+
+
<section>
+
<h2 id="status">status</h2>
+
<p>Current status: <span id="current-status">Loading...</span></p>
+
<p>
+
off-site status page in case the PDS goes down; in other words, this
+
page will remain up even when the PDS is down.
+
</p>
+
<p>
+
<a href="https://uptime.4-walls.net/status/katproto">status page</a>
+
</p>
+
</section>
+
+
<hr />
+
+
<section>
+
<h2 id="credits">credits</h2>
+
<p>
+
PDS:
+
<a href="https://github.com/bluesky-social/pds"
+
>github.com/bluesky-social/pds</a
+
><br />
+
dynamic user list:
+
<a
+
href="https://tangled.org/@vielle.dev/server-config/blob/master/landing/landing.ts"
+
>most of the code here</a
+
><br />
+
</p>
+
<hr />
+
<h2 id="source">source</h2>
+
<p>
+
index page:
+
<a
+
href="https://tangled.org/@katproto.girlonthemoon.xyz/katproto_index"
+
>tangled.org/@katproto.girlonthemoon.xyz/katproto_index</a
+
>
+
</p>
+
</section>
+
</main>
+
</body>
</html>
+2 -3
katproto_users.ts
···
await Promise.all(
users.map(
async (x) =>
-
`<span class="user-count"><a href="https://bsky.app/profile/${x.did}">${await x.display}</a></span>`
)
)
);
-
const fin = Array.from(users).join("<br>");
-
return await fin;
}
async function checkStatus() {
···
await Promise.all(
users.map(
async (x) =>
+
`<li><a href="https://bsky.app/profile/${x.did}">${await x.display}</a></li>`
)
)
);
+
return users.join("");
}
async function checkStatus() {