Skip to content

Commit

Permalink
Removed let assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
neauoire committed Sep 30, 2018
1 parent 25a12bd commit 15b773f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 22 deletions.
4 changes: 2 additions & 2 deletions 404.html
Expand Up @@ -9,8 +9,8 @@
</head>
<body style='background:black'>
<script>
let parts = window.location.pathname.split("/")
let target = parts.slice(-1);
const parts = window.location.pathname.split("/")
const target = parts.slice(-1);
parts.splice(-1)
document.location.href = parts.join("/")+"/#"+target
</script>
Expand Down
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -11,7 +11,7 @@
</head>
<body>
<script>
let portal = new Portal(sites);
const portal = new Portal(sites);
portal.start();
</script>
</body>
Expand Down
14 changes: 8 additions & 6 deletions links/main.css
@@ -1,3 +1,5 @@
* { 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;}

body { background:#f4f4f4; padding:0px; margin:0px; }
body 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 }
body 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 }
Expand All @@ -6,12 +8,12 @@ body div p a { color:black; text-decoration: none; text-decoration: underline;}
body div p a:hover { text-decoration: underline; }
body div p b { font-weight: normal; color:#000; font-family: 'input_mono_medium' }
body div p.readme { max-width:500px; }
body div list { display:block; max-width: 800px; columns:3; border-bottom: 2px solid white;padding-bottom: 15px;margin-bottom:15px; overflow: hidden;}
body div list ln { width: 22em; display:block; padding-left:5px; overflow: hidden; text-overflow: ellipsis; }
body div list ln a { line-height: 20px; display: inline-block; color:#000; padding:0px 5px; text-decoration: none;}
body div list ln a:visited { color:#999; text-decoration: none;}
body div list ln a:hover { background:#ccc; color:#000; text-decoration: none; border-radius: 2px }
body div ul { display:block; max-width: 800px; columns:3; border-bottom: 2px solid white;padding-bottom: 15px;margin-bottom:15px; overflow: hidden;}
body div ul li { width: 22em; display:block; padding-left:5px; overflow: hidden; text-overflow: ellipsis; }
body div ul li a { line-height: 20px; display: inline-block; color:#000; padding:0px 5px; text-decoration: none;}
body div ul li a:visited { color:#999; text-decoration: none;}
body div ul li a:hover { background:#ccc; color:#000; text-decoration: none; border-radius: 2px }

@media (max-width: 950px) {
@media (max-width: 950px){
body div list { columns: 2 }
}
18 changes: 6 additions & 12 deletions scripts/portal.js
Expand Up @@ -28,13 +28,7 @@ function Portal(sites)

this.directory = function()
{
let html = ""

for(let id in this.sites){
let site = this.sites[id]
html += `<ln>${id}) <a href='${site}'>${site.split("//")[1]}</a></ln>`
}
return `<list>${html}</list>\n${this.readme()}${this.buttons()}`
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()}`
}

this.reload = function()
Expand All @@ -56,14 +50,14 @@ function Portal(sites)

this.locate = function()
{
let hash = this.location();
const hash = this.location();

if(hash == "random"){
return Math.floor(Math.random()*this.sites.length)
}

for(let id in this.sites){
let site = this.sites[id];
for(const id in this.sites){
const site = this.sites[id];
if(site.indexOf(hash) >-1){
return parseInt(id)
}
Expand All @@ -78,8 +72,8 @@ function Portal(sites)

this.redirect = function()
{
let location = this.locate();
let target = this.next(location);
const location = this.locate();
const target = this.next(location);
this.navigate(target)
return `<p>Redirecting to <b>${target}</b></p><meta http-equiv="refresh" content="3; url=${target}">
<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>`
Expand Down
2 changes: 1 addition & 1 deletion scripts/sites.js
@@ -1,5 +1,5 @@
// protocole://url.domain.ext
let sites = [
const sites = [
"https://wiki.xxiivv.com"
, "http://estevancarlos.com"
, "https://electro.pizza"
Expand Down

0 comments on commit 15b773f

Please sign in to comment.