portotamara157 commited on
Commit
25a3fce
·
verified ·
1 Parent(s): 44fe5f5

pode deixar mais robusta e mobile first

Browse files
Files changed (3) hide show
  1. index.html +144 -60
  2. manifest.json +28 -0
  3. sw.js +45 -0
index.html CHANGED
@@ -2,8 +2,11 @@
2
  <html lang="en" class="scroll-smooth">
3
  <head>
4
  <meta charset="UTF-8">
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>SlimPick: Mitolyn vs Lipozem Comparison</title>
 
 
 
7
  <script src="https://cdn.tailwindcss.com"></script>
8
  <script src="https://unpkg.com/feather-icons"></script>
9
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
@@ -21,16 +24,61 @@
21
  }
22
  }
23
  </script>
 
 
24
  <style>
 
 
 
 
 
 
 
25
  .hero-gradient {
26
- background: linear-gradient(135deg, #4F46E5 0%, #10B981 100%);
 
 
 
 
27
  }
 
28
  .feature-card:hover {
29
  transform: translateY(-5px);
30
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
31
  }
 
32
  .comparison-table tr:nth-child(even) {
33
- background-color: #F9FAFB;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
34
  }
35
  </style>
36
  </head>
@@ -46,61 +94,66 @@
46
  </a>
47
  </div>
48
  <div class="hidden md:flex items-center space-x-8">
49
- <a href="#overview" class="text-gray-700 hover:text-primary transition">Overview</a>
50
- <a href="#comparison" class="text-gray-700 hover:text-primary transition">Comparison</a>
51
- <a href="#pros-cons" class="text-gray-700 hover:text-primary transition">Pros & Cons</a>
52
- <a href="#verdict" class="text-gray-700 hover:text-primary transition">Verdict</a>
53
  </div>
54
  <div class="flex items-center md:hidden">
55
- <button id="menu-toggle" class="text-gray-700">
56
  <i data-feather="menu"></i>
57
  </button>
58
  </div>
59
  </div>
60
  </div>
61
  <!-- Mobile menu -->
62
- <div id="mobile-menu" class="hidden md:hidden bg-white pb-3 px-4">
63
- <a href="#overview" class="block py-2 text-gray-700 hover:text-primary transition">Overview</a>
64
- <a href="#comparison" class="block py-2 text-gray-700 hover:text-primary transition">Comparison</a>
65
- <a href="#pros-cons" class="block py-2 text-gray-700 hover:text-primary transition">Pros & Cons</a>
66
- <a href="#verdict" class="block py-2 text-gray-700 hover:text-primary transition">Verdict</a>
67
  </div>
68
  </nav>
69
  <!-- Hero Section -->
70
- <section class="hero-gradient text-white py-20">
71
- <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
72
  <div class="flex justify-center mb-8">
73
- <div class="flex flex-col md:flex-row items-center gap-8">
74
- <img src="http://static.photos/health/640x360/101" alt="Mitolyn" class="w-48 h-48 object-contain rounded-lg shadow-lg">
75
- <h1 class="text-4xl md:text-5xl font-bold">Mitolyn vs FitSpresso</h1>
76
- <img src="http://static.photos/health/640x360/102" alt="FitSpresso" class="w-48 h-48 object-contain rounded-lg shadow-lg">
 
 
 
 
77
  </div>
78
  </div>
79
- <p class="text-xl md:text-2xl mb-8 max-w-3xl mx-auto">The ultimate comparison to help you choose the right metabolic booster</p>
80
- <div class="flex flex-col sm:flex-row justify-center gap-4">
81
- <a href="#comparison" class="bg-white text-primary font-semibold px-6 py-3 rounded-lg shadow-md hover:bg-gray-100 transition duration-300">
82
  Compare Now
83
  </a>
84
- <a href="#verdict" class="bg-transparent border-2 border-white text-white font-semibold px-6 py-3 rounded-lg hover:bg-white hover:text-primary transition duration-300">
85
  See Verdict
86
  </a>
87
  </div>
88
- </div>
89
  </section>
90
-
91
  <!-- Overview Section -->
92
- <section id="overview" class="py-16 bg-white">
93
- <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
94
  <h2 class="text-3xl font-bold text-center mb-12 text-dark">What's the Difference?</h2>
95
- <div class="grid md:grid-cols-2 gap-12">
96
- <div class="bg-light p-8 rounded-xl shadow-md">
97
- <div class="flex items-center mb-4">
98
  <div class="bg-primary p-3 rounded-full mr-4">
99
  <i data-feather="zap" class="text-white"></i>
100
  </div>
101
  <h3 class="text-2xl font-bold text-dark">Mitolyn</h3>
102
  </div>
103
- <img src="http://static.photos/health/320x240/101" alt="Mitolyn" class="w-full h-48 object-contain mb-4 rounded-lg">
 
 
104
  <p class="text-gray-700 mb-4">A <span class="font-semibold">mitochondria-centric formula</span> designed to optimize cellular energy production and fat oxidation at the metabolic level.</p>
105
  <ul class="space-y-2">
106
  <li class="flex items-start">
@@ -117,14 +170,16 @@
117
  </li>
118
  </ul>
119
  </div>
120
- <div class="bg-light p-8 rounded-xl shadow-md">
121
- <div class="flex items-center mb-4">
122
  <div class="bg-secondary p-3 rounded-full mr-4">
123
  <i data-feather="droplet" class="text-white"></i>
124
  </div>
125
  <h3 class="text-2xl font-bold text-dark">FitSpresso</h3>
126
  </div>
127
- <img src="http://static.photos/health/320x240/102" alt="FitSpresso" class="w-full h-48 object-contain mb-4 rounded-lg">
 
 
128
  </div>
129
  <p class="text-gray-700 mb-4">A <span class="font-semibold">metabolic booster</span> that combines Capsicum Annum, L-Carnitine and Chromium Picolinate to support fat loss.</p>
130
  <ul class="space-y-2">
@@ -145,14 +200,13 @@
145
  </div>
146
  </div>
147
  </section>
148
-
149
  <!-- Comparison Section -->
150
- <section id="comparison" class="py-16 bg-gray-50">
151
- <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
152
  <h2 class="text-3xl font-bold text-center mb-12 text-dark">Key Differences</h2>
153
- <div class="overflow-x-auto">
154
- <table class="min-w-full bg-white rounded-xl overflow-hidden shadow-md comparison-table">
155
- <thead class="bg-gray-100">
156
  <tr>
157
  <th class="py-4 px-6 text-left text-dark font-bold">Aspect</th>
158
  <th class="py-4 px-6 text-left text-primary font-bold">Mitolyn</th>
@@ -215,13 +269,12 @@
215
  </div>
216
  </div>
217
  </section>
218
-
219
  <!-- Pros & Cons Section -->
220
- <section id="pros-cons" class="py-16 bg-white">
221
- <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
222
  <h2 class="text-3xl font-bold text-center mb-12 text-dark">Pros & Cons</h2>
223
- <div class="grid md:grid-cols-2 gap-12">
224
- <!-- Mitolyn Pros/Cons -->
225
  <div>
226
  <h3 class="text-2xl font-bold mb-6 text-primary flex items-center">
227
  <i data-feather="zap" class="mr-2"></i> Mitolyn
@@ -346,22 +399,23 @@
346
  </div>
347
  </div>
348
  </section>
349
-
350
  <!-- Verdict Section -->
351
- <section id="verdict" class="py-16 bg-gray-50">
352
- <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
353
  <h2 class="text-3xl font-bold text-center mb-12 text-dark">Final Verdict</h2>
354
- <div class="bg-white rounded-xl shadow-md overflow-hidden">
355
- <div class="p-8">
356
- <div class="grid md:grid-cols-2 gap-8">
357
- <div class="border-r border-gray-200 pr-8">
358
  <div class="flex items-center mb-6">
359
  <div class="bg-primary p-3 rounded-full mr-4">
360
  <i data-feather="zap" class="text-white"></i>
361
  </div>
362
  <h3 class="text-2xl font-bold">Mitolyn</h3>
363
  </div>
364
- <img src="http://static.photos/health/320x240/101" alt="Mitolyn" class="w-full h-48 object-contain mb-6 rounded-lg">
 
 
365
  <p class="text-gray-700 mb-6"><span class="font-bold text-dark">Best for metabolic flexibility, endurance, and gradual fat loss.</span> Ideal if you follow a balanced diet and prefer steady results over quick fixes.</p>
366
  <div class="bg-light p-4 rounded-lg">
367
  <h4 class="font-bold mb-2 text-dark">Choose Mitolyn If You:</h4>
@@ -392,7 +446,9 @@
392
  </div>
393
  <h3 class="text-2xl font-bold">FitSpresso</h3>
394
  </div>
395
- <img src="http://static.photos/health/320x240/102" alt="FitSpresso" class="w-full h-48 object-contain mb-6 rounded-lg">
 
 
396
  </div>
397
  <p class="text-gray-700 mb-6"><span class="font-bold text-dark">Best for those seeking a metabolic boost without stimulants.</span> Ideal if you want gentle support for fat loss without extreme diet changes.</p>
398
  <div class="bg-light p-4 rounded-lg">
@@ -418,8 +474,8 @@
418
  </div>
419
  </div>
420
  </div>
421
- <div class="mt-12 bg-primary/10 p-6 rounded-lg">
422
- <h3 class="text-2xl font-bold text-center mb-4 text-dark">Key Takeaway</h3>
423
  <p class="text-center text-gray-700 max-w-3xl mx-auto">Both work best with <span class="font-semibold">consistent nutrition, hydration, sleep, and movement</span>. Pick based on your <span class="font-semibold">diet, energy needs, and tolerance for stimulants/fibers</span>.</p>
424
  </div>
425
  </div>
@@ -455,16 +511,44 @@
455
  </div>
456
  </div>
457
  </footer>
458
-
459
  <script>
460
  // Mobile menu toggle
461
  document.getElementById('menu-toggle').addEventListener('click', function() {
462
  const menu = document.getElementById('mobile-menu');
463
  menu.classList.toggle('hidden');
 
464
  });
465
 
466
- // Feather icons
467
- feather.replace();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
468
  </script>
469
  </body>
470
  </html>
 
2
  <html lang="en" class="scroll-smooth">
3
  <head>
4
  <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
6
+ <meta name="theme-color" content="#4F46E5">
7
+ <meta name="apple-mobile-web-app-capable" content="yes">
8
+ <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
9
+ <title>SlimPick: Mitolyn vs Lipozem Comparison</title>
10
  <script src="https://cdn.tailwindcss.com"></script>
11
  <script src="https://unpkg.com/feather-icons"></script>
12
  <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
 
24
  }
