on master help sign in
Removed let assignments
15b773fDevine Lu Linvega
404.html+2−2
@@ -9,8 +9,8 @@ permalink: /404.html
9</head>
9</head>
10<body style='background:black'>
10<body style='background:black'>
11 <script>
11 <script>
12− let parts = window.location.pathname.split("/")
12+ const parts = window.location.pathname.split("/")
13− let target = parts.slice(-1);
13+ const target = parts.slice(-1);
14 parts.splice(-1)
14 parts.splice(-1)
15 document.location.href = parts.join("/")+"/#"+target
15 document.location.href = parts.join("/")+"/#"+target
16 </script>
16 </script>
index.html+1−1
@@ -11,7 +11,7 @@
11</head>
11</head>
12<body>
12<body>
13 <script>
13 <script>
14− let portal = new Portal(sites);
14+ const portal = new Portal(sites);
15 portal.start();
15 portal.start();
16 </script>
16 </script>
17</body>
17</body>
links/main.css+8−6
@@ -1,3 +1,5 @@
1+* { margin:0;padding:0;border:0;outline:0;text-decoration:none;font-weight:inherit;font-style:inherit;color:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;list-style:none;border-collapse:collapse;border-spacing:0; -webkit-font-smoothing: antialiased;-moz-osx-font-smoothing: grayscale;}
2+
1body { background:#f4f4f4; padding:0px; margin:0px; }
3body { background:#f4f4f4; padding:0px; margin:0px; }
2body div { display:block; background: #ddd;min-height: calc(100vh - 60px);width: calc(100vw - 60px);margin: 15px;color: #555;padding: 15px;font-family:'input_mono_regular', 'Monospaced','Courier New',courier;font-size:11px; position: relative; border-radius: 2px }
4body div { display:block; background: #ddd;min-height: calc(100vh - 60px);width: calc(100vw - 60px);margin: 15px;color: #555;padding: 15px;font-family:'input_mono_regular', 'Monospaced','Courier New',courier;font-size:11px; position: relative; border-radius: 2px }
3body div #icon { display: block;width: 30px;height: 30px;background-image: url(../icon.white.svg);background-size: cover;background-repeat: no-repeat;position: absolute;bottom: 10px;right:10px;background-position: center;padding:0px }
5body div #icon { display: block;width: 30px;height: 30px;background-image: url(../icon.white.svg);background-size: cover;background-repeat: no-repeat;position: absolute;bottom: 10px;right:10px;background-position: center;padding:0px }
@@ -6,12 +8,12 @@ body div p a { color:black; text-decoration: none; text-decoration: underline;}
6body div p a:hover { text-decoration: underline; }
8body div p a:hover { text-decoration: underline; }
7body div p b { font-weight: normal; color:#000; font-family: 'input_mono_medium' }
9body div p b { font-weight: normal; color:#000; font-family: 'input_mono_medium' }
8body div p.readme { max-width:500px; }
10body div p.readme { max-width:500px; }
9−body div list { display:block; max-width: 800px; columns:3; border-bottom: 2px solid white;padding-bottom: 15px;margin-bottom:15px; overflow: hidden;}
11+body div ul { display:block; max-width: 800px; columns:3; border-bottom: 2px solid white;padding-bottom: 15px;margin-bottom:15px; overflow: hidden;}
10−body div list ln { width: 22em; display:block; padding-left:5px; overflow: hidden; text-overflow: ellipsis; }
12+body div ul li { width: 22em; display:block; padding-left:5px; overflow: hidden; text-overflow: ellipsis; }
11−body div list ln a { line-height: 20px; display: inline-block; color:#000; padding:0px 5px; text-decoration: none;}
13+body div ul li a { line-height: 20px; display: inline-block; color:#000; padding:0px 5px; text-decoration: none;}
12−body div list ln a:visited { color:#999; text-decoration: none;}
14+body div ul li a:visited { color:#999; text-decoration: none;}
13−body div list ln a:hover { background:#ccc; color:#000; text-decoration: none; border-radius: 2px }
15+body div ul li a:hover { background:#ccc; color:#000; text-decoration: none; border-radius: 2px }
14
16
15−@media (max-width: 950px) {
17+@media (max-width: 950px){
16 body div list { columns: 2 }
18 body div list { columns: 2 }
17}
19}
scripts/portal.js+6−12
@@ -28,13 +28,7 @@ function Portal(sites)
28
28
29 this.directory = function()
29 this.directory = function()
30 {
30 {
31− let html = ""
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()}`
32−
33− for(let id in this.sites){
34− let site = this.sites[id]
35− html += `<ln>${id}) <a href='${site}'>${site.split("//")[1]}</a></ln>`
36− }
37− return `<list>${html}</list>\n${this.readme()}${this.buttons()}`
38 }
32 }
39
33
40 this.reload = function()
34 this.reload = function()
@@ -56,14 +50,14 @@ function Portal(sites)
56
50
57 this.locate = function()
51 this.locate = function()
58 {
52 {
59− let hash = this.location();
53+ const hash = this.location();
60
54
61 if(hash == "random"){
55 if(hash == "random"){
62 return Math.floor(Math.random()*this.sites.length)
56 return Math.floor(Math.random()*this.sites.length)
63 }
57 }
64
58
65− for(let id in this.sites){
59+ for(const id in this.sites){
66− let site = this.sites[id];
60+ const site = this.sites[id];
67 if(site.indexOf(hash) >-1){
61 if(site.indexOf(hash) >-1){
68 return parseInt(id)
62 return parseInt(id)
69 }
63 }
@@ -78,8 +72,8 @@ function Portal(sites)
78
72
79 this.redirect = function()
73 this.redirect = function()
80 {
74 {
81− let location = this.locate();
75+ const location = this.locate();
82− let target = this.next(location);
76+ const target = this.next(location);
83 this.navigate(target)
77 this.navigate(target)
84 return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
78 return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
85 <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>`
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>`
scripts/sites.js+1−1
@@ -1,5 +1,5 @@
1// protocole://url.domain.ext
1// protocole://url.domain.ext
2−let sites = [
2+const sites = [
3 "https://wiki.xxiivv.com"
3 "https://wiki.xxiivv.com"
4 , "http://estevancarlos.com"
4 , "http://estevancarlos.com"
5 , "https://electro.pizza"
5 , "https://electro.pizza"