-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
210 lines (199 loc) · 6.18 KB
/
index.html
File metadata and controls
210 lines (199 loc) · 6.18 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
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Florida Man Adventures - Legendary Tees</title>
<meta name="description" content="Official Florida Man Adventures e-commerce store. Get your legendary Florida tees, shirts, and gear.">
<link href="https://fonts.googleapis.com/css2?family=Bangers&family=Inter:wght@400;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Inter', sans-serif;
background-color: #121212;
color: #e0e0e0;
margin: 0;
}
header {
background: #000;
border-bottom: 2px solid #FF4500;
padding: 1.5rem 1rem;
text-align: center;
}
header h1 {
font-family: 'Bangers', cursive;
font-size: 2.5rem;
color: #FF4500;
letter-spacing: 2px;
margin: 0;
text-shadow: 1px 1px #ff0000;
}
.container {
margin: 40px auto;
padding: 0 6vw;
max-width: 1350px;
}
.product-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 32px;
}
.product-card {
background: #1e1e1e;
border: 1px solid #333;
border-radius: 12px;
overflow: hidden;
box-shadow: 0 4px 15px rgba(0,0,0,0.4);
transition: transform 0.25s, box-shadow 0.25s;
}
.product-card:hover {
transform: translateY(-5px);
box-shadow: 0 8px 25px rgba(255, 69, 0, 0.2);
}
.product-image {
width: 100%;
height: 320px;
object-fit: cover;
background: #333;
display: block;
}
.product-info {
padding: 24px;
text-align: center;
}
.product-title {
font-family: 'Bangers', cursive;
font-size: 1.7rem;
color: #fff;
margin-bottom: 12px;
}
.product-price {
font-size: 2rem;
font-weight: 700;
color: #FF4500;
margin: 20px 0;
}
.buy-button {
width: 100%;
padding: 16px;
background: #FF4500;
color: #121212;
border: none;
border-radius: 8px;
font-size: 1.1rem;
font-weight: 700;
cursor: pointer;
transition: all 0.25s;
}
.buy-button:hover {
background: #fff;
color: #FF4500;
transform: scale(1.05);
}
.buy-button:disabled {
cursor: not-allowed;
background: #555;
}
footer {
background: #000;
color: #888;
text-align: center;
padding: 40px 24px;
margin-top: 60px;
border-top: 1px solid #333;
}
footer a {
color: #FF4500;
text-decoration: underline;
margin: 0 10px;
}
footer p {
margin-top: 20px;
font-size: 0.9rem;
}
</style>
</head>
<body>
<header>
<h1>🐊 FLORIDA MAN 🔥</h1>
</header>
<div class="container">
<div class="product-grid" id="product-grid">
<p>Loading the chaos...</p>
</div>
</div>
<footer>
<nav>
<a href="/index.html">Home</a>
<a href="/contact.html">Contact</a>
<a href="/privacy.html">Privacy</a>
<a href="/terms.html">Terms</a>
<a href="/refunds.html">Refunds</a>
</nav>
<p>© 2025 Florida Man Adventures. All chaos reserved.</p>
</footer>
<script>
const grid = document.getElementById('product-grid');
function renderProducts(products) {
grid.innerHTML = ''; // Clear the "Loading..."
products.forEach(product => {
const card = document.createElement('div');
card.className = 'product-card';
card.innerHTML = \`
<img src="\${product.mockup_url}" alt="\${product.title}" class="product-image" loading="lazy"
onerror="this.onerror=null;this.src='https://placehold.co/400x400/333/888?text=Image+Not+Found';">
<div class="product-info">
<h2 class="product-title">\${product.title}</h2>
<p style="color: #999;">\${product.description}</p>
<div class="product-price">$ \${product.price.toFixed(2)}</div>
<button class="buy-button" data-product-id="\${product.product_id}">
BUY NOW
</button>
</div>
\`;
grid.appendChild(card);
});
attachBuyButtonListeners();
}
function attachBuyButtonListeners() {
document.querySelectorAll('.buy-button').forEach(btn => {
btn.addEventListener('click', async (e) => {
const productId = e.target.dataset.productId;
btn.textContent = 'PROCESSING...';
btn.disabled = true;
try {
// This now points to our NEW Netlify function
const response = await fetch('/.netlify/functions/create-checkout', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ product_id: productId })
});
const data = await response.json();
if (data.url) {
window.location.href = data.url;
} else {
throw new Error(data.error || 'Unknown checkout error.');
}
} catch (error) {
console.error('Checkout failed:', error);
alert('Payment error. The gators may have chewed the wires. Please try again.');
btn.textContent = 'BUY NOW';
btn.disabled = false;
}
});
});
}
// --- MAIN ---
document.addEventListener('DOMContentLoaded', async () => {
try {
const response = await fetch('/.netlify/functions/products');
if (!response.ok) throw new Error('Failed to fetch product list.');
const products = await response.json();
renderProducts(products);
} catch (error) {
console.error('Could not load products:', error);
grid.innerHTML = '<p style="color: #ff4500;">The gators ate the product list. Please try again later.</p>';
}
});
</script>
</body>
</html>