25
  }
26
  </script>
27
+ <link rel="manifest" href="/manifest.json">
28
+ <link rel="apple-touch-icon" href="/icons/apple-touch-icon.png">
29
  <style>
30
+ :root {
31
+ --primary: #4F46E5;
32
+ --secondary: #10B981;
33
+ --dark: #1F2937;
34
+ --light: #F3F4F6;
35
+ }
36
+
37
  .hero-gradient {
38
+ background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
39
+ }
40
+
41
+ .feature-card {
42
+ transition: all 0.3s ease;
43
  }
44
+
45
  .feature-card:hover {
46
  transform: translateY(-5px);
47
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
48
  }
49
+
50
  .comparison-table tr:nth-child(even) {
51
+ background-color: var(--light);
52
+ }
53
+
54
+ @media (max-width: 640px) {
55
+ .hero-heading {
56
+ font-size: 2rem;
57
+ line-height: 2.5rem;
58
+ }
59
+ .hero-subheading {
60
+ font-size: 1.25rem;
61
+ line-height: 1.75rem;
62
+ }
63
+ .section-padding {
64
+ padding-top: 3rem;
65
+ padding-bottom: 3rem;
66
+ }
67
+ }
68
+
69
+ /* Touch feedback */
70
+ button, a {
71
+ -webkit-tap-highlight-color: transparent;
72
+ }
73
+
74
+ /* Performance optimizations */
75
+ html {
76
+ scroll-behavior: smooth;
77
+ }
78
+
79
+ img {
80
+ max-width: 100%;
81
+ height: auto;
82
  }
