-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplates.html
More file actions
562 lines (510 loc) · 28.4 KB
/
templates.html
File metadata and controls
562 lines (510 loc) · 28.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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Templates - TruckCraft Studio</title>
<meta name="description" content="Professional VTC website templates. Choose from our collection of customizable templates designed specifically for trucking companies.">
<meta name="keywords" content="VTC Templates, Trucking Website Templates, Professional Templates, Customizable Design, TruckCraft Studio">
<link rel="icon" href="assets/logo.png">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="dns-prefetch" href="https://via.placeholder.com">
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/responsive-enhancements.css">
<link rel="stylesheet" href="assets/alignment-fixes.css">
<link rel="stylesheet" href="assets/animations.css">
<link rel="stylesheet" href="assets/preloader.css">
<link rel="stylesheet" href="assets/template-cards.css">
<script src="assets/preloader.js"></script>
</head>
<body>
<!-- Preloader -->
<script>document.write(PreloaderHandler.getHTML());</script>
<!-- Skip to main content for accessibility -->
<a href="#main-content" class="skip-link">Skip to main content</a>
<!-- Navigation will be inserted by JavaScript -->
<!-- Main Content -->
<main id="main-content" role="main">
<!-- Templates Hero Section -->
<section class="hero-section">
<div class="container">
<div class="hero-content fade-in-up" style="text-align: center; max-width: 900px; margin: 0 auto;">
<h1 class="hero-title">
Choose Your Perfect
<span class="gradient-text">VTC Template</span>
</h1>
<p class="hero-description">
Browse our collection of professionally designed templates. Each one is fully customizable and ready to launch in minutes—no coding required!
</p>
<!-- Quick Stats -->
<div class="hero-stats fade-in-up delay-2" style="margin-top: 3rem;" role="list" aria-label="Template statistics">
<div class="stat-item" role="listitem">
<span class="stat-number" aria-label="Number of templates">6</span>
<span class="stat-label">Free Templates</span>
</div>
<div class="stat-item" role="listitem">
<span class="stat-number" aria-label="Number of categories">3</span>
<span class="stat-label">Categories</span>
</div>
<div class="stat-item" role="listitem">
<span class="stat-number" aria-label="Setup time">5min</span>
<span class="stat-label">Quick Setup</span>
</div>
<div class="stat-item" role="listitem">
<span class="stat-number" aria-label="Responsive percentage">100%</span>
<span class="stat-label">Responsive</span>
</div>
</div>
</div>
</div>
</section>
<!-- Pro Templates Promotion Section -->
<section class="section" style="background: linear-gradient(135deg, rgba(124, 58, 237, 0.05), rgba(139, 92, 246, 0.03)); border-top: 1px solid rgba(124, 58, 237, 0.1); border-bottom: 1px solid rgba(124, 58, 237, 0.1);">
<div class="container">
<div class="pro-templates-promo fade-in-up">
<div class="promo-badge">
✨ Premium Templates Available
</div>
<h2 class="promo-title">
Want More? Check Out Our
<span class="gradient-text">Pro Templates</span>
</h2>
<p class="promo-description">
Get access to 9 advanced VTC templates with premium features, professional designs, and enhanced customization options.
</p>
<div class="promo-stats">
<div class="promo-stat-item">
<div class="promo-stat-number">9</div>
<div class="promo-stat-label">Pro Templates</div>
</div>
<div class="promo-stat-item">
<div class="promo-stat-number">Advanced</div>
<div class="promo-stat-label">Editing Tools</div>
</div>
<div class="promo-stat-item">
<div class="promo-stat-number">Premium</div>
<div class="promo-stat-label">Features</div>
</div>
</div>
<div class="promo-actions">
<a href="pro-templates.html" class="btn btn-primary">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
</svg>
View Pro Templates
</a>
</div>
</div>
</div>
</section>
<!-- Filter Section -->
<section class="section">
<div class="container">
<div class="section-header fade-in-up" style="text-align: center; margin-bottom: 2rem;">
<h2 class="section-title">Browse Templates</h2>
<p class="section-subtitle">Filter by category to find the perfect template for your VTC</p>
</div>
<div class="templates-filters fade-in-up delay-1">
<div class="filter-tabs" role="tablist" aria-label="Template category filters">
<button class="filter-tab active" data-category="all" role="tab" aria-selected="true" aria-controls="templates-grid">All Templates</button>
<button class="filter-tab" data-category="dashboard" role="tab" aria-selected="false" aria-controls="templates-grid">Dashboard</button>
<button class="filter-tab" data-category="landing" role="tab" aria-selected="false" aria-controls="templates-grid">Landing Page</button>
<button class="filter-tab" data-category="profile" role="tab" aria-selected="false" aria-controls="templates-grid">Driver Profile</button>
<button class="filter-tab" data-category="learning" role="tab" aria-selected="false" aria-controls="templates-grid">Learning</button>
</div>
</div>
<!-- Templates Grid -->
<div class="templates-grid fade-in-up delay-2" id="templates-grid" role="region" aria-label="Template cards">
<!-- Template Card: Elite Haulage -->
<article class="template-card" data-category="landing">
<div class="template-content">
<h3 class="template-title">Elite Haulage</h3>
<p class="template-description">Premium landing page design for professional trucking companies</p>
<span class="template-category">Landing Page</span>
<div class="template-actions">
<a href="create.html?template=elite-haulage" class="template-btn">
Use This Template
</a>
<a href="#" onclick="openPreview('template/elite-haulage.html'); return false;" class="template-preview-link">Preview</a>
</div>
</div>
</article>
<!-- Template Card: Highway Horizon -->
<article class="template-card" data-category="dashboard">
<div class="template-content">
<h3 class="template-title">Highway Horizon</h3>
<p class="template-description">Modern dashboard template with analytics and fleet management</p>
<span class="template-category">Dashboard</span>
<div class="template-actions">
<a href="create.html?template=highway-horizon" class="template-btn">
Use This Template
</a>
<a href="#" onclick="openPreview('template/highway-horizon.html'); return false;" class="template-preview-link">Preview</a>
</div>
</div>
</article>
<!-- Template Card: Light Haulage -->
<article class="template-card" data-category="landing">
<div class="template-content">
<h3 class="template-title">Light Haulage</h3>
<p class="template-description">Clean and minimal design for small to medium VTC operations</p>
<span class="template-category">Landing Page</span>
<div class="template-actions">
<a href="create.html?template=light-haulage" class="template-btn">
Use This Template
</a>
<a href="#" onclick="openPreview('template/light-haulage.html'); return false;" class="template-preview-link">Preview</a>
</div>
</div>
</article>
<!-- Template Card: Midnight Convoy -->
<article class="template-card" data-category="profile">
<div class="template-content">
<h3 class="template-title">Midnight Convoy</h3>
<p class="template-description">Dark theme template with driver profiles and company showcase</p>
<span class="template-category">Driver Profile</span>
<div class="template-actions">
<a href="create.html?template=midnight-convoy" class="template-btn">
Use This Template
</a>
<a href="#" onclick="openPreview('template/midnight-convoy.html'); return false;" class="template-preview-link">Preview</a>
</div>
</div>
</article>
<!-- Template Card: Pacific Routes -->
<article class="template-card" data-category="dashboard">
<div class="template-content">
<h3 class="template-title">Pacific Routes</h3>
<p class="template-description">Route tracking and logistics management focused template</p>
<span class="template-category">Dashboard</span>
<div class="template-actions">
<a href="create.html?template=pacific-routes" class="template-btn">
Use This Template
</a>
<a href="#" onclick="openPreview('template/pacific-routes.html'); return false;" class="template-preview-link">Preview</a>
</div>
</div>
</article>
<!-- Template Card: Velocity VTC -->
<article class="template-card" data-category="landing">
<div class="template-content">
<h3 class="template-title">Velocity VTC</h3>
<p class="template-description">Fast-paced, dynamic landing page for competitive VTC teams</p>
<span class="template-category">Landing Page</span>
<div class="template-actions">
<a href="create.html?template=velocity-vtc" class="template-btn">
Use This Template
</a>
<a href="#" onclick="openPreview('template/velocity-vtc.html'); return false;" class="template-preview-link">Preview</a>
</div>
</div>
</article>
<!-- PRO TEMPLATES START -->
<!-- Template Card: Ultimate Elite PRO -->
<article class="template-card template-card-pro" data-category="landing" data-pro="true">
<span class="pro-badge">PRO</span>
<div class="template-content">
<h3 class="template-title">Ultimate Elite</h3>
<p class="template-description">Premium corporate design with advanced animations and click-to-edit interface</p>
<span class="template-category">Landing Page • Pro</span>
<div class="template-actions">
<button onclick="showPaymentModal('ultimate-elite')" class="template-btn template-btn-pro">
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="margin-right: 6px;">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
</svg>
Upgrade to Use
</button>
<a href="#" onclick="openPreview('template/ultimate-elite.html'); return false;" class="template-preview-link">Preview</a>
</div>
</div>
</article>
<!-- Template Card: Metro Express PRO -->
<article class="template-card template-card-pro" data-category="dashboard" data-pro="true">
<span class="pro-badge">PRO</span>
<div class="template-content">
<h3 class="template-title">Metro Express</h3>
<p class="template-description">Modern dashboard with real-time analytics and visual editing tools</p>
<span class="template-category">Dashboard • Pro</span>
<div class="template-actions">
<button onclick="showPaymentModal('metro-express')" class="template-btn template-btn-pro">
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="margin-right: 6px;">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
</svg>
Upgrade to Use
</button>
<a href="#" onclick="openPreview('template/metro-express.html'); return false;" class="template-preview-link">Preview</a>
</div>
</div>
</article>
<!-- Template Card: Platinum Routes PRO -->
<article class="template-card template-card-pro" data-category="profile" data-pro="true">
<span class="pro-badge">PRO</span>
<div class="template-content">
<h3 class="template-title">Platinum Routes</h3>
<p class="template-description">Luxury driver profile template with interactive galleries and live editing</p>
<span class="template-category">Driver Profile • Pro</span>
<div class="template-actions">
<button onclick="showPaymentModal('platinum-routes')" class="template-btn template-btn-pro">
<svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" style="margin-right: 6px;">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
</svg>
Upgrade to Use
</button>
<a href="#" onclick="openPreview('template/platinum-routes.html'); return false;" class="template-preview-link">Preview</a>
</div>
</div>
</article>
</div>
</div>
</section>
</main>
<!-- Preview Modal -->
<div id="previewModal" class="preview-modal" style="display: none;">
<div class="preview-modal-overlay"></div>
<div class="preview-modal-content">
<div class="preview-modal-header">
<h3 class="preview-modal-title">Template Preview</h3>
<button class="preview-modal-close" aria-label="Close preview">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
</div>
<div class="preview-modal-body">
<iframe id="previewFrame" frameborder="0" allowfullscreen></iframe>
</div>
<div class="preview-modal-footer">
<button class="btn btn-outline" onclick="closePreview()">Close</button>
<a id="previewFullscreen" href="#" target="_blank" class="btn btn-primary">Open in New Tab</a>
</div>
</div>
</div>
<!-- Payment/Upgrade Modal -->
<div id="paymentModal" class="payment-modal" style="display: none;" role="dialog" aria-modal="true" aria-labelledby="payment-modal-title">
<div class="payment-modal-overlay" onclick="closePaymentModal()"></div>
<div class="payment-modal-content">
<button class="payment-modal-close" onclick="closePaymentModal()" aria-label="Close payment modal">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</button>
<div class="payment-header">
<div class="payment-icon" aria-hidden="true">
<svg width="48" height="48" viewBox="0 0 24 24" fill="none">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z" fill="url(#gradient)" stroke="currentColor" stroke-width="1.5"/>
<defs>
<linearGradient id="gradient" x1="0%" y1="0%" x2="100%" y2="100%">
<stop offset="0%" style="stop-color:#7c3aed"/>
<stop offset="100%" style="stop-color:#ec4899"/>
</linearGradient>
</defs>
</svg>
</div>
<h2 id="payment-modal-title" class="payment-title">Upgrade to Pro</h2>
<p class="payment-subtitle">Unlock premium templates with visual editing</p>
</div>
<div class="payment-features">
<div class="feature-item">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 6L9 17l-5-5"/>
</svg>
<span><strong>Click-to-Edit</strong> - No coding required</span>
</div>
<div class="feature-item">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 6L9 17l-5-5"/>
</svg>
<span><strong>9 Premium Templates</strong> - Advanced designs</span>
</div>
<div class="feature-item">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 6L9 17l-5-5"/>
</svg>
<span><strong>Visual Editor</strong> - See changes instantly</span>
</div>
<div class="feature-item">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 6L9 17l-5-5"/>
</svg>
<span><strong>Priority Support</strong> - Get help fast</span>
</div>
<div class="feature-item">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M20 6L9 17l-5-5"/>
</svg>
<span><strong>Lifetime Updates</strong> - New templates added</span>
</div>
</div>
<div class="payment-pricing">
<div class="price-tag">
<span class="price-currency">$</span>
<span class="price-amount">29</span>
<span class="price-period">one-time</span>
</div>
<p class="price-note">No monthly fees • Lifetime access</p>
</div>
<div class="payment-actions">
<button class="btn btn-primary btn-large btn-payment" id="paymentBtn" onclick="processPayment()" aria-label="Upgrade to Pro for $29">
<svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" class="btn-icon">
<path d="M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z"/>
</svg>
<span class="btn-text">Upgrade Now</span>
<span class="btn-spinner" style="display: none;">
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3">
<circle cx="12" cy="12" r="10" opacity="0.25"/>
<path d="M12 2a10 10 0 0 1 10 10" stroke-linecap="round"/>
</svg>
</span>
</button>
<button class="btn btn-outline" onclick="closePaymentModal()" aria-label="Close and maybe upgrade later">Maybe Later</button>
</div>
<p class="payment-guarantee">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/>
</svg>
30-day money-back guarantee
</p>
</div>
</div>
<!-- Footer -->
<footer class="site-footer" role="contentinfo"><div class="footer-container"><div class="footer-main"><div class="footer-brand"><a href="index.html" class="footer-logo" aria-label="TruckCraft Studio Home"><svg viewBox="0 0 32 32" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M16 2L3 9v14l13 7 13-7V9L16 2z" fill="currentColor" opacity="0.2"/><path d="M16 8l8 4.5v9L16 26l-8-4.5v-9L16 8z" fill="currentColor"/><circle cx="16" cy="16" r="3" fill="white"/></svg><span>TruckCraft Studio</span></a><p class="footer-tagline">Create stunning VTC websites with ease. Professional tools for virtual trucking companies.</p><div class="footer-socials" role="list"><a href="https://twitter.com/your-handle" class="footer-social-link" aria-label="Follow us on Twitter" target="_blank" rel="noopener noreferrer"><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M23 3a10.9 10.9 0 01-3.14 1.53 4.48 4.48 0 00-7.86 3v1A10.66 10.66 0 013 4s-4 9 5 13a11.64 11.64 0 01-7 2c9 5 20 0 20-11.5a4.5 4.5 0 00-.08-.83A7.72 7.72 0 0023 3z"/></svg></a><a href="https://linkedin.com/company/your-company" class="footer-social-link" aria-label="Connect on LinkedIn" target="_blank" rel="noopener noreferrer"><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M16 8a6 6 0 016 6v7h-4v-7a2 2 0 00-2-2 2 2 0 00-2 2v7h-4v-7a6 6 0 016-6zM2 9h4v12H2z"/><circle cx="4" cy="4" r="2"/></svg></a><a href="https://github.com/Shriii19/web-maker" class="footer-social-link" aria-label="View on GitHub" target="_blank" rel="noopener noreferrer"><svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><path d="M9 19c-5 1.5-5-2.5-7-3m14 6v-3.87a3.37 3.37 0 00-.94-2.61c3.14-.35 6.44-1.54 6.44-7A5.44 5.44 0 0020 4.77 5.07 5.07 0 0019.91 1S18.73.65 16 2.48a13.38 13.38 0 00-7 0C6.27.65 5.09 1 5.09 1A5.07 5.07 0 005 4.77a5.44 5.44 0 00-1.5 3.78c0 5.42 3.3 6.61 6.44 7A3.37 3.37 0 009 18.13V22"/></svg></a></div></div><nav class="footer-links"><ul class="footer-links-list"><li><a href="about.html">About Us</a></li><li><a href="features.html">Features</a></li><li><a href="pricing.html">Pricing</a></li><li><a href="contact.html">Contact</a></li></ul></nav><nav class="footer-links"><ul class="footer-links-list"><li><a href="templates.html">Templates</a></li><li><a href="pro-templates.html">Pro Templates</a></li><li><a href="create.html">Create Website</a></li></ul></nav><nav class="footer-links"><ul class="footer-links-list"><li><a href="help.html">Help Center</a></li><li><a href="documentation.html">Documentation</a></li><li><a href="tutorials.html">Tutorials</a></li></ul></nav></div><div class="footer-bottom"><p class="footer-copyright">© <span id="current-year">2025</span> TruckCraft Studio. All rights reserved.</p><nav aria-label="Legal"><ul class="footer-legal"><li><a href="terms.html">Terms of Service</a></li><li><a href="privacy.html">Privacy Policy</a></li></ul></nav></div></div></footer>
<link rel="stylesheet" href="assets/footer.css">
<script src="assets/scroll-animations.js" defer></script>
<script src="assets/global-error-handler.js" defer></script>
<script src="assets/main.js" defer></script>
<script src="assets/footer.js" defer></script>
<script defer>
// Preview Modal Functions
function openPreview(templateUrl) {
const modal = document.getElementById('previewModal');
const iframe = document.getElementById('previewFrame');
const fullscreenLink = document.getElementById('previewFullscreen');
iframe.src = templateUrl;
fullscreenLink.href = templateUrl;
modal.style.display = 'flex';
document.body.style.overflow = 'hidden';
}
function closePreview() {
const modal = document.getElementById('previewModal');
const iframe = document.getElementById('previewFrame');
modal.style.display = 'none';
iframe.src = '';
document.body.style.overflow = '';
}
// Close on overlay click
document.addEventListener('DOMContentLoaded', () => {
const modal = document.getElementById('previewModal');
const overlay = modal.querySelector('.preview-modal-overlay');
const closeBtn = modal.querySelector('.preview-modal-close');
overlay.addEventListener('click', closePreview);
closeBtn.addEventListener('click', closePreview);
// Close on Escape key
document.addEventListener('keydown', (e) => {
if (e.key === 'Escape' && modal.style.display === 'flex') {
closePreview();
}
});
});
// Template Filter Functionality
document.addEventListener('DOMContentLoaded', () => {
const filterTabs = document.querySelectorAll('.filter-tab');
const templateCards = document.querySelectorAll('.template-card');
filterTabs.forEach(tab => {
tab.addEventListener('click', () => {
const category = tab.dataset.category;
// Update active tab
filterTabs.forEach(t => t.classList.remove('active'));
tab.classList.add('active');
// Filter templates
templateCards.forEach(card => {
if (category === 'all') {
card.style.display = 'flex';
} else {
if (card.dataset.category === category) {
card.style.display = 'flex';
} else {
card.style.display = 'none';
}
}
});
});
});
});
// Payment Modal Functions
let selectedTemplate = '';
function showPaymentModal(templateName) {
if (!templateName) {
console.error('No template name provided');
return;
}
selectedTemplate = templateName;
const modal = document.getElementById('paymentModal');
if (modal) {
modal.style.display = 'flex';
document.body.style.overflow = 'hidden';
}
}
function closePaymentModal() {
const modal = document.getElementById('paymentModal');
modal.style.display = 'none';
document.body.style.overflow = '';
selectedTemplate = '';
}
function processPayment() {
// Validate template selection
if (!selectedTemplate) {
alert('Error: No template selected. Please try again.');
return;
}
// Get button elements
const paymentBtn = document.getElementById('paymentBtn');
const btnText = paymentBtn.querySelector('.btn-text');
const btnIcon = paymentBtn.querySelector('.btn-icon');
const btnSpinner = paymentBtn.querySelector('.btn-spinner');
// Set loading state
paymentBtn.disabled = true;
paymentBtn.style.opacity = '0.7';
paymentBtn.style.cursor = 'not-allowed';
btnText.textContent = 'Processing...';
btnIcon.style.display = 'none';
btnSpinner.style.display = 'inline-block';
// Simulate payment processing delay
setTimeout(() => {
alert('Payment processing would happen here!\n\nIn production, this would:\n1. Integrate with Stripe/PayPal\n2. Process the $29 payment\n3. Grant access to Pro templates\n4. Redirect to the visual editor\n\nFor demo: Redirecting to editor with the template...');
try {
// Store pro access in localStorage (demo purposes)
localStorage.setItem('proAccess', 'true');
localStorage.setItem('proAccessDate', new Date().toISOString());
// Redirect to visual editor with selected template
window.location.href = `create.html?template=${selectedTemplate}&mode=visual&pro=true`;
} catch (error) {
console.error('Error processing payment:', error);
// Reset button state on error
paymentBtn.disabled = false;
paymentBtn.style.opacity = '1';
paymentBtn.style.cursor = 'pointer';
btnText.textContent = 'Upgrade Now';
btnIcon.style.display = 'inline-block';
btnSpinner.style.display = 'none';
alert('An error occurred. Please try again.');
}
}, 800);
}
// Check if user has pro access
function hasProAccess() {
return localStorage.getItem('proAccess') === 'true';
}
// Close payment modal on Escape
document.addEventListener('keydown', (e) => {
const modal = document.getElementById('paymentModal');
if (e.key === 'Escape' && modal.style.display === 'flex') {
closePaymentModal();
}
});
</script>
</body>
</html>