-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviewmemes.html
More file actions
88 lines (79 loc) · 2.4 KB
/
viewmemes.html
File metadata and controls
88 lines (79 loc) · 2.4 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>MemeStash Gallery</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="https://fonts.googleapis.com/css2?family=Outfit:wght@500;700&display=swap" rel="stylesheet" />
<style>
body {
font-family: 'Outfit', sans-serif;
background: #f0f4f8;
padding: 20px;
text-align: center;
}
h1 {
font-size: 2.5rem;
margin-bottom: 10px;
}
.gallery {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 20px;
margin-top: 30px;
padding: 0 10px;
}
.gallery img {
max-width: 100%;
border-radius: 12px;
box-shadow: 0 4px 12px rgba(0,0,0,0.1);
transition: transform 0.2s;
}
.gallery img:hover {
transform: scale(1.03);
}
footer {
margin-top: 40px;
color: #777;
font-size: 0.9rem;
}
</style>
</head>
<body>
<h1>Meme Gallery</h1>
<p>Fresh memes uploaded by the community 🎉</p>
<div class="gallery" id="gallery"></div>
<footer>
© 2025 MemeStash by Baconyy11
</footer>
<script type="module">
import { createClient } from 'https://cdn.jsdelivr.net/npm/@supabase/supabase-js/+esm'
const supabaseUrl = 'https://tyympdfmtwxbzkarolrm.supabase.co';
const supabaseKey = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InR5eW1wZGZtdHd4YnprYXJvbHJtIiwicm9sZSI6ImFub24iLCJpYXQiOjE3NTAyNzQ2ODYsImV4cCI6MjA2NTg1MDY4Nn0.CJSweUgVGLHP2bTg8QwfMpojHrS76hmThN86T4dA33Y';
const supabase = createClient(supabaseUrl, supabaseKey);
async function loadMemes() {
const { data, error } = await supabase.storage.from('memes').list('', {
limit: 100,
sortBy: { column: 'created_at', order: 'desc' },
});
const gallery = document.getElementById('gallery');
gallery.innerHTML = '';
if (error) {
gallery.innerHTML = '<p>Error loading memes.</p>';
return;
}
if (data.length === 0) {
gallery.innerHTML = '<p>No memes uploaded yet 😢</p>';
return;
}
data.forEach(file => {
const img = document.createElement('img');
img.src = `${supabaseUrl}/storage/v1/object/public/memes/${file.name}`;
img.alt = file.name;
gallery.appendChild(img);
});
}
loadMemes();
</script>
</body>
</html>