!DOCTYPE html
html lang=en
head
meta charset=UTF-8
meta name=viewport content=width=device-width, initial-scale=1.0
titleXYZ Deals - Daily Rewards & Trending Productstitle
script src=httpscdnjs.cloudflare.comajaxlibsPapaParse5.4.1papaparse.min.jsscript
style
body { font-family -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, sans-serif; margin 0; padding 0; background #f5f7fa; color #333; }
.app-container { max-width 1200px; width 100%; margin 0 auto; background #ffffff; min-height 100vh; box-shadow 0 0 20px rgba(0,0,0,0.05); display flex; flex-direction column; overflow-x hidden; }
Header & Cart
.header { background #000; color #fff; padding 15px 25px; display flex; align-items center; justify-content space-between; position sticky; top 0; z-index 100; }
.header h1 { margin 0; font-size 20px; font-weight 900; letter-spacing 1px; }
.cart-btn { position relative; background none; border none; color #fff; font-size 24px; cursor pointer; }
.cart-badge { position absolute; top -5px; right -8px; background #25D366; color #fff; font-size 11px; font-weight bold; width 18px; height 18px; border-radius 50%; display flex; align-items center; justify-content center; }
.content-section { padding 25px 20px; flex-grow 1; }
.section-title { font-size 18px; font-weight 800; text-transform uppercase; margin-bottom 15px; display flex; align-items center; gap 8px; }
Trending Horizontal Scroll
.trending-container { display flex; overflow-x auto; gap 15px; padding-bottom 20px; margin-bottom 20px; scroll-snap-type x mandatory; scrollbar-width none; }
.trending-container-webkit-scrollbar { display none; }
Product Grid for All Items
.product-grid { display grid; grid-template-columns repeat(auto-fill, minmax(160px, 1fr)); gap 15px; }
Product Cards
.product-card { background #fff; border 1px solid #eaeaea; border-radius 12px; overflow hidden; display flex; flex-direction column; transition transform 0.2s, box-shadow 0.2s; scroll-snap-align start; }
.trending-container .product-card { min-width 220px; max-width 220px; flex-shrink 0; border 1px solid #e2e8f0; box-shadow 0 4px 12px rgba(0,0,0,0.04); }
.product-cardhover { transform translateY(-3px); box-shadow 0 8px 20px rgba(0,0,0,0.08); }
.product-image { width 100%; height 160px; object-fit cover; background #f0f0f0; }
.product-info { padding 12px; display flex; flex-direction column; flex-grow 1; }
.product-title { font-size 13px; font-weight 600; color #111; margin 0 0 8px 0; line-height 1.4; display -webkit-box; -webkit-line-clamp 2; -webkit-box-orient vertical; overflow hidden; }
Pricing
.price-row { display flex; align-items baseline; gap 8px; margin-top auto; margin-bottom 12px; }
.sell-price { font-size 16px; font-weight 800; color #111; }
.mrp-price { font-size 12px; color #999; text-decoration line-through; }
.gcoin-price { font-size 11px; font-weight 700; color #3b82f6; background rgba(59,130,246,0.1); padding 4px 8px; border-radius 12px; display inline-block; margin-bottom 12px; width fit-content; }
Add to Cart
.add-btn { background #111; color #fff; border none; padding 10px; border-radius 6px; font-weight 700; font-size 13px; cursor pointer; transition background 0.2s; width 100%; }
.add-btnhover { background #333; }
Toast Notification
.toast { position fixed; bottom -50px; left 50%; transform translateX(-50%); background #111; color #fff; padding 12px 24px; border-radius 30px; font-size 14px; font-weight bold; transition bottom 0.3s; z-index 1000; box-shadow 0 4px 15px rgba(0,0,0,0.2); }
.toast.show { bottom 30px; }
.site-footer { background #111; color #888; padding 30px 20px; text-align center; font-size 13px; margin-top auto;}
style
head
body
div class=app-container
div class=header
h1XYZ DEALSh1
button class=cart-btn onclick=window.location.href='checkout.html'
🛒 span class=cart-badge id=cartCount0span
button
div
div class=content-section
!-- TRENDING PRODUCTS SECTION --
div class=section-title id=trendingTitle style=display none;
🔥 Trending Now
div
div class=trending-container id=trendingGrid
!-- Trending items load here --
div
!-- ALL PRODUCTS SECTION --
div class=section-title style=margin-top 10px;
👜 All Products
div
div class=product-grid id=mainProductGrid
!-- Regular items load here --
div
div
footer class=site-footer© 2026 XYZ Deals. All rights reserved.footer
div
div class=toast id=toastAdded to cart!div
script
let cart = JSON.parse(localStorage.getItem('xyz_cart')) [];
document.getElementById('cartCount').innerText = cart.length;
Papa.parse(xyzdeals_catalog.csv, {
download true,
header true,
complete function(results) {
let trendingHTML = '';
let allHTML = '';
let hasTrending = false;
results.data.forEach((row, index) = {
if (!row.Title) return;
let priceStr = row['Final_Selling_Price'] String(row['Final_Selling_Price']).replace([^0-9]g, '') '299';
let priceNum = parseInt(priceStr) 299;
let mrpStr = row['MRP'] String(row['MRP']).replace([^0-9]g, '') (priceNum + 300).toString();
let mrpNum = parseInt(mrpStr) priceNum + 300;
let gcoinAmt = priceNum 100;
Image fallback
let imageSrc = row['Image_URL'] 'httpsvia.placeholder.com300x300text=XYZ+Deals';
let cardHTML = `
div class=product-card
img src=${imageSrc} class=product-image alt=Product Image
div class=product-info
h3 class=product-title${row.Title}h3
div class=gcoin-price${gcoinAmt.toLocaleString('en-IN')} GCoinsdiv
div class=price-row
span class=sell-priceRs. ${priceNum.toLocaleString('en-IN')}span
span class=mrp-priceRs. ${mrpNum.toLocaleString('en-IN')}span
div
button class=add-btn onclick=addToCart(${index})Add to Cartbutton
div
div
`;
Check the new Trending column. If it says Yes, it goes to the top.
if (row.Trending && row.Trending.trim().toLowerCase() === 'yes') {
trendingHTML += cardHTML;
hasTrending = true;
} else {
allHTML += cardHTML;
}
});
if (hasTrending) {
document.getElementById('trendingTitle').style.display = 'flex';
document.getElementById('trendingGrid').innerHTML = trendingHTML;
}
document.getElementById('mainProductGrid').innerHTML = allHTML;
}
});
function addToCart(productId) {
cart.push(productId);
localStorage.setItem('xyz_cart', JSON.stringify(cart));
document.getElementById('cartCount').innerText = cart.length;
const toast = document.getElementById('toast');
toast.classList.add('show');
setTimeout(() = toast.classList.remove('show'), 2000);
}
script
body
html