Spaces:
Running
Running
Update index.html
Browse files- index.html +49 -42
index.html
CHANGED
@@ -1,54 +1,61 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
-
<html>
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
-
<
|
|
|
6 |
<style>
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
gap: 10px;
|
12 |
}
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
}
|
18 |
</style>
|
19 |
</head>
|
20 |
<body>
|
21 |
-
<h1>
|
22 |
-
<
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
// JavaScript code to load images from the folder
|
28 |
-
const galleryContainer = document.querySelector('.gallery');
|
29 |
|
30 |
-
//
|
31 |
-
|
32 |
-
'
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
// Loop through the file names and create img elements
|
42 |
-
imageFileNames.forEach(fileName => {
|
43 |
-
const img = document.createElement('img');
|
44 |
-
img.src = `${folderPath}${fileName}`;
|
45 |
-
img.alt = fileName;
|
46 |
-
galleryContainer.appendChild(img);
|
47 |
-
});
|
48 |
-
})
|
49 |
-
.catch(error => {
|
50 |
-
console.error('Error loading images:', error);
|
51 |
-
});
|
52 |
-
</script>
|
53 |
</body>
|
54 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
<head>
|
4 |
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Directory Listing</title>
|
7 |
<style>
|
8 |
+
body {
|
9 |
+
font-family: Arial, sans-serif;
|
10 |
+
background-color: #f0f0f0;
|
11 |
+
padding: 20px;
|
|
|
12 |
}
|
13 |
+
|
14 |
+
h1 {
|
15 |
+
background-color: #333;
|
16 |
+
color: #fff;
|
17 |
+
padding: 10px;
|
18 |
+
}
|
19 |
+
|
20 |
+
ul {
|
21 |
+
list-style: none;
|
22 |
+
padding: 0;
|
23 |
+
}
|
24 |
+
|
25 |
+
li {
|
26 |
+
margin: 5px;
|
27 |
+
padding: 5px;
|
28 |
+
background-color: #fff;
|
29 |
+
border: 1px solid #ccc;
|
30 |
+
}
|
31 |
+
|
32 |
+
a {
|
33 |
+
text-decoration: none;
|
34 |
+
color: #0077cc;
|
35 |
+
}
|
36 |
+
|
37 |
+
a:hover {
|
38 |
+
text-decoration: underline;
|
39 |
}
|
40 |
</style>
|
41 |
</head>
|
42 |
<body>
|
43 |
+
<h1>Directory Listing</h1>
|
44 |
+
<ul>
|
45 |
+
<?php
|
46 |
+
// Get the list of files and subfolders in the 'spidey' directory
|
47 |
+
$directory = 'spidey';
|
48 |
+
$contents = scandir($directory);
|
|
|
|
|
49 |
|
50 |
+
// Loop through the contents and display them as links
|
51 |
+
foreach ($contents as $item) {
|
52 |
+
// Exclude '.' and '..' (current directory and parent directory)
|
53 |
+
if ($item != '.' && $item != '..') {
|
54 |
+
$path = $directory . '/' . $item;
|
55 |
+
echo '<li><a href="' . $path . '">' . $item . '</a></li>';
|
56 |
+
}
|
57 |
+
}
|
58 |
+
?>
|
59 |
+
</ul>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
60 |
</body>
|
61 |
</html>
|