-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhumanitarian-aid-donations.html
More file actions
292 lines (262 loc) · 7.99 KB
/
humanitarian-aid-donations.html
File metadata and controls
292 lines (262 loc) · 7.99 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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PhotoChat Aid Fund - Business Challenge</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/@supabase/supabase-js@2"></script>
<style>
:root {
--bg: #0b0f14;
--card: #111827;
--accent: #00f6ff;
--text: #e5e7eb;
}
body {
margin: 0;
font-family: system-ui;
background: var(--bg);
color: var(--text);
}
header, nav {
background: #020617;
border-color: #1f2937;
}
header {
display: flex;
align-items: center;
padding: 10px;
}
header img {
height: 32px;
margin-right: 8px;
}
.tabs {
display: flex;
overflow-x: auto;
border-bottom: 1px solid #1f2937;
}
.tabs button {
flex: 1;
background: none;
border: none;
color: #9ca3af;
padding: 10px;
}
.tabs button.active {
color: var(--accent);
}
.feed {
max-width: 640px;
margin: auto;
padding-bottom: 120px;
}
.post {
background: var(--card);
margin: 12px;
border-radius: 14px;
overflow: hidden;
}
.post-header {
padding: 10px;
font-weight: 600;
}
.post img, .post video {
width: 100%;
}
.post-caption {
padding: 10px;
font-size: .9rem;
}
.fab {
position: fixed;
bottom: 90px;
right: 20px;
background: var(--accent);
width: 56px;
height: 56px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
color: #000;
font-size: 2rem;
}
nav {
position: fixed;
bottom: 0;
width: 100%;
display: flex;
justify-content: space-around;
padding: 10px;
}
footer {
text-align: center;
font-size: .75rem;
color: #6b7280;
padding: 20px;
}
.modal {
display: none;
position: fixed;
inset: 0;
background: #020617;
padding: 14px;
z-index: 50;
}
button, input, textarea {
width: 100%;
padding: 10px;
margin-top: 8px;
background: #020617;
color: #fff;
border: 1px solid #1f2937;
border-radius: 10px;
}
</style>
</head>
<body>
<header>
<img src="file_00000000edd071f590a2740f51337467.png" alt="Logo">
<b>PhotoChat Aid Fund</b>
<div style="margin-left:auto">
<i class="bi bi-google" onclick="loginGoogle()"></i>
</div>
</header>
<div class="tabs">
<button class="active" onclick="setTab(this, 'home')">Home</button>
<button onclick="setTab(this, 'trending')">Trending</button>
<button onclick="setTab(this, 'random')">Random</button>
<button onclick="setTab(this, 'sports')">Sports</button>
<button onclick="setTab(this, 'news')">News</button>
<button onclick="setTab(this, 'realestate')">Real Estate</button>
<button onclick="openLive()">Live</button>
</div>
<div id="feed" class="feed"></div>
<!-- Business Challenge Video Section -->
<div id="businessChallengeSection">
<h2>Business Challenge Videos</h2>
<div id="business1" class="business">
<h3>Business 1: 15 Votes</h3>
<video width="320" height="240" controls>
<source src="VID-20260227-WA0015.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<p>Votes: 15 (15 SDC = 10 USD)</p>
<button onclick="voteForBusiness('business1')">Vote</button>
</div>
<div id="business2" class="business">
<h3>Business 2: 13 Votes</h3>
<video width="320" height="240" controls>
<source src="VID-20260227-WA0015.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<p>Votes: 13 (13 SDC = 8.3 USD)</p>
<button onclick="voteForBusiness('business2')">Vote</button>
</div>
<div id="business3" class="business">
<h3>Business 3: 50 Votes</h3>
<video width="320" height="240" controls>
<source src="VID-20260227-WA0015.mp4" type="video/mp4">
Your browser does not support the video tag.
</video>
<p>Votes: 50 (50 SDC = 33.3 USD)</p>
<button onclick="voteForBusiness('business3')">Vote</button>
</div>
</div>
<div class="fab" onclick="openCreate()">+</div>
<nav>🏠 🔍 ➕ 💬 👤</nav>
<footer>© SadiCoin Tech 2026 · PhotoChat Aid Fund</footer>
<!-- Modals -->
<div id="paymentModal" class="modal">
<button onclick="closePayment()">⬅ Back</button>
<h3>Purchase Votes</h3>
<input type="number" id="numVotes" placeholder="Enter number of votes">
<button onclick="buyVotesFromAgent()">Buy Votes</button>
</div>
<div id="uploadSMEVideoModal" class="modal">
<button onclick="closeSMEUpload()">⬅ Back</button>
<input type="file" id="smeVideoFile">
<button onclick="uploadSMEVideo()">Upload Video</button>
</div>
<script>
const supabase = supabaseJs.createClient(
"https://jbhhfzbhcvzxtthhmfhz.supabase.co",
"YOUR_SUPABASE_ANON_KEY_HERE"
);
let businessVotes = {
business1: 15, // Example votes
business2: 13,
business3: 50
};
function setTab(btn, type) {
document.querySelectorAll(".tabs button").forEach(b => b.classList.remove("active"));
btn.classList.add("active");
render(demoPosts[type]);
}
function render(list) {
feed.innerHTML = "";
list.forEach(p => {
feed.innerHTML += `
<div class="post">
<div class="post-header">${p.u}</div>
<img src="${p.img}">
<div class="post-caption">${p.t}</div>
</div>`;
});
}
async function loginGoogle() {
await supabase.auth.signInWithOAuth({ provider: "google" });
}
// Voting system
function voteForBusiness(business) {
const votePrice = 10; // 10 ZAR per vote (1 SDC)
const numVotes = 1; // Default to 1 vote for simplicity, but this can be adjusted
const totalCost = numVotes * votePrice;
// Increment votes
businessVotes[business]++;
// Update displayed vote count
document.querySelector(`#${business} p`).textContent = `Votes: ${businessVotes[business]} (${businessVotes[business] * votePrice} ZAR)`;
// Process payment (in this case, simulate it)
processPayment(totalCost, business);
}
async function processPayment(totalCost, business) {
// Open payment modal and ask for proof of payment
alert(`Total payment for voting: ${totalCost} ZAR. Please send proof of payment.`);
// Simulate proof of payment submission (whatsapp or upload system could be added here)
const receipt = generateReceipt(totalCost, business);
console.log('Payment receipt:', receipt);
alert(`Vote for ${business} successful. Proof of payment sent to WhatsApp.`);
}
function generateReceipt(totalCost, business) {
return {
business: business,
totalCost: totalCost,
transactionId: Date.now(),
receiptDate: new Date().toLocaleString(),
};
}
// SME Video Upload Functionality
async function uploadSMEVideo() {
const smeId = "sme123"; // Example SME ID
const file = document.getElementById("smeVideoFile").files[0];
if (file) {
const { data, error } = await supabase.storage
.from('sme-videos')
.upload(`${smeId}/video.mp4`, file);
if (error) {
console.error('Video upload failed:', error);
} else {
console.log('Video uploaded:', data);
}
} else {
alert("Please select a video file to upload.");
}
}
function closeSMEUpload() { uploadSMEVideoModal.style.display = "none"; }
// Start with default home feed when the page loads
setTab(document.querySelector(".tabs button"), "home");
</script>
</body>
</html>