This repository has been archived by the owner on Apr 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
81 lines (74 loc) · 2.36 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="styles.css">
<title>Hicup</title>
<style>
.modal {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.8);
align-items: center;
justify-content: center;
z-index: 1;
}
.modal-content {
max-width: 80%;
max-height: 80%;
object-fit: contain;
}
.close {
position: absolute;
top: 10px;
left: 10px;
color: #fff;
font-size: 20px;
cursor: pointer;
}
</style>
<script src="hicup-player.js"></script>
</head>
<body>
<header>
<h1>Hicup</h1>
</header>
<nav>
<a href="My-HTML/index.html"><button>My custom sites</button></a>
<button onclick="loadContent('photos')">Photos</button>
<button onclick="loadContent('videos')">Videos</button>
<button onclick="loadContent('music')">Music</button>
</nav>
<section class="container" id="content"></section>
<!-- Photo Modal -->
<div id="myModal" class="modal">
<span id="closeModal" class="close">×</span>
<div id="modalContent" class="modal-content"></div>
</div>
<script>
function loadContent(type) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function () {
if (xhr.readyState == 4 && xhr.status == 200) {
document.getElementById('content').innerHTML = xhr.responseText;
// Add event listeners to each item to open the modal
var items = document.querySelectorAll('.item');
items.forEach(function (item) {
item.addEventListener('click', function () {
var contentUrl = this.getAttribute('data-url');
toggleModal(contentUrl);
});
});
}
};
xhr.open('GET', 'server.php?type=' + type, true);
xhr.send();
}
</script>
</body>
</html>