-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
110 lines (109 loc) · 2.76 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE html>
<html>
<head>
<title>My chat with chatGPT</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<style>
/* Add the sidenav class to the body element */
body {
font-family: Arial, sans-serif;
padding: 0;
margin: 0;
/* added */
display: flex;
}
/* Add the sidenav class to the body element */
.sidenav {
height: 100%;
width: 256px;
position: fixed;
z-index: 1;
top: 0;
left: 0;
background-color: #7f8c8d;
overflow-x: hidden;
padding-top: 64px;
/* added */
transition: 0.5s;
}
.sidenav a {
padding: 6px 8px 6px 16px;
text-decoration: none;
font-size: 18px;
color: #f1f1f1;
display: block;
}
.main {
/* added */
flex-grow: 1;
margin-left: 256px;
margin-top: 64px;
padding: 0px 12px;
}
/* added */
.sidenav.open {
width: 256px;
}
.sidenav.closed {
width: 0;
}
@media screen and (max-height: 450px) {
.sidenav {
padding-top: 15px;
}
.sidenav a {
font-size: 18px;
}
}
</style>
<style>
#page-frame {
width: 100%;
height: 100%;
border: none;
position: absolute;
top: 64px;
left: 0;
}
</style>
</head>
<body>
<div class="sidenav">
<?php
$files = glob("*.html");
foreach ($files as $file) {
echo '<a href="#" onClick="displayPage(\'' .
$file .
'\'); return false;">' .
$file .
"</a>";
}
?>
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()">×</a>
</div>
<div class="navbar-fixed">
<nav>
<div class="nav-wrapper blue-grey darken-2">
<a href="#" class="brand-logo center white-text">Pages</a>
<a href="#" data-target="slide-out" class="sidenav-trigger"><i class="material-icons">menu</i></a>
</div>
</nav>
</div>
<div style="height: calc(100vh - 64px);">
<iframe id="page-frame" class="responsive-iframe"></iframe>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.sidenav');
var instances = M.Sidenav.init(elems);
});
function displayPage(pageUrl) {
document.querySelector('#page-frame').src = pageUrl;
var elems = document.querySelectorAll('.sidenav');
var instances = M.Sidenav.getInstance(elems[0]);
instances.close();
}
</script>
</body>
</html>