83
  </style>
84
  </head>
 
94
  </a>
95
  </div>
96
  <div class="hidden md:flex items-center space-x-8">
97
+ <a href="#overview" class="text-gray-700 hover:text-primary transition duration-300">Overview</a>
98
+ <a href="#comparison" class="text-gray-700 hover:text-primary transition duration-300">Comparison</a>
99
+ <a href="#pros-cons" class="text-gray-700 hover:text-primary transition duration-300">Pros & Cons</a>
100
+ <a href="#verdict" class="text-gray-700 hover:text-primary transition duration-300">Verdict</a>
101
  </div>
102
  <div class="flex items-center md:hidden">
103
+ <button id="menu-toggle" class="text-gray-700 focus:outline-none" aria-label="Toggle menu">
104
  <i data-feather="menu"></i>
105
  </button>
106
  </div>
107
  </div>
108
  </div>
109
  <!-- Mobile menu -->
110
+ <div id="mobile-menu" class="hidden md:hidden bg-white pb-3 px-4 transition-all duration-300 ease-in-out">
111
+ <a href="#overview" class="block py-3 text-gray-700 hover:text-primary transition duration-300 border-b border-gray-100">Overview</a>
112
+ <a href="#comparison" class="block py-3 text-gray-700 hover:text-primary transition duration-300 border-b border-gray-100">Comparison</a>
113
+ <a href="#pros-cons" class="block py-3 text-gray-700 hover:text-primary transition duration-300 border-b border-gray-100">Pros & Cons</a>
114
+ <a href="#verdict" class="block py-3 text-gray-700 hover:text-primary transition duration-300">Verdict</a>
115
  </div>
