Spaces:
Running
Running
undefined - Initial Deployment
Browse files- README.md +7 -5
- index.html +749 -19
README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: static
|
7 |
pinned: false
|
|
|
|
|
8 |
---
|
9 |
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
1 |
---
|
2 |
+
title: arlon-news
|
3 |
+
emoji: 🐳
|
4 |
+
colorFrom: yellow
|
5 |
+
colorTo: blue
|
6 |
sdk: static
|
7 |
pinned: false
|
8 |
+
tags:
|
9 |
+
- deepsite
|
10 |
---
|
11 |
|
12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
@@ -1,19 +1,749 @@
|
|
1 |
-
<!
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>FashionHub - Jual Beli Baju Online</title>
|
7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
9 |
+
<style>
|
10 |
+
/* Custom CSS for animations */
|
11 |
+
.product-card:hover {
|
12 |
+
transform: translateY(-5px);
|
13 |
+
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
|
14 |
+
}
|
15 |
+
|
16 |
+
.cart-item-enter {
|
17 |
+
opacity: 0;
|
18 |
+
transform: translateX(100px);
|
19 |
+
}
|
20 |
+
.cart-item-enter-active {
|
21 |
+
opacity: 1;
|
22 |
+
transform: translateX(0);
|
23 |
+
transition: all 300ms ease-in;
|
24 |
+
}
|
25 |
+
.cart-item-exit {
|
26 |
+
opacity: 1;
|
27 |
+
transform: translateX(0);
|
28 |
+
}
|
29 |
+
.cart-item-exit-active {
|
30 |
+
opacity: 0;
|
31 |
+
transform: translateX(100px);
|
32 |
+
transition: all 300ms ease-in;
|
33 |
+
}
|
34 |
+
|
35 |
+
@keyframes pulse {
|
36 |
+
0%, 100% {
|
37 |
+
opacity: 1;
|
38 |
+
}
|
39 |
+
50% {
|
40 |
+
opacity: 0.5;
|
41 |
+
}
|
42 |
+
}
|
43 |
+
|
44 |
+
.animate-pulse {
|
45 |
+
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
46 |
+
}
|
47 |
+
</style>
|
48 |
+
</head>
|
49 |
+
<body class="bg-gray-50 font-sans">
|
50 |
+
<!-- Header/Navbar -->
|
51 |
+
<header class="bg-white shadow-sm sticky top-0 z-50">
|
52 |
+
<div class="container mx-auto px-4 py-3 flex justify-between items-center">
|
53 |
+
<div class="flex items-center space-x-2">
|
54 |
+
<i class="fas fa-tshirt text-2xl text-indigo-600"></i>
|
55 |
+
<h1 class="text-xl font-bold text-gray-800">FashionHub</h1>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
<div class="hidden md:flex space-x-6">
|
59 |
+
<a href="#" class="text-gray-700 hover:text-indigo-600 font-medium">Beranda</a>
|
60 |
+
<a href="#" class="text-gray-700 hover:text-indigo-600 font-medium">Produk</a>
|
61 |
+
<a href="#" class="text-gray-700 hover:text-indigo-600 font-medium">Kategori</a>
|
62 |
+
<a href="#" class="text-gray-700 hover:text-indigo-600 font-medium">Tentang Kami</a>
|
63 |
+
</div>
|
64 |
+
|
65 |
+
<div class="flex items-center space-x-4">
|
66 |
+
<button id="search-btn" class="text-gray-600 hover:text-indigo-600">
|
67 |
+
<i class="fas fa-search"></i>
|
68 |
+
</button>
|
69 |
+
<button id="cart-btn" class="relative text-gray-600 hover:text-indigo-600">
|
70 |
+
<i class="fas fa-shopping-cart"></i>
|
71 |
+
<span id="cart-count" class="absolute -top-2 -right-2 bg-indigo-600 text-white text-xs rounded-full h-5 w-5 flex items-center justify-center">0</span>
|
72 |
+
</button>
|
73 |
+
<button id="mobile-menu-btn" class="md:hidden text-gray-600 hover:text-indigo-600">
|
74 |
+
<i class="fas fa-bars"></i>
|
75 |
+
</button>
|
76 |
+
</div>
|
77 |
+
</div>
|
78 |
+
|
79 |
+
<!-- Mobile Menu -->
|
80 |
+
<div id="mobile-menu" class="hidden md:hidden bg-white border-t py-2 px-4">
|
81 |
+
<a href="#" class="block py-2 text-gray-700 hover:text-indigo-600">Beranda</a>
|
82 |
+
<a href="#" class="block py-2 text-gray-700 hover:text-indigo-600">Produk</a>
|
83 |
+
<a href="#" class="block py-2 text-gray-700 hover:text-indigo-600">Kategori</a>
|
84 |
+
<a href="#" class="block py-2 text-gray-700 hover:text-indigo-600">Tentang Kami</a>
|
85 |
+
</div>
|
86 |
+
|
87 |
+
<!-- Search Bar -->
|
88 |
+
<div id="search-bar" class="hidden bg-white border-t py-3 px-4">
|
89 |
+
<div class="container mx-auto flex">
|
90 |
+
<input type="text" placeholder="Cari baju, kaos, kemeja..." class="flex-grow px-4 py-2 border rounded-l-lg focus:outline-none focus:ring-2 focus:ring-indigo-500">
|
91 |
+
<button class="bg-indigo-600 text-white px-4 py-2 rounded-r-lg hover:bg-indigo-700">
|
92 |
+
<i class="fas fa-search"></i>
|
93 |
+
</button>
|
94 |
+
</div>
|
95 |
+
</div>
|
96 |
+
</header>
|
97 |
+
|
98 |
+
<!-- Hero Section -->
|
99 |
+
<section class="bg-gradient-to-r from-indigo-500 to-purple-600 text-white py-16">
|
100 |
+
<div class="container mx-auto px-4 text-center">
|
101 |
+
<h1 class="text-4xl md:text-5xl font-bold mb-4">Temukan Gaya Terbaikmu</h1>
|
102 |
+
<p class="text-xl mb-8 max-w-2xl mx-auto">Koleksi baju terbaru dengan kualitas premium dan harga terjangkau</p>
|
103 |
+
<button class="bg-white text-indigo-600 font-bold px-8 py-3 rounded-full hover:bg-gray-100 transition duration-300">
|
104 |
+
Belanja Sekarang
|
105 |
+
</button>
|
106 |
+
</div>
|
107 |
+
</section>
|
108 |
+
|
109 |
+
<!-- Categories -->
|
110 |
+
<section class="py-12 bg-white">
|
111 |
+
<div class="container mx-auto px-4">
|
112 |
+
<h2 class="text-2xl font-bold text-gray-800 mb-8 text-center">Kategori Populer</h2>
|
113 |
+
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
114 |
+
<div class="bg-gray-100 rounded-lg p-4 text-center hover:bg-indigo-50 cursor-pointer transition duration-300">
|
115 |
+
<div class="bg-indigo-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-3">
|
116 |
+
<i class="fas fa-tshirt text-indigo-600 text-xl"></i>
|
117 |
+
</div>
|
118 |
+
<h3 class="font-medium text-gray-800">Kaos</h3>
|
119 |
+
</div>
|
120 |
+
<div class="bg-gray-100 rounded-lg p-4 text-center hover:bg-indigo-50 cursor-pointer transition duration-300">
|
121 |
+
<div class="bg-indigo-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-3">
|
122 |
+
<i class="fas fa-shirt text-indigo-600 text-xl"></i>
|
123 |
+
</div>
|
124 |
+
<h3 class="font-medium text-gray-800">Kemeja</h3>
|
125 |
+
</div>
|
126 |
+
<div class="bg-gray-100 rounded-lg p-4 text-center hover:bg-indigo-50 cursor-pointer transition duration-300">
|
127 |
+
<div class="bg-indigo-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-3">
|
128 |
+
<i class="fas fa-vest text-indigo-600 text-xl"></i>
|
129 |
+
</div>
|
130 |
+
<h3 class="font-medium text-gray-800">Jaket</h3>
|
131 |
+
</div>
|
132 |
+
<div class="bg-gray-100 rounded-lg p-4 text-center hover:bg-indigo-50 cursor-pointer transition duration-300">
|
133 |
+
<div class="bg-indigo-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-3">
|
134 |
+
<i class="fas fa-hat-cowboy text-indigo-600 text-xl"></i>
|
135 |
+
</div>
|
136 |
+
<h3 class="font-medium text-gray-800">Aksesoris</h3>
|
137 |
+
</div>
|
138 |
+
</div>
|
139 |
+
</div>
|
140 |
+
</section>
|
141 |
+
|
142 |
+
<!-- Products -->
|
143 |
+
<section class="py-12 bg-gray-50">
|
144 |
+
<div class="container mx-auto px-4">
|
145 |
+
<div class="flex justify-between items-center mb-8">
|
146 |
+
<h2 class="text-2xl font-bold text-gray-800">Produk Terbaru</h2>
|
147 |
+
<a href="#" class="text-indigo-600 hover:text-indigo-800 font-medium">Lihat Semua</a>
|
148 |
+
</div>
|
149 |
+
|
150 |
+
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6" id="products-container">
|
151 |
+
<!-- Products will be loaded here by JavaScript -->
|
152 |
+
</div>
|
153 |
+
|
154 |
+
<div class="mt-8 text-center">
|
155 |
+
<button class="bg-indigo-600 text-white px-6 py-2 rounded-md hover:bg-indigo-700 transition duration-300">
|
156 |
+
Muat Lebih Banyak
|
157 |
+
</button>
|
158 |
+
</div>
|
159 |
+
</div>
|
160 |
+
</section>
|
161 |
+
|
162 |
+
<!-- Features -->
|
163 |
+
<section class="py-12 bg-white">
|
164 |
+
<div class="container mx-auto px-4">
|
165 |
+
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
|
166 |
+
<div class="text-center">
|
167 |
+
<div class="bg-indigo-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-4">
|
168 |
+
<i class="fas fa-truck text-indigo-600 text-xl"></i>
|
169 |
+
</div>
|
170 |
+
<h3 class="text-lg font-bold text-gray-800 mb-2">Gratis Ongkir</h3>
|
171 |
+
<p class="text-gray-600">Gratis ongkir untuk pembelian di atas Rp 200.000</p>
|
172 |
+
</div>
|
173 |
+
<div class="text-center">
|
174 |
+
<div class="bg-indigo-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-4">
|
175 |
+
<i class="fas fa-exchange-alt text-indigo-600 text-xl"></i>
|
176 |
+
</div>
|
177 |
+
<h3 class="text-lg font-bold text-gray-800 mb-2">Pengembalian Mudah</h3>
|
178 |
+
<p class="text-gray-600">Garansi 30 hari pengembalian tanpa alasan</p>
|
179 |
+
</div>
|
180 |
+
<div class="text-center">
|
181 |
+
<div class="bg-indigo-100 w-16 h-16 mx-auto rounded-full flex items-center justify-center mb-4">
|
182 |
+
<i class="fas fa-headset text-indigo-600 text-xl"></i>
|
183 |
+
</div>
|
184 |
+
<h3 class="text-lg font-bold text-gray-800 mb-2">Dukungan 24/7</h3>
|
185 |
+
<p class="text-gray-600">Tim customer service siap membantu Anda</p>
|
186 |
+
</div>
|
187 |
+
</div>
|
188 |
+
</div>
|
189 |
+
</section>
|
190 |
+
|
191 |
+
<!-- Newsletter -->
|
192 |
+
<section class="py-12 bg-indigo-600 text-white">
|
193 |
+
<div class="container mx-auto px-4 text-center">
|
194 |
+
<h2 class="text-2xl font-bold mb-4">Dapatkan Penawaran Eksklusif</h2>
|
195 |
+
<p class="mb-6 max-w-2xl mx-auto">Berlangganan newsletter kami dan dapatkan diskon 10% untuk pembelian pertama</p>
|
196 |
+
<div class="max-w-md mx-auto flex">
|
197 |
+
<input type="email" placeholder="Alamat email Anda" class="flex-grow px-4 py-3 rounded-l-lg focus:outline-none text-gray-800">
|
198 |
+
<button class="bg-indigo-800 px-6 py-3 rounded-r-lg hover:bg-indigo-900 transition duration-300">
|
199 |
+
Berlangganan
|
200 |
+
</button>
|
201 |
+
</div>
|
202 |
+
</div>
|
203 |
+
</section>
|
204 |
+
|
205 |
+
<!-- Footer -->
|
206 |
+
<footer class="bg-gray-800 text-white py-12">
|
207 |
+
<div class="container mx-auto px-4">
|
208 |
+
<div class="grid grid-cols-1 md:grid-cols-4 gap-8">
|
209 |
+
<div>
|
210 |
+
<div class="flex items-center space-x-2 mb-4">
|
211 |
+
<i class="fas fa-tshirt text-2xl text-indigo-400"></i>
|
212 |
+
<h3 class="text-xl font-bold">FashionHub</h3>
|
213 |
+
</div>
|
214 |
+
<p class="text-gray-400 mb-4">Toko baju online dengan koleksi terbaik dan harga terjangkau.</p>
|
215 |
+
<div class="flex space-x-4">
|
216 |
+
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-facebook-f"></i></a>
|
217 |
+
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-twitter"></i></a>
|
218 |
+
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-instagram"></i></a>
|
219 |
+
<a href="#" class="text-gray-400 hover:text-white"><i class="fab fa-tiktok"></i></a>
|
220 |
+
</div>
|
221 |
+
</div>
|
222 |
+
<div>
|
223 |
+
<h4 class="text-lg font-bold mb-4">Tautan Cepat</h4>
|
224 |
+
<ul class="space-y-2">
|
225 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Beranda</a></li>
|
226 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Produk</a></li>
|
227 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Kategori</a></li>
|
228 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Tentang Kami</a></li>
|
229 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Kontak</a></li>
|
230 |
+
</ul>
|
231 |
+
</div>
|
232 |
+
<div>
|
233 |
+
<h4 class="text-lg font-bold mb-4">Bantuan</h4>
|
234 |
+
<ul class="space-y-2">
|
235 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Pusat Bantuan</a></li>
|
236 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Cara Pembelian</a></li>
|
237 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Pengembalian</a></li>
|
238 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Status Pesanan</a></li>
|
239 |
+
<li><a href="#" class="text-gray-400 hover:text-white">Pembayaran</a></li>
|
240 |
+
</ul>
|
241 |
+
</div>
|
242 |
+
<div>
|
243 |
+
<h4 class="text-lg font-bold mb-4">Kontak</h4>
|
244 |
+
<ul class="space-y-2 text-gray-400">
|
245 |
+
<li class="flex items-start space-x-2">
|
246 |
+
<i class="fas fa-map-marker-alt mt-1"></i>
|
247 |
+
<span>Jl. Fashion No. 123, Jakarta, Indonesia</span>
|
248 |
+
</li>
|
249 |
+
<li class="flex items-center space-x-2">
|
250 |
+
<i class="fas fa-phone"></i>
|
251 |
+
<span>+62 123 4567 890</span>
|
252 |
+
</li>
|
253 |
+
<li class="flex items-center space-x-2">
|
254 |
+
<i class="fas fa-envelope"></i>
|
255 |
+
<span>[email protected]</span>
|
256 |
+
</li>
|
257 |
+
</ul>
|
258 |
+
</div>
|
259 |
+
</div>
|
260 |
+
<div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400">
|
261 |
+
<p>© 2023 FashionHub. All rights reserved.</p>
|
262 |
+
</div>
|
263 |
+
</div>
|
264 |
+
</footer>
|
265 |
+
|
266 |
+
<!-- Shopping Cart Sidebar -->
|
267 |
+
<div id="cart-sidebar" class="fixed top-0 right-0 w-full md:w-96 h-full bg-white shadow-lg transform translate-x-full transition-transform duration-300 ease-in-out z-50 overflow-y-auto">
|
268 |
+
<div class="p-4 border-b flex justify-between items-center">
|
269 |
+
<h3 class="text-lg font-bold">Keranjang Belanja (<span id="cart-sidebar-count">0</span>)</h3>
|
270 |
+
<button id="close-cart" class="text-gray-500 hover:text-gray-700">
|
271 |
+
<i class="fas fa-times"></i>
|
272 |
+
</button>
|
273 |
+
</div>
|
274 |
+
|
275 |
+
<div id="cart-items" class="p-4">
|
276 |
+
<!-- Cart items will be loaded here -->
|
277 |
+
<div id="empty-cart-message" class="text-center py-8">
|
278 |
+
<i class="fas fa-shopping-cart text-4xl text-gray-300 mb-4"></i>
|
279 |
+
<p class="text-gray-500">Keranjang belanja Anda kosong</p>
|
280 |
+
<a href="#" class="mt-4 inline-block bg-indigo-600 text-white px-4 py-2 rounded-md hover:bg-indigo-700">Mulai Belanja</a>
|
281 |
+
</div>
|
282 |
+
</div>
|
283 |
+
|
284 |
+
<div class="p-4 border-t sticky bottom-0 bg-white">
|
285 |
+
<div class="flex justify-between mb-4">
|
286 |
+
<span class="font-medium">Total:</span>
|
287 |
+
<span id="cart-total" class="font-bold">Rp 0</span>
|
288 |
+
</div>
|
289 |
+
<button id="checkout-btn" class="w-full bg-indigo-600 text-white py-3 rounded-md hover:bg-indigo-700 disabled:opacity-50 disabled:cursor-not-allowed" disabled>
|
290 |
+
Lanjut ke Pembayaran
|
291 |
+
</button>
|
292 |
+
</div>
|
293 |
+
</div>
|
294 |
+
|
295 |
+
<!-- Overlay -->
|
296 |
+
<div id="overlay" class="fixed inset-0 bg-black bg-opacity-50 z-40 hidden"></div>
|
297 |
+
|
298 |
+
<!-- Product Quick View Modal -->
|
299 |
+
<div id="quick-view-modal" class="fixed inset-0 flex items-center justify-center z-50 hidden">
|
300 |
+
<div class="absolute inset-0 bg-black bg-opacity-50" id="close-quick-view"></div>
|
301 |
+
<div class="bg-white rounded-lg max-w-4xl w-full mx-4 max-h-[90vh] overflow-y-auto relative z-10">
|
302 |
+
<button id="close-quick-view-btn" class="absolute top-4 right-4 text-gray-500 hover:text-gray-700">
|
303 |
+
<i class="fas fa-times"></i>
|
304 |
+
</button>
|
305 |
+
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 p-6">
|
306 |
+
<div class="bg-gray-100 rounded-lg overflow-hidden">
|
307 |
+
<img id="quick-view-image" src="" alt="Product" class="w-full h-auto object-cover">
|
308 |
+
</div>
|
309 |
+
<div>
|
310 |
+
<h3 id="quick-view-title" class="text-2xl font-bold text-gray-800 mb-2"></h3>
|
311 |
+
<div class="flex items-center mb-4">
|
312 |
+
<div class="flex text-yellow-400 mr-2">
|
313 |
+
<i class="fas fa-star"></i>
|
314 |
+
<i class="fas fa-star"></i>
|
315 |
+
<i class="fas fa-star"></i>
|
316 |
+
<i class="fas fa-star"></i>
|
317 |
+
<i class="fas fa-star-half-alt"></i>
|
318 |
+
</div>
|
319 |
+
<span class="text-gray-600">(42 ulasan)</span>
|
320 |
+
</div>
|
321 |
+
<div class="text-2xl font-bold text-indigo-600 mb-4" id="quick-view-price"></div>
|
322 |
+
<p id="quick-view-description" class="text-gray-600 mb-6"></p>
|
323 |
+
|
324 |
+
<div class="mb-6">
|
325 |
+
<h4 class="font-medium text-gray-800 mb-2">Ukuran:</h4>
|
326 |
+
<div class="flex space-x-2">
|
327 |
+
<button class="border rounded-md px-3 py-1 hover:bg-gray-100 focus:bg-indigo-100 focus:border-indigo-500 focus:text-indigo-700">S</button>
|
328 |
+
<button class="border rounded-md px-3 py-1 hover:bg-gray-100 focus:bg-indigo-100 focus:border-indigo-500 focus:text-indigo-700">M</button>
|
329 |
+
<button class="border rounded-md px-3 py-1 hover:bg-gray-100 focus:bg-indigo-100 focus:border-indigo-500 focus:text-indigo-700">L</button>
|
330 |
+
<button class="border rounded-md px-3 py-1 hover:bg-gray-100 focus:bg-indigo-100 focus:border-indigo-500 focus:text-indigo-700">XL</button>
|
331 |
+
</div>
|
332 |
+
</div>
|
333 |
+
|
334 |
+
<div class="mb-6">
|
335 |
+
<h4 class="font-medium text-gray-800 mb-2">Warna:</h4>
|
336 |
+
<div class="flex space-x-2">
|
337 |
+
<button class="w-8 h-8 rounded-full bg-black border-2 border-gray-300 focus:border-indigo-500"></button>
|
338 |
+
<button class="w-8 h-8 rounded-full bg-blue-600 border-2 border-gray-300 focus:border-indigo-500"></button>
|
339 |
+
<button class="w-8 h-8 rounded-full bg-red-600 border-2 border-gray-300 focus:border-indigo-500"></button>
|
340 |
+
<button class="w-8 h-8 rounded-full bg-gray-200 border-2 border-gray-300 focus:border-indigo-500"></button>
|
341 |
+
</div>
|
342 |
+
</div>
|
343 |
+
|
344 |
+
<div class="flex items-center space-x-4 mb-6">
|
345 |
+
<div class="flex items-center border rounded-md">
|
346 |
+
<button class="px-3 py-1 text-gray-600 hover:bg-gray-100">-</button>
|
347 |
+
<span class="px-3 py-1">1</span>
|
348 |
+
<button class="px-3 py-1 text-gray-600 hover:bg-gray-100">+</button>
|
349 |
+
</div>
|
350 |
+
<button id="add-to-cart-btn" class="flex-grow bg-indigo-600 text-white py-2 rounded-md hover:bg-indigo-700">
|
351 |
+
<i class="fas fa-shopping-cart mr-2"></i> Tambah ke Keranjang
|
352 |
+
</button>
|
353 |
+
</div>
|
354 |
+
|
355 |
+
<div class="border-t pt-4">
|
356 |
+
<div class="flex items-center text-gray-600 mb-2">
|
357 |
+
<i class="fas fa-truck mr-2"></i>
|
358 |
+
<span>Gratis ongkir untuk pembelian di atas Rp 200.000</span>
|
359 |
+
</div>
|
360 |
+
<div class="flex items-center text-gray-600">
|
361 |
+
<i class="fas fa-exchange-alt mr-2"></i>
|
362 |
+
<span>Pengembalian mudah dalam 30 hari</span>
|
363 |
+
</div>
|
364 |
+
</div>
|
365 |
+
</div>
|
366 |
+
</div>
|
367 |
+
</div>
|
368 |
+
</div>
|
369 |
+
|
370 |
+
<script>
|
371 |
+
// Sample product data
|
372 |
+
const products = [
|
373 |
+
{
|
374 |
+
id: 1,
|
375 |
+
title: "Kaos Polo Slim Fit",
|
376 |
+
price: 149000,
|
377 |
+
image: "https://images.unsplash.com/photo-1576566588028-4147f3842f27?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80",
|
378 |
+
description: "Kaos polo slim fit dengan bahan katun pilihan yang nyaman digunakan sehari-hari.",
|
379 |
+
colors: ["Hitam", "Putih", "Biru Navy"],
|
380 |
+
sizes: ["S", "M", "L", "XL"]
|
381 |
+
},
|
382 |
+
{
|
383 |
+
id: 2,
|
384 |
+
title: "Kemeja Flanel Kotak",
|
385 |
+
price: 249000,
|
386 |
+
image: "https://images.unsplash.com/photo-1598033129183-c4f50c736f10?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80",
|
387 |
+
description: "Kemeja flanel dengan motif kotak-kotak yang stylish dan cocok untuk berbagai kesempatan.",
|
388 |
+
colors: ["Merah", "Biru", "Hijau"],
|
389 |
+
sizes: ["M", "L", "XL"]
|
390 |
+
},
|
391 |
+
{
|
392 |
+
id: 3,
|
393 |
+
title: "Jaket Denim Vintage",
|
394 |
+
price: 349000,
|
395 |
+
image: "https://images.unsplash.com/photo-1543076447-215ad9ba6923?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80",
|
396 |
+
description: "Jaket denim vintage dengan potongan modern dan bahan yang kuat serta tahan lama.",
|
397 |
+
colors: ["Biru Tua", "Hitam"],
|
398 |
+
sizes: ["S", "M", "L", "XL"]
|
399 |
+
},
|
400 |
+
{
|
401 |
+
id: 4,
|
402 |
+
title: "Hoodie Oversize",
|
403 |
+
price: 199000,
|
404 |
+
image: "https://images.unsplash.com/photo-1620799140408-edc6dcb6d633?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80",
|
405 |
+
description: "Hoodie oversize dengan bahan fleece yang hangat dan nyaman dipakai.",
|
406 |
+
colors: ["Abu-abu", "Hitam", "Krem"],
|
407 |
+
sizes: ["S", "M", "L", "XL"]
|
408 |
+
},
|
409 |
+
{
|
410 |
+
id: 5,
|
411 |
+
title: "Kaos Graphic Print",
|
412 |
+
price: 129000,
|
413 |
+
image: "https://images.unsplash.com/photo-1527719327859-c6ce80353573?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80",
|
414 |
+
description: "Kaos dengan graphic print eksklusif dan bahan katun yang lembut.",
|
415 |
+
colors: ["Putih", "Hitam", "Biru"],
|
416 |
+
sizes: ["S", "M", "L"]
|
417 |
+
},
|
418 |
+
{
|
419 |
+
id: 6,
|
420 |
+
title: "Celana Chino Slim",
|
421 |
+
price: 279000,
|
422 |
+
image: "https://images.unsplash.com/photo-1599443015574-be0fe9c7f99f?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80",
|
423 |
+
description: "Celana chino slim fit dengan bahan yang nyaman dan cocok untuk berbagai gaya.",
|
424 |
+
colors: ["Beige", "Coklat", "Navy"],
|
425 |
+
sizes: ["28", "30", "32", "34"]
|
426 |
+
},
|
427 |
+
{
|
428 |
+
id: 7,
|
429 |
+
title: "Blazer Slim Fit",
|
430 |
+
price: 499000,
|
431 |
+
image: "https://images.unsplash.com/photo-1591047139829-d91aecb6caea?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80",
|
432 |
+
description: "Blazer slim fit dengan bahan premium dan jahitan rapi untuk penampilan formal.",
|
433 |
+
colors: ["Hitam", "Navy", "Abu-abu"],
|
434 |
+
sizes: ["S", "M", "L", "XL"]
|
435 |
+
},
|
436 |
+
{
|
437 |
+
id: 8,
|
438 |
+
title: "Topi Snapback",
|
439 |
+
price: 99000,
|
440 |
+
image: "https://images.unsplash.com/photo-1521369909029-bdd5d07e1e1a?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=800&q=80",
|
441 |
+
description: "Topi snapback dengan logo bordir dan bahan yang nyaman dipakai.",
|
442 |
+
colors: ["Hitam", "Putih", "Merah"],
|
443 |
+
sizes: ["One Size"]
|
444 |
+
}
|
445 |
+
];
|
446 |
+
|
447 |
+
// Cart functionality
|
448 |
+
let cart = [];
|
449 |
+
|
450 |
+
// DOM Elements
|
451 |
+
const productsContainer = document.getElementById('products-container');
|
452 |
+
const cartBtn = document.getElementById('cart-btn');
|
453 |
+
const cartSidebar = document.getElementById('cart-sidebar');
|
454 |
+
const closeCartBtn = document.getElementById('close-cart');
|
455 |
+
const cartItemsContainer = document.getElementById('cart-items');
|
456 |
+
const cartCount = document.getElementById('cart-count');
|
457 |
+
const cartSidebarCount = document.getElementById('cart-sidebar-count');
|
458 |
+
const cartTotal = document.getElementById('cart-total');
|
459 |
+
const checkoutBtn = document.getElementById('checkout-btn');
|
460 |
+
const emptyCartMessage = document.getElementById('empty-cart-message');
|
461 |
+
const overlay = document.getElementById('overlay');
|
462 |
+
const mobileMenuBtn = document.getElementById('mobile-menu-btn');
|
463 |
+
const mobileMenu = document.getElementById('mobile-menu');
|
464 |
+
const searchBtn = document.getElementById('search-btn');
|
465 |
+
const searchBar = document.getElementById('search-bar');
|
466 |
+
const quickViewModal = document.getElementById('quick-view-modal');
|
467 |
+
const closeQuickViewBtn = document.getElementById('close-quick-view-btn');
|
468 |
+
const closeQuickView = document.getElementById('close-quick-view');
|
469 |
+
const quickViewImage = document.getElementById('quick-view-image');
|
470 |
+
const quickViewTitle = document.getElementById('quick-view-title');
|
471 |
+
const quickViewPrice = document.getElementById('quick-view-price');
|
472 |
+
const quickViewDescription = document.getElementById('quick-view-description');
|
473 |
+
const addToCartBtn = document.getElementById('add-to-cart-btn');
|
474 |
+
|
475 |
+
// Current product for quick view
|
476 |
+
let currentProduct = null;
|
477 |
+
|
478 |
+
// Format price to IDR
|
479 |
+
function formatPrice(price) {
|
480 |
+
return new Intl.NumberFormat('id-ID', { style: 'currency', currency: 'IDR', maximumFractionDigits: 0 }).format(price);
|
481 |
+
}
|
482 |
+
|
483 |
+
// Render products
|
484 |
+
function renderProducts() {
|
485 |
+
productsContainer.innerHTML = '';
|
486 |
+
|
487 |
+
products.forEach(product => {
|
488 |
+
const productCard = document.createElement('div');
|
489 |
+
productCard.className = 'product-card bg-white rounded-lg overflow-hidden shadow-md transition duration-300 hover:shadow-lg';
|
490 |
+
productCard.innerHTML = `
|
491 |
+
<div class="relative">
|
492 |
+
<img src="${product.image}" alt="${product.title}" class="w-full h-64 object-cover">
|
493 |
+
<button class="absolute top-2 right-2 bg-white rounded-full w-8 h-8 flex items-center justify-center shadow-md hover:bg-gray-100 quick-view-btn" data-id="${product.id}">
|
494 |
+
<i class="fas fa-eye text-gray-600"></i>
|
495 |
+
</button>
|
496 |
+
</div>
|
497 |
+
<div class="p-4">
|
498 |
+
<h3 class="font-bold text-gray-800 mb-1 truncate">${product.title}</h3>
|
499 |
+
<div class="flex items-center mb-2">
|
500 |
+
<div class="flex text-yellow-400 text-xs mr-1">
|
501 |
+
<i class="fas fa-star"></i>
|
502 |
+
<i class="fas fa-star"></i>
|
503 |
+
<i class="fas fa-star"></i>
|
504 |
+
<i class="fas fa-star"></i>
|
505 |
+
<i class="fas fa-star-half-alt"></i>
|
506 |
+
</div>
|
507 |
+
<span class="text-gray-500 text-xs">(42)</span>
|
508 |
+
</div>
|
509 |
+
<div class="font-bold text-indigo-600 mb-3">${formatPrice(product.price)}</div>
|
510 |
+
<button class="w-full bg-indigo-600 text-white py-2 rounded-md hover:bg-indigo-700 transition duration-300 add-to-cart-btn" data-id="${product.id}">
|
511 |
+
<i class="fas fa-shopping-cart mr-2"></i> Tambah
|
512 |
+
</button>
|
513 |
+
</div>
|
514 |
+
`;
|
515 |
+
|
516 |
+
productsContainer.appendChild(productCard);
|
517 |
+
});
|
518 |
+
|
519 |
+
// Add event listeners to quick view buttons
|
520 |
+
document.querySelectorAll('.quick-view-btn').forEach(btn => {
|
521 |
+
btn.addEventListener('click', (e) => {
|
522 |
+
const productId = parseInt(e.currentTarget.getAttribute('data-id'));
|
523 |
+
openQuickView(productId);
|
524 |
+
});
|
525 |
+
});
|
526 |
+
|
527 |
+
// Add event listeners to add to cart buttons
|
528 |
+
document.querySelectorAll('.add-to-cart-btn').forEach(btn => {
|
529 |
+
btn.addEventListener('click', (e) => {
|
530 |
+
const productId = parseInt(e.currentTarget.getAttribute('data-id'));
|
531 |
+
addToCart(productId);
|
532 |
+
});
|
533 |
+
});
|
534 |
+
}
|
535 |
+
|
536 |
+
// Add to cart
|
537 |
+
function addToCart(productId, quantity = 1) {
|
538 |
+
const product = products.find(p => p.id === productId);
|
539 |
+
|
540 |
+
if (!product) return;
|
541 |
+
|
542 |
+
// Check if product already in cart
|
543 |
+
const existingItem = cart.find(item => item.id === productId);
|
544 |
+
|
545 |
+
if (existingItem) {
|
546 |
+
existingItem.quantity += quantity;
|
547 |
+
} else {
|
548 |
+
cart.push({
|
549 |
+
...product,
|
550 |
+
quantity: quantity
|
551 |
+
});
|
552 |
+
}
|
553 |
+
|
554 |
+
updateCart();
|
555 |
+
|
556 |
+
// Show notification
|
557 |
+
const notification = document.createElement('div');
|
558 |
+
notification.className = 'fixed bottom-4 right-4 bg-green-500 text-white px-4 py-2 rounded-md shadow-lg flex items-center animate-pulse';
|
559 |
+
notification.innerHTML = `
|
560 |
+
<i class="fas fa-check-circle mr-2"></i>
|
561 |
+
<span>${product.title} ditambahkan ke keranjang</span>
|
562 |
+
`;
|
563 |
+
document.body.appendChild(notification);
|
564 |
+
|
565 |
+
setTimeout(() => {
|
566 |
+
notification.classList.remove('animate-pulse');
|
567 |
+
notification.classList.add('opacity-0', 'transition-opacity', 'duration-300');
|
568 |
+
setTimeout(() => notification.remove(), 300);
|
569 |
+
}, 2000);
|
570 |
+
}
|
571 |
+
|
572 |
+
// Remove from cart
|
573 |
+
function removeFromCart(productId) {
|
574 |
+
cart = cart.filter(item => item.id !== productId);
|
575 |
+
updateCart();
|
576 |
+
}
|
577 |
+
|
578 |
+
// Update cart quantity
|
579 |
+
function updateCartItemQuantity(productId, newQuantity) {
|
580 |
+
const item = cart.find(item => item.id === productId);
|
581 |
+
|
582 |
+
if (item) {
|
583 |
+
if (newQuantity <= 0) {
|
584 |
+
removeFromCart(productId);
|
585 |
+
} else {
|
586 |
+
item.quantity = newQuantity;
|
587 |
+
}
|
588 |
+
|
589 |
+
updateCart();
|
590 |
+
}
|
591 |
+
}
|
592 |
+
|
593 |
+
// Update cart UI
|
594 |
+
function updateCart() {
|
595 |
+
// Update cart count
|
596 |
+
const totalItems = cart.reduce((sum, item) => sum + item.quantity, 0);
|
597 |
+
cartCount.textContent = totalItems;
|
598 |
+
cartSidebarCount.textContent = totalItems;
|
599 |
+
|
600 |
+
// Update cart items
|
601 |
+
if (cart.length === 0) {
|
602 |
+
emptyCartMessage.classList.remove('hidden');
|
603 |
+
cartItemsContainer.innerHTML = '';
|
604 |
+
checkoutBtn.disabled = true;
|
605 |
+
} else {
|
606 |
+
emptyCartMessage.classList.add('hidden');
|
607 |
+
|
608 |
+
let itemsHTML = '';
|
609 |
+
let totalPrice = 0;
|
610 |
+
|
611 |
+
cart.forEach(item => {
|
612 |
+
totalPrice += item.price * item.quantity;
|
613 |
+
|
614 |
+
itemsHTML += `
|
615 |
+
<div class="cart-item flex py-4 border-b">
|
616 |
+
<div class="w-20 h-20 bg-gray-100 rounded-md overflow-hidden flex-shrink-0">
|
617 |
+
<img src="${item.image}" alt="${item.title}" class="w-full h-full object-cover">
|
618 |
+
</div>
|
619 |
+
<div class="ml-4 flex-grow">
|
620 |
+
<h4 class="font-medium text-gray-800 mb-1">${item.title}</h4>
|
621 |
+
<div class="text-indigo-600 font-medium mb-2">${formatPrice(item.price)}</div>
|
622 |
+
<div class="flex items-center">
|
623 |
+
<div class="flex items-center border rounded-md">
|
624 |
+
<button class="px-2 py-1 text-gray-600 hover:bg-gray-100 decrease-quantity" data-id="${item.id}">-</button>
|
625 |
+
<span class="px-2 py-1 quantity">${item.quantity}</span>
|
626 |
+
<button class="px-2 py-1 text-gray-600 hover:bg-gray-100 increase-quantity" data-id="${item.id}">+</button>
|
627 |
+
</div>
|
628 |
+
<button class="ml-4 text-red-500 hover:text-red-700 remove-item" data-id="${item.id}">
|
629 |
+
<i class="fas fa-trash"></i>
|
630 |
+
</button>
|
631 |
+
</div>
|
632 |
+
</div>
|
633 |
+
</div>
|
634 |
+
`;
|
635 |
+
});
|
636 |
+
|
637 |
+
cartItemsContainer.innerHTML = itemsHTML;
|
638 |
+
cartTotal.textContent = formatPrice(totalPrice);
|
639 |
+
checkoutBtn.disabled = false;
|
640 |
+
|
641 |
+
// Add event listeners to quantity buttons
|
642 |
+
document.querySelectorAll('.decrease-quantity').forEach(btn => {
|
643 |
+
btn.addEventListener('click', (e) => {
|
644 |
+
const productId = parseInt(e.currentTarget.getAttribute('data-id'));
|
645 |
+
const item = cart.find(item => item.id === productId);
|
646 |
+
if (item) {
|
647 |
+
updateCartItemQuantity(productId, item.quantity - 1);
|
648 |
+
}
|
649 |
+
});
|
650 |
+
});
|
651 |
+
|
652 |
+
document.querySelectorAll('.increase-quantity').forEach(btn => {
|
653 |
+
btn.addEventListener('click', (e) => {
|
654 |
+
const productId = parseInt(e.currentTarget.getAttribute('data-id'));
|
655 |
+
const item = cart.find(item => item.id === productId);
|
656 |
+
if (item) {
|
657 |
+
updateCartItemQuantity(productId, item.quantity + 1);
|
658 |
+
}
|
659 |
+
});
|
660 |
+
});
|
661 |
+
|
662 |
+
document.querySelectorAll('.remove-item').forEach(btn => {
|
663 |
+
btn.addEventListener('click', (e) => {
|
664 |
+
const productId = parseInt(e.currentTarget.getAttribute('data-id'));
|
665 |
+
removeFromCart(productId);
|
666 |
+
});
|
667 |
+
});
|
668 |
+
}
|
669 |
+
}
|
670 |
+
|
671 |
+
// Open quick view modal
|
672 |
+
function openQuickView(productId) {
|
673 |
+
const product = products.find(p => p.id === productId);
|
674 |
+
|
675 |
+
if (!product) return;
|
676 |
+
|
677 |
+
currentProduct = product;
|
678 |
+
|
679 |
+
quickViewImage.src = product.image;
|
680 |
+
quickViewImage.alt = product.title;
|
681 |
+
quickViewTitle.textContent = product.title;
|
682 |
+
quickViewPrice.textContent = formatPrice(product.price);
|
683 |
+
quickViewDescription.textContent = product.description;
|
684 |
+
|
685 |
+
quickViewModal.classList.remove('hidden');
|
686 |
+
overlay.classList.remove('hidden');
|
687 |
+
document.body.style.overflow = 'hidden';
|
688 |
+
}
|
689 |
+
|
690 |
+
// Close quick view modal
|
691 |
+
function closeQuickViewModal() {
|
692 |
+
quickViewModal.classList.add('hidden');
|
693 |
+
overlay.classList.add('hidden');
|
694 |
+
document.body.style.overflow = 'auto';
|
695 |
+
}
|
696 |
+
|
697 |
+
// Toggle cart sidebar
|
698 |
+
function toggleCartSidebar() {
|
699 |
+
if (cartSidebar.classList.contains('translate-x-full')) {
|
700 |
+
cartSidebar.classList.remove('translate-x-full');
|
701 |
+
overlay.classList.remove('hidden');
|
702 |
+
document.body.style.overflow = 'hidden';
|
703 |
+
} else {
|
704 |
+
cartSidebar.classList.add('translate-x-full');
|
705 |
+
overlay.classList.add('hidden');
|
706 |
+
document.body.style.overflow = 'auto';
|
707 |
+
}
|
708 |
+
}
|
709 |
+
|
710 |
+
// Toggle mobile menu
|
711 |
+
function toggleMobileMenu() {
|
712 |
+
mobileMenu.classList.toggle('hidden');
|
713 |
+
}
|
714 |
+
|
715 |
+
// Toggle search bar
|
716 |
+
function toggleSearchBar() {
|
717 |
+
searchBar.classList.toggle('hidden');
|
718 |
+
}
|
719 |
+
|
720 |
+
// Event listeners
|
721 |
+
cartBtn.addEventListener('click', toggleCartSidebar);
|
722 |
+
closeCartBtn.addEventListener('click', toggleCartSidebar);
|
723 |
+
overlay.addEventListener('click', () => {
|
724 |
+
toggleCartSidebar();
|
725 |
+
closeQuickViewModal();
|
726 |
+
});
|
727 |
+
mobileMenuBtn.addEventListener('click', toggleMobileMenu);
|
728 |
+
searchBtn.addEventListener('click', toggleSearchBar);
|
729 |
+
closeQuickViewBtn.addEventListener('click', closeQuickViewModal);
|
730 |
+
closeQuickView.addEventListener('click', closeQuickViewModal);
|
731 |
+
addToCartBtn.addEventListener('click', () => {
|
732 |
+
if (currentProduct) {
|
733 |
+
addToCart(currentProduct.id);
|
734 |
+
closeQuickViewModal();
|
735 |
+
}
|
736 |
+
});
|
737 |
+
checkoutBtn.addEventListener('click', () => {
|
738 |
+
alert('Terima kasih! Anda akan diarahkan ke halaman pembayaran.');
|
739 |
+
cart = [];
|
740 |
+
updateCart();
|
741 |
+
toggleCartSidebar();
|
742 |
+
});
|
743 |
+
|
744 |
+
// Initialize
|
745 |
+
renderProducts();
|
746 |
+
updateCart();
|
747 |
+
</script>
|
748 |
+
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=ArlonCarion/arlon-news" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
749 |
+
</html>
|