on master help sign in
Removed let assignments
commit15b773feec104e1a3c9c9b2f4d44944380a185ec authorDevine Lu Linvega <aliceffekt@gmail.com> dateSun 30 Sep 2018, 19:46 (8 years ago) parent25a12bd
5 files changed+18−22
404.html+2−2 index.html+1−1 links/main.css+8−6 scripts/portal.js+6−12 scripts/sites.js+1−1
404.html+2−2
@@ -9,8 +9,8 @@ permalink: /404.html
99</head>
1010<body style='background:black'>
1111 <script>
12− let parts = window.location.pathname.split("/")
13− let target = parts.slice(-1);
12+ const parts = window.location.pathname.split("/")
13+ const target = parts.slice(-1);
1414 parts.splice(-1)
1515 document.location.href = parts.join("/")+"/#"+target
1616 </script>
index.html+1−1
@@ -11,7 +11,7 @@
1111</head>
1212<body>
1313 <script>
14− let portal = new Portal(sites);
14+ const portal = new Portal(sites);
1515 portal.start();
1616 </script>
1717</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+
13body { background:#f4f4f4; padding:0px; margin:0px; }
24body 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 }
35body 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;}
68body div p a:hover { text-decoration: underline; }
79body div p b { font-weight: normal; color:#000; font-family: 'input_mono_medium' }
810body 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;}
10−body div list ln { 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;}
12−body div list ln a:visited { color:#999; text-decoration: none;}
13−body div list ln a:hover { background:#ccc; color:#000; text-decoration: none; border-radius: 2px }
11+body div ul { display:block; max-width: 800px; columns:3; border-bottom: 2px solid white;padding-bottom: 15px;margin-bottom:15px; overflow: hidden;}
12+body div ul li { width: 22em; display:block; padding-left:5px; overflow: hidden; text-overflow: ellipsis; }
13+body div ul li a { line-height: 20px; display: inline-block; color:#000; padding:0px 5px; text-decoration: none;}
14+body div ul li a:visited { color:#999; text-decoration: none;}
15+body div ul li a:hover { background:#ccc; color:#000; text-decoration: none; border-radius: 2px }
1416
15−@media (max-width: 950px) {
17+@media (max-width: 950px){
1618 body div list { columns: 2 }
1719}
scripts/portal.js+6−12
@@ -28,13 +28,7 @@ function Portal(sites)
2828
2929 this.directory = function()
3030 {
31− let html = ""
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()}`
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()}`
3832 }
3933
4034 this.reload = function()
@@ -56,14 +50,14 @@ function Portal(sites)
5650
5751 this.locate = function()
5852 {
59− let hash = this.location();
53+ const hash = this.location();
6054
6155 if(hash == "random"){
6256 return Math.floor(Math.random()*this.sites.length)
6357 }
6458
65− for(let id in this.sites){
66− let site = this.sites[id];
59+ for(const id in this.sites){
60+ const site = this.sites[id];
6761 if(site.indexOf(hash) >-1){
6862 return parseInt(id)
6963 }
@@ -78,8 +72,8 @@ function Portal(sites)
7872
7973 this.redirect = function()
8074 {
81− let location = this.locate();
82− let target = this.next(location);
75+ const location = this.locate();
76+ const target = this.next(location);
8377 this.navigate(target)
8478 return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
8579 <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 @@
11// protocole://url.domain.ext
2−let sites = [
2+const sites = [
33 "https://wiki.xxiivv.com"
44 , "http://estevancarlos.com"
55 , "https://electro.pizza"