aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorsten Ortlepp <post@ortlepp.eu>2020-03-29 12:59:31 +0200
committerThorsten Ortlepp <post@ortlepp.eu>2020-03-29 12:59:31 +0200
commit123450cda69bd5219fd746e1fc617ea43a34f507 (patch)
tree2ab88f29e6b778817a9c765900a94ac00bb86a14
parent33f9d72c18efcfe44ee45ba41833d3fcddcdd17c (diff)
downloadsimple-dash-fork-123450cda69bd5219fd746e1fc617ea43a34f507.zip
Moved config into index.html
-rw-r--r--config.sample.json20
-rw-r--r--index.html41
2 files changed, 9 insertions, 52 deletions
diff --git a/config.sample.json b/config.sample.json
deleted file mode 100644
index e3b734c..0000000
--- a/config.sample.json
+++ /dev/null
@@ -1,20 +0,0 @@
-{
- "title" : "Your Homepage Title",
- "items" : [
- {
- "alt" : "Github",
- "icon" : "fab fa-github",
- "link" : "https://github.com/Swagielka"
- },
- {
- "alt" : "Twitter",
- "icon" : "fab fa-twitter",
- "link" : "https://twitter.com/Kukielka_"
- },
- {
- "alt" : "Docker Hub",
- "icon" : "fab fa-docker",
- "link" : "https://hub.docker.com/u/kukielka/"
- }
- ]
-}
diff --git a/index.html b/index.html
index 2a910e3..fb41562 100644
--- a/index.html
+++ b/index.html
@@ -1,61 +1,39 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
- <title>Loading...</title>
-
+ <!-- Set title below -->
+ <title>Your Homepage Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<link rel="stylesheet" type="text/css" href="common/css/fontawesome-all.min.css" />
<link rel="stylesheet" type="text/css" href="common/css/main.css" />
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
</head>
-
<body id="homepage">
-
<div id="wrapper">
<div id="itemlist">
- <a title="Loading..."><i class="fa-spin fas fa-spinner fa-fw"></i></a>
+ <!-- First item: Homepage -->
+ <a href="https://ortlepp.eu/" title="Homepage"><i class="fa fa-home fa-fw"></i></a>
+ <!-- Second item: GitHub -->
+ <a href="https://github.com/tortlepp" title="GitHub"><i class="fab fa-github"></i></a>
+ <!-- Third item: Google -->
+ <a href="https://www.google.com/" title="Google"><i class="fab fa-google"></i></a>
+ <!-- Add more items here ... -->
</div>
</div>
-
<script src="common/js/trianglify.min.js"></script>
<script>
- var request = new XMLHttpRequest();
- request.overrideMimeType("application/json");
- request.open("GET", 'config.json');
- request.onload = function () {
- if (request.status >= 200 && request.status < 400) {
- var config = JSON.parse(this.response);
- console.log(config);
- document.title = config.title;
-
- var itemlistHTML = '';
- for (var i = 0; i < config.items.length; i++) {
- var item = config.items[i];
- itemlistHTML += '<a href="'+item.link+'" title="'+item.alt+'"><i class="'+item.icon+' fa-fw"></i></a>';
- }
- document.getElementById("itemlist").innerHTML = itemlistHTML;
- } else {
- var error_text = "Error: "+request.status;
- console.error(error_text);
- document.title = error_text;
- }
- }
- request.send(null);
-
function addTriangleTo(target) {
var dimensions = target.getClientRects()[0];
var pattern = Trianglify({
width: dimensions.width,
height: dimensions.height
});
-
target.style['background-image'] = 'url(' + pattern.png() + ')';
target.style['background-size'] = 'cover';
target.style['-webkit-background-size'] = 'cover';
target.style['-moz-background-size'] = 'cover';
target.style['-o-background-size'] = 'cover';
}
-
var resizeTimer;
window.addEventListener("resize", function () {
clearTimeout(resizeTimer);
@@ -63,7 +41,6 @@
addTriangleTo(homepage);
}, 400);
})
-
addTriangleTo(homepage);
</script>
</body>