generated from flowcase/registry-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
119 lines (113 loc) · 3.37 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
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
111
112
113
114
115
116
117
118
119
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Droplet Registry</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/css/all.min.css">
<style>
body {
background-color: #F0F1F3; /* Light Gray */
font-family: 'IBM Plex Sans', sans-serif;
}
.navbar {
background-color: #ffffff;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}
.navbar-brand img {
height: 40px;
}
.nav-link {
color: #4E5D6C; /* Dark Gray */
font-weight: 500;
}
.btn-warning {
background-color: #5E37A6; /* Purple */
border-color: #5E37A6;
color: #fff;
}
.btn-warning:hover {
background-color: #462887;
border-color: #462887;
}
.droplet-card {
background: #ffffff;
border-radius: 15px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
overflow: hidden;
transition: all 0.3s ease-in-out;
}
.droplet-card:hover {
transform: translateY(-10px);
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}
.droplet-card img {
width: 100%;
height: auto;
border-bottom: 2px solid #ddd;
}
.droplet-card .card-body {
padding: 20px;
}
.droplet-card h4 {
font-weight: 600;
color: #000000; /* Black */
}
.droplet-card p {
color: #4E5D6C; /* Dark Gray */
font-size: 14px;
}
footer {
background-color: #5E37A6; /* Purple */
color: #ffffff;
padding: 20px 0;
text-align: center;
margin-top: 50px;
}
</style>
</head>
<body>
<!-- Droplet Registry Section -->
<section class="container mt-5">
<div class="row" id="droplet-container">
<!-- Dynamic cards will be injected here -->
</div>
</section>
<!-- Bootstrap and JS dependencies -->
<script src="https://code.jquery.com/jquery-3.5.1.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script>
<!-- Custom JS -->
<script>
document.addEventListener('DOMContentLoaded', function() {
fetch('droplets.json')
.then(response => response.json())
.then(data => {
const container = document.getElementById('droplet-container');
//order by display_name
data.sort((a, b) => a.display_name.localeCompare(b.display_name));
data.forEach(droplet => {
const card = document.createElement('div');
card.className = 'col-md-4 mb-4';
card.innerHTML = `
<div class="droplet-card">
<img src="${droplet.image_path}" alt="${droplet.display_name}">
<div class="card-body">
<h4 class="card-title">${droplet.display_name}</h4>
<h6 class="card-subtitle mb-2 text-muted">${droplet.container_docker_image}</h6>
<p class="card-text">${droplet.description}</p>
</div>
</div>
`;
container.appendChild(card);
});
})
.catch(error => {
console.error('Error:', error);
const container = document.getElementById('droplet-container');
container.innerHTML = '<div class="col"><p class="text-center">An error occurred while fetching droplets. Please try again later.</p></div>';
});
});
</script>
</body>
</html>