Minor cleanup

This commit is contained in:
Devine Lu Linvega 2018-05-17 11:36:32 +12:00
parent 518528ea14
commit 4490dffda6
2 changed files with 13 additions and 5 deletions

View File

@ -3,10 +3,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="scripts/portal.js"></script> <script src="portal.js"></script>
<link rel="stylesheet" type="text/css" href="links/reset.css"/>
<link rel="stylesheet" type="text/css" href="links/fonts.css"/>
<link rel="stylesheet" type="text/css" href="links/main.css"/>
<title>Webring</title> <title>Webring</title>
</head> </head>
<body> <body>
@ -19,5 +16,10 @@
var portal = new Portal(sites); var portal = new Portal(sites);
portal.start(); portal.start();
</script> </script>
<style>
body { background:#eee; padding:30px; }
body a { color:#000; display: inline-block; padding:0px 5px; line-height: 20px}
body a:hover { color:#eee; background:#000; text-decoration: none; }
</style>
</body> </body>
</html> </html>

View File

@ -22,11 +22,17 @@ function Portal(sites)
var site = this.sites[id] var site = this.sites[id]
html += `${id}) <a href='${site}'>${site}</a>\n` html += `${id}) <a href='${site}'>${site}</a>\n`
} }
html += `\n<a href='#random' onClick="window.location.reload()">Random</a> | <a href='https://github.com/XXIIVV/webring'>Information</a>` html += `\n<a href='#random' onClick="portal.reload('random')">Random</a> | <a href='https://github.com/XXIIVV/webring'>Information</a>`
return html return html
} }
this.reload = function()
{
console.log("!!")
setTimeout(()=>{ window.location.reload() },500)
}
this.location = function() this.location = function()
{ {
return window.location.hash.replace("#","").trim(); return window.location.hash.replace("#","").trim();