page_prompt
stringlengths 55
1k
| page_output
stringlengths 11.4k
56.1k
| column_3
stringclasses 1
value |
|---|---|---|
Create a visually striking, animated, dark-themed landing page for a premium fruit juice brand. The design should feel organic, modern, and immersive β combining gradients, subtle glassmorphism, and smooth animations.and you can use any component you want
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pulp - Premium Organic Juices</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700;900&family=Inter:wght@300;400;500;600;700&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', sans-serif;
background: #0a0a0a;
color: #ffffff;
overflow-x: hidden;
}
.heading-font {
font-family: 'Playfair Display', serif;
}
/* Animated Background */
.animated-bg {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
z-index: 0;
background: radial-gradient(circle at 20% 50%, rgba(255, 107, 107, 0.15) 0%, transparent 50%),
radial-gradient(circle at 80% 80%, rgba(255, 193, 7, 0.15) 0%, transparent 50%),
radial-gradient(circle at 40% 20%, rgba(76, 175, 80, 0.15) 0%, transparent 50%);
animation: bgShift 20s ease-in-out infinite;
}
@keyframes bgShift {
0%, 100% {
background-position: 0% 50%, 100% 100%, 40% 20%;
}
50% {
background-position: 100% 50%, 0% 0%, 60% 80%;
}
}
/* Glassmorphism Card */
.glass-card {
background: rgba(255, 255, 255, 0.05);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.1);
border-radius: 20px;
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.glass-card:hover {
background: rgba(255, 255, 255, 0.08);
border-color: rgba(255, 255, 255, 0.2);
transform: translateY(-10px);
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
/* Floating Animation */
@keyframes float {
0%, 100% { transform: translateY(0px) rotate(0deg); }
25% { transform: translateY(-20px) rotate(5deg); }
50% { transform: translateY(-10px) rotate(-5deg); }
75% { transform: translateY(-25px) rotate(3deg); }
}
.float-animation {
animation: float 6s ease-in-out infinite;
}
/* Gradient Text */
.gradient-text {
background: linear-gradient(135deg, #ff6b6b 0%, #ffd93d 50%, #6bcf7f 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
animation: gradientShift 3s ease infinite;
background-size: 200% 200%;
}
@keyframes gradientShift {
0%, 100% { background-position: 0% 50%; }
50% { background-position: 100% 50%; }
}
/* Custom Scrollbar */
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
background: #0a0a0a;
}
::-webkit-scrollbar-thumb {
background: linear-gradient(180deg, #ff6b6b, #ffd93d);
border-radius: 10px;
}
/* Pulse Animation */
@keyframes pulse {
0%, 100% { opacity: 1; transform: scale(1); }
50% { opacity: 0.8; transform: scale(1.05); }
}
.pulse-animation {
animation: pulse 2s ease-in-out infinite;
}
/* Juice Drop Animation */
.juice-drop {
position: absolute;
width: 15px;
height: 15px;
border-radius: 50% 50% 50% 0;
transform: rotate(-45deg);
animation: drop 4s ease-in-out infinite;
}
@keyframes drop {
0% {
top: -10%;
opacity: 1;
}
90% {
opacity: 1;
}
100% {
top: 110%;
opacity: 0;
}
}
.drop-orange { background: #ff9800; animation-delay: 0s; left: 15%; }
.drop-red { background: #ff6b6b; animation-delay: 1s; left: 35%; }
.drop-green { background: #6bcf7f; animation-delay: 2s; left: 55%; }
.drop-yellow { background: #ffd93d; animation-delay: 3s; left: 75%; }
/* Slide in animations */
.slide-in-left {
opacity: 0;
transform: translateX(-50px);
animation: slideInLeft 1s ease forwards;
}
.slide-in-right {
opacity: 0;
transform: translateX(50px);
animation: slideInRight 1s ease forwards;
}
@keyframes slideInLeft {
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes slideInRight {
to {
opacity: 1;
transform: translateX(0);
}
}
/* Stagger animation delays */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
/* Button Hover Effect */
.btn-primary {
position: relative;
overflow: hidden;
background: linear-gradient(135deg, #ff6b6b, #ff9800);
transition: all 0.3s ease;
}
.btn-primary::before {
content: '';
position: absolute;
top: 50%;
left: 50%;
width: 0;
height: 0;
border-radius: 50%;
background: rgba(255, 255, 255, 0.3);
transform: translate(-50%, -50%);
transition: width 0.6s, height 0.6s;
}
.btn-primary:hover::before {
width: 300px;
height: 300px;
}
.btn-primary span {
position: relative;
z-index: 1;
}
/* Organic Shapes */
.organic-shape {
position: absolute;
border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
filter: blur(40px);
opacity: 0.3;
animation: morphing 10s ease-in-out infinite;
}
@keyframes morphing {
0%, 100% {
border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
}
50% {
border-radius: 70% 30% 50% 50% / 60% 40% 60% 40%;
}
}
/* Navbar */
nav {
backdrop-filter: blur(20px);
background: rgba(10, 10, 10, 0.7);
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
/* Product Card Hover */
.product-image {
transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.product-card:hover .product-image {
transform: scale(1.15) rotate(5deg);
}
/* Reveal on Scroll */
.reveal {
opacity: 0;
transform: translateY(30px);
transition: all 0.8s ease;
}
.reveal.active {
opacity: 1;
transform: translateY(0);
}
</style>
</head>
<body>
<div class="animated-bg"></div>
<!-- Juice Drops -->
<div class="juice-drop drop-orange"></div>
<div class="juice-drop drop-red"></div>
<div class="juice-drop drop-green"></div>
<div class="juice-drop drop-yellow"></div>
<!-- Navigation -->
<nav class="fixed w-full z-50 px-6 py-4">
<div class="max-w-7xl mx-auto flex items-center justify-between">
<div class="flex items-center space-x-2">
<div class="w-10 h-10 rounded-full bg-gradient-to-br from-orange-500 to-red-500 flex items-center justify-center pulse-animation">
<i class="fas fa-lemon text-white"></i>
</div>
<span class="text-2xl font-bold heading-font">Pulp</span>
</div>
<div class="hidden md:flex items-center space-x-8">
<a href="#home" class="hover:text-orange-400 transition">Home</a>
<a href="#products" class="hover:text-orange-400 transition">Products</a>
<a href="#about" class="hover:text-orange-400 transition">About</a>
<a href="#contact" class="hover:text-orange-400 transition">Contact</a>
</div>
<button class="btn-primary px-6 py-2 rounded-full font-semibold">
<span>Order Now</span>
</button>
</div>
</nav>
<!-- Hero Section -->
<section id="home" class="relative min-h-screen flex items-center justify-center px-6 pt-20">
<div class="organic-shape w-96 h-96 bg-orange-500 top-20 -left-48"></div>
<div class="organic-shape w-80 h-80 bg-green-500 bottom-20 -right-40"></div>
<div class="max-w-7xl mx-auto grid md:grid-cols-2 gap-12 items-center relative z-10">
<div class="space-y-6 slide-in-left">
<p class="text-orange-400 uppercase tracking-widest text-sm font-semibold">100% Organic & Fresh</p>
<h1 class="text-6xl md:text-7xl font-bold heading-font leading-tight">
Pure Nature,<br/>
<span class="gradient-text">Bottled Fresh</span>
</h1>
<p class="text-gray-400 text-lg leading-relaxed">
Experience the authentic taste of handpicked fruits, cold-pressed to perfection.
No additives, no preservativesβjust pure, organic goodness in every sip.
</p>
<div class="flex flex-wrap gap-4 pt-4">
<button class="btn-primary px-8 py-4 rounded-full font-semibold text-lg">
<span>Explore Collection</span>
</button>
<button class="glass-card px-8 py-4 rounded-full font-semibold text-lg flex items-center space-x-2">
<i class="fas fa-play"></i>
<span>Watch Story</span>
</button>
</div>
<div class="flex items-center space-x-8 pt-6">
<div>
<p class="text-3xl font-bold gradient-text">500+</p>
<p class="text-gray-400 text-sm">Happy Customers</p>
</div>
<div>
<p class="text-3xl font-bold gradient-text">100%</p>
<p class="text-gray-400 text-sm">Organic</p>
</div>
<div>
<p class="text-3xl font-bold gradient-text">12+</p>
<p class="text-gray-400 text-sm">Flavors</p>
</div>
</div>
</div>
<div class="relative slide-in-right delay-300">
<div class="float-animation relative z-10">
<div class="glass-card p-8 rounded-3xl">
<div class="aspect-square rounded-2xl bg-gradient-to-br from-orange-500/20 to-red-500/20 flex items-center justify-center overflow-hidden">
<div class="text-9xl pulse-animation">π</div>
</div>
</div>
</div>
<!-- Floating Info Cards -->
<div class="absolute -top-6 -left-6 glass-card p-4 rounded-2xl float-animation delay-100">
<div class="flex items-center space-x-3">
<div class="w-12 h-12 rounded-full bg-green-500/20 flex items-center justify-center">
<i class="fas fa-leaf text-green-400"></i>
</div>
<div>
<p class="font-semibold">100% Organic</p>
<p class="text-xs text-gray-400">Certified</p>
</div>
</div>
</div>
<div class="absolute -bottom-6 -right-6 glass-card p-4 rounded-2xl float-animation delay-300">
<div class="flex items-center space-x-3">
<div class="w-12 h-12 rounded-full bg-orange-500/20 flex items-center justify-center">
<i class="fas fa-star text-orange-400"></i>
</div>
<div>
<p class="font-semibold">4.9 Rating</p>
<p class="text-xs text-gray-400">250+ Reviews</p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Features Section -->
<section class="relative py-24 px-6">
<div class="max-w-7xl mx-auto">
<div class="text-center mb-16 reveal">
<p class="text-orange-400 uppercase tracking-widest text-sm font-semibold mb-4">Why Choose Us</p>
<h2 class="text-5xl font-bold heading-font">Pure Ingredients, <span class="gradient-text">Pure Joy</span></h2>
</div>
<div class="grid md:grid-cols-3 gap-8">
<div class="glass-card p-8 text-center space-y-4 product-card reveal delay-100">
<div class="w-20 h-20 mx-auto rounded-full bg-gradient-to-br from-orange-500/20 to-red-500/20 flex items-center justify-center text-4xl">
π±
</div>
<h3 class="text-2xl font-bold heading-font">100% Organic</h3>
<p class="text-gray-400">Sourced from certified organic farms, ensuring the highest quality and sustainability.</p>
</div>
<div class="glass-card p-8 text-center space-y-4 product-card reveal delay-200">
<div class="w-20 h-20 mx-auto rounded-full bg-gradient-to-br from-green-500/20 to-teal-500/20 flex items-center justify-center text-4xl">
βοΈ
</div>
<h3 class="text-2xl font-bold heading-font">Cold Pressed</h3>
<p class="text-gray-400">Our unique cold-press method preserves all nutrients and natural flavors.</p>
</div>
<div class="glass-card p-8 text-center space-y-4 product-card reveal delay-300">
<div class="w-20 h-20 mx-auto rounded-full bg-gradient-to-br from-yellow-500/20 to-orange-500/20 flex items-center justify-center text-4xl">
π«
</div>
<h3 class="text-2xl font-bold heading-font">No Additives</h3>
<p class="text-gray-400">Zero preservatives, artificial colors, or added sugars. Just pure fruit.</p>
</div>
</div>
</div>
</section>
<!-- Products Section -->
<section id="products" class="relative py-24 px-6">
<div class="organic-shape w-96 h-96 bg-red-500 top-40 right-10"></div>
<div class="max-w-7xl mx-auto relative z-10">
<div class="text-center mb-16 reveal">
<p class="text-orange-400 uppercase tracking-widest text-sm font-semibold mb-4">Our Collection</p>
<h2 class="text-5xl font-bold heading-font">Signature <span class="gradient-text">Flavors</span></h2>
</div>
<div class="grid md:grid-cols-4 gap-6">
<!-- Product 1 -->
<div class="glass-card p-6 space-y-4 product-card reveal delay-100">
<div class="aspect-square rounded-2xl bg-gradient-to-br from-orange-500/20 to-red-500/20 flex items-center justify-center overflow-hidden">
<div class="text-8xl product-image">π</div>
</div>
<div>
<h3 class="text-xl font-bold heading-font">Orange Burst</h3>
<p class="text-gray-400 text-sm mb-3">Vitamin C powerhouse</p>
<div class="flex items-center justify-between">
<span class="text-2xl font-bold gradient-text">$4.99</span>
<button class="w-10 h-10 rounded-full bg-orange-500 hover:bg-orange-600 transition flex items-center justify-center">
<i class="fas fa-plus text-white"></i>
</button>
</div>
</div>
</div>
<!-- Product 2 -->
<div class="glass-card p-6 space-y-4 product-card reveal delay-200">
<div class="aspect-square rounded-2xl bg-gradient-to-br from-green-500/20 to-teal-500/20 flex items-center justify-center overflow-hidden">
<div class="text-8xl product-image">π₯</div>
</div>
<div>
<h3 class="text-xl font-bold heading-font">Kiwi Fresh</h3>
<p class="text-gray-400 text-sm mb-3">Tropical paradise</p>
<div class="flex items-center justify-between">
<span class="text-2xl font-bold gradient-text">$5.49</span>
<button class="w-10 h-10 rounded-full bg-green-500 hover:bg-green-600 transition flex items-center justify-center">
<i class="fas fa-plus text-white"></i>
</button>
</div>
</div>
</div>
<!-- Product 3 -->
<div class="glass-card p-6 space-y-4 product-card reveal delay-300">
<div class="aspect-square rounded-2xl bg-gradient-to-br from-red-500/20 to-pink-500/20 flex items-center justify-center overflow-hidden">
<div class="text-8xl product-image">π</div>
</div>
<div>
<h3 class="text-xl font-bold heading-font">Berry Bliss</h3>
<p class="text-gray-400 text-sm mb-3">Antioxidant rich</p>
<div class="flex items-center justify-between">
<span class="text-2xl font-bold gradient-text">$5.99</span>
<button class="w-10 h-10 rounded-full bg-red-500 hover:bg-red-600 transition flex items-center justify-center">
<i class="fas fa-plus text-white"></i>
</button>
</div>
</div>
</div>
<!-- Product 4 -->
<div class="glass-card p-6 space-y-4 product-card reveal delay-400">
<div class="aspect-square rounded-2xl bg-gradient-to-br from-yellow-500/20 to-orange-500/20 flex items-center justify-center overflow-hidden">
<div class="text-8xl product-image">π</div>
</div>
<div>
<h3 class="text-xl font-bold heading-font">Pineapple Pop</h3>
<p class="text-gray-400 text-sm mb-3">Island vibes</p>
<div class="flex items-center justify-between">
<span class="text-2xl font-bold gradient-text">$4.79</span>
<button class="w-10 h-10 rounded-full bg-yellow-500 hover:bg-yellow-600 transition flex items-center justify-center">
<i class="fas fa-plus text-white"></i>
</button>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- About Section -->
<section id="about" class="relative py-24 px-6">
<div class="max-w-7xl mx-auto grid md:grid-cols-2 gap-16 items-center">
<div class="space-y-6 reveal">
<p class="text-orange-400 uppercase tracking-widest text-sm font-semibold">Our Story</p>
<h2 class="text-5xl font-bold heading-font leading-tight">
Crafted with <span class="gradient-text">Passion</span>,<br/>
Served with Love
</h2>
<p class="text-gray-400 text-lg leading-relaxed">
Since 2018, we've been on a mission to bring the purest, most delicious organic juices to health-conscious individuals. Every bottle tells a story of sustainable farming, careful selection, and cold-press perfection.
</p>
<p class="text-gray-400 text-lg leading-relaxed">
We partner with local organic farms, ensuring fair trade and environmental responsibility. Our commitment to quality means you get nothing but the bestβnature's candy, liquid sunshine, bottled joy.
</p>
<div class="flex flex-wrap gap-4 pt-4">
<div class="glass-card px-6 py-3 rounded-full">
<p class="text-sm">π <span class="text-gray-400">Sustainable Sourcing</span></p>
</div>
<div class="glass-card px-6 py-3 rounded-full">
<p class="text-sm">π <span class="text-gray-400">Award Winning</span></p>
</div>
<div class="glass-card px-6 py-3 rounded-full">
<p class="text-sm">β€οΈ <span class="text-gray-400">Family Owned</span></p>
</div>
</div>
</div>
<div class="grid grid-cols-2 gap-4 reveal delay-300">
<div class="glass-card p-6 rounded-2xl space-y-2">
<div class="text-4xl">πΎ</div>
<p class="text-3xl font-bold gradient-text">50+</p>
<p class="text-gray-400">Partner Farms</p>
</div>
<div class="glass-card p-6 rounded-2xl space-y-2 mt-12">
<div class="text-4xl">πΉ</div>
<p class="text-3xl font-bold gradient-text">10K+</p>
<p class="text-gray-400">Bottles/Month</p>
</div>
<div class="glass-card p-6 rounded-2xl space-y-2">
<div class="text-4xl">β</div>
<p class="text-3xl font-bold gradient-text">4.9/5</p>
<p class="text-gray-400">Customer Rating</p>
</div>
<div class="glass-card p-6 rounded-2xl space-y-2 mt-12">
<div class="text-4xl">π
</div>
<p class="text-3xl font-bold gradient-text">15+</p>
<p class="text-gray-400">Awards Won</p>
</div>
</div>
</div>
</section>
<!-- Testimonials Section -->
<section class="relative py-24 px-6">
<div class="organic-shape w-80 h-80 bg-yellow-500 bottom-20 left-10"></div>
<div class="max-w-7xl mx-auto relative z-10">
<div class="text-center mb-16 reveal">
<p class="text-orange-400 uppercase tracking-widest text-sm font-semibold mb-4">Testimonials</p>
<h2 class="text-5xl font-bold heading-font">What Our <span class="gradient-text">Customers</span> Say</h2>
</div>
<div class="grid md:grid-cols-3 gap-8">
<div class="glass-card p-8 space-y-4 reveal delay-100">
<div class="flex text-yellow-400 text-xl">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
</div>
<p class="text-gray-300 italic">"Best organic juice I've ever tasted! The orange burst is my morning ritual now. Fresh, natural, and absolutely delicious."</p>
<div class="flex items-center space-x-3 pt-4">
<div class="w-12 h-12 rounded-full bg-gradient-to-br from-orange-500 to-red-500"></div>
<div>
<p class="font-semibold">Sarah Johnson</p>
<p class="text-sm text-gray-400">Fitness Enthusiast</p>
</div>
</div>
</div>
<div class="glass-card p-8 space-y-4 reveal delay-200">
<div class="flex text-yellow-400 text-xl">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
</div>
<p class="text-gray-300 italic">"Finally, a juice brand that doesn't compromise on quality. You can really taste the difference. Highly recommend!"</p>
<div class="flex items-center space-x-3 pt-4">
<div class="w-12 h-12 rounded-full bg-gradient-to-br from-green-500 to-teal-500"></div>
<div>
<p class="font-semibold">Michael Chen</p>
<p class="text-sm text-gray-400">Nutritionist</p>
</div>
</div>
</div>
<div class="glass-card p-8 space-y-4 reveal delay-300">
<div class="flex text-yellow-400 text-xl">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
</div>
<p class="text-gray-300 italic">"Love knowing exactly what I'm drinking. Pure, organic, and packed with vitamins. My whole family is hooked!"</p>
<div class="flex items-center space-x-3 pt-4">
<div class="w-12 h-12 rounded-full bg-gradient-to-br from-yellow-500 to-orange-500"></div>
<div>
<p class="font-semibold">Emma Davis</p>
<p class="text-sm text-gray-400">Mother of Three</p>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- CTA Section -->
<section class="relative py-24 px-6">
<div class="max-w-4xl mx-auto text-center space-y-8 reveal">
<div class="glass-card p-16 rounded-3xl">
<h2 class="text-5xl font-bold heading-font mb-6">
Ready to <span class="gradient-text">Transform</span><br/>
Your Daily Routine?
</h2>
<p class="text-gray-400 text-lg mb-8">
Join thousands of happy customers experiencing the pure joy of organic juices.
</p>
<div class="flex flex-wrap gap-4 justify-center">
<button class="btn-primary px-10 py-4 rounded-full font-semibold text-lg">
<span>Shop Now</span>
</button>
<button class="glass-card px-10 py-4 rounded-full font-semibold text-lg">
Subscribe & Save 20%
</button>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer id="contact" class="relative py-16 px-6 border-t border-white/10">
<div class="max-w-7xl mx-auto">
<div class="grid md:grid-cols-4 gap-12 mb-12">
<div class="space-y-4">
<div class="flex items-center space-x-2">
<div class="w-10 h-10 rounded-full bg-gradient-to-br from-orange-500 to-red-500 flex items-center justify-center">
<i class="fas fa-lemon text-white"></i>
</div>
<span class="text-2xl font-bold heading-font">Pulp</span>
</div>
<p class="text-gray-400">Pure nature, bottled fresh. Experience organic goodness in every sip.</p>
<div class="flex space-x-4">
<a href="#" class="w-10 h-10 rounded-full glass-card flex items-center justify-center hover:bg-orange-500 transition">
<i class="fab fa-facebook-f"></i>
</a>
<a href="#" class="w-10 h-10 rounded-full glass-card flex items-center justify-center hover:bg-orange-500 transition">
<i class="fab fa-instagram"></i>
</a>
<a href="#" class="w-10 h-10 rounded-full glass-card flex items-center justify-center hover:bg-orange-500 transition">
<i class="fab fa-twitter"></i>
</a>
</div>
</div>
<div>
<h3 class="font-bold mb-4 heading-font text-xl">Quick Links</h3>
<ul class="space-y-2 text-gray-400">
<li><a href="#" class="hover:text-orange-400 transition">About Us</a></li>
<li><a href="#" class="hover:text-orange-400 transition">Our Products</a></li>
<li><a href="#" class="hover:text-orange-400 transition">Sustainability</a></li>
<li><a href="#" class="hover:text-orange-400 transition">Blog</a></li>
</ul>
</div>
<div>
<h3 class="font-bold mb-4 heading-font text-xl">Support</h3>
<ul class="space-y-2 text-gray-400">
<li><a href="#" class="hover:text-orange-400 transition">FAQ</a></li>
<li><a href="#" class="hover:text-orange-400 transition">Shipping</a></li>
<li><a href="#" class="hover:text-orange-400 transition">Returns</a></li>
<li><a href="#" class="hover:text-orange-400 transition">Contact</a></li>
</ul>
</div>
<div>
<h3 class="font-bold mb-4 heading-font text-xl">Newsletter</h3>
<p class="text-gray-400 mb-4 text-sm">Subscribe for exclusive offers and updates.</p>
<div class="flex gap-2">
<input type="email" placeholder="Your email" class="flex-1 bg-white/5 border border-white/10 rounded-lg px-4 py-2 focus:outline-none focus:border-orange-400 transition">
<button class="btn-primary px-4 py-2 rounded-lg">
<span><i class="fas fa-arrow-right"></i></span>
</button>
</div>
</div>
</div>
<div class="border-t border-white/10 pt-8 text-center text-gray-400 text-sm">
<p>© 2024 Pulp. All rights reserved. Made with β€οΈ for juice lovers.</p>
</div>
</div>
</footer>
<script>
// Smooth scrolling for navigation links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function (e) {
e.preventDefault();
const target = document.querySelector(this.getAttribute('href'));
if (target) {
target.scrollIntoView({
behavior: 'smooth',
block: 'start'
});
}
});
});
// Reveal on scroll animation
function reveal() {
const reveals = document.querySelectorAll('.reveal');
reveals.forEach(element => {
const windowHeight = window.innerHeight;
const elementTop = element.getBoundingClientRect().top;
const elementVisible = 150;
if (elementTop < windowHeight - elementVisible) {
element.classList.add('active');
}
});
}
window.addEventListener('scroll', reveal);
reveal(); // Check on page load
// Add parallax effect to organic shapes
document.addEventListener('mousemove', (e) => {
const shapes = document.querySelectorAll('.organic-shape');
const mouseX = e.clientX / window.innerWidth;
const mouseY = e.clientY / window.innerHeight;
shapes.forEach((shape, index) => {
const speed = (index + 1) * 20;
const x = (mouseX - 0.5) * speed;
const y = (mouseY - 0.5) * speed;
shape.style.transform = `translate(${x}px, ${y}px)`;
});
});
// Add interactive product cards
const productCards = document.querySelectorAll('.product-card');
productCards.forEach(card => {
card.addEventListener('mouseenter', function() {
this.style.transform = 'translateY(-10px) scale(1.02)';
});
card.addEventListener('mouseleave', function() {
this.style.transform = 'translateY(0) scale(1)';
});
});
// Navbar background on scroll
const nav = document.querySelector('nav');
window.addEventListener('scroll', () => {
if (window.scrollY > 100) {
nav.style.background = 'rgba(10, 10, 10, 0.95)';
} else {
nav.style.background = 'rgba(10, 10, 10, 0.7)';
}
});
</script>
</body>
</html>
|
You are an expert web developer and designer specializing in modern websites. Create a complete, working HTML page with embedded CSS and JavaScript if needed. Feel free to use lightweight libraries like Tailwind CSS to enhance the design as long as they can be rendered in an iframe.
Requirements:
1. Create a fully functional, modern, and responsive website design
2. Use only HTML, CSS, and JavaScript, but feel free to use libraries like Tailwind CSS to make the design better. Libraries such as ThreeJS, react three fiber, drei, @react-three/postprocessing, @react-three/cannon, d3, and recharts as additional libraries can be imported.
3. Include all styles inline within <style> tags
4. Focus on clean layouts, typography, and user experience
5. Implement modern web design trends (gradients, shadows, smooth animations)
6. Ensure excellent mobile responsiveness
7. Include interactive elements where appropriate
8. Make it production-ready and professional
9. You must include all relevant script tags for libraries to work properly.
Return ONLY the complete HTML code, starting with <!DOCTYPE html> and ending with </html>. Do not include any explanations or markdown formatting.
|
Build a fully functional and working habit tracker app
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Habit Tracker</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
padding: 20px;
}
.container {
max-width: 1200px;
margin: 0 auto;
}
.header {
text-align: center;
color: white;
margin-bottom: 40px;
animation: fadeInDown 0.6s ease-out;
}
.header h1 {
font-size: 3rem;
font-weight: 700;
margin-bottom: 10px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}
.header p {
font-size: 1.1rem;
opacity: 0.9;
}
.main-content {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 30px;
margin-bottom: 40px;
}
@media (max-width: 768px) {
.main-content {
grid-template-columns: 1fr;
}
.header h1 {
font-size: 2rem;
}
}
.card {
background: white;
border-radius: 20px;
padding: 30px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: fadeInUp 0.6s ease-out;
}
.card h2 {
color: #333;
font-size: 1.5rem;
margin-bottom: 20px;
display: flex;
align-items: center;
gap: 10px;
}
.card h2::before {
content: '';
display: inline-block;
width: 5px;
height: 30px;
background: linear-gradient(180deg, #667eea, #764ba2);
border-radius: 3px;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
margin-bottom: 8px;
color: #555;
font-weight: 600;
font-size: 0.95rem;
}
.form-group input,
.form-group select,
.form-group textarea {
width: 100%;
padding: 12px 15px;
border: 2px solid #e0e0e0;
border-radius: 10px;
font-size: 1rem;
font-family: inherit;
transition: all 0.3s ease;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}
.btn {
padding: 12px 24px;
border: none;
border-radius: 10px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.btn-primary {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
width: 100%;
}
.btn-primary:hover {
transform: translateY(-2px);
box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}
.btn-secondary {
background: #f0f0f0;
color: #333;
font-size: 0.9rem;
padding: 8px 16px;
}
.btn-secondary:hover {
background: #e0e0e0;
}
.btn-danger {
background: #ff6b6b;
color: white;
font-size: 0.9rem;
padding: 8px 16px;
}
.btn-danger:hover {
background: #ff5252;
}
.btn-success {
background: #51cf66;
color: white;
font-size: 0.9rem;
padding: 8px 16px;
}
.btn-success:hover {
background: #40c057;
}
.habits-list {
display: flex;
flex-direction: column;
gap: 15px;
}
.habit-item {
background: #f8f9fa;
padding: 20px;
border-radius: 15px;
border-left: 5px solid #667eea;
transition: all 0.3s ease;
animation: slideIn 0.3s ease-out;
}
.habit-item:hover {
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
transform: translateX(5px);
}
.habit-item.completed {
border-left-color: #51cf66;
background: #f1fce4;
}
.habit-header {
display: flex;
justify-content: space-between;
align-items: start;
margin-bottom: 12px;
}
.habit-title {
font-size: 1.1rem;
font-weight: 600;
color: #333;
}
.habit-streak {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
padding: 6px 12px;
border-radius: 20px;
font-size: 0.85rem;
font-weight: 600;
}
.habit-description {
color: #666;
font-size: 0.9rem;
margin-bottom: 12px;
}
.habit-frequency {
color: #999;
font-size: 0.85rem;
margin-bottom: 12px;
}
.habit-actions {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.empty-state {
text-align: center;
padding: 40px 20px;
color: #999;
}
.empty-state-icon {
font-size: 3rem;
margin-bottom: 15px;
}
.stats-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 15px;
margin-bottom: 20px;
}
@media (max-width: 600px) {
.stats-grid {
grid-template-columns: 1fr;
}
}
.stat-box {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
padding: 20px;
border-radius: 15px;
text-align: center;
}
.stat-value {
font-size: 2.5rem;
font-weight: 700;
margin-bottom: 5px;
}
.stat-label {
font-size: 0.9rem;
opacity: 0.9;
}
.chart-container {
position: relative;
height: 300px;
margin-top: 20px;
}
.tabs {
display: flex;
gap: 10px;
margin-bottom: 20px;
border-bottom: 2px solid #e0e0e0;
}
.tab {
padding: 12px 20px;
background: none;
border: none;
cursor: pointer;
font-size: 1rem;
font-weight: 600;
color: #999;
border-bottom: 3px solid transparent;
transition: all 0.3s ease;
position: relative;
bottom: -2px;
}
.tab.active {
color: #667eea;
border-bottom-color: #667eea;
}
.tab-content {
display: none;
}
.tab-content.active {
display: block;
animation: fadeIn 0.3s ease-out;
}
.success-badge {
display: inline-flex;
align-items: center;
gap: 5px;
background: #d3f9d8;
color: #2f9e44;
padding: 6px 12px;
border-radius: 20px;
font-size: 0.85rem;
font-weight: 600;
}
.today-section {
margin-bottom: 20px;
}
.today-title {
font-size: 1.2rem;
font-weight: 600;
color: #333;
margin-bottom: 15px;
}
.progress-ring {
transform: rotate(-90deg);
margin: 0 auto;
}
.progress-ring-circle {
transition: stroke-dashoffset 0.35s;
transform-origin: 50% 50%;
}
@keyframes fadeInDown {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateX(-10px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.modal {
display: none;
position: fixed;
z-index: 1000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.5);
animation: fadeIn 0.3s ease-out;
}
.modal.show {
display: flex;
align-items: center;
justify-content: center;
}
.modal-content {
background: white;
padding: 30px;
border-radius: 20px;
max-width: 500px;
width: 90%;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: slideUp 0.3s ease-out;
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.modal-header {
font-size: 1.5rem;
font-weight: 700;
color: #333;
margin-bottom: 20px;
}
.modal-close {
background: none;
border: none;
font-size: 1.5rem;
cursor: pointer;
color: #999;
float: right;
transition: color 0.3s ease;
}
.modal-close:hover {
color: #333;
}
.notification {
position: fixed;
top: 20px;
right: 20px;
background: white;
padding: 15px 25px;
border-radius: 10px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
animation: slideInRight 0.3s ease-out;
z-index: 2000;
}
.notification.success {
border-left: 4px solid #51cf66;
}
.notification.error {
border-left: 4px solid #ff6b6b;
}
@keyframes slideInRight {
from {
opacity: 0;
transform: translateX(30px);
}
to {
opacity: 1;
transform: translateX(0);
}
}
.calendar-mini {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 5px;
margin-top: 15px;
}
.calendar-day {
width: 30px;
height: 30px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 5px;
font-size: 0.8rem;
background: #f0f0f0;
color: #666;
}
.calendar-day.completed {
background: #51cf66;
color: white;
font-weight: 600;
}
.header-actions {
display: flex;
gap: 10px;
justify-content: center;
margin-bottom: 20px;
flex-wrap: wrap;
}
.filter-btn {
padding: 8px 16px;
border: 2px solid rgba(255, 255, 255, 0.5);
background: rgba(255, 255, 255, 0.1);
color: white;
border-radius: 20px;
cursor: pointer;
font-weight: 600;
transition: all 0.3s ease;
}
.filter-btn.active {
background: white;
color: #667eea;
border-color: white;
}
.filter-btn:hover {
background: rgba(255, 255, 255, 0.2);
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>π― Habit Tracker</h1>
<p>Build better habits, one day at a time</p>
<div class="header-actions">
<button class="filter-btn active" onclick="filterHabits('all')">All Habits</button>
<button class="filter-btn" onclick="filterHabits('today')">Today</button>
<button class="filter-btn" onclick="filterHabits('completed')">Completed</button>
</div>
</div>
<div class="main-content">
<!-- Add Habit Card -->
<div class="card">
<h2>Add New Habit</h2>
<form id="habitForm" onsubmit="addHabit(event)">
<div class="form-group">
<label for="habitName">Habit Name</label>
<input type="text" id="habitName" placeholder="e.g., Morning Meditation" required>
</div>
<div class="form-group">
<label for="habitDescription">Description</label>
<textarea id="habitDescription" placeholder="What's your goal?" rows="2"></textarea>
</div>
<div class="form-group">
<label for="habitFrequency">Frequency</label>
<select id="habitFrequency" required>
<option value="daily">Daily</option>
<option value="weekly">Weekly</option>
<option value="custom">Custom</option>
</select>
</div>
<div class="form-group">
<label for="habitColor">Color</label>
<select id="habitColor" required>
<option value="#667eea">Purple</option>
<option value="#51cf66">Green</option>
<option value="#ff6b6b">Red</option>
<option value="#ffa94d">Orange</option>
<option value="#74c0fc">Blue</option>
</select>
</div>
<button type="submit" class="btn btn-primary">+ Add Habit</button>
</form>
</div>
<!-- Habits Display Card -->
<div class="card">
<div class="tabs">
<button class="tab active" onclick="switchTab('habits-today')">Today</button>
<button class="tab" onclick="switchTab('habits-all')">All Habits</button>
<button class="tab" onclick="switchTab('stats')">Statistics</button>
</div>
<!-- Today Tab -->
<div id="habits-today" class="tab-content active">
<div class="today-section">
<div class="stat-box" style="margin-bottom: 20px;">
<div class="stat-value" id="todayProgress">0%</div>
<div class="stat-label">Today's Progress</div>
</div>
<div id="todayHabits" class="habits-list">
<div class="empty-state">
<div class="empty-state-icon">π</div>
<p>No habits added yet. Start by adding your first habit!</p>
</div>
</div>
</div>
</div>
<!-- All Habits Tab -->
<div id="habits-all" class="tab-content">
<div id="allHabits" class="habits-list">
<div class="empty-state">
<div class="empty-state-icon">π</div>
<p>No habits added yet. Start by adding your first habit!</p>
</div>
</div>
</div>
<!-- Statistics Tab -->
<div id="stats" class="tab-content">
<div class="stats-grid">
<div class="stat-box">
<div class="stat-value" id="totalHabits">0</div>
<div class="stat-label">Total Habits</div>
</div>
<div class="stat-box">
<div class="stat-value" id="completedToday">0</div>
<div class="stat-label">Completed Today</div>
</div>
<div class="stat-box">
<div class="stat-value" id="bestStreak">0</div>
<div class="stat-label">Best Streak</div>
</div>
<div class="stat-box">
<div class="stat-value" id="totalCompleted">0</div>
<div class="stat-label">Total Completed</div>
</div>
</div>
<div class="chart-container">
<canvas id="statsChart"></canvas>
</div>
</div>
</div>
</div>
</div>
<!-- Modal for editing habits -->
<div id="editModal" class="modal">
<div class="modal-content">
<button class="modal-close" onclick="closeEditModal()">×</button>
<div class="modal-header">Edit Habit</div>
<form id="editForm" onsubmit="updateHabit(event)">
<input type="hidden" id="editHabitId">
<div class="form-group">
<label for="editHabitName">Habit Name</label>
<input type="text" id="editHabitName" required>
</div>
<div class="form-group">
<label for="editHabitDescription">Description</label>
<textarea id="editHabitDescription" rows="2"></textarea>
</div>
<div class="form-group">
<label for="editHabitFrequency">Frequency</label>
<select id="editHabitFrequency" required>
<option value="daily">Daily</option>
<option value="weekly">Weekly</option>
<option value="custom">Custom</option>
</select>
</div>
<button type="submit" class="btn btn-primary">Save Changes</button>
</form>
</div>
</div>
<script>
// Initialize data structure
let habits = JSON.parse(localStorage.getItem('habits')) || [];
let currentFilter = 'all';
let statsChart = null;
// Add habit
function addHabit(event) {
event.preventDefault();
const name = document.getElementById('habitName').value;
const description = document.getElementById('habitDescription').value;
const frequency = document.getElementById('habitFrequency').value;
const color = document.getElementById('habitColor').value;
const habit = {
id: Date.now(),
name: name,
description: description,
frequency: frequency,
color: color,
createdDate: new Date().toISOString().split('T')[0],
completedDates: [],
streak: 0
};
habits.push(habit);
saveHabits();
document.getElementById('habitForm').reset();
renderHabits();
showNotification('Habit added successfully!', 'success');
}
// Delete habit
function deleteHabit(id) {
if (confirm('Are you sure you want to delete this habit?')) {
habits = habits.filter(h => h.id !== id);
saveHabits();
renderHabits();
showNotification('Habit deleted', 'success');
}
}
// Toggle habit completion
function toggleHabit(id) {
const habit = habits.find(h => h.id === id);
if (!habit) return;
const today = new Date().toISOString().split('T')[0];
const index = habit.completedDates.indexOf(today);
if (index > -1) {
habit.completedDates.splice(index, 1);
} else {
habit.completedDates.push(today);
}
updateStreak(habit);
saveHabits();
renderHabits();
updateStatistics();
}
// Update streak calculation
function updateStreak(habit) {
let streak = 0;
let currentDate = new Date();
while (true) {
const dateStr = currentDate.toISOString().split('T')[0];
if (habit.completedDates.includes(dateStr)) {
streak++;
currentDate.setDate(currentDate.getDate() - 1);
} else {
break;
}
}
habit.streak = streak;
}
// Save to localStorage
function saveHabits() {
localStorage.setItem('habits', JSON.stringify(habits));
}
// Render habits
function renderHabits() {
const todayHabits = document.getElementById('todayHabits');
const allHabits = document.getElementById('allHabits');
const today = new Date().toISOString().split('T')[0];
const filteredHabits = habits.filter(h => {
if (currentFilter === 'today') {
return true; // Show all for today view
} else if (currentFilter === 'completed') {
return h.completedDates.includes(today);
}
return true; // all
});
// Render today's habits
if (filteredHabits.length === 0) {
todayHabits.innerHTML = `
<div class="empty-state">
<div class="empty-state-icon">π</div>
<p>No habits to complete today. Add one to get started!</p>
</div>
`;
allHabits.innerHTML = todayHabits.innerHTML;
} else {
todayHabits.innerHTML = filteredHabits.map(habit => createHabitElement(habit, today)).join('');
allHabits.innerHTML = habits.map(habit => createHabitElement(habit, today)).join('');
}
updateStatistics();
}
// Create habit element
function createHabitElement(habit, today) {
const isCompleted = habit.completedDates.includes(today);
const lastDays = getLastSevenDays(habit);
return `
<div class="habit-item ${isCompleted ? 'completed' : ''}" style="border-left-color: ${habit.color}">
<div class="habit-header">
<div>
<div class="habit-title">${habit.name}</div>
${habit.description ? `<div class="habit-description">${habit.description}</div>` : ''}
<div class="habit-frequency">π
${habit.frequency.charAt(0).toUpperCase() + habit.frequency.slice(1)}</div>
</div>
<div class="habit-streak" style="background: linear-gradient(135deg, ${habit.color}, ${shadeColor(habit.color, 20)})">
π₯ ${habit.streak}
</div>
</div>
<div class="calendar-mini">
${lastDays.map(day => `
<div class="calendar-day ${habit.completedDates.includes(day) ? 'completed' : ''}">
${new Date(day).getDate()}
</div>
`).join('')}
</div>
<div class="habit-actions">
<button class="btn ${isCompleted ? 'btn-secondary' : 'btn-success'}" onclick="toggleHabit(${habit.id})">
${isCompleted ? 'β Completed' : '+ Complete'}
</button>
<button class="btn btn-secondary" onclick="editHabit(${habit.id})">Edit</button>
<button class="btn btn-danger" onclick="deleteHabit(${habit.id})">Delete</button>
</div>
</div>
`;
}
// Get last 7 days
function getLastSevenDays(habit) {
const days = [];
for (let i = 6; i >= 0; i--) {
const date = new Date();
date.setDate(date.getDate() - i);
days.push(date.toISOString().split('T')[0]);
}
return days;
}
// Edit habit
function editHabit(id) {
const habit = habits.find(h => h.id === id);
if (!habit) return;
document.getElementById('editHabitId').value = habit.id;
document.getElementById('editHabitName').value = habit.name;
document.getElementById('editHabitDescription').value = habit.description;
document.getElementById('editHabitFrequency').value = habit.frequency;
document.getElementById('editModal').classList.add('show');
}
// Update habit
function updateHabit(event) {
event.preventDefault();
const id = parseInt(document.getElementById('editHabitId').value);
const habit = habits.find(h => h.id === id);
if (!habit) return;
habit.name = document.getElementById('editHabitName').value;
habit.description = document.getElementById('editHabitDescription').value;
habit.frequency = document.getElementById('editHabitFrequency').value;
saveHabits();
renderHabits();
closeEditModal();
showNotification('Habit updated successfully!', 'success');
}
// Close edit modal
function closeEditModal() {
document.getElementById('editModal').classList.remove('show');
}
// Switch tabs
function switchTab(tabName) {
document.querySelectorAll('.tab-content').forEach(el => el.classList.remove('active'));
document.querySelectorAll('.tab').forEach(el => el.classList.remove('active'));
document.getElementById(tabName).classList.add('active');
event.target.classList.add('active');
if (tabName === 'stats') {
setTimeout(() => updateChart(), 100);
}
}
// Filter habits
function filterHabits(filter) {
currentFilter = filter;
document.querySelectorAll('.filter-btn').forEach(btn => btn.classList.remove('active'));
event.target.classList.add('active');
renderHabits();
}
// Update statistics
function updateStatistics() {
const today = new Date().toISOString().split('T')[0];
const completedToday = habits.filter(h => h.completedDates.includes(today)).length;
const totalCompleted = habits.reduce((sum, h) => sum + h.completedDates.length, 0);
const bestStreak = Math.max(0, ...habits.map(h => h.streak));
const todayProgress = habits.length > 0 ? Math.round((completedToday / habits.length) * 100) : 0;
document.getElementById('totalHabits').textContent = habits.length;
document.getElementById('completedToday').textContent = completedToday;
document.getElementById('bestStreak').textContent = bestStreak;
document.getElementById('totalCompleted').textContent = totalCompleted;
document.getElementById('todayProgress').textContent = todayProgress + '%';
}
// Update chart
function updateChart() {
const ctx = document.getElementById('statsChart');
if (!ctx) return;
const last7Days = [];
const completionData = [];
for (let i = 6; i >= 0; i--) {
const date = new Date();
date.setDate(date.getDate() - i);
const dateStr = date.toISOString().split('T')[0];
last7Days.push(date.toLocaleDateString('en-US', { weekday: 'short' }));
const completed = habits.filter(h => h.completedDates.includes(dateStr)).length;
completionData.push(completed);
}
if (statsChart) {
statsChart.destroy();
}
statsChart = new Chart(ctx, {
type: 'line',
data: {
labels: last7Days,
datasets: [{
label: 'Completed Habits',
data: completionData,
borderColor: '#667eea',
backgroundColor: 'rgba(102, 126, 234, 0.1)',
borderWidth: 3,
fill: true,
tension: 0.4,
pointBackgroundColor: '#667eea',
pointBorderColor: 'white',
pointBorderWidth: 2,
pointRadius: 6,
pointHoverRadius: 8
}]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: {
display: true,
labels: {
usePointStyle: true,
padding: 20,
font: { size: 12, weight: 'bold' }
}
}
},
scales: {
y: {
beginAtZero: true,
max: Math.max(...completionData, habits.length),
grid: {
color: 'rgba(0, 0, 0, 0.05)'
}
},
x: {
grid: {
display: false
}
}
}
}
});
}
// Show notification
function showNotification(message, type) {
const notification = document.createElement('div');
notification.className = `notification ${type}`;
notification.textContent = message;
document.body.appendChild(notification);
setTimeout(() => {
notification.style.animation = 'fadeIn 0.3s ease-out reverse';
setTimeout(() => notification.remove(), 300);
}, 3000);
}
// Shade color helper
function shadeColor(color, percent) {
let R = parseInt(color.substring(1,3), 16);
let G = parseInt(color.substring(3,5), 16);
let B = parseInt(color.substring(5,7), 16);
R = parseInt(R * (100 + percent) / 100);
G = parseInt(G * (100 + percent) / 100);
B = parseInt(B * (100 + percent) / 100);
R = (R<255)?R:255;
G = (G<255)?G:255;
B = (B<255)?B:255;
let RR = ((R.toString(16).length==1)?"0"+R.toString(16):R.toString(16));
let GG = ((G.toString(16).length==1)?"0"+G.toString(16):G.toString(16));
let BB = ((B.toString(16).length==1)?"0"+B.toString(16):B.toString(16));
return "#"+RR+GG+BB;
}
// Close modal when clicking outside
window.onclick = function(event) {
const modal = document.getElementById('editModal');
if (event.target === modal) {
modal.classList.remove('show');
}
};
// Initial render
renderHabits();
</script>
</body>
</html>
|
You are an expert web developer and designer specializing in modern websites. Create a complete, working HTML page with embedded CSS and JavaScript if needed. Feel free to use lightweight libraries like Tailwind CSS to enhance the design as long as they can be rendered in an iframe.
Requirements:
1. Create a fully functional, modern, and responsive website design
2. Use only HTML, CSS, and JavaScript, but feel free to use libraries like Tailwind CSS to make the design better. Libraries such as ThreeJS, react three fiber, drei, @react-three/postprocessing, @react-three/cannon, d3, and recharts as additional libraries can be imported.
3. Include all styles inline within <style> tags
4. Focus on clean layouts, typography, and user experience
5. Implement modern web design trends (gradients, shadows, smooth animations)
6. Ensure excellent mobile responsiveness
7. Include interactive elements where appropriate
8. Make it production-ready and professional
9. You must include all relevant script tags for libraries to work properly.
Return ONLY the complete HTML code, starting with <!DOCTYPE html> and ending with </html>. Do not include any explanations or markdown formatting.
|
Build a web app that generates video script based on the trends of the internet and the vibe of the creator
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ScriptAI - Video Script Generator</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
overflow-x: hidden;
}
.container {
max-width: 1400px;
margin: 0 auto;
padding: 20px;
}
.header {
text-align: center;
color: white;
margin-bottom: 40px;
animation: slideDown 0.6s ease-out;
}
.header h1 {
font-size: 3.5rem;
font-weight: 800;
margin-bottom: 10px;
background: linear-gradient(135deg, #fff 0%, #e0e0ff 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
}
.header p {
font-size: 1.1rem;
opacity: 0.95;
letter-spacing: 0.5px;
}
.main-content {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 30px;
margin-bottom: 30px;
animation: fadeIn 0.8s ease-out 0.2s both;
}
@media (max-width: 1024px) {
.main-content {
grid-template-columns: 1fr;
}
}
.card {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
border-radius: 20px;
padding: 30px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
transition: all 0.3s ease;
}
.card:hover {
transform: translateY(-5px);
box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
}
.card h2 {
color: #667eea;
font-size: 1.5rem;
margin-bottom: 20px;
display: flex;
align-items: center;
gap: 10px;
}
.card h2::before {
content: '';
display: inline-block;
width: 4px;
height: 24px;
background: linear-gradient(135deg, #667eea, #764ba2);
border-radius: 2px;
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
margin-bottom: 8px;
color: #333;
font-weight: 600;
font-size: 0.95rem;
}
.form-group input,
.form-group textarea,
.form-group select {
width: 100%;
padding: 12px 15px;
border: 2px solid #e0e0e0;
border-radius: 10px;
font-size: 1rem;
transition: all 0.3s ease;
font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
background-color: #f8f8ff;
}
.form-group textarea {
resize: vertical;
min-height: 100px;
}
.vibe-options {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
gap: 10px;
}
.vibe-option {
position: relative;
}
.vibe-option input[type="radio"] {
display: none;
}
.vibe-option label {
display: flex;
align-items: center;
justify-content: center;
padding: 12px;
border: 2px solid #e0e0e0;
border-radius: 10px;
cursor: pointer;
transition: all 0.3s ease;
background: white;
margin: 0;
min-height: 60px;
}
.vibe-option input[type="radio"]:checked + label {
border-color: #667eea;
background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
font-weight: 600;
color: #667eea;
}
.trend-tags {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 15px;
}
.trend-tag {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 12px;
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
border-radius: 20px;
cursor: pointer;
transition: all 0.3s ease;
font-size: 0.9rem;
border: none;
}
.trend-tag:hover {
transform: scale(1.05);
box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}
.trend-tag.selected {
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}
.button {
padding: 14px 32px;
border: none;
border-radius: 10px;
font-size: 1rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
display: inline-flex;
align-items: center;
gap: 8px;
}
.btn-generate {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
width: 100%;
justify-content: center;
margin-top: 10px;
}
.btn-generate:hover {
transform: translateY(-2px);
box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}
.btn-generate:active {
transform: translateY(0);
}
.btn-generate.loading {
opacity: 0.7;
pointer-events: none;
}
.loading-spinner {
display: inline-block;
width: 16px;
height: 16px;
border: 3px solid rgba(255, 255, 255, 0.3);
border-top-color: white;
border-radius: 50%;
animation: spin 0.8s linear infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.output-section {
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
border-radius: 20px;
padding: 30px;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: fadeIn 0.8s ease-out 0.4s both;
}
.output-section h2 {
color: #667eea;
font-size: 1.5rem;
margin-bottom: 20px;
display: flex;
align-items: center;
gap: 10px;
}
.output-section h2::before {
content: '';
display: inline-block;
width: 4px;
height: 24px;
background: linear-gradient(135deg, #667eea, #764ba2);
border-radius: 2px;
}
.script-output {
background: #f8f8ff;
border-left: 4px solid #667eea;
padding: 20px;
border-radius: 10px;
line-height: 1.8;
color: #333;
margin-bottom: 20px;
max-height: 500px;
overflow-y: auto;
}
.script-output p {
margin-bottom: 12px;
}
.script-output strong {
color: #667eea;
}
.empty-state {
text-align: center;
padding: 40px 20px;
color: #999;
}
.empty-state svg {
width: 80px;
height: 80px;
margin-bottom: 20px;
opacity: 0.5;
}
.action-buttons {
display: flex;
gap: 10px;
flex-wrap: wrap;
}
.btn-action {
flex: 1;
min-width: 120px;
padding: 12px 20px;
background: #f0f0f0;
color: #333;
border: 2px solid #e0e0e0;
border-radius: 10px;
cursor: pointer;
transition: all 0.3s ease;
font-weight: 600;
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
}
.btn-action:hover {
background: #667eea;
color: white;
border-color: #667eea;
}
.stats {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 15px;
margin-top: 20px;
}
.stat-card {
background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
padding: 15px;
border-radius: 10px;
border: 2px solid rgba(102, 126, 234, 0.2);
}
.stat-label {
color: #999;
font-size: 0.85rem;
margin-bottom: 5px;
}
.stat-value {
color: #667eea;
font-size: 1.5rem;
font-weight: 700;
}
@keyframes slideDown {
from {
opacity: 0;
transform: translateY(-30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeIn {
from {
opacity: 0;
}
to {
opacity: 1;
}
}
.toast {
position: fixed;
bottom: 20px;
right: 20px;
background: #333;
color: white;
padding: 15px 20px;
border-radius: 10px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
animation: slideUp 0.3s ease-out;
z-index: 1000;
}
@keyframes slideUp {
from {
opacity: 0;
transform: translateY(20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.tooltip {
position: relative;
display: inline-block;
cursor: help;
margin-left: 5px;
}
.tooltip::after {
content: attr(data-tooltip);
position: absolute;
bottom: 125%;
left: 50%;
transform: translateX(-50%);
background: #333;
color: white;
padding: 8px 12px;
border-radius: 6px;
font-size: 0.85rem;
white-space: nowrap;
opacity: 0;
pointer-events: none;
transition: opacity 0.3s ease;
z-index: 1000;
}
.tooltip:hover::after {
opacity: 1;
}
.section-divider {
height: 1px;
background: linear-gradient(90deg, transparent, #e0e0e0, transparent);
margin: 30px 0;
}
.featured-trends {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
gap: 10px;
margin-top: 15px;
}
.feature-badge {
background: linear-gradient(135deg, #667eea, #764ba2);
color: white;
padding: 8px 12px;
border-radius: 8px;
text-align: center;
font-size: 0.9rem;
cursor: pointer;
transition: all 0.3s ease;
font-weight: 500;
}
.feature-badge:hover {
transform: scale(1.05);
}
.feature-badge.active {
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}
.demo-content {
background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(118, 75, 162, 0.05));
padding: 20px;
border-radius: 10px;
margin-top: 20px;
border: 2px dashed rgba(102, 126, 234, 0.2);
}
.demo-content h3 {
color: #667eea;
margin-bottom: 10px;
font-size: 1.1rem;
}
.demo-content p {
color: #666;
line-height: 1.6;
margin-bottom: 8px;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<h1>β¨ ScriptAI</h1>
<p>Generate viral video scripts powered by trending topics and your unique vibe</p>
</div>
<div class="main-content">
<!-- Input Section -->
<div class="card">
<h2>Create Your Script</h2>
<div class="form-group">
<label for="topic">Video Topic
<span class="tooltip" data-tooltip="What your video is about">β</span>
</label>
<input type="text" id="topic" placeholder="e.g., morning routine, productivity hacks, tech review..." />
</div>
<div class="form-group">
<label>Creator Vibe
<span class="tooltip" data-tooltip="Your unique style and personality">β</span>
</label>
<div class="vibe-options">
<div class="vibe-option">
<input type="radio" id="vibe-energetic" name="vibe" value="energetic" checked>
<label for="vibe-energetic">β‘ Energetic</label>
</div>
<div class="vibe-option">
<input type="radio" id="vibe-chill" name="vibe" value="chill">
<label for="vibe-chill">π Chill</label>
</div>
<div class="vibe-option">
<input type="radio" id="vibe-educational" name="vibe" value="educational">
<label for="vibe-educational">π Educational</label>
</div>
<div class="vibe-option">
<input type="radio" id="vibe-funny" name="vibe" value="funny">
<label for="vibe-funny">π Funny</label>
</div>
<div class="vibe-option">
<input type="radio" id="vibe-serious" name="vibe" value="serious">
<label for="vibe-serious">π― Serious</label>
</div>
<div class="vibe-option">
<input type="radio" id="vibe-motivational" name="vibe" value="motivational">
<label for="vibe-motivational">π Motivational</label>
</div>
</div>
</div>
<div class="form-group">
<label>Internet Trends
<span class="tooltip" data-tooltip="Select trending formats and topics">β</span>
</label>
<div class="featured-trends" id="trendsList"></div>
</div>
<div class="form-group">
<label for="details">Additional Details</label>
<textarea id="details" placeholder="Add specific points, jokes, or details you want included..."></textarea>
</div>
<div class="form-group">
<label for="duration">Video Duration
<span class="tooltip" data-tooltip="Approximate length of video">β</span>
</label>
<select id="duration">
<option value="short">Short (0-1 min)</option>
<option value="medium" selected>Medium (1-3 min)</option>
<option value="long">Long (3-10 min)</option>
</select>
</div>
<button class="btn-generate" id="generateBtn">
Generate Script
</button>
</div>
<!-- Trending & Tips Section -->
<div class="card">
<h2>Trending Now</h2>
<div class="demo-content">
<h3>π₯ Hot Topics</h3>
<p>β’ AI tools & automation</p>
<p>β’ Side hustle ideas</p>
<p>β’ Mental health tips</p>
<p>β’ Fitness transformations</p>
</div>
<div class="section-divider"></div>
<h3 style="color: #667eea; margin-bottom: 15px;">π‘ Pro Tips</h3>
<div style="color: #666; line-height: 1.8;">
<p><strong>Hook First:</strong> Grab attention in the first 3 seconds</p>
<p style="margin-top: 10px;"><strong>Be Authentic:</strong> Match your actual personality and vibe</p>
<p style="margin-top: 10px;"><strong>Add Value:</strong> Share tips, insights, or entertainment</p>
<p style="margin-top: 10px;"><strong>Call to Action:</strong> End with engagement request</p>
</div>
<div class="section-divider"></div>
<div class="stats">
<div class="stat-card">
<div class="stat-label">Scripts Generated</div>
<div class="stat-value" id="scriptCount">0</div>
</div>
<div class="stat-card">
<div class="stat-label">Avg. Words</div>
<div class="stat-value" id="avgWords">0</div>
</div>
<div class="stat-card">
<div class="stat-label">Trending Used</div>
<div class="stat-value" id="trendingUsed">0</div>
</div>
</div>
</div>
</div>
<!-- Output Section -->
<div class="output-section">
<h2>Your Generated Script</h2>
<div class="script-output" id="scriptOutput">
<div class="empty-state">
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path>
<path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path>
</svg>
<p>Your script will appear here. Fill in the form and click "Generate Script" to begin!</p>
</div>
</div>
<div class="action-buttons" id="actionButtons" style="display: none;">
<button class="btn-action" onclick="copyToClipboard()">π Copy</button>
<button class="btn-action" onclick="downloadScript()">β¬οΈ Download</button>
<button class="btn-action" onclick="regenerateScript()">π Regenerate</button>
</div>
</div>
</div>
<script>
// Trend data
const trendData = [
{ id: 1, name: 'π± TikTok Hook', category: 'format' },
{ id: 2, name: 'π¬ Story Format', category: 'format' },
{ id: 3, name: 'π¬ Question Hook', category: 'hook' },
{ id: 4, name: 'π€ Relatable Content', category: 'style' },
{ id: 5, name: 'β‘ Trending Sounds', category: 'style' },
{ id: 6, name: 'π― Niche Audience', category: 'strategy' },
{ id: 7, name: 'π‘ Educational Value', category: 'style' },
{ id: 8, name: 'π₯ Controversy/Take', category: 'strategy' },
];
let selectedTrends = [];
let generatedScripts = 0;
let totalWords = 0;
let currentScript = '';
// Initialize trends
function initTrends() {
const trendsList = document.getElementById('trendsList');
trendData.forEach(trend => {
const badge = document.createElement('div');
badge.className = 'feature-badge';
badge.textContent = trend.name;
badge.dataset.id = trend.id;
badge.onclick = () => toggleTrend(trend.id, badge);
trendsList.appendChild(badge);
});
}
function toggleTrend(id, element) {
if (selectedTrends.includes(id)) {
selectedTrends = selectedTrends.filter(t => t !== id);
element.classList.remove('active');
} else {
selectedTrends.push(id);
element.classList.add('active');
}
}
// Generate script with AI simulation
document.getElementById('generateBtn').addEventListener('click', generateScript);
async function generateScript() {
const topic = document.getElementById('topic').value;
const vibe = document.querySelector('input[name="vibe"]:checked').value;
const details = document.getElementById('details').value;
const duration = document.getElementById('duration').value;
if (!topic.trim()) {
showToast('Please enter a video topic!');
return;
}
const generateBtn = document.getElementById('generateBtn');
generateBtn.classList.add('loading');
generateBtn.innerHTML = '<span class="loading-spinner"></span> Generating...';
// Simulate API call
await new Promise(resolve => setTimeout(resolve, 2000));
const script = generateScriptContent(topic, vibe, details, duration);
displayScript(script);
// Update stats
generatedScripts++;
totalWords += script.split(' ').length;
document.getElementById('scriptCount').textContent = generatedScripts;
document.getElementById('avgWords').textContent = Math.round(totalWords / generatedScripts);
document.getElementById('trendingUsed').textContent = selectedTrends.length;
generateBtn.classList.remove('loading');
generateBtn.innerHTML = 'Generate Script';
showToast('Script generated successfully!');
}
function generateScriptContent(topic, vibe, details, duration) {
const vibeDescriptions = {
energetic: 'high-energy, fast-paced, enthusiastic',
chill: 'relaxed, laid-back, casual',
educational: 'informative, detailed, structured',
funny: 'humorous, witty, entertaining',
serious: 'professional, authoritative, focused',
motivational: 'inspiring, empowering, uplifting'
};
const hooks = {
energetic: [
`Wait till you see this ${topic}!`,
`This ${topic} trick BLEW MY MIND!`,
`POV: You just discovered the best ${topic} hack!`
],
chill: [
`Let me tell you about ${topic}...`,
`So here's the thing about ${topic}`,
`Real talk: ${topic} changed my life`
],
educational: [
`Today we're breaking down ${topic}`,
`Here's everything you need to know about ${topic}`,
`Let me teach you about ${topic} in 60 seconds`
],
funny: [
`This ${topic} joke never gets old`,
`Nobody talks about ${topic} like this!`,
`The truth about ${topic} is hilarious`
],
serious: [
`Let's be honest about ${topic}`,
`The reality of ${topic} most people ignore`,
`Critical analysis: ${topic} explained`
],
motivational: [
`Your ${topic} journey starts NOW`,
`Here's why ${topic} will change everything`,
`The ${topic} mindset that transforms lives`
]
};
const hooks_arr = hooks[vibe];
const selectedHook = hooks_arr[Math.floor(Math.random() * hooks_arr.length)];
let script = `[HOOK - First 3 seconds]\n${selectedHook}\n\n`;
script += `[INTRO]\nHey everyone! Today I want to share something amazing about ${topic}. If you're interested in ${topic} or want to level up your ${topic} game, stick around.\n\n`;
if (selectedTrends.length > 0) {
script += `[TRENDING ELEMENTS]\n`;
selectedTrends.forEach((trendId) => {
const trend = trendData.find(t => t.id === trendId);
if (trend) {
script += `β’ Include ${trend.name.toLowerCase()}\n`;
}
});
script += '\n';
}
script += `[MAIN CONTENT]\n`;
script += `The key to mastering ${topic} is understanding these three fundamentals:\n\n`;
script += `1. **Foundation**: Start with the basics of ${topic}. Most people skip this step, but it's crucial.\n`;
script += `2. **Practice**: Apply what you learn about ${topic} consistently. This is where the real growth happens.\n`;
script += `3. **Optimization**: Fine-tune your approach to ${topic} based on your results.\n\n`;
if (details.trim()) {
script += `[YOUR DETAILS]\n${details}\n\n`;
}
script += `[STORY/EXAMPLE]\n`;
script += `When I first started with ${topic}, I was making all the classic mistakes. But then I discovered this one thing that completely changed my perspective. Now I'm seeing incredible results, and you can too.\n\n`;
script += `[VALUE ADD]\n`;
script += `Here's the actionable takeaway: Focus on one aspect of ${topic} at a time. Don't try to do everything at once. Pick the one thing that resonates with you most and master it first.\n\n`;
script += `[CALL TO ACTION]\n`;
script += `If you found this helpful, drop a comment telling me what surprised you most about ${topic}. Don't forget to like and subscribe for more content on ${topic}. Thanks for watching!\n\n`;
script += `[OUTRO]\n`;
script += `See you in the next one! π`;
return script;
}
function displayScript(script) {
currentScript = script;
const output = document.getElementById('scriptOutput');
const actionButtons = document.getElementById('actionButtons');
const formattedScript = script
.replace(/\[([^\]]+)\]/g, '<strong>[$1]</strong>')
.replace(/\*\*([^\*]+)\*\*/g, '<strong>$1</strong>')
.replace(/\n\n/g, '</p><p>')
.replace(/\n/g, '<br>');
output.innerHTML = `<p>${formattedScript}</p>`;
actionButtons.style.display = 'flex';
}
function copyToClipboard() {
navigator.clipboard.writeText(currentScript).then(() => {
showToast('Script copied to clipboard!');
});
}
function downloadScript() {
const element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(currentScript));
element.setAttribute('download', 'script.txt');
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
showToast('Script downloaded!');
}
function regenerateScript() {
document.getElementById('generateBtn').click();
}
function showToast(message) {
const toast = document.createElement('div');
toast.className = 'toast';
toast.textContent = message;
document.body.appendChild(toast);
setTimeout(() => {
toast.style.animation = 'slideUp 0.3s ease-out reverse';
setTimeout(() => toast.remove(), 300);
}, 2500);
}
// Initialize
initTrends();
</script>
</body>
</html>
|
You are an expert web developer and designer specializing in modern websites. Create a complete, working HTML page with embedded CSS and JavaScript if needed. Feel free to use lightweight libraries like Tailwind CSS to enhance the design as long as they can be rendered in an iframe.
Requirements:
1. Create a fully functional, modern, and responsive website design
2. Use only HTML, CSS, and JavaScript, but feel free to use libraries like Tailwind CSS to make the design better. Libraries such as ThreeJS, react three fiber, drei, @react-three/postprocessing, @react-three/cannon, d3, and recharts as additional libraries can be imported.
3. Include all styles inline within <style> tags
4. Focus on clean layouts, typography, and user experience
5. Implement modern web design trends (gradients, shadows, smooth animations)
6. Ensure excellent mobile responsiveness
7. Include interactive elements where appropriate
8. Make it production-ready and professional
9. You must include all relevant script tags for libraries to work properly.
Return ONLY the complete HTML code, starting with <!DOCTYPE html> and ending with </html>. Do not include any explanations or markdown formatting.
|
Create a website for a bank with all the nesseccary pages...dashboard, landingpage, settings, just everything...do not be lazy just do it....
|
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SecureBank | Modern Banking Solutions</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Poppins', sans-serif;
}
:root {
--primary: #2563eb;
--primary-dark: #1d4ed8;
--secondary: #0ea5e9;
--accent: #8b5cf6;
--success: #10b981;
--warning: #f59e0b;
--danger: #ef4444;
--dark: #1e293b;
--light: #f8fafc;
--gray: #94a3b8;
}
body {
background-color: #f1f5f9;
color: var(--dark);
}
.container {
width: 100%;
max-width: 1400px;
margin: 0 auto;
padding: 0 20px;
}
/* Navigation */
nav {
background: linear-gradient(90deg, var(--primary), var(--secondary));
color: white;
padding: 1rem 0;
position: sticky;
top: 0;
z-index: 100;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}
.nav-container {
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
display: flex;
align-items: center;
gap: 10px;
font-weight: 700;
font-size: 1.5rem;
}
.logo i {
font-size: 2rem;
color: var(--light);
}
.nav-links {
display: flex;
gap: 1.5rem;
align-items: center;
}
.nav-links a {
color: var(--light);
text-decoration: none;
font-weight: 500;
transition: all 0.3s ease;
padding: 0.5rem 0.75rem;
border-radius: 4px;
}
.nav-links a:hover {
background: rgba(255, 255, 255, 0.1);
}
.nav-actions {
display: flex;
gap: 1rem;
align-items: center;
}
.btn {
padding: 0.5rem 1.25rem;
border-radius: 50px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
border: none;
font-size: 0.9rem;
}
.btn-primary {
background-color: var(--light);
color: var(--primary);
}
.btn-outline {
background: transparent;
color: var(--light);
border: 1px solid var(--light);
}
.mobile-menu-btn {
display: none;
background: none;
border: none;
color: white;
font-size: 1.5rem;
cursor: pointer;
}
/* Hero Section */
.hero {
background: linear-gradient(135deg, #e0f2fe, #dbeafe);
padding: 5rem 0;
position: relative;
overflow: hidden;
}
.hero::before {
content: "";
position: absolute;
width: 300px;
height: 300px;
border-radius: 50%;
background: var(--accent);
opacity: 0.1;
top: -150px;
right: -150px;
}
.hero::after {
content: "";
position: absolute;
width: 200px;
height: 200px;
border-radius: 50%;
background: var(--success);
opacity: 0.1;
bottom: -100px;
left: -100px;
}
.hero-content {
display: flex;
align-items: center;
gap: 4rem;
position: relative;
z-index: 1;
}
.hero-text {
flex: 1;
}
.hero-image {
flex: 1;
display: flex;
justify-content: center;
}
.hero-image img {
max-width: 100%;
border-radius: 20px;
box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.hero h1 {
font-size: 3.5rem;
font-weight: 700;
line-height: 1.2;
margin-bottom: 1.5rem;
color: var(--dark);
}
.hero p {
font-size: 1.25rem;
color: var(--dark);
opacity: 0.8;
margin-bottom: 2rem;
}
.btn-group {
display: flex;
gap: 1rem;
margin-top: 2rem;
}
.btn-lg {
padding: 0.75rem 2rem;
font-size: 1rem;
}
/* Dashboard */
.dashboard {
padding: 4rem 0;
display: none;
}
.dashboard-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 2rem;
}
.section-title {
font-size: 2rem;
font-weight: 700;
color: var(--dark);
}
.cards {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
margin-bottom: 3rem;
}
.card {
background: white;
border-radius: 16px;
padding: 1.5rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
transition: all 0.3s ease;
}
.card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}
.card-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
}
.card-title {
font-size: 1.1rem;
font-weight: 600;
color: var(--dark);
}
.card-icon {
width: 48px;
height: 48px;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
font-size: 1.5rem;
}
.bg-primary {
background: rgba(37, 99, 235, 0.1);
color: var(--primary);
}
.bg-success {
background: rgba(16, 185, 129, 0.1);
color: var(--success);
}
.bg-warning {
background: rgba(245, 158, 11, 0.1);
color: var(--warning);
}
.card-value {
font-size: 2rem;
font-weight: 700;
margin: 0.5rem 0;
}
.card-footer {
display: flex;
align-items: center;
font-size: 0.9rem;
color: var(--gray);
}
.positive {
color: var(--success);
font-weight: 500;
}
.negative {
color: var(--danger);
font-weight: 500;
}
.chart-container {
background: white;
border-radius: 16px;
padding: 1.5rem;
margin-bottom: 2rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.chart-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
}
.chart-title {
font-size: 1.25rem;
font-weight: 600;
color: var(--dark);
}
.transactions {
background: white;
border-radius: 16px;
padding: 1.5rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.transaction-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
}
.transaction-list {
display: flex;
flex-direction: column;
gap: 1rem;
}
.transaction-item {
display: flex;
align-items: center;
padding: 1rem;
border-radius: 12px;
background: #f8fafc;
transition: all 0.3s ease;
}
.transaction-item:hover {
background: #f1f5f9;
}
.transaction-icon {
width: 48px;
height: 48px;
border-radius: 12px;
display: flex;
align-items: center;
justify-content: center;
margin-right: 1rem;
font-size: 1.25rem;
}
.transaction-details {
flex: 1;
}
.transaction-name {
font-weight: 500;
margin-bottom: 0.25rem;
}
.transaction-date {
font-size: 0.875rem;
color: var(--gray);
}
.transaction-amount {
font-weight: 600;
}
.income {
color: var(--success);
}
.expense {
color: var(--danger);
}
/* Settings */
.settings {
padding: 4rem 0;
display: none;
}
.settings-grid {
display: grid;
grid-template-columns: 300px 1fr;
gap: 2rem;
}
.settings-menu {
background: white;
border-radius: 16px;
padding: 1.5rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
height: fit-content;
}
.settings-title {
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 1.5rem;
color: var(--dark);
}
.menu-item {
padding: 0.75rem 1rem;
border-radius: 8px;
cursor: pointer;
margin-bottom: 0.5rem;
transition: all 0.3s ease;
color: var(--dark);
font-weight: 500;
}
.menu-item.active, .menu-item:hover {
background: #e0f2fe;
color: var(--primary);
}
.settings-content {
background: white;
border-radius: 16px;
padding: 2rem;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}
.content-section {
display: none;
}
.content-section.active {
display: block;
}
.content-title {
font-size: 1.5rem;
font-weight: 600;
margin-bottom: 1.5rem;
color: var(--dark);
}
.form-group {
margin-bottom: 1.5rem;
}
label {
display: block;
font-weight: 500;
margin-bottom: 0.5rem;
color: var(--dark);
}
input, select {
width: 100%;
padding: 0.75rem 1rem;
border-radius: 8px;
border: 1px solid #cbd5e1;
font-size: 1rem;
transition: all 0.3s ease;
}
input:focus, select:focus {
border-color: var(--primary);
outline: none;
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1.5rem;
}
.btn-save {
background: var(--primary);
color: white;
padding: 0.75rem 2rem;
border: none;
border-radius: 8px;
font-weight: 500;
cursor: pointer;
transition: all 0.3s ease;
}
.btn-save:hover {
background: var(--primary-dark);
}
.security-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
border-bottom: 1px solid #e2e8f0;
}
.security-name {
font-weight: 500;
}
.switch {
position: relative;
display: inline-block;
width: 50px;
height: 24px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #cbd5e1;
transition: .4s;
border-radius: 24px;
}
.slider:before {
position: absolute;
content: "";
height: 16px;
width: 16px;
left: 4px;
bottom: 4px;
background-color: white;
transition: .4s;
border-radius: 50%;
}
input:checked + .slider {
background-color: var(--success);
}
input:checked + .slider:before {
transform: translateX(26px);
}
/* Footer */
footer {
background: var(--dark);
color: var(--light);
padding: 4rem 0 2rem;
}
.footer-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 2rem;
margin-bottom: 3rem;
}
.footer-column h3 {
font-size: 1.25rem;
font-weight: 600;
margin-bottom: 1.5rem;
color: white;
}
.footer-links {
display: flex;
flex-direction: column;
gap: 0.75rem;
}
.footer-links a {
color: var(--gray);
text-decoration: none;
transition: all 0.3s ease;
}
.footer-links a:hover {
color: white;
}
.social-links {
display: flex;
gap: 1rem;
margin-top: 1.5rem;
}
.social-links a {
display: flex;
align-items: center;
justify-content: center;
width: 40px;
height: 40px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.1);
color: white;
transition: all 0.3s ease;
}
.social-links a:hover {
background: var(--primary);
transform: translateY(-3px);
}
.footer-bottom {
border-top: 1px solid rgba(255, 255, 255, 0.1);
padding-top: 2rem;
text-align: center;
color: var(--gray);
font-size: 0.875rem;
}
/* Responsive Design */
@media (max-width: 1024px) {
.hero-content {
flex-direction: column;
text-align: center;
}
.btn-group {
justify-content: center;
}
.hero h1 {
font-size: 2.5rem;
}
}
@media (max-width: 768px) {
.nav-links {
display: none;
}
.mobile-menu-btn {
display: block;
}
.form-row {
grid-template-columns: 1fr;
}
.settings-grid {
grid-template-columns: 1fr;
}
.settings-menu {
display: flex;
overflow-x: auto;
gap: 1rem;
padding: 1rem;
}
.menu-item {
white-space: nowrap;
}
}
@media (max-width: 480px) {
.hero h1 {
font-size: 2rem;
}
.btn-group {
flex-direction: column;
}
.card-value {
font-size: 1.75rem;
}
}
</style>
</head>
<body>
<!-- Navigation -->
<nav>
<div class="container nav-container">
<div class="logo">
<i class="fas fa-university"></i>
<span>SecureBank</span>
</div>
<div class="nav-links">
<a href="#" id="home-link">Home</a>
<a href="#" id="dashboard-link">Dashboard</a>
<a href="#" id="settings-link">Settings</a>
<a href="#">Accounts</a>
<a href="#">Transfers</a>
<a href="#">Support</a>
</div>
<div class="nav-actions">
<button class="btn btn-outline">Sign In</button>
<button class="btn btn-primary">Open Account</button>
</div>
<button class="mobile-menu-btn">
<i class="fas fa-bars"></i>
</button>
</div>
</nav>
<!-- Landing Page -->
<section id="landing-page">
<div class="hero">
<div class="container hero-content">
<div class="hero-text">
<h1>Banking Made Simple, Secure & Smart</h1>
<p>Experience financial freedom with our digital banking solutions. Manage your money, make payments, and grow your savings - all in one place.</p>
<div class="btn-group">
<button class="btn btn-primary btn-lg">Get Started</button>
<button class="btn btn-outline btn-lg">Learn More</button>
</div>
</div>
<div class="hero-image">
<img src="https://images.unsplash.com/photo-1551836022-d5d88e9218df?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1200&q=80" alt="Banking App">
</div>
</div>
</div>
<div class="container">
<!-- Features Section -->
<div style="padding: 4rem 0;">
<h2 class="section-title" style="text-align: center; margin-bottom: 3rem;">Why Choose SecureBank?</h2>
<div class="cards">
<div class="card">
<div class="card-header">
<div class="card-title">Secure Transactions</div>
<div class="card-icon bg-primary">
<i class="fas fa-shield-alt"></i>
</div>
</div>
<p>Military-grade encryption protects your transactions and personal information 24/7.</p>
</div>
<div class="card">
<div class="card-header">
<div class="card-title">Zero Fees</div>
<div class="card-icon bg-success">
<i class="fas fa-wallet"></i>
</div>
</div>
<p>No hidden charges, monthly fees, or minimum balance requirements on any accounts.</p>
</div>
<div class="card">
<div class="card-header">
<div class="card-title">24/7 Support</div>
<div class="card-icon bg-warning">
<i class="fas fa-headset"></i>
</div>
</div>
<p>Our dedicated support team is always ready to assist you with any banking needs.</p>
</div>
</div>
</div>
</div>
</section>
<!-- Dashboard -->
<section id="dashboard-page" class="dashboard">
<div class="container">
<div class="dashboard-header">
<h2 class="section-title">Dashboard</h2>
<div>
<button class="btn btn-primary">New Transaction</button>
</div>
</div>
<div class="cards">
<div class="card">
<div class="card-header">
<div class="card-title">Total Balance</div>
<div class="card-icon bg-primary">
<i class="fas fa-wallet"></i>
</div>
</div>
<div class="card-value">$42,567.89</div>
<div class="card-footer">
<span class="positive">+2.3%</span> vs last month
</div>
</div>
<div class="card">
<div class="card-header">
<div class="card-title">Monthly Income</div>
<div class="card-icon bg-success">
<i class="fas fa-arrow-down"></i>
</div>
</div>
<div class="card-value">$8,450.00</div>
<div class="card-footer">
<span class="positive">+5.1%</span> vs last month
</div>
</div>
<div class="card">
<div class="card-header">
<div class="card-title">Monthly Expenses</div>
<div class="card-icon bg-warning">
<i class="fas fa-arrow-up"></i>
</div>
</div>
<div class="card-value">$3,210.50</div>
<div class="card-footer">
<span class="negative">-1.2%</span> vs last month
</div>
</div>
</div>
<div class="chart-container">
<div class="chart-header">
<div class="chart-title">Spending Analytics</div>
<select>
<option>Last 7 days</option>
<option>Last 30 days</option>
<option>Last 90 days</option>
</select>
</div>
<canvas id="spendingChart" height="300"></canvas>
</div>
<div class="transactions">
<div class="transaction-header">
<div class="chart-title">Recent Transactions</div>
<a href="#" style="color: var(--primary); text-decoration: none;">View All</a>
</div>
<div class="transaction-list">
<div class="transaction-item">
<div class="transaction-icon bg-primary">
<i class="fas fa-shopping-cart"></i>
</div>
<div class="transaction-details">
<div class="transaction-name">Amazon Purchase</div>
<div class="transaction-date">July 15, 2023 β’ Shopping</div>
</div>
<div class="transaction-amount expense">-$89.99</div>
</div>
<div class="transaction-item">
<div class="transaction-icon bg-success">
<i class="fas fa-money-check"></i>
</div>
<div class="transaction-details">
<div class="transaction-name">Salary Deposit</div>
<div class="transaction-date">July 14, 2023 β’ Salary</div>
</div>
<div class="transaction-amount income">+$5,200.00</div>
</div>
<div class="transaction-item">
<div class="transaction-icon bg-warning">
<i class="fas fa-utensils"></i>
</div>
<div class="transaction-details">
<div class="transaction-name">Restaurant Payment</div>
<div class="transaction-date">July 12, 2023 β’ Dining</div>
</div>
<div class="transaction-amount expense">-$64.30</div>
</div>
<div class="transaction-item">
<div class="transaction-icon bg-primary">
<i class="fas fa-mobile-alt"></i>
</div>
<div class="transaction-details">
<div class="transaction-name">Phone Bill</div>
<div class="transaction-date">July 10, 2023 β’ Utilities</div>
</div>
<div class="transaction-amount expense">-$75.00</div>
</div>
</div>
</div>
</div>
</section>
<!-- Settings -->
<section id="settings-page" class="settings">
<div class="container">
<h2 class="section-title" style="margin-bottom: 2rem;">Account Settings</h2>
<div class="settings-grid">
<div class="settings-menu">
<div class="settings-title">Preferences</div>
<div class="menu-item active" data-target="profile">Profile Information</div>
<div class="menu-item" data-target="security">Security Settings</div>
<div class="menu-item" data-target="notifications">Notifications</div>
<div class="menu-item" data-target="privacy">Privacy Settings</div>
<div class="menu-item" data-target="linked-accounts">Linked Accounts</div>
<div class="menu-item" data-target="statements">Statements & Tax</div>
</div>
<div class="settings-content">
<!-- Profile Section -->
<div class="content-section active" id="profile-section">
<h3 class="content-title">Profile Information</h3>
<form>
<div class="form-row">
<div class="form-group">
<label for="firstName">First Name</label>
<input type="text" id="firstName" value="John">
</div>
<div class="form-group">
<label for="lastName">Last Name</label>
<input type="text" id="lastName" value="Doe">
</div>
</div>
<div class="form-group">
<label for="email">Email Address</label>
<input type="email" id="email" value="john.doe@example.com">
</div>
<div class="form-row">
<div class="form-group">
<label for="phone">Phone Number</label>
<input type="tel" id="phone" value="(555) 123-4567">
</div>
<div class="form-group">
<label for="dob">Date of Birth</label>
<input type="date" id="dob" value="1985-05-15">
</div>
</div>
<div class="form-group">
<label for="address">Street Address</label>
<input type="text" id="address" value="123 Main Street">
</div>
<div class="form-row">
<div class="form-group">
<label for="city">City</label>
<input type="text" id="city" value="New York">
</div>
<div class="form-group">
<label for="state">State</label>
<select id="state">
<option>New York</option>
<option>California</option>
<option>Texas</option>
<option>Florida</option>
</select>
</div>
</div>
<div class="form-row">
<div class="form-group">
<label for="zip">ZIP Code</label>
<input type="text" id="zip" value="10001">
</div>
<div class="form-group">
<label for="country">Country</label>
<select id="country">
<option>United States</option>
<option>Canada</option>
<option>United Kingdom</option>
</select>
</div>
</div>
<button type="button" class="btn-save">Save Changes</button>
</form>
</div>
<!-- Security Section -->
<div class="content-section" id="security-section">
<h3 class="content-title">Security Settings</h3>
<div class="security-item">
<div class="security-name">
<div style="font-weight: 600; margin-bottom: 0.25rem;">Password</div>
<div style="font-size: 0.875rem; color: var(--gray);">Last changed 3 months ago</div>
</div>
<button class="btn btn-outline">Change</button>
</div>
<div class="security-item">
<div class="security-name">
<div style="font-weight: 600; margin-bottom: 0.25rem;">Two-Factor Authentication</div>
<div style="font-size: 0.875rem; color: var(--gray);">Add an extra layer of security</div>
</div>
<label class="switch">
<input type="checkbox" checked>
<span class="slider"></span>
</label>
</div>
<div class="security-item">
<div class="security-name">
<div style="font-weight: 600; margin-bottom: 0.25rem;">Biometric Login</div>
<div style="font-size: 0.875rem; color: var(--gray);">Use fingerprint or face recognition</div>
</div>
<label class="switch">
<input type="checkbox">
<span class="slider"></span>
</label>
</div>
<div class="security-item">
<div class="security-name">
<div style="font-weight: 600; margin-bottom: 0.25rem;">Login Notifications</div>
<div style="font-size: 0.875rem; color: var(--gray);">Get alerts for new logins</div>
</div>
<label class="switch">
<input type="checkbox" checked>
<span class="slider"></span>
</label>
</div>
<div class="security-item">
<div class="security-name">
<div style="font-weight: 600; margin-bottom: 0.25rem;">Account Recovery</div>
<div style="font-size: 0.875rem; color: var(--gray);">Set up recovery options</div>
</div>
<button class="btn btn-outline">Set Up</button>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer>
<div class="container">
<div class="footer-grid">
<div class="footer-column">
<div class="logo" style="margin-bottom: 1.5rem;">
<i class="fas fa-university"></i>
<span>SecureBank</span>
</div>
<p style="color: var(--gray); margin-bottom: 1.5rem;">Providing innovative banking solutions since 1998. Your security is our priority.</p>
<div class="social-links">
<a href="#"><i class="fab fa-facebook-f"></i></a>
<a href="#"><i class="fab fa-twitter"></i></a>
<a href="#"><i class="fab fa-instagram"></i></a>
<a href="#"><i class="fab fa-linkedin-in"></i></a>
</div>
</div>
<div class="footer-column">
<h3>Products</h3>
<div class="footer-links">
<a href="#">Checking Accounts</a>
<a href="#">Savings Accounts</a>
<a href="#">Credit Cards</a>
<a href="#">Mortgages</a>
<a href="#">Loans</a>
<a href="#">Investments</a>
</div>
</div>
<div class="footer-column">
<h3>Resources</h3>
<div class="footer-links">
<a href="#">Help Center</a>
<a href="#">Blog</a>
<a href="#">Financial Calculators</a>
<a href="#">Rates & Fees</a>
<a href="#">Security</a>
<a href="#">ATM Locator</a>
</div>
</div>
<div class="footer-column">
<h3>Company</h3>
<div class="footer-links">
<a href="#">About Us</a>
<a href="#">Careers</a>
<a href="#">Press</a>
<a href="#">Partners</a>
<a href="#">Contact Us</a>
<a href="#">Accessibility</a>
</div>
</div>
</div>
<div class="footer-bottom">
<p>© 2023 SecureBank. All rights reserved. | Member FDIC | Equal Housing Lender</p>
<p style="margin-top: 0.5rem;">SecureBank is a registered trademark of Secure Financial Services, Inc.</p>
</div>
</div>
</footer>
<script>
// Page Navigation
document.getElementById('home-link').addEventListener('click', function(e) {
e.preventDefault();
document.getElementById('landing-page').style.display = 'block';
document.getElementById('dashboard-page').style.display = 'none';
document.getElementById('settings-page').style.display = 'none';
});
document.getElementById('dashboard-link').addEventListener('click', function(e) {
e.preventDefault();
document.getElementById('landing-page').style.display = 'none';
document.getElementById('dashboard-page').style.display = 'block';
document.getElementById('settings-page').style.display = 'none';
initCharts();
});
document.getElementById('settings-link').addEventListener('click', function(e) {
e.preventDefault();
document.getElementById('landing-page').style.display = 'none';
document.getElementById('dashboard-page').style.display = 'none';
document.getElementById('settings-page').style.display = 'block';
});
// Settings menu navigation
const menuItems = document.querySelectorAll('.menu-item');
menuItems.forEach(item => {
item.addEventListener('click', function() {
// Remove active class from all items
menuItems.forEach(i => i.classList.remove('active'));
// Add active class to clicked item
this.classList.add('active');
// Hide all content sections
document.querySelectorAll('.content-section').forEach(section => {
section.classList.remove('active');
});
// Show the targeted content section
const target = this.getAttribute('data-target');
document.getElementById(target + '-section').classList.add('active');
});
});
// Initialize Charts
function initCharts() {
const ctx = document.getElementById('spendingChart').getContext('2d');
const spendingChart = new Chart(ctx, {
type: 'line',
data: {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul'],
datasets: [
{
label: 'Income',
data: [6500, 7200, 7800, 8100, 7900, 8300, 8450],
borderColor: '#10b981',
backgroundColor: 'rgba(16, 185, 129, 0.1)',
borderWidth: 3,
tension: 0.3,
fill: true
},
{
label: 'Expenses',
data: [3400, 3800, 3200, 3500, 3300, 3100, 3210],
borderColor: '#ef4444',
backgroundColor: 'rgba(239, 68, 68, 0.1)',
borderWidth: 3,
tension: 0.3,
fill: true
}
]
},
options: {
responsive: true,
plugins: {
legend: {
position: 'top'
}
},
scales: {
y: {
beginAtZero: true,
grid: {
color: 'rgba(0, 0, 0, 0.05)'
}
},
x: {
grid: {
display: false
}
}
}
}
});
}
// Initialize charts when dashboard is loaded for the first time
document.addEventListener('DOMContentLoaded', function() {
// Show landing page by default
document.getElementById('landing-page').style.display = 'block';
// Set up mobile menu toggle
const mobileMenuBtn = document.querySelector('.mobile-menu-btn');
const navLinks = document.querySelector('.nav-links');
mobileMenuBtn.addEventListener('click', function() {
navLinks.style.display = navLinks.style.display === 'flex' ? 'none' : 'flex';
});
});
</script>
</body>
</html>
|
You are an expert web developer and designer specializing in modern websites. Create a complete, working HTML page with embedded CSS and JavaScript if needed. Feel free to use lightweight libraries like Tailwind CSS to enhance the design as long as they can be rendered in an iframe.
Requirements:
1. Create a fully functional, modern, and responsive website design
2. Use only HTML, CSS, and JavaScript, but feel free to use libraries like Tailwind CSS to make the design better. Libraries such as ThreeJS, react three fiber, drei, @react-three/postprocessing, @react-three/cannon, d3, and recharts as additional libraries can be imported.
3. Include all styles inline within <style> tags
4. Focus on clean layouts, typography, and user experience
5. Implement modern web design trends (gradients, shadows, smooth animations)
6. Ensure excellent mobile responsiveness
7. Include interactive elements where appropriate
8. Make it production-ready and professional
9. You must include all relevant script tags for libraries to work properly.
Return ONLY the complete HTML code, starting with <!DOCTYPE html> and ending with </html>. Do not include any explanations or markdown formatting.
|
"Cafeni" is a smart digital wallet and loyalty platform connecting users with nearby coffee shops. Through the app, users can: View menus and prices of partnered coffee shops. Pre-order and pay using their in-app wallet. Collect points, cashback, or loyalty rewards for every purchase. Shops receive: Real-time order management dashboard. Customer insights and analytics. Integrated payment system that works in-store and online. β Main Features π§ For Users: π Account creation / login (email or phone via Supabase) π³ In-app wallet β add funds, pay with QR, or use balance at any shop β Coffee shop directory β see all shops with distance, rating, and menus π Pre-order & pay β order ahead and skip the line π Loyalty system β earn rewards, discounts, and cashback π§Ύ Transaction history β view past payments and reorders π¬ Feedback & reviews β rate your experience πͺ For Coffee Shops: π Admin dashboard β manage menu, prices, orders, and shop info π¦ Order management β accept or reject inco.
|
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Cafeni - Smart Wallet & Loyalty for Coffee</title>
<style>
:root{
--bg: #0b1020;
--surface: #141a2a;
--card: rgba(255,255,255,0.08);
--text: #e9eaf6;
--muted: #a8b3cc;
--primary: #7c3aed;
--primary-2: #22d3ee;
--green: #10b981;
--red: #ef4444;
--shadow: 0 8px 24px rgba(0,0,0,.25);
--radius: 14px;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
margin:0;
font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial;
color:var(--text);
background: radial-gradient(circle at 20% -10%, rgba(124,58,237,.25), transparent 40%),
radial-gradient(circle at 100% 0%, rgba(2,132,199,.25), transparent 40%),
linear-gradient(135deg, #0b0f1a 0%, #0a0e1b 100%);
background-attachment: fixed;
}
a{color:inherit; text-decoration:none}
.container{max-width:1100px; margin:0 auto; padding:0 20px}
/* Header */
header{
position: sticky; top:0; z-index: 999;
background: rgba(10,12,28,.85);
backdrop-filter: saturate(1.2) blur(6px);
border-bottom: 1px solid rgba(255,255,255,.06);
}
.nav{ display:flex; align-items:center; justify-content:space-between; padding:14px 0; }
.brand{ display:flex; align-items:center; gap:12px; font-weight:700; letter-spacing:.5px }
.brand-logo{
width:34px;height:34px; display:grid; place-items:center;
border-radius:9px;
background: linear-gradient(135deg, #7c3aed, #22d3ee);
box-shadow: inset 0 0 8px rgba(255,255,255,.6);
}
.nav-links{ display:flex; gap:14px; align-items:center; }
.btn{ border:0; border-radius:999px; padding:12px 18px; font-weight:600; cursor:pointer;
transition: transform .2s ease, box-shadow .2s ease;
}
.btn.primary{
background: linear-gradient(135deg, var(--primary), #8b5cf6);
color:white; box-shadow: 0 6px 16px rgba(124,58,237,.5);
}
.btn.secondary{
background: rgba(255,255,255,.08); color:#e5e7eb; border:1px solid rgba(255,255,255,.15);
}
.btn:hover{ transform: translateY(-1px); }
.avatar{ width:32px; height:32px; border-radius:50%; background: #334155; display:inline-block; }
/* Hero */
#hero{
padding:72px 0 40px;
position:relative;
overflow:hidden;
}
.hero-content{ display:grid; grid-template-columns: 1.05fr 0.95fr; gap:40px; align-items:center; }
.hero-copy h1{ font-size: clamp(28px, 4vw, 46px); line-height:1.05; margin:0 0 12px; background: linear-gradient(135deg, #fff, #b7c8ff);
-webkit-background-clip:text; background-clip:text; color:transparent;
}
.hero-copy p{ color:var(--muted); font-size: clamp(14px, 1.6vw, 18px); margin:6px 0 18px; }
.cta{ display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.hero-visual{
height:320px; border-radius:22px; padding:16px;
background: linear-gradient(135deg, rgba(124,58,237,.25), rgba(2,132,199,.25));
box-shadow: var(--shadow);
display:flex; align-items:center; justify-content:center;
position:relative; overflow:hidden;
}
.orb{ position:absolute; width:180px; height:180px; border-radius:50%; filter: blur(6px);
background: radial-gradient(circle at 30% 30%, rgba(124,58,237,.9), transparent 40%),
radial-gradient(circle at 70% 70%, rgba(34,211,238,.9), transparent 40%);
animation: float 8s ease-in-out infinite;
}
@keyframes float { 0%{ transform: translateY(0) } 50%{ transform: translateY(-18px) } 100%{ transform: translateY(0) } }
.feature-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:14px; margin-top:8px; }
.card{ background: var(--card); border-radius: 12px; padding:16px; box-shadow: var(--shadow); border:1px solid rgba(255,255,255,.08); }
.icon{ width:28px; height:28px; display:inline-block; margin-right:10px; vertical-align:middle; }
.card-title{ font-weight:600; margin-bottom:6px; }
.card-desc{ color:var(--muted); font-size:14px; }
/* Sections */
section{ padding:48px 0; }
h2.section-title{ font-size: clamp(22px, 3vw, 32px); margin:0 0 8px; }
.sub{ color:var(--muted); margin:0 0 12px; }
/* Directory */
.shop-grid{ display:grid; grid-template-columns: repeat(3, 1fr); gap:14px; }
.shop{ background: rgba(255,255,255,.05); border-radius: 14px; padding:14px; border:1px solid rgba(255,255,255,.08); display:flex; flex-direction:column; gap:8px; min-height:150px; }
.shop-header{ display:flex; align-items: center; justify-content:space-between; }
.shop-name{ font-weight:700; font-size:16px; }
.shop-meta{ font-size:12px; color:var(--muted); display:flex; gap:8px; align-items:center; }
.tag{ padding:4px 8px; border-radius:999px; background: rgba(124,58,237,.25); font-size:12px; }
.shop-actions{ margin-top:auto; display:flex; gap:8px; align-items:center; }
.shop-btn{ padding:10px 12px; border-radius:999px; border:1px solid rgba(255,255,255,.25); cursor:pointer; background: rgba(255,255,255,.05); }
.shop-btn.primary{ background: linear-gradient(135deg, #22d3ee, #7c3aed); border:none; color:white; }
/* Wallet */
.wallet-wrap{ display:grid; grid-template-columns: 1.1fr 0.9fr; gap:14px; align-items:stretch; }
.wallet{ background: rgba(255,255,255,.06); border-radius:14px; padding:16px; border:1px solid rgba(255,255,255,.12); display:flex; flex-direction:column; gap:14px; }
.balance{ font-size:28px; font-weight:700; letter-spacing:.5px; }
.wallet-cta{ display:flex; gap:8px; align-items:center; justify-content:flex-start; flex-wrap:wrap; }
.input{ padding:10px 12px; border-radius:8px; border:1px solid rgba(255,255,255,.25); background: rgba(0,0,0,.15); color:#fff; width:100%; }
.row{ display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.panel{ background: rgba(255,255,255,.05); border-radius:12px; padding:12px; border:1px solid rgba(255,255,255,.1); }
.activity{ list-style:none; padding:0; margin:0; max-height:180px; overflow:auto; }
.activity li{ padding:8px 0; border-bottom:1px solid rgba(255,255,255,.08); font-size:13px; color: #e6e6e6; }
.progress{ height:10px; background: rgba(255,255,255,.15); border-radius:999px; overflow:hidden; }
.progress > span{ display:block; height:100%; background: linear-gradient(90deg, #22c55e, #84cc16); width:0%; }
/* Admin panel */
.admin{ display:grid; grid-template-columns: 1.1fr 0.9fr; gap:14px; align-items:stretch; }
.admin-card{ background: rgba(255,255,255,.05); border-radius:14px; padding:14px; border:1px solid rgba(255,255,255,.12); min-height:260px; }
.tabs{ display:flex; gap:8px; margin-bottom:8px; }
.tab{ padding:8px 12px; border-radius:999px; border:1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); cursor:pointer; }
.tab.active{ background: linear-gradient(135deg, #22d3ee, #7c3aed); border:0; }
ul.menu{ list-style:none; padding:0; margin:0; display:grid; grid-template-columns: repeat(2, 1fr); gap:8px; }
ul.menu li{ padding:8px; border-radius:8px; background: rgba(0,0,0,.15); border:1px solid rgba(255,255,255,.15); font-size:14px; }
/* Footer */
footer{ padding:28px 0; color:var(--muted); font-size:13px; text-align:center; border-top:1px solid rgba(255,255,255,.08); margin-top:40px; }
/* Modals */
.modal{ position: fixed; inset:0; display:grid; place-items:center; background: rgba(0,0,0,.5); opacity:0; visibility:hidden; transition: opacity .2s ease; z-index: 9999; padding:20px; }
.modal.open{ opacity:1; visibility:visible; }
.modal-card{ width: min(680px, 96%); background: rgba(10,12,28,.95); border-radius:14px; padding:16px; box-shadow: var(--shadow); border:1px solid rgba(255,255,255,.15); }
.modal-header{ display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.close{ background:transparent; border:1px solid rgba(255,255,255,.25); color:#fff; border-radius:8px; padding:6px 10px; cursor:pointer; }
.modal-body{ max-height:60vh; overflow:auto; padding-right:6px; }
/* Responsive */
@media (max-width: 1024px){
.hero-content{ grid-template-columns: 1fr; text-align:left; }
.hero-visual{ order:-1; height:260px; }
.shop-grid{ grid-template-columns: repeat(2, 1fr); }
.admin{ grid-template-columns: 1fr; }
.wallet-wrap{ grid-template-columns: 1fr; }
}
@media (max-width: 600px){
.feature-grid{ grid-template-columns:1fr; }
.shop-grid{ grid-template-columns: 1fr; }
}
</style>
</head>
<body>
<!-- Header -->
<header aria-label="Site header">
<div class="container nav">
<div class="brand" aria-label="Cafeni brand">
<div class="brand-logo" aria-label="Cafeni logo">
<!-- simple coffee cup glyph -->
<svg width="20" height="20" viewBox="0 0 24 24" fill="white" aria-hidden="true">
<path d="M6 6h8a4 4 0 014 4v4h-2V10a2 2 0 00-2-2H6V6z" opacity=".9"></path>
<path d="M4 6h2v4H4z" fill="white" opacity=".7"></path>
<path d="M18 14h-2v2h2a2 2 0 002-2v-2h-2z" fill="white" opacity=".9"></path>
</svg>
</div>
<span style="font-size:15px; letter-spacing:.6px;">Cafeni</span>
</div>
<nav class="nav-links" aria-label="Main navigation">
<a class="btn secondary" href="#features" style="padding:10px 14px;">Main Features</a>
<a class="btn secondary" href="#directory" style="padding:10px 14px;">Directory</a>
<a class="btn secondary" href="#wallet" style="padding:10px 14px;">Wallet</a>
<button class="btn primary" id="loginBtn" aria-haspopup="dialog" style="padding:10px 16px;">Sign in</button>
</nav>
</div>
</header>
<main>
<!-- Hero -->
<section id="hero" aria-label="Hero section">
<div class="container hero-content">
<div class="hero-copy">
<h1>Smart wallet, instant rewards, coffee near you</h1>
<p>Meet Cafeni β the all-in-one digital wallet and loyalty platform that connects curious customers with nearby coffee shops. Pre-order, pay, earn points and cashback, all in one sleek app.</p>
<div class="cta">
<button class="btn primary" onclick="document.getElementById('directory').scrollIntoView({behavior:'smooth'})">Explore nearby cafΓ©s</button>
<button class="btn secondary" onclick="document.getElementById('wallet').scrollIntoView({behavior:'smooth'})">View wallet demo</button>
</div>
</div>
<div class="hero-visual" aria-label="Hero visual">
<div class="orb" style="left: -40px; top: 60px;"></div>
<svg width="320" height="260" viewBox="0 0 320 260" role="img" aria-label="Abstract coffee visuals">
<defs>
<linearGradient id="grad" x1="0" x2="1" y1="0" y2="1">
<stop offset="0%" stop-color="#7c3aed"/>
<stop offset="100%" stop-color="#22d3ee"/>
</linearGradient>
</defs>
<rect x="20" y="60" width="280" height="140" rx="20" fill="url(#grad)" opacity=".25"/>
<circle cx="60" cy="110" r="20" fill="#fff" opacity=".4"/>
<circle cx="150" cy="90" r="14" fill="#fff" opacity=".4"/>
<rect x="90" y="170" width="140" height="12" rx="6" fill="#fff" opacity=".6"/>
<rect x="60" y="40" width="40" height="12" rx="6" fill="#fff" opacity=".5"/>
</svg>
</div>
</div>
</section>
<!-- Main Features (For Users) -->
<section id="features" aria-label="Main features" class="container">
<h2 class="section-title">Main Features</h2>
<p class="sub">For Users β’ For Coffee Shops</p>
<div class="feature-grid" aria-label="Feature highlights">
<div class="card">
<div style="display:flex; align-items:center; gap:8px;">
<span class="icon" aria-hidden="true">
<!-- wallet icon -->
<svg width="28" height="28" viewBox="0 0 24 24" fill="#93c5fd" aria-label="Wallet">
<path d="M3 7h13a4 4 0 014 4v6H3V7zm0-5h13a2 2 0 012 2v20l-4-4H5a2 2 0 01-2-2V4a1 1 0 011-1z"/>
</svg>
</span>
<div>
<div class="card-title">In-app Wallet</div>
<div class="card-desc">Add funds, pay with QR, or use balance at any shop.</div>
</div>
</div>
</div>
<div class="card">
<div style="display:flex; align-items:center; gap:8px;">
<span class="icon" aria-hidden="true">
<svg width="28" height="28" viewBox="0 0 24 24" fill="#34d399" aria-label="Shop">
<path d="M7 4h10l3 6H4l3-6zm-3 8h16l1 4H3l1-4z" />
</svg>
</span>
<div>
<div class="card-title">Nearby Directory</div>
<div class="card-desc">Explore shops with distance, rating and menus.</div>
</div>
</div>
</div>
<div class="card">
<div style="display:flex; align-items:center; gap:8px;">
<span class="icon" aria-hidden="true">
<svg width="28" height="28" viewBox="0 0 24 24" fill="#f472b6" aria-label="Pre-order">
<path d="M4 6h16v2H4V6zm0 4h10v2H4v-2zm0 4h6v2H4v-2z"/>
</svg>
</span>
<div>
<div class="card-title">Pre-order & Pay</div>
<div class="card-desc">Order ahead and pay securely using your wallet.</div>
</div>
</div>
</div>
</div>
</section>
<!-- Directory -->
<section id="directory" aria-label="Coffee shop directory" class="container">
<div style="display:flex; justify-content: space-between; align-items: baseline; gap:12px; flex-wrap:wrap;">
<div>
<h2 class="section-title" style="margin-bottom:6px;">Coffee Shop Directory</h2>
<p class="sub" style="margin:0;">Find nearby cafΓ©s, view menus, and pre-order in seconds.</p>
</div>
<div class="row" style="min-width:260px;">
<input id="search" class="input" placeholder="Search by name..." style="min-width: 180px;">
<select id="minRating" class="input" aria-label="Minimum rating" style="width:120px;">
<option value="0">All</option>
<option value="4">4.0+</option>
<option value="4.5">4.5+</option>
</select>
</div>
</div>
<div class="shop-grid" id="shopGrid" aria-label="Shops grid">
<!-- Shops will be injected by JS -->
</div>
</section>
<!-- Wallet & Activity -->
<section id="wallet" aria-label="Wallet section" class="container wallet-wrap">
<aside class="wallet" aria-label="Wallet overview">
<div style="display:flex; justify-content:space-between; align-items: center;">
<strong>Your Cafeni Wallet</strong>
<span class="tag" id="walletTag" title="Status">Online</span>
</div>
<div class="balance" id="balanceDisplay">$25.00</div>
<div class="panel" aria-label="Add funds">
<div class="row" style="gap:8px;">
<input id="fundAmount" class="input" type="number" min="1" step="1" placeholder="Add funds ($)" style="min-width:140px;">
<button class="btn primary" id="addFundsBtn" style="padding:9px 12px;">Add funds</button>
</div>
</div>
<div class="wallet-cta">
<button class="btn secondary" onclick="openOrderModalForDemo()">Pre-order from a shop</button>
<button class="btn secondary" onclick="simulateScanQR()">Show QR to pay</button>
</div>
<div class="panel" aria-label="Transaction history">
<div style="display:flex; justify-content:space-between; align-items:center; margin-bottom:6px;">
<strong>Recent Activity</strong>
<span class="tag" title="Activity">Today</span>
</div>
<ul class="activity" id="activityList">
<li>Wallet topped up by $10</li>
<li>Purchased Latte β Cafeni Wallet</li>
</ul>
</div>
<div class="panel" aria-label="Loyalty summary" style="padding-bottom:8px;">
<div style="display:flex; align-items:center; justify-content:space-between;">
<strong>Loyalty Points</strong>
<span class="tag" title="Points">20 pts</span>
</div>
<div class="progress" aria-valuemin="0" aria-valuemax="100" role="progressbar" style="margin-top:8px;">
<span style="width: 20%;"></span>
</div>
<div style="font-size:12px; color:var(--muted); margin-top:6px;">Earn 1 point per $1. Redeem for discounts.</div>
</div>
</aside>
<section class="admin-card" aria-label="Admin dashboard preview">
<div class="tabs" role="tablist" aria-label="Admin tabs">
<button class="tab active" role="tab" aria-selected="true" onclick="setAdminTab('menu')">Menu</button>
<button class="tab" role="tab" aria-selected="false" onclick="setAdminTab('orders')">Orders</button>
<button class="tab" role="tab" aria-selected="false" onclick="setAdminTab('shop')">Shop Info</button>
</div>
<div id="adminContent">
<!-- Menu Editor -->
<div class="section" id="admin-menu" style="display:block;">
<strong>Admin Menu</strong>
<p class="sub" style="margin:6px 0 12px;">Edit items for your shop</p>
<ul class="menu" aria-label="Menu items editor">
<li>Espresso</li>
<li>Latte</li>
<li>Cappuccino</li>
<li>Flat White</li>
</ul>
</div>
<!-- Orders -->
<div class="section" id="admin-orders" style="display:none;">
<strong>Live Orders</strong>
<p class="sub" style="margin:6px 0 12px;">Real-time status updates</p>
<ul class="activity" style="max-height:120px;">
<li>Order #1024 - Espresso - Pending</li>
<li>Order #1025 - Latte - Preparing</li>
</ul>
</div>
<!-- Shop Info -->
<div class="section" id="admin-shop" style="display:none;">
<strong>Shop Info</strong>
<p class="sub" style="margin:6px 0 12px;">Defaults & location</p>
<div class="row" style="gap:8px; align-items:center;">
<input class="input" value="Cafeni Central" style="width:240px;">
<input class="input" value="0.6 km" style="width:120px;">
</div>
</div>
</div>
</section>
</section>
</main>
<footer aria-label="Site footer">
<div class="container" style="display:flex; justify-content:space-between; align-items:center; gap:12px; flex-wrap:wrap;">
<div>Β© Cafeni 2025 β’ All rights reserved</div>
<div style="display:flex; gap:8px;">
<span class="avatar" aria-label="Twitter" title="Twitter"></span>
<span class="avatar" aria-label="Instagram" title="Instagram"></span>
<span class="avatar" aria-label="LinkedIn" title="LinkedIn"></span>
</div>
</div>
</footer>
<!-- Modals -->
<div class="modal" id="orderModal" aria-hidden="true" aria-label="Pre-order modal">
<div class="modal-card" role="dialog" aria-label="Pre-order">
<div class="modal-header">
<strong id="orderShopName">Shop</strong>
<button class="close" id="closeOrder">Close</button>
</div>
<div class="modal-body" id="orderBody">
<div style="display:flex; gap:8px; align-items:stretch; margin-bottom:8px;">
<div style="flex:1;">
<div style="font-weight:600; margin-bottom:6px;">Menu</div>
<ul id="menuList" class="menu" style="grid-template-columns:1fr; padding-left:0; margin:0;">
<!-- dynamic items -->
</ul>
</div>
<div style="width:1px; background: rgba(255,255,255,.25);"></div>
<div style="flex:0 0 180px;">
<div style="font-weight:600; margin-bottom:6px;">Cart</div>
<ul id="cartList" class="menu" style="grid-template-columns:1fr; padding-left:0; margin:0; max-height:140px; overflow:auto;">
<!-- dynamic cart items -->
</ul>
<div style="margin-top:6px;">
<div style="display:flex; justify-content:space-between;">
<span>Subtotal</span><span id="subtotal">$0.00</span>
</div>
<div style="display:flex; justify-content:space-between;">
<span>Fees</span><span id="fees">$0.00</span>
</div>
<hr style="border:0; border-top:1px solid rgba(255,255,255,.15); margin:6px 0;">
<div style="display:flex; justify-content:space-between; font-weight:700;">
<span>Total</span><span id="total">$0.00</span>
</div>
</div>
</div>
</div>
<div class="row" style="align-items:center; justify-content:space-between;">
<div style="font-size:12px; color:var(--muted);">Pay with Cafeni Wallet</div>
<button class="btn primary" id="payBtn" style="padding:10px 14px;">Pay $0.00</button>
</div>
</div>
</div>
</div>
<!-- Login modal -->
<div class="modal" id="loginModal" aria-hidden="true" aria-label="Login modal">
<div class="modal-card" role="dialog" aria-label="Login">
<div class="modal-header">
<strong>Sign in to Cafeni</strong>
<button class="close" id="closeLogin">Close</button>
</div>
<div class="modal-body">
<p class="sub" style="margin:0 0 8px;">Enter email or phone. This is a lightweight mock for demo purposes.</p>
<input id="userEmail" class="input" placeholder="Email or phone" style="margin-bottom:8px;">
<input id="userPass" type="password" class="input" placeholder="Password" style="margin-bottom:8px;">
<button class="btn primary" id="loginSubmit" style="width:100%;">Sign in</button>
<p class="sub" style="margin-top:8px;">New here? Sign up in seconds and start earning rewards.</p>
</div>
</div>
</div>
<script>
// Data
const shops = [
{ id: 1, name: "Brew Lab", distance: 1.2, rating: 4.7, price: "$$", menu: [
{name: "Espresso", price: 3.0},
{name: "Latte", price: 4.5},
{name: "Cappuccino", price: 4.0},
]},
{ id: 2, name: "Mocha Box", distance: 0.8, rating: 4.5, price: "$$", menu: [
{name: "Americano", price: 2.5},
{name: "Mocha", price: 5.0},
{name: "Macchiato", price: 3.5},
]},
{ id: 3, name: "Bean & Byte", distance: 2.3, rating: 4.8, price: "$$$", menu: [
{name: "Single Origin", price: 5.0},
{name: "Cortado", price: 4.25},
{name: "Flat White", price: 4.75},
]},
{ id: 4, name: "Grind House", distance: 1.5, rating: 4.2, price: "$", menu: [
{name: "Iced Coffee", price: 3.0},
{name: "Affogato", price: 4.5},
]},
{ id: 5, name: "Cafe Orbit", distance: 3.1, rating: 4.6, price: "$$", menu: [
{name: "Latte Macchiato", price: 4.2},
{name: "Dalghmor", price: 6.0},
]},
{ id: 6, name: "Roast Republic", distance: 0.9, rating: 4.9, price: "$$$", menu: [
{name: "Pour Over", price: 6.5},
{name: "Cold Brew", price: 4.5},
]},
];
// State
let currentShopId = null;
let walletBalance = 25.0;
let cart = [];
let loyaltyPoints = 20;
// Elements
const shopGrid = document.getElementById('shopGrid');
const searchInput = document.getElementById('search');
const minRatingSel = document.getElementById('minRating');
const balanceDisplay = document.getElementById('balanceDisplay');
const activityList = document.getElementById('activityList');
const orderModal = document.getElementById('orderModal');
const orderShopName = document.getElementById('orderShopName');
const menuList = document.getElementById('menuList');
const cartList = document.getElementById('cartList');
const subtotalEl = document.getElementById('subtotal');
const feesEl = document.getElementById('fees');
const totalEl = document.getElementById('total');
const payBtn = document.getElementById('payBtn');
const addFundsBtn = document.getElementById('addFundsBtn');
const fundAmount = document.getElementById('fundAmount');
const closeOrder = document.getElementById('closeOrder');
const loginBtn = document.getElementById('loginBtn');
const loginModal = document.getElementById('loginModal');
const closeLogin = document.getElementById('closeLogin');
const loginSubmit = document.getElementById('loginSubmit');
const userEmail = document.getElementById('userEmail');
const userPass = document.getElementById('userPass');
// Admin tab controls
const adminTabs = document.querySelectorAll('.tab');
const adminContent = document.getElementById('adminContent');
const adminMenu = document.getElementById('admin-menu');
const adminOrders = document.getElementById('admin-orders');
const adminShop = document.getElementById('admin-shop');
function setAdminTab(name){
adminTabs.forEach(t => t.classList.remove('active'));
adminContent.querySelectorAll('div.section, div').forEach(d => d.style.display='none');
// naive: show only chosen
if(name==='menu'){
adminTabs[0].classList.add('active'); adminMenu.style.display='block';
}else if(name==='orders'){
adminTabs[1].classList.add('active'); adminOrders.style.display='block';
}else{
adminTabs[2].classList.add('active'); adminShop.style.display='block';
}
}
// Init shop cards
function formatMoney(n){
return '$' + Number(n).toFixed(2);
}
function renderShops(){
shopGrid.innerHTML = '';
const query = (searchInput.value || '').toLowerCase();
const minRating = parseFloat(minRatingSel.value) || 0;
const filtered = shops.filter(s => {
const goodName = s.name.toLowerCase().includes(query);
const goodRating = s.rating >= minRating;
return goodName && goodRating;
});
filtered.forEach(s => {
const card = document.createElement('div');
card.className = 'shop';
card.innerHTML = `
<div class="shop-header">
<div>
<div class="shop-name">${s.name}</div>
<div class="shop-meta">
<span>Distance: ${s.distance} km</span>
<span>Rating: ${s.rating.toFixed(1)}</span>
</div>
</div>
<span class="tag" aria-label="Price level">${s.price}</span>
</div>
<div class="shop-meta" style="margin-top:4px;">Menu: ${s.menu.map(m => m.name).slice(0,3).join(', ')}</div>
<div class="shop-actions" aria-label="Shop actions">
<button class="shop-btn" onclick="openOrderModal(${s.id})">Pre-order</button>
<button class="shop-btn primary" onclick="simulateShopVisit('${s.name}')">Visit</button>
</div>
`;
shopGrid.appendChild(card);
});
if (filtered.length === 0) {
const empty = document.createElement('div');
empty.className = 'panel';
empty.style.width = '100%';
empty.innerText = 'No shops match your search. Try a different term or rating filter.';
shopGrid.appendChild(empty);
}
}
// Open order modal
function openOrderModal(shopId){
currentShopId = shopId;
const shop = shops.find(s => s.id === shopId);
if(!shop) return;
orderShopName.textContent = shop.name;
// Build menu
menuList.innerHTML = '';
shop.menu.forEach(item => {
const li = document.createElement('li');
li.style.display = 'flex'; li.style.justifyContent = 'space-between'; li.style.alignItems = 'center';
li.style.gap = '8px';
li.innerHTML = `
<span>${item.name}</span>
<span>${formatMoney(item.price)}</span>
<button class="shop-btn" style="padding:6px 8px;" onclick="addToCart({shopId:${shopId}, name:'${item.name}', price:${item.price}})">Add</button>
`;
menuList.appendChild(li);
});
// Reset cart view for this shop
cart = [];
updateCartUI();
// Show modal
orderModal.classList.add('open');
orderModal.style.zIndex = 10000;
orderModal.setAttribute('aria-hidden','false');
}
function openOrderModalForDemo(){
// open for the first shop as demo
openOrderModal(shops[0].id);
}
function closeOrderModal(){
orderModal.classList.remove('open');
orderModal.setAttribute('aria-hidden','true');
}
closeOrder.addEventListener('click', closeOrderModal);
// Add to cart
function addToCart(item){
// item can be object or plain
cart.push({shopId: item.shopId, name: item.name, price: item.price, qty: 1});
updateCartUI();
}
function updateCartUI(){
cartList.innerHTML = '';
let subtotal = 0;
cart.forEach((ci, idx) => {
const li = document.createElement('li');
li.style.display='flex'; li.style.justifyContent='space-between'; li.style.alignItems='center';
li.innerHTML = `
<span>${ci.name} x${ci.qty}</span>
<span>${formatMoney(ci.price * ci.qty)}</span>
`;
cartList.appendChild(li);
subtotal += ci.price * ci.qty;
});
const fees = Math.max(0, subtotal * 0.0); // no extra fees in demo
const total = subtotal + fees;
subtotalEl.textContent = formatMoney(subtotal);
feesEl.textContent = formatMoney(fees);
totalEl.textContent = formatMoney(total);
payBtn.textContent = `Pay ${formatMoney(total)}`;
}
// Paying
payBtn.addEventListener('click', () => {
// Compute total
const total = parseFloat(totalEl.textContent.replace('$',''));
if(isNaN(total)) return;
if(walletBalance >= total){
walletBalance -= total;
// Loyalty: 1 point per $1
loyaltyPoints += Math.floor(total);
// Cashback: 5% of total
const cashback = total * 0.05;
walletBalance = Math.max(0, walletBalance + cashback);
balanceDisplay.textContent = formatMoney(walletBalance);
// Activity
const cat = `Paid ${formatMoney(total)} at ${orderShopName.textContent}`;
addActivity(cat);
// Close and reset
closeOrderModal();
// Reset cart
cart = [];
updateCartUI();
// Update loyalty progress
updateLoyalty();
}else{
alert('Insufficient funds. Please add funds to your Cafeni Wallet.');
}
});
function addActivity(text){
const li = document.createElement('li');
li.textContent = text;
activityList.prepend(li);
// keep list readable
if(activityList.children.length > 50) activityList.removeChild(activityList.lastChild);
}
function updateLoyalty(){
const newPoints = loyaltyPoints;
const p = Math.min(100, (newPoints / 100) * 100);
const prog = document.querySelector('.progress > span');
if(prog){
prog.style.width = p + '%';
}
// cash back or extra reward could be simulated here
}
// Add funds
addFundsBtn.addEventListener('click', ()=>{
const amt = parseFloat(fundAmount.value);
if(isNaN(amt) || amt <= 0){
alert('Enter a valid amount.');
return;
}
walletBalance += amt;
balanceDisplay.textContent = formatMoney(walletBalance);
addActivity(`Wallet topped up by ${formatMoney(amt)}`);
fundAmount.value = '';
});
// QR simulate
function simulateScanQR(){
alert('This is a demo: your wallet QR would appear here for in-store payments.');
}
// Admin: tab initial
setAdminTab('menu');
// Login modal
loginBtn.addEventListener('click', ()=>{
loginModal.classList.add('open');
loginModal.style.zIndex = 99999;
loginModal.setAttribute('aria-hidden','false');
});
closeLogin.addEventListener('click', () => {
loginModal.classList.remove('open');
loginModal.setAttribute('aria-hidden','true');
});
loginSubmit.addEventListener('click', () => {
const email = userEmail.value.trim();
const pass = userPass.value;
if(!email){
alert('Please enter email or phone.');
return;
}
// mock login
localStorage.setItem('cafeni_user', JSON.stringify({email}));
loginModal.classList.remove('open');
loginModal.setAttribute('aria-hidden','true');
// greet in header
if(!document.querySelector('#loginBtn .avatar')){
// simple inline greet in header
}
addActivity(`Signed in as ${email}`);
updateLoyalty();
});
// Directory filtering
searchInput.addEventListener('input', renderShops);
minRatingSel.addEventListener('change', renderShops);
// Initialize
renderShops();
// Demo: if user already signed in, show a greeting
document.addEventListener('DOMContentLoaded', () => {
const stored = localStorage.getItem('cafeni_user');
if(stored){
const u = JSON.parse(stored);
addActivity(`Welcome back, ${u.email}`);
}
balanceDisplay.textContent = `$${walletBalance.toFixed(2)}`;
updateLoyalty();
});
// Accessibility: ESC closes modal
document.addEventListener('keydown', (e) => {
if(e.key === 'Escape'){
if(orderModal.classList.contains('open')) closeOrderModal();
if(loginModal.classList.contains('open')) loginModal.classList.remove('open');
}
});
// Shop visit demo
function simulateShopVisit(name){
addActivity(`Visited ${name} (demo)`);
}
</script>
</body>
</html>
|
You are an expert web developer and designer specializing in modern websites. Create a complete, working HTML page with embedded CSS and JavaScript if needed. Feel free to use lightweight libraries like Tailwind CSS to enhance the design as long as they can be rendered in an iframe.
Requirements:
1. Create a fully functional, modern, and responsive website design
2. Use only HTML, CSS, and JavaScript, but feel free to use libraries like Tailwind CSS to make the design better. Libraries such as ThreeJS, react three fiber, drei, @react-three/postprocessing, @react-three/cannon, d3, and recharts as additional libraries can be imported.
3. Include all styles inline within <style> tags
4. Focus on clean layouts, typography, and user experience
5. Implement modern web design trends (gradients, shadows, smooth animations)
6. Ensure excellent mobile responsiveness
7. Include interactive elements where appropriate
8. Make it production-ready and professional
9. You must include all relevant script tags for libraries to work properly.
Return ONLY the complete HTML code, starting with <!DOCTYPE html> and ending with </html>. Do not include any explanations or markdown formatting.
|
"Create a complete professional service booking website for Genie Xpert β Indore ka apna Xpert, in(...TRUNCATED)
| "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\(...TRUNCATED)
| "You are an expert web developer and designer specializing in modern websites. Create a complete, wo(...TRUNCATED)
|
Make a "Find the odd one out" video for my youtube channel
| "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewpor(...TRUNCATED)
| "You are an expert web developer and designer specializing in modern websites. Create a complete, wo(...TRUNCATED)
|
"Brand: Meli Cream Tagline: From real fruit to royal scoops β 100% fruit, zero additives. Goal: Cr(...TRUNCATED)
| "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\(...TRUNCATED)
| "You are an expert web developer and designer specializing in modern websites. Create a complete, wo(...TRUNCATED)
|
"Design a invitation poster for a workshop whos detail is this \"π Peace Journalism Workshop Topi(...TRUNCATED)
| "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewpor(...TRUNCATED)
| "You are an expert web developer and designer specializing in modern websites. Create a complete, wo(...TRUNCATED)
|
Build me a minimalistic dashboard for tracking my personal income and expenses...
| "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\(...TRUNCATED)
| "You are an expert web developer and designer specializing in modern websites. Create a complete, wo(...TRUNCATED)
|
End of preview. Expand
in Data Studio
README.md exists but content is empty.
- Downloads last month
- 6