116
  </nav>
117
  <!-- Hero Section -->
118
+ <section class="hero-gradient text-white py-16 md:py-20">
119
+ <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center">
120
  <div class="flex justify-center mb-8">
121
+ <div class="flex flex-col md:flex-row items-center gap-4 md:gap-8">
122
+ <img src="http://static.photos/health/640x360/101" alt="Mitolyn"
123
+ class="w-32 h-32 md:w-48 md:h-48 object-contain rounded-lg shadow-lg"
124
+ loading="lazy">
125
+ <h1 class="text-3xl md:text-5xl font-bold hero-heading text-center md:text-left">Mitolyn vs FitSpresso</h1>
126
+ <img src="http://static.photos/health/640x360/102" alt="FitSpresso"
127
+ class="w-32 h-32 md:w-48 md:h-48 object-contain rounded-lg shadow-lg"
128
+ loading="lazy">
129
  </div>
130
  </div>
131
+ <p class="text-lg md:text-2xl mb-8 max-w-3xl mx-auto px-4 hero-subheading text-center">The ultimate comparison to help you choose the right metabolic booster</p>
132
+ <div class="flex flex-col sm:flex-row justify-center gap-4 px-4">
133
+ <a href="#comparison" class="bg-white text-primary font-semibold px-6 py-3 rounded-lg shadow-md hover:bg-gray-100 transition duration-300 active:scale-95 focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-primary/50 text-center">
134
  Compare Now
135
  </a>
136
+ <a href="#verdict" class="bg-transparent border-2 border-white text-white font-semibold px-6 py-3 rounded-lg hover:bg-white hover:text-primary transition duration-300 active:scale-95 focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-primary/50 text-center">
137
  See Verdict
138
  </a>
139
  </div>
140
+ </div>
141
  </section>
 
142
  <!-- Overview Section -->
143
+ <section id="overview" class="py-12 md:py-16 bg-white section-padding">
144
+ <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
145
  <h2 class="text-3xl font-bold text-center mb-12 text-dark">What's the Difference?</h2>
146
+ <div class="grid md:grid-cols-2 gap-8 md:gap-12 px-4 sm:px-0">
147
+ <div class="bg-light p-6 md:p-8 rounded-xl shadow-md">
148
+ <div class="flex items-center mb-4">
149
  <div class="bg-primary p-3 rounded-full mr-4">
150
  <i data-feather="zap" class="text-white"></i>
151
  </div>
152
  <h3 class="text-2xl font-bold text-dark">Mitolyn</h3>
153
  </div>
154
+ <img src="http://static.photos/health/320x240/101" alt="Mitolyn"
155
+ class="w-full h-40 md:h-48 object-contain mb-4 rounded-lg"
156
+ loading="lazy">
157
  <p class="text-gray-700 mb-4">A <span class="font-semibold">mitochondria-centric formula</span> designed to optimize cellular energy production and fat oxidation at the metabolic level.</p>
158
  <ul class="space-y-2">
159
  <li class="flex items-start">
 
170
  </li>
171
  </ul>
172
  </div>
173
+ <div class="bg-light p-6 md:p-8 rounded-xl shadow-md">
174
+ <div class="flex items-center mb-4">
175
  <div class="bg-secondary p-3 rounded-full mr-4">
176
  <i data-feather="droplet" class="text-white"></i>
177
  </div>
178
  <h3 class="text-2xl font-bold text-dark">FitSpresso</h3>
