@@ -9,8 +9,13 @@ const HTML = `<!DOCTYPE html>
99 body { font-family: sans-serif; padding: 2rem; background: #f5f5f5; }
1010 h1 { color: #333; }
1111 .card { background: white; border-radius: 8px; padding: 1.5rem; margin: 1rem 0; box-shadow: 0 2px 4px rgba(0,0,0,0.1); }
12+ .price { font-size: 1.5rem; font-weight: bold; color: #111; margin: 0.5rem 0; }
13+ .badge { display: inline-block; background: #fef3c7; color: #92400e; font-size: 0.75rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px; margin-bottom: 0.5rem; }
1214 button { background: #6366f1; color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 6px; cursor: pointer; font-size: 1rem; }
1315 button:hover { background: #4f46e5; }
16+ .btn-wishlist { background: white; color: #6366f1; border: 2px solid #6366f1; margin-left: 0.5rem; }
17+ .btn-wishlist:hover { background: #eef2ff; }
18+ .wishlist-msg { display: none; color: #10b981; font-size: 0.9rem; margin-top: 0.5rem; }
1419 .modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); align-items: center; justify-content: center; }
1520 .modal.open { display: flex; }
1621 .modal-content { background: white; border-radius: 12px; padding: 2rem; max-width: 400px; width: 90%; }
@@ -22,11 +27,15 @@ const HTML = `<!DOCTYPE html>
2227 <h1>Product Page</h1>
2328
2429 <div class="card">
30+ <span class="badge">Best Seller</span>
2531 <h2>Wireless Headphones</h2>
2632 <p>Premium noise-cancelling headphones with 30-hour battery life.</p>
27- <p id="counter">0</p>
33+ <p class="price">$129.99</p>
34+ <p id="counter">0 in cart</p>
2835 <button id="add-to-cart">Add to Cart</button>
36+ <button class="btn-wishlist" id="wishlist-btn">♡ Wishlist</button>
2937 <button id="try-on-btn" style="margin-left:0.5rem; background:#10b981">Virtual Try-On</button>
38+ <p class="wishlist-msg" id="wishlist-msg">Added to wishlist!</p>
3039 </div>
3140
3241 <div class="modal" id="modal">
@@ -42,7 +51,12 @@ const HTML = `<!DOCTYPE html>
4251 let count = 0;
4352 document.getElementById('add-to-cart').addEventListener('click', () => {
4453 count++;
45- document.getElementById('counter').textContent = count;
54+ document.getElementById('counter').textContent = count + ' in cart';
55+ });
56+ document.getElementById('wishlist-btn').addEventListener('click', () => {
57+ const msg = document.getElementById('wishlist-msg');
58+ msg.style.display = 'block';
59+ document.getElementById('wishlist-btn').textContent = '♥ Wishlisted';
4660 });
4761 document.getElementById('try-on-btn').addEventListener('click', () => {
4862 document.getElementById('modal').classList.add('open');
0 commit comments