imspidey commited on
Commit
ed2e85d
·
1 Parent(s): 1230d46

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +49 -42
index.html CHANGED
@@ -1,54 +1,61 @@
1
  <!DOCTYPE html>
2
- <html>
3
  <head>
4
  <meta charset="UTF-8">
5
- <title>Spider-Man Gallery</title>
 
6
  <style>
7
- /* Basic CSS for gallery layout */
8
- .gallery {
9
- display: grid;
10
- grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
11
- gap: 10px;
12
  }
13
-
14
- .gallery img {
15
- width: 100%;
16
- height: auto;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
  }
18
  </style>
19
  </head>
20
  <body>
21
- <h1>Spider-Man Gallery</h1>
22
- <div class="gallery">
23
- <!-- JavaScript will populate this section with images from the folder -->
24
- </div>
25
-
26
- <script>
27
- // JavaScript code to load images from the folder
28
- const galleryContainer = document.querySelector('.gallery');
29
 
30
- // Replace 'spidey_images/' with the actual path to your image folder
31
- const folderPath = 'spidey/'
32
- ';
33
-
34
- // Fetch a list of image files from the server
35
- fetch(`${folderPath}`)
36
- .then(response => response.text())
37
- .then(text => {
38
- // Split the response into lines, assuming each line is a file name
39
- const imageFileNames = text.split('\n').filter(Boolean);
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>