179
  </div>
180
+ <img src="http://static.photos/health/320x240/102" alt="FitSpresso"
181
+ class="w-full h-40 md:h-48 object-contain mb-4 rounded-lg"
182
+ loading="lazy">
183
  </div>
184
  <p class="text-gray-700 mb-4">A <span class="font-semibold">metabolic booster</span> that combines Capsicum Annum, L-Carnitine and Chromium Picolinate to support fat loss.</p>
185
  <ul class="space-y-2">
 
200
  </div>
201
  </div>
202
  </section>
 
203
  <!-- Comparison Section -->
204
+ <section id="comparison" class="py-12 md:py-16 bg-gray-50 section-padding">
205
+ <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
206
  <h2 class="text-3xl font-bold text-center mb-12 text-dark">Key Differences</h2>
207
+ <div class="overflow-x-auto px-4 sm:px-0">
208
+ <table class="min-w-full bg-white rounded-xl overflow-hidden shadow-md comparison-table text-sm md:text-base">
209
+ <thead class="bg-gray-100">
210
  <tr>
211
  <th class="py-4 px-6 text-left text-dark font-bold">Aspect</th>
212
  <th class="py-4 px-6 text-left text-primary font-bold">Mitolyn</th>
 
269
  </div>
270
  </div>
271
  </section>
 
272
  <!-- Pros & Cons Section -->
273
+ <section id="pros-cons" class="py-12 md:py-16 bg-white section-padding">
274
+ <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
275
  <h2 class="text-3xl font-bold text-center mb-12 text-dark">Pros & Cons</h2>
276
+ <div class="grid md:grid-cols-2 gap-8 md:gap-12 px-4 sm:px-0">
277
+ <!-- Mitolyn Pros/Cons -->
278
  <div>
279
  <h3 class="text-2xl font-bold mb-6 text-primary flex items-center">
280
  <i data-feather="zap" class="mr-2"></i> Mitolyn
 
399
  </div>
400
  </div>
401
  </section>
 
402
  <!-- Verdict Section -->
403
+ <section id="verdict" class="py-12 md:py-16 bg-gray-50 section-padding">
404
+ <div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
405
  <h2 class="text-3xl font-bold text-center mb-12 text-dark">Final Verdict</h2>
406
+ <div class="bg-white rounded-xl shadow-md overflow-hidden mx-4 sm:mx-0">
407
+ <div class="p-6 md:p-8">
408
+ <div class="grid md:grid-cols-2 gap-6 md:gap-8">
409
+ <div class="border-r border-gray-200 pr-8">
410
  <div class="flex items-center mb-6">
411
  <div class="bg-primary p-3 rounded-full mr-4">
412
  <i data-feather="zap" class="text-white"></i>
413
  </div>
414
  <h3 class="text-2xl font-bold">Mitolyn</h3>
415
  </div>
416
+ <img src="http://static.photos/health/320x240/101" alt="Mitolyn"
417
+ class="w-full h-40 md:h-48 object-contain mb-6 rounded-lg"
418
+ loading="lazy">
419
  <p class="text-gray-700 mb-6"><span class="font-bold text-dark">Best for metabolic flexibility, endurance, and gradual fat loss.</span> Ideal if you follow a balanced diet and prefer steady results over quick fixes.</p>
420
  <div class="bg-light p-4 rounded-lg">
421
  <h4 class="font-bold mb-2 text-dark">Choose Mitolyn If You:</h4>
 
446
  </div>
447
  <h3 class="text-2xl font-bold">FitSpresso</h3>
448
  </div>
449
+ <img src="http://static.photos/health/320x240/102" alt="FitSpresso"
450
+ class="w-full h-40 md:h-48 object-contain mb-6 rounded-lg"
451
+ loading="lazy">
452
  </div>
453
  <p class="text-gray-700 mb-6"><span class="font-bold text-dark">Best for those seeking a metabolic boost without stimulants.</span> Ideal if you want gentle support for fat loss without extreme diet changes.</p>
454
  <div class="bg-light p-4 rounded-lg">
 
474
  </div>
475
  </div>
476
  </div>
