-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
335 lines (299 loc) · 16.4 KB
/
index.html
File metadata and controls
335 lines (299 loc) · 16.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
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
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Spixi Mini Apps | Spixi</title>
<script src="https://cdn.tailwindcss.com"></script>
<link href="https://fonts.googleapis.com/css2?family=Lexend:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<script src="https://cdnjs.cloudflare.com/ajax/libs/qrcodejs/1.0.0/qrcode.min.js"></script>
<script>
tailwind.config = {
darkMode: 'class',
theme: {
extend: {
colors: {
'spixi': '#17334F',
'spixi-dark': '#F0F2F4',
'accent': '#24BBFF'
},
fontFamily: {
'lexend': ['Lexend', 'sans-serif'],
}
}
}
}
</script>
<style>
body {
font-family: 'Lexend', sans-serif;
}
.app-card {
transition: transform 0.2s, box-shadow 0.2s;
}
.app-card:hover {
transform: translateY(-4px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}
dialog::backdrop {
background: rgba(0, 0, 0, 0.5);
}
</style>
</head>
<body class="bg-gray-50 dark:bg-[#090B0D] text-spixi dark:text-spixi-dark font-lexend">
<!-- Header -->
<header class="bg-white dark:bg-[#090B0D] border-b border-gray-200 dark:border-gray-800 py-4">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex justify-between items-center">
<div class="flex items-center">
<a href="https://spixi.io" class="flex items-center space-x-2">
<img src="assets/spixi-logo.svg" alt="Spixi Logo" class="h-8">
<span class="text-2xl font-bold text-spixi dark:text-white">Spixi</span>
</a>
<nav class="hidden md:flex ml-10 space-x-8">
<a href="https://spixi.io/features"
class="text-gray-600 dark:text-gray-300 hover:text-accent transition-colors">Features</a>
<a href="https://spixi.io/download"
class="text-gray-600 dark:text-gray-300 hover:text-accent transition-colors">Download</a>
<a href="#" class="text-accent font-semibold">Mini Apps</a>
<a href="https://spixi.io/blog"
class="text-gray-600 dark:text-gray-300 hover:text-accent transition-colors">Blog</a>
</nav>
</div>
<div class="flex items-center space-x-4">
<!-- Theme Toggle -->
<button id="theme-toggle" type="button"
class="text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-2.5">
<svg id="theme-toggle-dark-icon" class="hidden w-5 h-5" fill="currentColor" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path d="M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z"></path>
</svg>
<svg id="theme-toggle-light-icon" class="hidden w-5 h-5" fill="currentColor" viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg">
<path
d="M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 00-.707-.293h-1.414a1 1 0 000 2h1.414a1 1 0 00.707-.293zm-10.607.707a1 1 0 01-.707.293H4a1 1 0 010-2h1.414a1 1 0 01.707.293zM17.293 8.293A1 1 0 0118 9v2a1 1 0 11-2 0V9a1 1 0 01.293-.707zm-14 0a1 1 0 01.707.293V9a1 1 0 01-2 0V9a1 1 0 01.293-.707z">
</path>
</svg>
</button>
<!-- Language Dropdown -->
<div class="relative">
<button id="language-dropdown-button"
class="flex items-center text-gray-600 dark:text-gray-300 hover:text-accent transition-colors focus:outline-none">
<img src="assets/flag-us.svg" alt="US Flag" class="w-5 h-5 rounded-full mr-2">
EN
<svg class="w-4 h-4 ml-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"
xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7">
</path>
</svg>
</button>
<div id="language-dropdown"
class="absolute right-0 mt-2 w-32 bg-white dark:bg-[#12171F] rounded-md shadow-lg py-1 z-20 hidden">
<a href="#"
class="flex items-center px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700">
<img src="assets/flag-us.svg" alt="US Flag" class="w-5 h-5 rounded-full mr-2">
English
</a>
<a href="#"
class="flex items-center px-4 py-2 text-sm text-gray-700 dark:text-gray-200 hover:bg-gray-100 dark:hover:bg-gray-700">
<img src="assets/flag-de.svg" alt="DE Flag" class="w-5 h-5 rounded-full mr-2">
Deutsch
</a>
</div>
</div>
</div>
</div>
</header>
<main>
<!-- Hero Section -->
<section class="py-20 text-center">
<h1 class="text-5xl font-bold text-spixi dark:text-white mb-4">Spixi Mini Apps</h1>
<p class="text-xl text-gray-600 dark:text-gray-300 max-w-2xl mx-auto">
Discover a world of decentralized applications built on the Spixi platform.
</p>
</section>
<!-- App Grid -->
<section class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12">
<div id="app-grid" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8">
<!-- Apps will be loaded here by JavaScript -->
</div>
</section>
</main>
<!-- Spixi Summary Section -->
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mb-32">
<div
class="bg-[radial-gradient(62.75%_223.69%_at_12.13%_-13.29%,_#97E3F9_0%,_#1394F1_100%)] dark:bg-[radial-gradient(62.75%_223.69%_at_12.13%_-13.29%,_#082444_0%,_#044E83_100%)] rounded-2xl">
<div class="flex flex-col md:flex-row items-center justify-between pt-5 px-10">
<div class="md:w-1/2 flex flex-col py-10">
<h2 class="text-5xl font-lexend font-semibold text-black dark:text-white">
Start using Spixi
</h2>
<div class="my-4">
<p class="text-base text-black dark:text-white">
Download Spixi today and experience the future of secure communication. <br>
Available on Desktop and Mobile.
</p>
</div>
<div class="my-4">
<a href="https://spixi.io/download"
class="inline-block border border-spixi dark:border-white text-black dark:text-white hover:bg-[#24BBFF] font-medium rounded-lg py-3 px-8 transition-colors">
Download Now
</a>
</div>
</div>
<div class="md:w-1/2 flex justify-end">
<img src="assets/SpixiSummaryLight.png" class="w-[432px] dark:hidden" alt="Spixi Summary Light">
<img src="assets/SpixiSummaryDark.png" class="w-[432px] hidden dark:block" alt="Spixi Summary Dark">
</div>
</div>
</div>
</div>
<!-- Footer -->
<footer class="bg-white dark:bg-[#090B0D] border-t border-gray-200 dark:border-gray-800 py-12">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center text-gray-500 text-sm">
<p>© 2025 Spixi. All rights reserved.</p>
<div class="mt-4 flex justify-center gap-6">
<a href="#" class="hover:text-accent">Privacy Policy</a>
<a href="#" class="hover:text-accent">Terms of Use</a>
</div>
</div>
</footer>
<!-- Modal -->
<dialog id="appModal"
class="backdrop:bg-black/50 backdrop:backdrop-blur-sm rounded-2xl p-6 w-[90%] max-w-md bg-white dark:bg-[#090B0D] text-spixi dark:text-spixi-dark shadow-2xl">
<div class="flex flex-col items-center gap-3">
<h2 class="text-xl font-semibold mb-4">Open <span id="modalAppName" class="text-accent"></span> in Spixi
</h2>
<div class="bg-[#f0f0f0] dark:bg-[#0D141C] p-4 rounded-lg w-full flex flex-col items-center gap-1">
<h3 class="font-medium">Scan QR with Spixi</h3>
<div id="qrcode" class="bg-white p-2 rounded-lg mx-auto my-4"></div>
<p class="text-sm text-center text-gray-500">Add Mini App from URL:</p>
<p id="modalAppUrl"
class="text-xs text-center break-all font-mono bg-white dark:bg-black/20 p-2 rounded w-full">
</p>
</div>
<button onclick="closeModal()"
class="mt-2 border border-accent text-spixi dark:text-white rounded-lg px-4 py-2 hover:bg-accent hover:text-white transition-colors">
Close
</button>
</div>
</dialog>
<script>
const modal = document.getElementById('appModal');
const modalAppName = document.getElementById('modalAppName');
const modalAppUrl = document.getElementById('modalAppUrl');
const qrcodeContainer = document.getElementById('qrcode');
let qrCodeObj = null;
function openModal(name, url) {
modalAppName.textContent = name;
// Construct full URL if it's relative
const fullUrl = url.startsWith('http') ? url : window.location.origin + '/' + url;
modalAppUrl.textContent = fullUrl;
// Clear previous QR
qrcodeContainer.innerHTML = '';
// Generate new QR
qrCodeObj = new QRCode(qrcodeContainer, {
text: fullUrl,
width: 192,
height: 192,
colorDark: "#000000",
colorLight: "#ffffff",
correctLevel: QRCode.CorrectLevel.H
});
modal.showModal();
}
function closeModal() {
modal.close();
}
// Close on backdrop click
modal.addEventListener('click', (e) => {
const rect = modal.getBoundingClientRect();
const isInDialog = (rect.top <= e.clientY && e.clientY <= rect.top + rect.height &&
rect.left <= e.clientX && e.clientX <= rect.left + rect.width);
if (!isInDialog) {
modal.close();
}
});
async function loadApps() {
try {
const response = await fetch('apps.json');
const apps = await response.json();
const grid = document.getElementById('app-grid');
grid.innerHTML = apps.map(app => `
<div class="app-card bg-white dark:bg-[#12171F] rounded-2xl p-6 border border-gray-100 dark:border-gray-800 flex flex-col h-full">
<div class="flex items-start justify-between mb-4">
<img src="${app.icon}" alt="${app.name}" class="w-16 h-16 rounded-xl object-cover bg-gray-100 dark:bg-gray-800">
<span class="px-3 py-1 text-xs font-medium bg-blue-50 dark:bg-blue-900/30 text-accent rounded-full">${app.version}</span>
</div>
<h3 class="text-xl font-bold mb-2">${app.name}</h3>
<p class="text-gray-600 dark:text-gray-400 text-sm mb-6 flex-grow">${app.description}</p>
<div class="flex gap-3 mt-auto">
<button onclick="openModal('${app.name}', '${app.downloadUrl}')" class="flex-1 bg-accent hover:bg-blue-400 text-white font-medium py-2.5 px-4 rounded-xl text-center transition-colors">
Try it now
</button>
<a href="${app.sourceUrl}" target="_blank" class="px-3 py-2.5 text-gray-500 hover:text-spixi dark:hover:text-white transition-colors" title="View Source">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 0 0-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0 0 20 4.77 5.07 5.07 0 0 0 19.91 1S18.73.65 16 2.48a13.38 13.38 0 0 0-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 0 0 5 4.77a5.44 5.44 0 0 0-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 0 0 9 18.13V22"></path></svg>
</a>
</div>
</div>
`).join('');
} catch (error) {
console.error('Error loading apps:', error);
document.getElementById('app-grid').innerHTML = `
<div class="col-span-full text-center py-12 text-red-500">
<p>Failed to load apps. Please try again later.</p>
</div>
`;
}
}
loadApps();
// Theme Toggle Logic
const themeToggleBtn = document.getElementById('theme-toggle');
const themeToggleDarkIcon = document.getElementById('theme-toggle-dark-icon');
const themeToggleLightIcon = document.getElementById('theme-toggle-light-icon');
// Change the icons inside the button based on previous settings
if (localStorage.getItem('color-theme') === 'dark' || (!('color-theme' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
themeToggleLightIcon.classList.remove('hidden');
document.documentElement.classList.add('dark');
} else {
themeToggleDarkIcon.classList.remove('hidden');
document.documentElement.classList.remove('dark');
}
themeToggleBtn.addEventListener('click', function () {
// toggle icons inside button
themeToggleDarkIcon.classList.toggle('hidden');
themeToggleLightIcon.classList.toggle('hidden');
// if set via local storage previously
if (localStorage.getItem('color-theme')) {
if (localStorage.getItem('color-theme') === 'light') {
document.documentElement.classList.add('dark');
localStorage.setItem('color-theme', 'dark');
} else {
document.documentElement.classList.remove('dark');
localStorage.setItem('color-theme', 'light');
}
// if NOT set via local storage previously
} else {
if (document.documentElement.classList.contains('dark')) {
document.documentElement.classList.remove('dark');
localStorage.setItem('color-theme', 'light');
} else {
document.documentElement.classList.add('dark');
localStorage.setItem('color-theme', 'dark');
}
}
});
// Language Dropdown Logic
const langBtn = document.getElementById('language-dropdown-button');
const langDropdown = document.getElementById('language-dropdown');
langBtn.addEventListener('click', () => {
langDropdown.classList.toggle('hidden');
});
// Close dropdown when clicking outside
document.addEventListener('click', (e) => {
if (!langBtn.contains(e.target) && !langDropdown.contains(e.target)) {
langDropdown.classList.add('hidden');
}
});
</script>
</body>
</html>