78 lines
1.9 KiB
HTML
78 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 commonheath of casakhstan webring</h1>
|
|
</header>
|
|
<main>
|
|
<section>
|
|
<h2>members</h2>
|
|
<ul>
|
|
{{#data}}
|
|
<li>
|
|
<a href="{{{url}}}">{{{title}}}</a>
|
|
</li>
|
|
{{/data}}
|
|
</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 = [
|
|
{{#data}}
|
|
{
|
|
"id": {{{id}}},
|
|
"name": "{{{name}}}",
|
|
"url": "{{{url}}}",
|
|
},
|
|
{{/data}}
|
|
]
|
|
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>
|