477
+ <div class="mt-8 md:mt-12 bg-primary/10 p-4 md:p-6 rounded-lg mx-4 sm:mx-0">
478
+ <h3 class="text-2xl font-bold text-center mb-4 text-dark">Key Takeaway</h3>
479
  <p class="text-center text-gray-700 max-w-3xl mx-auto">Both work best with <span class="font-semibold">consistent nutrition, hydration, sleep, and movement</span>. Pick based on your <span class="font-semibold">diet, energy needs, and tolerance for stimulants/fibers</span>.</p>
480
  </div>
481
  </div>
 
511
  </div>
512
  </div>
513
  </footer>
 
514
  <script>
515
  // Mobile menu toggle
516
  document.getElementById('menu-toggle').addEventListener('click', function() {
517
  const menu = document.getElementById('mobile-menu');
518
  menu.classList.toggle('hidden');
519
+ this.setAttribute('aria-expanded', menu.classList.contains('hidden') ? 'false' : 'true');
520
  });
521
 
522
+ // Close mobile menu when clicking outside
523
+ document.addEventListener('click', function(event) {
524
+ const menuToggle = document.getElementById('menu-toggle');
525
+ const mobileMenu = document.getElementById('mobile-menu');
526
+
527
+ if (!menuToggle.contains(event.target) && !mobileMenu.contains(event.target)) {
528
+ mobileMenu.classList.add('hidden');
529
+ menuToggle.setAttribute('aria-expanded', 'false');
530
+ }
531
+ });
532
+
533
+ // Performance optimization - load feather icons after page load
534
+ if (document.readyState === 'complete') {
535
+ feather.replace();
536
+ } else {
537
+ document.addEventListener('DOMContentLoaded', function() {
538
+ feather.replace();
539
+ });
540
+ }
541
+
542
+ // Service worker registration for PWA
543
+ if ('serviceWorker' in navigator) {
544
+ window.addEventListener('load', () => {
545
+ navigator.serviceWorker.register('/sw.js').then(registration => {
546
+ console.log('ServiceWorker registration successful');
547
+ }).catch(err => {
548
+ console.log('ServiceWorker registration failed: ', err);
549
+ });
550
+ });
551
+ }
552
  </script>
553
  </body>
554
  </html>
manifest.json ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```json
2
+ {
3
+ "name": "SlimPick",
4
+ "short_name": "SlimPick",
5
+ "start_url": "/",
6
+ "display": "standalone",
7
+ "background_color": "#4F46E5",
8
+ "theme_color": "#4F46E5",
9
+ "description": "Mitolyn vs FitSpresso comparison tool",
10
+ "icons": [
11
+ {
12
+ "src": "/icons/android-chrome-192x192.png",
13
+ "sizes": "192x192",
14
+ "type": "image/png"
15
+ },
16
+ {
17
+ "src": "/icons/android-chrome-512x512.png",
18
+ "sizes": "512x512",
19
+ "type": "image/png"
20
+ },
21
+ {
22
+ "src": "/icons/apple-touch-icon.png",
23
+ "sizes": "180x180",
24
+ "type": "image/png"
25
+ }
26
+ ]
27
+ }
28
+ ```
sw.js ADDED
@@ -0,0 +1,45 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ```javascript
2
+ const CACHE_NAME = 'slimpick-v1';
3
+ const ASSETS_TO_CACHE = [
4
+ '/',
5
+ '/index.html',
6
+ '/manifest.json',
7
+ '/icons/apple-touch-icon.png',
8
+ '/css/main.css',
9
+ '/js/main.js'
10
+ ];
11
+
12
+ self.addEventListener('install', (event) => {
13
+ event.waitUntil(
14
+ caches.open(CACHE_NAME)
15
+ .then((cache) => {
16
+ return cache.addAll(ASSETS_TO_CACHE);
17
+ })
18
+ );
19
+ });
20
+
21
+ self.addEventListener('fetch', (event) => {
22
+ event.respondWith(
23
+ caches.match(event.request)
24
+ .then((response) => {
25
+ return response || fetch(event.request);
26
+ })
27
+ );
28
+ });
29
+
30
+ self.addEventListener('activate', (event) => {
31
+ const cacheWhitelist = [CACHE_NAME];
32
+ event.waitUntil(
33
+ caches.keys().then((cacheNames) => {
34
+ return Promise.all(
35
+ cacheNames.map((cacheName) => {
36
+ if (cacheWhitelist.indexOf(cacheName) === -1) {
37
+ return caches.delete(cacheName);
38
+ }
39
+ })
40
+ );
41
+ })
42
+ );
43
+ });
44
+ ```
45
+ ```