Update index.html
Browse files- index.html +98 -18
index.html
CHANGED
@@ -1,19 +1,99 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</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>AI Image Gallery</title>
|
7 |
+
<style>
|
8 |
+
body {
|
9 |
+
font-family: Arial, sans-serif;
|
10 |
+
background-color: #f4f4f4;
|
11 |
+
margin: 0;
|
12 |
+
padding: 0;
|
13 |
+
}
|
14 |
+
|
15 |
+
.gallery {
|
16 |
+
display: grid;
|
17 |
+
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
18 |
+
gap: 10px;
|
19 |
+
padding: 20px;
|
20 |
+
margin-top: 20px;
|
21 |
+
}
|
22 |
+
|
23 |
+
.gallery img {
|
24 |
+
width: 100%;
|
25 |
+
height: auto;
|
26 |
+
border-radius: 8px;
|
27 |
+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
|
28 |
+
transition: transform 0.3s ease-in-out;
|
29 |
+
}
|
30 |
+
|
31 |
+
.gallery img:hover {
|
32 |
+
transform: scale(1.05);
|
33 |
+
}
|
34 |
+
|
35 |
+
.container {
|
36 |
+
text-align: center;
|
37 |
+
margin-top: 20px;
|
38 |
+
}
|
39 |
+
|
40 |
+
h1 {
|
41 |
+
color: #333;
|
42 |
+
}
|
43 |
+
|
44 |
+
.loading {
|
45 |
+
font-size: 18px;
|
46 |
+
color: #666;
|
47 |
+
}
|
48 |
+
</style>
|
49 |
+
</head>
|
50 |
+
<body>
|
51 |
+
|
52 |
+
<div class="container">
|
53 |
+
<h1>AI Image Gallery</h1>
|
54 |
+
<p class="loading">Loading images...</p>
|
55 |
+
<div class="gallery" id="gallery"></div>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
<script>
|
59 |
+
// Fetch the markdown file from the URL
|
60 |
+
const markdownUrl = "https://pub-fdaeaa9117e64f39ae731591e713d186.r2.dev/logs/imgnaicloud.txt";
|
61 |
+
|
62 |
+
// Fetch the markdown content
|
63 |
+
fetch(markdownUrl)
|
64 |
+
.then(response => response.text())
|
65 |
+
.then(markdownContent => {
|
66 |
+
// Parse the markdown content to extract image URLs
|
67 |
+
const imageUrls = parseImageUrls(markdownContent);
|
68 |
+
|
69 |
+
// Hide loading text once images are fetched
|
70 |
+
document.querySelector('.loading').style.display = 'none';
|
71 |
+
|
72 |
+
// Display images in the gallery
|
73 |
+
const gallery = document.getElementById('gallery');
|
74 |
+
imageUrls.forEach(url => {
|
75 |
+
const imgElement = document.createElement('img');
|
76 |
+
imgElement.src = url;
|
77 |
+
imgElement.alt = 'Image from markdown';
|
78 |
+
gallery.appendChild(imgElement);
|
79 |
+
});
|
80 |
+
})
|
81 |
+
.catch(error => {
|
82 |
+
console.error("Error fetching markdown:", error);
|
83 |
+
document.querySelector('.loading').textContent = "Failed to load images.";
|
84 |
+
});
|
85 |
+
|
86 |
+
// Function to extract image URLs from markdown content
|
87 |
+
function parseImageUrls(markdown) {
|
88 |
+
const regex = /!\[.*?\]\((https?:\/\/[^\s]+)\)/g;
|
89 |
+
let match;
|
90 |
+
const urls = [];
|
91 |
+
while ((match = regex.exec(markdown)) !== null) {
|
92 |
+
urls.push(match[1]);
|
93 |
+
}
|
94 |
+
return urls;
|
95 |
+
}
|
96 |
+
</script>
|
97 |
+
|
98 |
+
</body>
|
99 |
</html>
|