-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
89 lines (75 loc) · 2.15 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html>
<head>
<title>alex hebing</title>
<link rel="shortcut icon" href="love.ico" />
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<?php
include "dirFinder.php";
$dirs = FindDirs();
?>
<h3>ALEX HEBING</h3>
<div id="container">
<div id="navBarContainer">
<nav id="navBar">
</nav>
</div>
<div id="explanationField" class="contentField">
</div>
<div id="imageField" class="contentField">
</div>
</div>
</body>
<script>
function CreateNavBar()
{
var dirs = JSON.parse( '<?php echo json_encode($dirs) ?>' );
for (var i = 0; i < dirs.length; i++) {
if (dirs[i].Name != "cgi-bin" && dirs[i].Name != "img" && dirs[i].Name != "dewit")
{
AddElementToNavBar(dirs[i]);
}
};
}
function AddElementToNavBar(dir)
{
var navBar = document.getElementById("navBar");
var newNode = document.createElement("a");
newNode.classList.add("navElement");
newNode.addEventListener('click', function() { location.href = dir.Name }, false)
newNode.onmouseover = function() { HandleMouseOver(dir.Name) };
newNode.onmouseleave = function() { HandleMouseLeave(dir.Name )};
var textNode = document.createElement("p");
textNode.innerText = dir.Name;
newNode.appendChild(textNode);
navBar.appendChild(newNode);
}
function HandleMouseOver(dirName)
{
var explanationField = document.getElementById("explanationField");
explanationField.innerText = SelectText(dirName);
}
function HandleMouseLeave()
{
var explanationField = document.getElementById("explanationField");
explanationField.innerText = "";
}
function SelectText(dirName)
{
switch(dirName) {
case "encourage":
return "Secret spot for exchanging encouragements. Goed bezig!";
case "volcasessions":
return "Weekend afternoon fun";
case "touch":
return "My first game, and last project for the university. Start the theoretical reflections on touch!";
case "a sweetness":
return "Some songs recorded in and around 2008. Mostly on life and death.";
default:
return "Nothing to say about this (yet)";
}
}
CreateNavBar();
</script>