on ae6fc2d help sign in
README.md+1−1
since splitsnapshots
unifiedsplit
@@ -1,6 +1,6 @@
1# Webring
1# Webring
2
2
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.
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.
4
4
5## Join the webring
5## Join the webring
6
6
links/main.css+2−2
@@ -15,5 +15,5 @@ body div ul li a:visited { color:#999; text-decoration: none;}
15body div ul li a:hover { background:#ccc; color:#000; text-decoration: none; border-radius: 2px }
15body div ul li a:hover { background:#ccc; color:#000; text-decoration: none; border-radius: 2px }
16
16
17@media (max-width: 950px){
17@media (max-width: 950px){
18− body div ul { columns: 2 }
18+ body div list { columns: 2 }
19−}
19+}
scripts/portal.js+46−35
@@ -1,63 +1,74 @@
1−'use strict'
1+'use strict';
2−
3−function Portal (sites) {
4− this.el = document.createElement('div')
5− this.sites = sites
6
2
3+function Portal(sites)
4+{
5+ this.el = document.createElement("div");
6+ this.sites = sites;
7+
7 // Templates
8 // Templates
8
9
9− function _readme () {
10+ function _readme()
11+ {
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>`
12+ 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>`
11 }
13 }
12
14
13− function _buttons () {
15+ function _buttons()
16+ {
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>`
17 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>`
15 }
18 }
16
19
17− function _directory (sites) {
20+ function _directory(sites)
21+ {
18 return `
22 return `
19− <ul>${sites.reduce((acc, val, id) => { return `${acc}<li>${id}) <a href='${val}'>${val.split('//')[1]}</a></li>` }, '')}</ul>\n${_readme()}${_buttons()}`
23+ <ul>${sites.reduce((acc,val,id) => { return `${acc}<li>${id}) <a href='${val}'>${val.split("//")[1]}</a></li>`; },"")}</ul>\n${_readme()}${_buttons()}`
20 }
24 }
21−
25+
22− function _redirect (target) {
26+ function _redirect(target)
27+ {
23 return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
28 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>`
29 <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>`
25 }
30 }
26
31
27− //
32+ //
28
33
29− this.install = function (host) {
34+ this.install = function(host)
35+ {
30− host.appendChild(this.el)
36+ host.appendChild(this.el);
31 }
37 }
32−
38+
33− this.start = function () {
39+ this.start = function()
40+ {
34− this.el.innerHTML = window.location.hash && window.location.hash.length > 4 ? _redirect(this.next()) : _directory(this.sites)
41+ this.el.innerHTML = window.location.hash && window.location.hash.length > 4 ? _redirect(this.next()) : _directory(this.sites);
35 }
42 }
36
43
37− this.reload = function () {
44+ this.reload = function()
45+ {
38− setTimeout(() => { window.location.reload() }, 500)
46+ setTimeout(()=>{ window.location.reload() },500)
39 }
47 }
40
48
41− this.navigate = function (target) {
49+ this.navigate = function(target)
50+ {
42− setTimeout(() => { window.location.href = target }, 3000)
51+ setTimeout(() => { window.location.href = target; },3000)
43 }
52 }
44−
53+
45− this.locate = function () {
54+ this.locate = function()
55+ {
46− const hash = window.location.hash.replace('#', '').trim()
56+ const hash = window.location.hash.replace("#","").trim();
47−
57+
48− if (hash == 'random') {
58+ if(hash == "random"){
49− return Math.floor(Math.random() * this.sites.length)
59+ return Math.floor(Math.random()*this.sites.length)
50 }
60 }
51−
61+
52− for (const id in this.sites) {
62+ for(const id in this.sites){
53− if (this.sites[id].indexOf(hash) > -1) {
63+ if(this.sites[id].indexOf(hash) >-1){
54 return parseInt(id)
64 return parseInt(id)
55 }
65 }
56 }
66 }
57− return -1
67+ return -1;
58 }
68 }
59−
69+
60− this.next = function (loc = this.locate()) {
70+ this.next = function(loc = this.locate())
71+ {
61− return loc == this.sites.length - 1 ? this.sites[0] : this.sites[loc + 1]
72+ return loc == this.sites.length-1 ? this.sites[0] : this.sites[loc+1];
62 }
73 }
63}
74}
scripts/sites.js−4
@@ -63,8 +63,4 @@ const sites = [
63 , "https://tynandebold.com"
63 , "https://tynandebold.com"
64 , "http://gytis.co"
64 , "http://gytis.co"
65 , "https://nomand.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];
66];