Spaces:
Running
Running
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Expense Ranger - Fun Expense Tracking</title> | |
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> | |
<style> | |
:root { | |
--primary: #4CAF50; | |
--primary-light: #81C784; | |
--primary-dark: #388E3C; | |
--secondary: #FFC107; | |
--accent: #FF5722; | |
--dark: #263238; | |
--light: #ECEFF1; | |
--gray: #90A4AE; | |
--danger: #E53935; | |
--success: #43A047; | |
} | |
* { | |
margin: 0; | |
padding: 0; | |
box-sizing: border-box; | |
font-family: 'Poppins', sans-serif; | |
} | |
body { | |
background-color: #f5f5f5; | |
color: var(--dark); | |
line-height: 1.6; | |
} | |
.container { | |
max-width: 800px; | |
margin: 0 auto; | |
padding: 20px; | |
} | |
header { | |
display: flex; | |
justify-content: space-between; | |
align-items: center; | |
padding: 15px 0; | |
border-bottom: 2px solid var(--primary-light); | |
margin-bottom: 20px; | |
} | |
.logo { | |
display: flex; | |
align-items: center; | |
font-size: 24px; | |
font-weight: 700; | |
color: var(--primary-dark); | |
} | |
.logo i { | |
margin-right: 10px; | |
color: var(--primary); | |
} | |
.user-info { | |
display: flex; | |
align-items: center; | |
} | |
.avatar { | |
width: 40px; | |
height: 40px; | |
border-radius: 50%; | |
background-color: var(--primary-light); | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
color: white; | |
font-weight: bold; | |
margin-left: 15px; | |
} | |
.streak { | |
display: flex; | |
align-items: center; | |
background-color: white; | |
padding: 8px 15px; | |
border-radius: 20px; | |
box-shadow: 0 2px 5px rgba(0,0,0,0.1); | |
} | |
.streak i { | |
color: var(--secondary); | |
margin-right: 5px; | |
} | |
main { | |
display: grid; | |
grid-template-columns: 1fr; | |
gap: 20px; | |
} | |
.card { | |
background-color: white; | |
border-radius: 15px; | |
padding: 20px; | |
box-shadow: 0 4px 10px rgba(0,0,0,0.05); | |
transition: transform 0.2s; | |
} | |
.card:hover { | |
transform: translateY(-5px); | |
} | |
.card-header { | |
display: flex; | |
justify-content: space-between; | |
align-items: center; | |
margin-bottom: 15px; | |
} | |
.card-title { | |
font-size: 18px; | |
font-weight: 600; | |
color: var(--primary-dark); | |
} | |
.card-icon { | |
width: 40px; | |
height: 40px; | |
border-radius: 50%; | |
background-color: var(--primary-light); | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
color: white; | |
} | |
.quick-actions { | |
display: grid; | |
grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); | |
gap: 15px; | |
} | |
.action-btn { | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
justify-content: center; | |
padding: 15px 0; | |
background-color: var(--light); | |
border-radius: 10px; | |
cursor: pointer; | |
transition: all 0.3s; | |
} | |
.action-btn:hover { | |
background-color: var(--primary-light); | |
color: white; | |
} | |
.action-btn i { | |
font-size: 24px; | |
margin-bottom: 5px; | |
color: var(--primary); | |
} | |
.action-btn:hover i { | |
color: white; | |
} | |
.expense-form { | |
display: grid; | |
gap: 15px; | |
} | |
.input-group { | |
display: flex; | |
flex-direction: column; | |
} | |
.input-group label { | |
margin-bottom: 5px; | |
font-weight: 500; | |
color: var(--dark); | |
} | |
.input-group input, .input-group select { | |
padding: 12px 15px; | |
border: 1px solid var(--gray); | |
border-radius: 8px; | |
font-size: 16px; | |
} | |
.submit-btn { | |
background-color: var(--primary); | |
color: white; | |
border: none; | |
padding: 12px; | |
border-radius: 8px; | |
font-size: 16px; | |
font-weight: 600; | |
cursor: pointer; | |
transition: background-color 0.3s; | |
} | |
.submit-btn:hover { | |
background-color: var(--primary-dark); | |
} | |
.expense-list { | |
display: grid; | |
gap: 10px; | |
} | |
.expense-item { | |
display: flex; | |
justify-content: space-between; | |
align-items: center; | |
padding: 15px; | |
background-color: var(--light); | |
border-radius: 10px; | |
} | |
.expense-category { | |
display: flex; | |
align-items: center; | |
} | |
.category-icon { | |
width: 35px; | |
height: 35px; | |
border-radius: 50%; | |
background-color: var(--primary); | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
color: white; | |
margin-right: 10px; | |
} | |
.expense-info h4 { | |
font-size: 15px; | |
margin-bottom: 2px; | |
} | |
.expense-info p { | |
font-size: 12px; | |
color: var(--gray); | |
} | |
.expense-amount { | |
font-weight: 600; | |
color: var(--danger); | |
} | |
.badges-container { | |
display: grid; | |
grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); | |
gap: 15px; | |
} | |
.badge { | |
display: flex; | |
flex-direction: column; | |
align-items: center; | |
padding: 15px; | |
background-color: var(--light); | |
border-radius: 10px; | |
text-align: center; | |
} | |
.badge i { | |
font-size: 30px; | |
margin-bottom: 10px; | |
color: var(--secondary); | |
} | |
.badge-earned i { | |
color: var(--primary); | |
} | |
.badge h4 { | |
font-size: 14px; | |
margin-bottom: 5px; | |
} | |
.badge p { | |
font-size: 12px; | |
color: var(--gray); | |
} | |
.leaderboard { | |
display: grid; | |
gap: 10px; | |
} | |
.leader-item { | |
display: flex; | |
align-items: center; | |
padding: 12px 15px; | |
background-color: var(--light); | |
border-radius: 10px; | |
} | |
.leader-position { | |
width: 30px; | |
height: 30px; | |
border-radius: 50%; | |
background-color: var(--secondary); | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
color: white; | |
font-weight: bold; | |
margin-right: 15px; | |
} | |
.leader-you { | |
background-color: var(--primary); | |
} | |
.leader-name { | |
flex: 1; | |
font-weight: 500; | |
} | |
.leader-score { | |
font-weight: 600; | |
color: var(--primary-dark); | |
} | |
.stats-container { | |
display: grid; | |
grid-template-columns: 1fr 1fr; | |
gap: 15px; | |
margin-bottom: 15px; | |
} | |
.stat-card { | |
background-color: var(--light); | |
border-radius: 10px; | |
padding: 15px; | |
text-align: center; | |
} | |
.stat-value { | |
font-size: 24px; | |
font-weight: 700; | |
color: var(--primary-dark); | |
margin: 5px 0; | |
} | |
.stat-label { | |
font-size: 12px; | |
color: var(--gray); | |
} | |
.progress-container { | |
height: 10px; | |
background-color: #e0e0e0; | |
border-radius: 5px; | |
margin-top: 15px; | |
overflow: hidden; | |
} | |
.progress-bar { | |
height: 100%; | |
background-color: var(--primary); | |
border-radius: 5px; | |
transition: width 0.5s ease; | |
} | |
.daily-challenge { | |
position: relative; | |
background: linear-gradient(135deg, var(--primary-light), var(--primary)); | |
color: white; | |
padding: 20px; | |
border-radius: 15px; | |
overflow: hidden; | |
} | |
.daily-challenge::before { | |
content: ""; | |
position: absolute; | |
top: -50px; | |
right: -50px; | |
width: 150px; | |
height: 150px; | |
background-color: rgba(255,255,255,0.1); | |
border-radius: 50%; | |
} | |
.daily-challenge h3 { | |
position: relative; | |
font-size: 20px; | |
margin-bottom: 15px; | |
} | |
.daily-challenge p { | |
position: relative; | |
margin-bottom: 20px; | |
font-size: 14px; | |
} | |
.challenge-btn { | |
position: relative; | |
background-color: white; | |
color: var(--primary-dark); | |
border: none; | |
padding: 10px 20px; | |
border-radius: 20px; | |
font-weight: 600; | |
cursor: pointer; | |
transition: all 0.3s; | |
} | |
.challenge-btn:hover { | |
background-color: var(--secondary); | |
color: white; | |
} | |
.tabs { | |
display: flex; | |
margin-bottom: 20px; | |
border-bottom: 1px solid #ddd; | |
} | |
.tab { | |
padding: 10px 20px; | |
cursor: pointer; | |
border-bottom: 3px solid transparent; | |
transition: all 0.3s; | |
} | |
.tab.active { | |
border-bottom-color: var(--primary); | |
color: var(--primary); | |
font-weight: 600; | |
} | |
.tab-content { | |
display: none; | |
} | |
.tab-content.active { | |
display: block; | |
} | |
.notification-btn { | |
position: relative; | |
margin-left: 15px; | |
} | |
.notification-btn::after { | |
content: "3"; | |
position: absolute; | |
top: -5px; | |
right: -5px; | |
width: 18px; | |
height: 18px; | |
background-color: var(--accent); | |
color: white; | |
border-radius: 50%; | |
font-size: 10px; | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
} | |
@media (max-width: 600px) { | |
.quick-actions { | |
grid-template-columns: repeat(2, 1fr); | |
} | |
.streak { | |
display: none; | |
} | |
.stats-container { | |
grid-template-columns: 1fr; | |
} | |
} | |
/* Animation for streak */ | |
@keyframes streakPulse { | |
0% { transform: scale(1); } | |
50% { transform: scale(1.1); } | |
100% { transform: scale(1); } | |
} | |
.streak-pulse { | |
animation: streakPulse 0.5s ease; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<header> | |
<div class="logo"> | |
<i class="fas fa-coins"></i> | |
Expense Ranger | |
</div> | |
<div class="user-info"> | |
<div class="streak"> | |
<i class="fas fa-fire"></i> | |
<span id="streak-count">5</span> | |
</div> | |
<div class="notification-btn"> | |
<i class="fas fa-bell"></i> | |
</div> | |
<div class="avatar">JD</div> | |
</div> | |
</header> | |
<main> | |
<section class="card daily-challenge"> | |
<h3>🗓️ Daily Challenge</h3> | |
<p>Spend less than $20 on dining out today and earn 50 XP!</p> | |
<button class="challenge-btn">Accept Challenge</button> | |
</section> | |
<section class="card"> | |
<div class="stats-container"> | |
<div class="stat-card"> | |
<div class="stat-label">This Week</div> | |
<div class="stat-value">$287</div> | |
<div class="progress-container"> | |
<div class="progress-bar" style="width: 65%"></div> | |
</div> | |
</div> | |
<div class="stat-card"> | |
<div class="stat-label">Remaining</div> | |
<div class="stat-value">$113</div> | |
<div class="progress-container"> | |
<div class="progress-bar" style="width: 35%"></div> | |
</div> | |
</div> | |
</div> | |
<div class="quick-actions"> | |
<div class="action-btn" onclick="openExpenseModal()"> | |
<i class="fas fa-plus-circle"></i> | |
<span>Add Expense</span> | |
</div> | |
<div class="action-btn"> | |
<i class="fas fa-chart-pie"></i> | |
<span>Analytics</span> | |
</div> | |
<div class="action-btn"> | |
<i class="fas fa-bullseye"></i> | |
<span>Goals</span> | |
</div> | |
<div class="action-btn"> | |
<i class="fas fa-users"></i> | |
<span>Groups</span> | |
</div> | |
</div> | |
</section> | |
<section class="card"> | |
<div class="card-header"> | |
<div class="card-title">Recent Expenses</div> | |
<div class="card-icon"> | |
<i class="fas fa-receipt"></i> | |
</div> | |
</div> | |
<div class="expense-list"> | |
<div class="expense-item"> | |
<div class="expense-category"> | |
<div class="category-icon"> | |
<i class="fas fa-utensils"></i> | |
</div> | |
<div class="expense-info"> | |
<h4>Lunch with Team</h4> | |
<p>Today, 12:30 PM</p> | |
</div> | |
</div> | |
<div class="expense-amount">-$24.50</div> | |
</div> | |
<div class="expense-item"> | |
<div class="expense-category"> | |
<div class="category-icon"> | |
<i class="fas fa-gas-pump"></i> | |
</div> | |
<div class="expense-info"> | |
<h4>Gas Station</h4> | |
<p>Yesterday, 5:15 PM</p> | |
</div> | |
</div> | |
<div class="expense-amount">-$35.20</div> | |
</div> | |
<div class="expense-item"> | |
<div class="expense-category"> | |
<div class="category-icon"> | |
<i class="fas fa-shopping-bag"></i> | |
</div> | |
<div class="expense-info"> | |
<h4>Office Supplies</h4> | |
<p>Yesterday, 10:00 AM</p> | |
</div> | |
</div> | |
<div class="expense-amount">-$18.75</div> | |
</div> | |
</div> | |
</section> | |
<div class="tabs"> | |
<div class="tab active" onclick="switchTab('badges')">Badges</div> | |
<div class="tab" onclick="switchTab('leaderboard')">Leaderboard</div> | |
</div> | |
<section id="badges-tab" class="tab-content active"> | |
<div class="card"> | |
<div class="card-header"> | |
<div class="card-title">Your Badges</div> | |
<div class="card-icon"> | |
<i class="fas fa-medal"></i> | |
</div> | |
</div> | |
<div class="badges-container"> | |
<div class="badge badge-earned"> | |
<i class="fas fa-medal"></i> | |
<h4>First Step</h4> | |
<p>Logged first expense</p> | |
</div> | |
<div class="badge badge-earned"> | |
<i class="fas fa-calendar-check"></i> | |
<h4>1-Week Streak</h4> | |
<p>7 consecutive days</p> | |
</div> | |
<div class="badge"> | |
<i class="fas fa-calendar-star"></i> | |
<h4>1-Month Streak</h4> | |
<p>30 consecutive days</p> | |
</div> | |
<div class="badge"> | |
<i class="fas fa-piggy-bank"></i> | |
<h4>Savings Pro</h4> | |
<p>Saved $500+</p> | |
</div> | |
<div class="badge"> | |
<i class="fas fa-coffee"></i> | |
<h4>Coffee Master</h4> | |
<p>Saved on 10 coffees</p> | |
</div> | |
<div class="badge"> | |
<i class="fas fa-trophy"></i> | |
<h4>Champion</h4> | |
<p>Top of leaderboard</p> | |
</div> | |
</div> | |
</div> | |
</section> | |
<section id="leaderboard-tab" class="tab-content"> | |
<div class="card"> | |
<div class="card-header"> | |
<div class="card-title">Weekly Challenge</div> | |
<div class="card-icon"> | |
<i class="fas fa-list-ol"></i> | |
</div> | |
</div> | |
<div class="leaderboard"> | |
<div class="leader-item"> | |
<div class="leader-position">1</div> | |
<div class="leader-name">Sarah K.</div> | |
<div class="leader-score">580 XP</div> | |
</div> | |
<div class="leader-item"> | |
<div class="leader-position">2</div> | |
<div class="leader-name">Mike T.</div> | |
<div class="leader-score">420 XP</div> | |
</div> | |
<div class="leader-item"> | |
<div class="leader-position leader-you">3</div> | |
<div class="leader-name">John D. (You)</div> | |
<div class="leader-score">350 XP</div> | |
</div> | |
<div class="leader-item"> | |
<div class="leader-position">4</div> | |
<div class="leader-name">Alex P.</div> | |
<div class="leader-score">310 XP</div> | |
</div> | |
<div class="leader-item"> | |
<div class="leader-position">5</div> | |
<div class="leader-name">Emma L.</div> | |
<div class="leader-score">295 XP</div> | |
</div> | |
</div> | |
</div> | |
</section> | |
</main> | |
</div> | |
<!-- Expense Modal --> | |
<div id="expenseModal" class="modal" style="display:none; position:fixed; top:0; left:0; width:100%; height:100%; background-color:rgba(0,0,0,0.5); z-index:1000; display:flex; justify-content:center; align-items:center;"> | |
<div class="modal-content" style="background-color:white; padding:30px; border-radius:15px; width:90%; max-width:500px; position:relative;"> | |
<span onclick="closeExpenseModal()" style="position:absolute; top:15px; right:20px; font-size:25px; cursor:pointer;">×</span> | |
<h2 style="margin-bottom:20px; color:var(--primary-dark);">Add New Expense</h2> | |
<form class="expense-form"> | |
<div class="input-group"> | |
<label for="expense-amount">Amount ($)</label> | |
<input type="number" id="expense-amount" placeholder="0.00" step="0.01" required> | |
</div> | |
<div class="input-group"> | |
<label for="expense-category">Category</label> | |
<select id="expense-category" required> | |
<option value="">Select a category</option> | |
<option value="food">Food & Dining</option> | |
<option value="transportation">Transportation</option> | |
<option value="shopping">Shopping</option> | |
<option value="entertainment">Entertainment</option> | |
<option value="utilities">Utilities</option> | |
<option value="other">Other</option> | |
</select> | |
</div> | |
<div class="input-group"> | |
<label for="expense-description">Description (Optional)</label> | |
<input type="text" id="expense-description" placeholder="e.g. Team lunch"> | |
</div> | |
<div class="input-group"> | |
<label for="expense-date">Date</label> | |
<input type="date" id="expense-date" required> | |
</div> | |
<button type="submit" class="submit-btn">Add Expense</button> | |
</form> | |
</div> | |
</div> | |
<script> | |
// Switch between tabs | |
function switchTab(tabId) { | |
// Hide all tab contents | |
document.querySelectorAll('.tab-content').forEach(content => { | |
content.classList.remove('active'); | |
}); | |
// Show selected tab content | |
document.getElementById(tabId + '-tab').classList.add('active'); | |
// Update active tab styling | |
document.querySelectorAll('.tab').forEach(tab => { | |
tab.classList.remove('active'); | |
}); | |
event.currentTarget.classList.add('active'); | |
} | |
// Open expense modal | |
function openExpenseModal() { | |
document.getElementById('expenseModal').style.display = 'flex'; | |
} | |
// Close expense modal | |
function closeExpenseModal() { | |
document.getElementById('expenseModal').style.display = 'none'; | |
} | |
// Close modal when clicking outside | |
window.onclick = function(event) { | |
if (event.target == document.getElementById('expenseModal')) { | |
closeExpenseModal(); | |
} | |
} | |
// Streak animation | |
const streakElement = document.querySelector('.streak'); | |
function animateStreak() { | |
streakElement.classList.add('streak-pulse'); | |
setTimeout(() => { | |
streakElement.classList.remove('streak-pulse'); | |
}, 500); | |
} | |
// Animate streak on page load | |
setTimeout(animateStreak, 1000); | |
// Animate streak every 12 hours to remind users | |
setInterval(() => { | |
animateStreak(); | |
}, 12 * 60 * 60 * 1000); | |
// Form submission | |
document.querySelector('.expense-form').addEventListener('submit', function(e) { | |
e.preventDefault(); | |
// In a real app, you would handle the form submission here | |
alert('Expense added successfully! +10 XP'); | |
closeExpenseModal(); | |
// Update streak count | |
const streakCount = document.getElementById('streak-count'); | |
streakCount.textContent = parseInt(streakCount.textContent) + 1; | |
animateStreak(); | |
}); | |
// Daily challenge button | |
document.querySelector('.challenge-btn').addEventListener('click', function() { | |
alert('Challenge accepted! Track your dining out expenses today.'); | |
this.textContent = 'Challenge in Progress'; | |
this.style.backgroundColor = '#FFD700'; | |
this.style.color = 'black'; | |
}); | |
</script> | |
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <a href="https://enzostvs-deepsite.hf.space" style="color: #fff;" target="_blank" >DeepSite</a> <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;"></p></body> | |
</html> |