pages/webring/index.html

74 lines
1.9 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width" />
<title>webring</title>
<style type="text/css" media="screen">
body {
max-width: 70ch;
margin: 0 auto;
}
</style>
</head>
<body>
<header>
<h1>the benevolent tildepals basement heroes 43beans commonhealth of casakhstan webring</h1>
</header>
<main>
<section>
<h2>members</h2>
<ul>
<li>
<a href="https://tilde.town/~dozens">tilde.town/~dozens</a>
</li>
</ul>
</section>
<section id="about">
<h2>about</h2>
<p>
for more info about becoming a member
and adding the webring to your site
see <a href="https://tildegit.org/casa/pages/src/branch/main/webring">https://tildegit.org/casa/pages/src/branch/main/webring</a>
</p>
</section>
</main>
<footer>
<p>
<small>
this webring is built using <a href="https://git.tilde.town/dozens/webring">https://git.tilde.town/dozens/webring</a>
</small>
</p>
</footer>
</body>
</html>
<script>
const members = [
{
"id": 0,
"name": "dozens",
"url": "https://tilde.town/~dozens",
},
]
const last = members.length - 1
const query = window.location.search
const params = new URLSearchParams(query)
const name = params.get('name')
const dir = params.get('dir')
if (name && dir) {
const step = (dir === 'next') ? 1 : (dir === 'prev') ? -1 : 0
const member = members.filter(member => member.name === name)[0]
if (!(typeof member === "undefined")) {
const next = (member.id + step > last)
? 0
: (member.id + step < 0)
? last
: member.id + step
const loc = members.filter(m => m.id === next)[0]
window.location.replace(loc.url)
}
}
</script>