on master help sign in
7 files changed+122−138
since splitsnapshots
unifiedsplit
README.md+1−1 index.html+1 links/fonts.css+8−15 links/main.css+2−2 media/fonts/input_mono_thin.ttf scripts/portal.js+42−60 scripts/sites.js+68−60
README.md+1−1
@@ -1,6 +1,6 @@
11# Webring
22
3−This [webring](https://wiki.xxiivv.com/webring) is an attempt to inspire artists & developers to create and maintain their own website and share traffic among each other. The webring's aim is to share personal websites such as *diaries, wikis & portfolios*. To add yourself to the ring, submit an [edit](https://github.com/XXIIVV/webring/edit/master/scripts/sites.js) to this repository.
3+This [webring](https://wiki.xxiivv.com/webring) is an attempt to inspire artists & developers to create and maintain their own website and share traffic among each other. The webring's aim is to share hand-crafted websites such as **diaries, wikis & portfolios**, single pagers with nothing but outgoing links to social platforms will be rejected. To add yourself to the ring, submit an [edit](https://github.com/XXIIVV/webring/edit/master/scripts/sites.js) to this repository.
44
55## Join the webring
66
index.html+1
@@ -12,6 +12,7 @@
1212<body>
1313 <script>
1414 const portal = new Portal(sites);
15+ portal.install(document.body);
1516 portal.start();
1617 </script>
1718</body>
links/fonts.css+8−15
@@ -1,22 +1,15 @@
11/* Input Mono */
22
33@font-face {
4− font-family: 'input_mono_regular';
5− src: url('../media/fonts/input_mono_regular.ttf') format('truetype');
6− font-weight: normal;
7− font-style: normal;
4+ font-family: 'input_mono_regular';
5+ src: url('../media/fonts/input_mono_regular.ttf') format('truetype');
6+ font-weight: normal;
7+ font-style: normal;
88}
99
1010@font-face {
11− font-family: 'input_mono_medium';
12− src: url('../media/fonts/input_mono_medium.ttf') format('truetype');
13− font-weight: normal;
14− font-style: normal;
15−}
16−
17−@font-face {
18− font-family: 'input_mono_thin';
19− src: url('../media/fonts/input_mono_thin.ttf') format('truetype');
20− font-weight: normal;
21− font-style: normal;
11+ font-family: 'input_mono_medium';
12+ src: url('../media/fonts/input_mono_medium.ttf') format('truetype');
13+ font-weight: normal;
14+ font-style: normal;
2215}
links/main.css+2−2
@@ -15,5 +15,5 @@ body div ul li a:visited { color:#999; text-decoration: none;}
1515body div ul li a:hover { background:#ccc; color:#000; text-decoration: none; border-radius: 2px }
1616
1717@media (max-width: 950px){
18− body div list { columns: 2 }
19−}
18+ body div ul { columns: 2 }
19+}
media/fonts/input_mono_thin.ttfdeleted

Binary file not shown.

scripts/portal.js+42−60
@@ -1,81 +1,63 @@
1−'use strict';
1+'use strict'
22
3−function Portal(sites)
4−{
5− this.el = document.createElement("div");
6− this.sites = sites;
7−
8− this.install = function()
9− {
10− document.body.appendChild(this.el);
3+function Portal (sites) {
4+ this.el = document.createElement('div')
5+ this.sites = sites
6+
7+ // Templates
8+
9+ function _readme () {
10+ return `<p class='readme'>This webring is an attempt to inspire artists & developers to build their own website and share traffic among each other. The ring welcomes personalized websites such as <b>diaries, wikis & portfolios</b>.</p><p>To add yourself to the ring, submit a <a href='https://github.com/XXIIVV/webring/edit/master/scripts/sites.js' target='_blank'>Pull Request</a>.<br />If you found a broken link, please <a href='https://github.com/XXIIVV/webring/issues/new' target='_blank'>report it</a>.</p>`
1111 }
12−
13− this.start = function()
14− {
15− this.install();
16− this.el.innerHTML = window.location.hash && window.location.hash.length > 4 ? this.redirect() : this.directory();
12+
13+ function _buttons () {
14+ return `<p class='buttons'><a href='#random' onClick="portal.reload('random')">Random</a> | <a href='https://github.com/XXIIVV/webring'>Information</a> <a id='icon' href='#random' onClick="portal.reload('random')"></a></p>`
1715 }
1816
19− this.readme = function()
20− {
21− return `<p class='readme'>This webring is an attempt to inspire artists & developers to build their own website and share traffic among each other. The ring welcomes personalized websites such as <b>diaries, wikis & portfolios</b>.</p><p>To add yourself to the ring, submit a <a href='https://github.com/XXIIVV/webring/edit/master/index.html' target='_blank'>Pull Request</a>.<br />If you found a broken link, please <a href='https://github.com/XXIIVV/webring/issues/new' target='_blank'>report it</a>.</p>`
17+ function _directory (sites) {
18+ return `
19+ <ul>${sites.reduce((acc, val, id) => { return `${acc}<li>${id}) <a href='${val}'>${val.split('//')[1]}</a></li>` }, '')}</ul>\n${_readme()}${_buttons()}`
2220 }
2321
24− this.buttons = function()
25− {
26− return `<p class='buttons'><a href='#random' onClick="portal.reload('random')">Random</a> | <a href='https://github.com/XXIIVV/webring'>Information</a> <a id='icon' href='#random' onClick="portal.reload('random')"></a></p>`
22+ function _redirect (target) {
23+ return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
24+ <p class='buttons'><a href='#' onClick="portal.reload('')">Directory</a> | <a href='#${target}' onClick="portal.reload('random')">Skip</a> | <a href='#random' onClick="portal.reload('random')">Random</a> | <a href='https://github.com/XXIIVV/webring'>Information</a> <a id='icon' href='#random' onClick="portal.reload('random')"></a></p>`
2725 }
28−
29− this.directory = function()
30− {
31− return `<ul>${this.sites.reduce((acc,val,id) => { return `${acc}<li>${id}) <a href='${val}'>${val.split("//")[1]}</a></li>`},"")}</ul>\n${this.readme()}${this.buttons()}`
26+
27+ //
28+
29+ this.install = function (host) {
30+ host.appendChild(this.el)
3231 }
3332
34− this.reload = function()
35− {
36− setTimeout(()=>{ window.location.reload() },500)
33+ this.start = function () {
34+ this.el.innerHTML = window.location.hash && window.location.hash.length > 4 ? _redirect(this.next()) : _directory(this.sites)
3735 }
3836
39− this.navigate = function(target)
40− {
41− setTimeout(() => {
42− window.location.href = target
43− },3000)
37+ this.reload = function () {
38+ setTimeout(() => { window.location.reload() }, 500)
4439 }
45−
46− this.location = function()
47− {
48− return window.location.hash.replace("#","").trim();
40+
41+ this.navigate = function (target) {
42+ setTimeout(() => { window.location.href = target }, 3000)
4943 }
50−
51− this.locate = function()
52− {
53− const hash = this.location();
54−
55− if(hash == "random"){
56− return Math.floor(Math.random()*this.sites.length)
44+
45+ this.locate = function () {
46+ const hash = window.location.hash.replace('#', '').trim()
47+
48+ if (hash == 'random') {
49+ return Math.floor(Math.random() * this.sites.length)
5750 }
58−
59− for(const id in this.sites){
60− const site = this.sites[id];
61− if(site.indexOf(hash) >-1){
51+
52+ for (const id in this.sites) {
53+ if (this.sites[id].indexOf(hash) > -1) {
6254 return parseInt(id)
6355 }
6456 }
6557 return -1
6658 }
67−
68− this.next = function(loc)
69− {
70− return loc == this.sites.length-1 ? this.sites[0] : this.sites[loc+1];
71− }
72−
73− this.redirect = function()
74− {
75− const location = this.locate();
76− const target = this.next(location);
77− this.navigate(target)
78− return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
79− <p class='buttons'><a href='#' onClick="portal.reload('')">Directory</a> | <a href='#${target}' onClick="portal.reload('random')">Skip</a> | <a href='#random' onClick="portal.reload('random')">Random</a> | <a href='https://github.com/XXIIVV/webring'>Information</a> <a id='icon' href='#random' onClick="portal.reload('random')"></a></p>`
59+
60+ this.next = function (loc = this.locate()) {
61+ return loc == this.sites.length - 1 ? this.sites[0] : this.sites[loc + 1]
8062 }
8163}
scripts/sites.js+68−60
@@ -1,62 +1,70 @@
1+'use strict';
2+
3+// Don't forget the comma! No trailing slashes
14// protocole://url.domain.ext
5+
26const sites = [
3− "https://wiki.xxiivv.com"
4− , "http://estevancarlos.com"
5− , "https://electro.pizza"
6− , "https://monochromatic.co"
7− , "https://joshavanier.github.io"
8− , "http://kaemura.com"
9− , "https://liamcooke.com"
10− , "https://electricgecko.de"
11− , "https://wichniow.ski"
12− , "https://hraew.autophagy.io"
13− , "https://evenunto.net"
14− , "https://anxl.faith"
15− , "https://xvw.github.io"
16− , "https://heracl.es"
17− , "https://felipecortez.net"
18− , "http://luminghao.com"
19− , "https://theiceshelf.com"
20− , "https://turelio.github.io"
21− , "https://spaceshipsin.space"
22− , "http://log.lectronice.com"
23− , "https://craze.co.uk"
24− , "https://shaneckel.com"
25− , "https://cblgh.org"
26− , "https://ellugar.co"
27− , "http://hur.bet"
28− , "http://chigby.org"
29− , "https://longest.voyage"
30− , "https://palomakop.tv"
31− , "https://travisshears.com"
32− , "https://v-os.ca"
33− , "http://secretinternet.club"
34− , "https://jmandel.xyz"
35− , "https://systems.ws"
36− , "https://jamesin.space"
37− , "https://nathanwentworth.co"
38− , "https://eswat.ca"
39− , "https://uonai.space"
40− , "http://controls.ee"
41− , "https://wasin.io"
42− , "https://inns.studio"
43− , "http://kokorobot.ca"
44− , "https://ameyama.com"
45− , "https://wake.st"
46− , "https://xarene.la"
47− , "https://alex.zyzhang.me"
48− , "http://bildwissenschaft.vortok.info"
49− , "https://jakofranko.github.com"
50− , "https://aeriform.io"
51− , "http://blog.lucasdidthis.com"
52− , "http://npisanti.com"
53− , "https://underscorediscovery.ca"
54− , "https://drisc.io"
55− , "https://neufv.website"
56− , "https://simbolo.xyz"
57− , "https://ricky.codes"
58− , "https://maxdeviant.com"
59− , "https://tynandebold.com"
60− , "http://gytis.co"
61− ];
62− // Don't forget the comma! No trailing slashes
7+ "https://wiki.xxiivv.com"
8+ , "http://estevancarlos.com"
9+ , "https://electro.pizza"
10+ , "https://monochromatic.co"
11+ , "https://joshavanier.github.io"
12+ , "http://kaemura.com"
13+ , "https://liamcooke.com"
14+ , "https://electricgecko.de"
15+ , "https://wichniow.ski"
16+ , "https://hraew.autophagy.io"
17+ , "https://evenunto.net"
18+ , "https://anxl.faith"
19+ , "https://xvw.github.io"
20+ , "https://heracl.es"
21+ , "https://felipecortez.net"
22+ , "http://luminghao.com"
23+ , "https://theiceshelf.com"
24+ , "https://turelio.github.io"
25+ , "https://spaceshipsin.space"
26+ , "http://log.lectronice.com"
27+ , "https://craze.co.uk"
28+ , "https://shaneckel.com"
29+ , "https://cblgh.org"
30+ , "https://ellugar.co"
31+ , "http://hur.bet"
32+ , "http://chigby.org"
33+ , "https://longest.voyage"
34+ , "https://palomakop.tv"
35+ , "https://travisshears.com"
36+ , "https://v-os.ca"
37+ , "http://secretinternet.club"
38+ , "https://jmandel.xyz"
39+ , "https://systems.ws"
40+ , "https://jamesin.space"
41+ , "https://nathanwentworth.co"
42+ , "https://eswat.ca"
43+ , "https://uonai.space"
44+ , "http://controls.ee"
45+ , "https://wasin.io"
46+ , "https://inns.studio"
47+ , "http://kokorobot.ca"
48+ , "https://ameyama.com"
49+ , "https://wake.st"
50+ , "https://xarene.la"
51+ , "https://alex.zyzhang.me"
52+ , "http://bildwissenschaft.vortok.info"
53+ , "https://jakofranko.github.com"
54+ , "https://aeriform.io"
55+ , "http://blog.lucasdidthis.com"
56+ , "http://npisanti.com"
57+ , "https://underscorediscovery.ca"
58+ , "https://drisc.io"
59+ , "https://neufv.website"
60+ , "https://simbolo.xyz"
61+ , "https://ricky.codes"
62+ , "https://maxdeviant.com"
63+ , "https://tynandebold.com"
64+ , "http://gytis.co"
65+ , "https://nomand.co"
66+ , "http://memoriata.com"
67+ , "https://mmm.s-ol.nu"
68+ , "https://chad.is"
69+ , "https://smidgeo.com/bots"
70+];