@@ -1,6 +1,6 @@
1function Portal(sites)
1function Portal(sites)
3− this.el = document.createElement("pre");
3+ this.el = document.createElement("div");
4 this.sites = sites;
4 this.sites = sites;
6 this.install = function()
6 this.install = function()
@@ -13,6 +13,16 @@ function Portal(sites)
13 this.install();
13 this.install();
14 this.el.innerHTML = window.location.hash && window.location.hash.length > 4 ? this.redirect() : this.directory();
14 this.el.innerHTML = window.location.hash && window.location.hash.length > 4 ? this.redirect() : this.directory();
17+ this.readme = function()
19+ 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> — To add yourself to the ring, submit a <a href='https://github.com/XXIIVV/webring/edit/master/index.html' target='_blank'>Pull Request</a>.</p>`
22+ this.buttons = function()
24+ 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 this.directory = function()
27 this.directory = function()
@@ -22,7 +32,7 @@ function Portal(sites)
22 var site = this.sites[id]
32 var site = this.sites[id]
23 html += `<ln>${id}) <a href='${site}'>${site.split("//")[1]}</a></ln>`
33 html += `<ln>${id}) <a href='${site}'>${site.split("//")[1]}</a></ln>`
25− return `<list>${html}</list>\n<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></ln>`
35+ return `<list>${html}</list>\n${this.readme()}${this.buttons()}`
28 this.reload = function()
38 this.reload = function()
@@ -69,6 +79,7 @@ function Portal(sites)
69 var location = this.locate();
79 var location = this.locate();
70 var target = this.next(location);
80 var target = this.next(location);
71 this.navigate(target)
81 this.navigate(target)
82+ return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
72− return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}"><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>`
83+ <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>`