Download index.html from Fleetpaw/simplepay: direct link, hf CLI and curl.
- Browser
- Download file 64.2 kB
-
https://huggingface.co/spaces/Fleetpaw/simplepay/resolve/main/index.html
- Command line
-
hf download hf://spaces/Fleetpaw/simplepay/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Fleetpaw/simplepay/resolve/main/index.html
64.2 kB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SimplePay - Financial Dashboard</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">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.gradient-bg {
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
}
.card-shadow {
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.slide-fade-enter-active {
transition: all 0.3s ease-out;
}
.slide-fade-leave-active {
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-fade-enter-from,
.slide-fade-leave-to {
transform: translateY(20px);
opacity: 0;
}
.tab-active {
border-bottom: 3px solid #8b5cf6;
color: #8b5cf6;
font-weight: 600;
}
.category-color {
width: 16px;
height: 16px;
border-radius: 4px;
display: inline-block;
margin-right: 8px;
}
.toggle-checkbox:checked {
right: 0;
border-color: #8b5cf6;
}
.toggle-checkbox:checked + .toggle-label {
background-color: #8b5cf6;
}
.verification-code-input {
letter-spacing: 10px;
font-size: 24px;
text-align: center;
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<!-- Login Modal -->
<div id="loginModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-xl p-8 w-full max-w-md mx-4">
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold text-gray-800">Welcome Back</h2>
<button id="closeLoginModal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<!-- Login Form -->
<div id="loginForm">
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Email</label>
<input type="email" id="loginEmail" class="block w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500" placeholder="your@email.com">
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Password</label>
<input type="password" id="loginPassword" class="block w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500" placeholder="••••••••">
</div>
<div class="flex items-center justify-between mb-6">
<div class="flex items-center">
<input type="checkbox" id="rememberMe" class="h-4 w-4 text-purple-600 focus:ring-purple-500 border-gray-300 rounded">
<label for="rememberMe" class="ml-2 block text-sm text-gray-700">Remember me</label>
</div>
<a href="#" class="text-sm text-purple-600 hover:text-purple-800">Forgot password?</a>
</div>
<button id="loginSubmit" class="w-full gradient-bg text-white py-3 px-6 rounded-lg font-semibold hover:opacity-90 transition">
Sign In
</button>
<div class="mt-4 text-center text-sm text-gray-600">
Don't have an account? <a href="#" class="text-purple-600 hover:text-purple-800 font-medium">Sign up</a>
</div>
</div>
<!-- Verification Form (hidden initially) -->
<div id="verificationForm" class="hidden">
<div class="text-center mb-6">
<div class="w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4">
<i class="fas fa-lock text-purple-600 text-2xl"></i>
</div>
<h3 class="text-lg font-bold text-gray-800 mb-1">Two-Step Verification</h3>
<p class="text-sm text-gray-600">We've sent a verification code to your email and phone</p>
</div>
<div class="mb-6">
<label class="block text-sm font-medium text-gray-700 mb-2 text-center">Enter 6-digit code</label>
<div class="flex justify-center space-x-2">
<input type="text" maxlength="1" class="w-12 h-12 text-center border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 verification-code-input">
<input type="text" maxlength="1" class="w-12 h-12 text-center border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 verification-code-input">
<input type="text" maxlength="1" class="w-12 h-12 text-center border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 verification-code-input">
<input type="text" maxlength="1" class="w-12 h-12 text-center border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 verification-code-input">
<input type="text" maxlength="1" class="w-12 h-12 text-center border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 verification-code-input">
<input type="text" maxlength="1" class="w-12 h-12 text-center border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-purple-500 verification-code-input">
</div>
</div>
<div class="text-center text-sm text-gray-500 mb-6">
Didn't receive a code? <a href="#" id="resendCode" class="text-purple-600 hover:text-purple-800 font-medium">Resend</a>
</div>
<button id="verifySubmit" class="w-full gradient-bg text-white py-3 px-6 rounded-lg font-semibold hover:opacity-90 transition">
Verify & Continue
</button>
<button id="backToLogin" class="w-full mt-3 py-2 px-6 text-purple-600 font-medium hover:text-purple-800 transition">
<i class="fas fa-arrow-left mr-2"></i> Back to login
</button>
</div>
</div>
</div>
<div class="gradient-bg text-white py-6 px-4">
<div class="container mx-auto flex justify-between items-center">
<div class="flex items-center space-x-2">
<i class="fas fa-money-bill-wave text-2xl"></i>
<h1 class="text-2xl font-bold">SimplePay</h1>
</div>
<div class="flex space-x-4">
<button id="openLoginBtn" class="px-4 py-2 rounded-full bg-white text-purple-600 font-semibold hover:bg-gray-100 transition">Sign In</button>
<button class="px-4 py-2 rounded-full bg-purple-700 text-white font-semibold hover:bg-purple-800 transition">Sign Up</button>
</div>
</div>
</div>
<div class="container mx-auto px-4 py-6">
<!-- Dashboard Tabs -->
<div class="flex border-b border-gray-200 mb-8 overflow-x-auto">
<button id="paymentTab" class="py-3 px-6 font-medium text-gray-500 hover:text-purple-600 transition tab-active whitespace-nowrap">
<i class="fas fa-exchange-alt mr-2"></i>Payment Transfer
</button>
<button id="expenseTab" class="py-3 px-6 font-medium text-gray-500 hover:text-purple-600 transition whitespace-nowrap">
<i class="fas fa-chart-pie mr-2"></i>Expense Tracker
</button>
<button id="reportsTab" class="py-3 px-6 font-medium text-gray-500 hover:text-purple-600 transition whitespace-nowrap">
<i class="fas fa-file-alt mr-2"></i>Reports
</button>
<button id="settingsTab" class="py-3 px-6 font-medium text-gray-500 hover:text-purple-600 transition whitespace-nowrap">
<i class="fas fa-cog mr-2"></i>Settings
</button>
</div>
<!-- Payment Transfer Section -->
<div id="paymentSection" class="dashboard-section">
<div class="max-w-3xl mx-auto bg-white rounded-xl card-shadow overflow-hidden">
<div class="p-6 border-b border-gray-200">
<h2 class="text-2xl font-bold text-gray-800">Send Payment</h2>
<p class="text-gray-600">Transfer money easily with adjustable commission rates</p>
</div>
<div class="p-6">
<div id="accountLockedWarning" class="hidden bg-red-50 border-l-4 border-red-500 p-4 mb-6">
<div class="flex">
<div class="flex-shrink-0">
<i class="fas fa-lock text-red-500"></i>
</div>
<div class="ml-3">
<p class="text-sm text-red-700">
Your account is currently locked. Please go to Settings to unlock your account.
</p>
</div>
</div>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">From Account</label>
<div class="relative">
<select class="block w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
<option>Personal Account (•••• 1234)</option>
<option>Business Account (•••• 5678)</option>
<option>Savings Account (•••• 9012)</option>
</select>
<div class="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none">
<i class="fas fa-chevron-down text-gray-400"></i>
</div>
</div>
</div>
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">To Recipient</label>
<div class="relative">
<input type="text" placeholder="Email, phone, or account ID" class="block w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
<div class="absolute inset-y-0 right-0 flex items-center pr-3">
<i class="fas fa-user-plus text-gray-400 hover:text-purple-600 cursor-pointer"></i>
</div>
</div>
</div>
</div>
<div class="mt-6">
<label class="block text-sm font-medium text-gray-700 mb-1">Amount</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<span class="text-gray-500">$</span>
</div>
<input type="number" id="amount" placeholder="0.00" class="block w-full pl-8 pr-24 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
<div class="absolute inset-y-0 right-0 flex items-center pr-3">
<span class="text-gray-500">USD</span>
</div>
</div>
<p id="limitWarning" class="hidden text-xs text-red-500 mt-1">Amount exceeds your daily sending limit of $<span id="dailyLimitValue">1000</span></p>
</div>
<div class="mt-6">
<div class="flex justify-between items-center mb-2">
<label class="block text-sm font-medium text-gray-700">Commission Rate</label>
<span id="commissionRateValue" class="text-sm font-medium text-purple-600">2.9%</span>
</div>
<input type="range" id="commissionRate" min="0" max="10" step="0.1", value="2.9" class="w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer">
<div class="flex justify-between text-xs text-gray-500 mt-1">
<span>0%</span>
<span>10%</span>
</div>
</div>
<div class="mt-8 bg-gray-50 p-4 rounded-lg">
<div class="flex justify-between py-2">
<span class="text-gray-600">Amount to send</span>
<span id="sendAmount" class="font-medium">$0.00</span>
</div>
<div class="flex justify-between py-2">
<span class="text-gray-600">Commission fee (<span id="feePercentage">2.9</span>%)</span>
<span id="feeAmount" class="font-medium">$0.00</span>
</div>
<div class="border-t border-gray-200 my-2"></div>
<div class="flex justify-between py-2">
<span class="text-gray-800 font-semibold">Total to pay</span>
<span id="totalAmount" class="text-purple-600 font-bold">$0.00</span>
</div>
</div>
<div class="mt-6">
<button id="sendPaymentBtn" class="w-full gradient-bg text-white py-3 px-6 rounded-lg font-semibold hover:opacity-90 transition disabled:opacity-50 disabled:cursor-not-allowed" disabled>
Send Payment
</button>
</div>
</div>
</div>
<div class="max-w-3xl mx-auto mt-8 bg-white rounded-xl card-shadow overflow-hidden">
<div class="p-6 border-b border-gray-200">
<h2 class="text-xl font-bold text-gray-800">Recent Transactions</h2>
</div>
<div class="p-6">
<div class="space-y-4">
<div class="flex items-center justify-between p-3 hover:bg-gray-50 rounded-lg transition">
<div class="flex items-center space-x-3">
<div class="w-10 h-10 rounded-full bg-purple-100 flex items-center justify-center">
<i class="fas fa-user text-purple-600"></i>
</div>
<div>
<p class="font-medium">John Doe</p>
<p class="text-sm text-gray-500">Today, 10:30 AM</p>
</div>
</div>
<div class="text-right">
<p class="font-medium text-green-600">+$125.00</p>
<p class="text-sm text-gray-500">Completed</p>
</div>
</div>
<div class="flex items-center justify-between p-3 hover:bg-gray-50 rounded-lg transition">
<div class="flex items-center space-x-3">
<div class="w-10 h-10 rounded-full bg-blue-100 flex items-center justify-center">
<i class="fas fa-store text-blue-600"></i>
</div>
<div>
<p class="font-medium">Acme Corp</p>
<p class="text-sm text-gray-500">Yesterday, 4:15 PM</p>
</div>
</div>
<div class="text-right">
<p class="font-medium text-red-600">-$89.50</p>
<p class="text-sm text-gray-500">Completed</p>
</div>
</div>
</div>
<button class="w-full mt-6 py-2 px-4 border border-gray-300 rounded-lg text-purple-600 font-medium hover:bg-gray-50 transition">
View All Transactions
</button>
</div>
</div>
</div>
<!-- Expense Tracker Section -->
<div id="expenseSection" class="dashboard-section hidden">
<div class="grid grid-cols-1 lg:grid-cols-3 gap-6">
<!-- Add Expense Form -->
<div class="bg-white rounded-xl card-shadow p-6">
<h2 class="text-xl font-bold text-gray-800 mb-4">Add New Expense</h2>
<form id="expenseForm">
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Amount</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<span class="text-gray-500">$</span>
</div>
<input type="number" id="expenseAmount" placeholder="0.00", class="block w-full pl-8 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500" required>
</div>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Category</label>
<div class="relative">
<select id="expenseCategory" class="block w-full px-4 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500" required>
<option value="">Select a category</option>
<option value="food" data-color="#F87171">Food & Dining</option>
<option value="transport" data-color="#60A5FA">Transportation</option>
<option value="housing" data-color="#34D399">Housing</option>
<option value="utilities", data-color="#FBBF24">Utilities</option>
<option value="shopping" data-color="#A78BFA">Shopping</option>
<option value="entertainment" data-color="#F472B6">Entertainment</option>
<option value="health" data-color="#4ADE80">Health</option>
<option value="other" data-color="#94A3B8">Other</option>
</select>
<div class="absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none">
<i class="fas fa-chevron-down text-gray-400"></i>
</div>
</div>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Date</label>
<input type="date" id="expenseDate" class="block w-full px-4 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500" required>
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Description (Optional)</label>
<input type="text" id="expenseDescription" placeholder="Brief description", class="block w-full px-4 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
</div>
<button type="submit" class="w-full gradient-bg text-white py-2 px-4 rounded-lg font-semibold hover:opacity-90 transition">
Add Expense
</button>
</form>
</div>
<!-- Expense Summary -->
<div class="bg-white rounded-xl card-shadow p-6">
<h2 class="text-xl font-bold text-gray-800 mb-4">Expense Summary</h2>
<div class="mb-6">
<canvas id="expenseChart" height="200"></canvas>
</div>
<div class="space-y-3">
<div class="flex justify-between items-center">
<span class="text-gray-600">Total Expenses This Month</span>
<span id="monthlyTotal" class="font-bold text-red-600">$0.00</span>
</div>
<div class="flex justify-between items-center">
<span class="text-gray-600">Daily Average</span>
<span id="dailyAverage" class="font-medium text-gray-700">$0.00</span>
</div>
<div class="flex justify-between items-center">
<span class="text-gray-600">Budget Remaining</span>
<span id="budgetRemaining" class="font-medium text-green-600">$1,500.00</span>
</div>
</div>
</div>
<!-- Recent Expenses -->
<div class="bg-white rounded-xl card-shadow p-6">
<div class="flex justify-between items-center mb-4">
<h2 class="text-xl font-bold text-gray-800">Recent Expenses</h2>
<button id="clearExpenses" class="text-sm text-red-500 hover:text-red-700">Clear All</button>
</div>
<div id="expenseList" class="space-y-3 max-h-96 overflow-y-auto">
<div class="text-center py-8 text-gray-500">
<i class="fas fa-receipt text-4xl mb-2"></i>
<p>No expenses recorded yet</p>
</div>
</div>
</div>
</div>
</div>
<!-- Reports Section -->
<div id="reportsSection" class="dashboard-section hidden">
<div class="bg-white rounded-xl card-shadow p-6">
<h2 class="text-xl font-bold text-gray-800 mb-6">Financial Reports</h2>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6 mb-8">
<div class="bg-gray-50 p-4 rounded-lg">
<h3 class="font-medium text-gray-700 mb-3">Monthly Spending</h3>
<canvas id="monthlyTrendChart" height="250"></canvas>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<h3 class="font-medium text-gray-700 mb-3">Category Breakdown</h3>
<canvas id="categoryBreakdownChart" height="250"></canvas>
</div>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<h3 class="font-medium text-gray-700 mb-3">Expense History</h3>
<div class="overflow-x-auto">
<table class="min-w-full divide-y divide-gray-200">
<thead class="bg-gray-100">
<tr>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Date</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Amount</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Category</th>
<th class="px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider">Description</th>
</tr>
</thead>
<tbody id="expenseHistory" class="bg-white divide-y divide-gray-200">
<tr>
<td colspan="4" class="px-6 py-4 text-center text-gray-500">No expense data available</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- Settings Section -->
<div id="settingsSection" class="dashboard-section hidden">
<div class="max-w-3xl mx-auto bg-white rounded-xl card-shadow overflow-hidden">
<div class="p-6 border-b border-gray-200">
<h2 class="text-2xl font-bold text-gray-800">Account Settings</h2>
<p class="text-gray-600">Manage your account preferences and security</p>
</div>
<div class="p-6">
<!-- Security Settings -->
<div class="mb-8">
<h3 class="text-lg font-semibold text-gray-800 mb-4">Security Settings</h3>
<!-- Emergency Lock -->
<div class="flex items-center justify-between py-4 border-b border-gray-100">
<div>
<h4 class="font-medium text-gray-800">Emergency Account Lock</h4>
<p class="text-sm text-gray-500">Immediately lock all outgoing transactions</p>
</div>
<div class="relative inline-block w-10 mr-2 align-middle select-none">
<input type="checkbox" id="accountLockToggle" class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"/>
<label for="accountLockToggle" class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"></label>
</div>
</div>
<!-- Two-Factor Authentication -->
<div class="flex items-center justify-between py-4 border-b border-gray-100">
<div>
<h4 class="font-medium text-gray-800">Two-Factor Authentication</h4>
<p class="text-sm text-gray-500">Add an extra layer of security to your account</p>
</div>
<div class="relative inline-block w-10 mr-2 align-middle select-none">
<input type="checkbox" id="twoFactorToggle" class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer" checked/>
<label for="twoFactorToggle" class="toggle-label block overflow-hidden h-6 rounded-full bg-purple-500 cursor-pointer"></label>
</div>
</div>
</div>
<!-- Transaction Limits -->
<div class="mb-8">
<h3 class="text-lg font-semibold text-gray-800 mb-4">Transaction Limits</h3>
<!-- Daily Limit -->
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Daily Sending Limit</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<span class="text-gray-500">$</span>
</div>
<input type="number" id="dailyLimit" value="1000" class="block w-full pl-8 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
</div>
<p class="text-xs text-gray-500 mt-1">Maximum amount you can send in a day</p>
</div>
<!-- Single Transaction Limit -->
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Single Transaction Limit</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<span class="text-gray-500">$</span>
</div>
<input type="number" id="singleTransactionLimit" value="500" class="block w-full pl-8 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
</div>
<p class="text-xs text-gray-500 mt-1">Maximum amount per single transaction</p>
</div>
<!-- Monthly Limit -->
<div>
<label class="block text-sm font-medium text-gray-700 mb-1">Monthly Sending Limit</label>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<span class="text-gray-500">$</span>
</div>
<input type="number" id="monthlyLimit" value="5000" class="block w-full pl-8 py-2 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500">
</div>
<p class="text-xs text-gray-500 mt-1">Maximum amount you can send in a month</p>
</div>
</div>
<!-- Notification Preferences -->
<div>
<h3 class="text-lg font-semibold text-gray-800 mb-4">Notification Preferences</h3>
<!-- Email Notifications -->
<div class="flex items-center justify-between py-4 border-b border-gray-100">
<div>
<h4 class="font-medium text-gray-800">Email Notifications</h4>
<p class="text-sm text-gray-500">Receive important updates via email</p>
</div>
<div class="relative inline-block w-10 mr-2 align-middle select-none">
<input type="checkbox" id="emailNotifications" class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer" checked/>
<label for="emailNotifications" class="toggle-label block overflow-hidden h-6 rounded-full bg-purple-500 cursor-pointer"></label>
</div>
</div>
<!-- SMS Notifications -->
<div class="flex items-center justify-between py-4">
<div>
<h4 class="font-medium text-gray-800">SMS Notifications</h4>
<p class="text-sm text-gray-500">Receive transaction alerts via SMS</p>
</div>
<div class="relative inline-block w-10 mr-2 align-middle select-none">
<input type="checkbox", id="smsNotifications" class="toggle-checkbox absolute block w-6 h-6 rounded-full bg-white border-4 appearance-none cursor-pointer"/>
<label for="smsNotifications" class="toggle-label block overflow-hidden h-6 rounded-full bg-gray-300 cursor-pointer"></label>
</div>
</div>
</div>
<!-- Save Button -->
<div class="mt-8">
<button id="saveSettings" class="w-full gradient-bg text-white py-3 px-6 rounded-lg font-semibold hover:opacity-90 transition">
Save Settings
</button>
</div>
</div>
</div>
</div>
</div>
<footer class="bg-gray-100 py-8 mt-12">
<div class="container mx-auto px-4">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="flex items-center space-x-2 mb-4 md:mb-0">
<i class="fas fa-money-bill-wave text-2xl text-purple-600"></i>
<h2 class="text-xl font-bold text-gray-800">SimplePay</h2>
</div>
<div class="flex space-x-6">
<a href="#" class="text-gray-600 hover:text-purple-600 transition">Privacy</a>
<a href="#" class="text-gray-600 hover:text-purple-600 transition">Terms</a>
<a href="#" class="text-gray-600 hover:text-purple-600 transition">Support</a>
</div>
</div>
<div class="mt-6 text-center text-gray-500 text-sm">
© 2023 SimplePay. All rights reserved.
</div>
</div>
</footer>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Login Modal Logic
const loginModal = document.getElementById('loginModal');
const openLoginBtn = document.getElementById('openLoginBtn');
const closeLoginModal = document.getElementById('closeLoginModal');
const loginForm = document.getElementById('loginForm');
const verificationForm = document.getElementById('verificationForm');
const backToLogin = document.getElementById('backToLogin');
const verifySubmit = document.getElementById('verifySubmit');
const resendCode = document.getElementById('resendCode');
const codeInputs = document.querySelectorAll('.verification-code-input');
// Show login modal
openLoginBtn.addEventListener('click', function() {
loginModal.classList.remove('hidden');
loginForm.classList.remove('hidden');
verificationForm.classList.add('hidden');
});
// Close login modal
closeLoginModal.addEventListener('click', function() {
loginModal.classList.add('hidden');
});
// Login form submission
document.getElementById('loginSubmit').addEventListener('click', function(e) {
e.preventDefault();
const email = document.getElementById('loginEmail').value;
const password = document.getElementById('loginPassword').value;
if (!email || !password) {
alert('Please enter both email and password');
return;
}
// In a real app, you would validate credentials with your backend
// Here we'll simulate a successful login that requires verification
// Show verification form
loginForm.classList.add('hidden');
verificationForm.classList.remove('hidden');
// Focus first code input
codeInputs[0].focus();
// Simulate sending verification code
console.log('Verification code sent to user');
});
// Back to login from verification
backToLogin.addEventListener('click', function() {
verificationForm.classList.add('hidden');
loginForm.classList.remove('hidden');
});
// Resend verification code
resendCode.addEventListener('click', function(e) {
e.preventDefault();
alert('New verification code sent!');
// In a real app, you would resend the code via email/SMS
});
// Verification code input handling
codeInputs.forEach((input, index) => {
// Move to next input when a digit is entered
input.addEventListener('input', function() {
if (this.value.length === 1) {
if (index < codeInputs.length - 1) {
codeInputs[index + 1].focus();
} else {
this.blur();
}
}
});
// Allow backspace to move to previous input
input.addEventListener('keydown', function(e) {
if (e.key === 'Backspace' && this.value.length === 0) {
if (index > 0) {
codeInputs[index - 1].focus();
}
}
});
});
// Verify code submission
verifySubmit.addEventListener('click', function() {
// Collect all code digits
let verificationCode = '';
codeInputs.forEach(input => {
verificationCode += input.value;
});
if (verificationCode.length !== 6) {
alert('Please enter the full 6-digit code');
return;
}
// In a real app, you would validate the code with your backend
// Here we'll just simulate successful verification
// Close modal and show success
loginModal.classList.add('hidden');
alert('Login successful! Welcome back.');
// Reset forms
document.getElementById('loginForm').reset();
codeInputs.forEach(input => input.value = '');
// In a real app, you would now show the authenticated user interface
});
// Payment Transfer Logic
const amountInput = document.getElementById('amount');
const commissionRate = document.getElementById('commissionRate');
const commissionRateValue = document.getElementById('commissionRateValue');
const feePercentage = document.getElementById('feePercentage');
const sendAmount = document.getElementById('sendAmount');
const feeAmount = document.getElementById('feeAmount');
const totalAmount = document.getElementById('totalAmount');
const sendPaymentBtn = document.getElementById('sendPaymentBtn');
const limitWarning = document.getElementById('limitWarning');
const dailyLimitValue = document.getElementById('dailyLimitValue');
const accountLockedWarning = document.getElementById('accountLockedWarning');
// Settings
const accountLockToggle = document.getElementById('accountLockToggle');
const dailyLimit = document.getElementById('dailyLimit');
const singleTransactionLimit = document.getElementById('singleTransactionLimit');
const monthlyLimit = document.getElementById('monthlyLimit');
const saveSettings = document.getElementById('saveSettings');
// Initialize settings from localStorage
let settings = JSON.parse(localStorage.getItem('settings')) || {
accountLocked: false,
dailyLimit: 1000,
singleTransactionLimit: 500,
monthlyLimit: 5000,
twoFactorEnabled: true,
emailNotifications: true,
smsNotifications: false
};
// Apply settings
function applySettings() {
accountLockToggle.checked = settings.accountLocked;
dailyLimit.value = settings.dailyLimit;
singleTransactionLimit.value = settings.singleTransactionLimit;
monthlyLimit.value = settings.monthlyLimit;
document.getElementById('twoFactorToggle').checked = settings.twoFactorEnabled;
document.getElementById('emailNotifications').checked = settings.emailNotifications;
document.getElementById('smsNotifications').checked = settings.smsNotifications;
// Update UI based on account lock status
if (settings.accountLocked) {
accountLockedWarning.classList.remove('hidden');
sendPaymentBtn.disabled = true;
} else {
accountLockedWarning.classList.add('hidden');
}
// Update daily limit display
dailyLimitValue.textContent = settings.dailyLimit;
}
// Save settings
function saveSettingsToStorage() {
settings = {
accountLocked: accountLockToggle.checked,
dailyLimit: parseFloat(dailyLimit.value) || 0,
singleTransactionLimit: parseFloat(singleTransactionLimit.value) || 0,
monthlyLimit: parseFloat(monthlyLimit.value) || 0,
twoFactorEnabled: document.getElementById('twoFactorToggle').checked,
emailNotifications: document.getElementById('emailNotifications').checked,
smsNotifications: document.getElementById('smsNotifications').checked
};
localStorage.setItem('settings', JSON.stringify(settings));
applySettings();
// Show success message
alert('Settings saved successfully!');
}
// Initialize settings
applySettings();
// Save settings button
saveSettings.addEventListener('click', saveSettingsToStorage);
// Update commission rate display
commissionRate.addEventListener('input', function() {
const rate = parseFloat(this.value);
commissionRateValue.textContent = rate.toFixed(1) + '%';
feePercentage.textContent = rate.toFixed(1);
calculateAmounts();
});
// Calculate amounts when input changes
amountInput.addEventListener('input', calculateAmounts);
function calculateAmounts() {
const amount = parseFloat(amountInput.value) || 0;
const rate = parseFloat(commissionRate.value) / 100;
const fee = amount * rate;
const total = amount + fee;
sendAmount.textContent = '$' + amount.toFixed(2);
feeAmount.textContent = '$' + fee.toFixed(2);
totalAmount.textContent = '$' + total.toFixed(2);
// Check against limits
if (amount > settings.singleTransactionLimit) {
limitWarning.classList.remove('hidden');
sendPaymentBtn.disabled = true;
} else {
limitWarning.classList.add('hidden');
// Enable/disable send button based on amount and account lock status
sendPaymentBtn.disabled = amount <= 0 || settings.accountLocked;
}
}
// Send payment button click
sendPaymentBtn.addEventListener('click', function() {
const amount = parseFloat(amountInput.value) || 0;
const rate = parseFloat(commissionRate.value);
if (amount <= 0) return;
// Show success message
alert(`Payment of $${amount.toFixed(2)} sent successfully!\nCommission fee: $${(amount * rate/100).toFixed(2)} (${rate.toFixed(1)}%)`);
// Reset form
amountInput.value = '';
calculateAmounts();
});
// Initialize calculations
calculateAmounts();
// Dashboard Tabs Logic
const paymentTab = document.getElementById('paymentTab');
const expenseTab = document.getElementById('expenseTab');
const reportsTab = document.getElementById('reportsTab');
const settingsTab = document.getElementById('settingsTab');
const paymentSection = document.getElementById('paymentSection');
const expenseSection = document.getElementById('expenseSection');
const reportsSection = document.getElementById('reportsSection');
const settingsSection = document.getElementById('settingsSection');
function setActiveTab(tab) {
// Remove active class from all tabs
[paymentTab, expenseTab, reportsTab, settingsTab].forEach(t => t.classList.remove('tab-active'));
// Hide all sections
[paymentSection, expenseSection, reportsSection, settingsSection].forEach(s => s.classList.add('hidden'));
// Add active class to selected tab and show corresponding section
tab.classList.add('tab-active');
if (tab === paymentTab) {
paymentSection.classList.remove('hidden');
} else if (tab === expenseTab) {
expenseSection.classList.remove('hidden');
renderExpenseCharts();
} else if (tab === reportsTab) {
reportsSection.classList.remove('hidden');
renderReportCharts();
} else if (tab === settingsTab) {
settingsSection.classList.remove('hidden');
}
}
paymentTab.addEventListener('click', () => setActiveTab(paymentTab));
expenseTab.addEventListener('click', () => setActiveTab(expenseTab));
reportsTab.addEventListener('click', () => setActiveTab(reportsTab));
settingsTab.addEventListener('click', () => setActiveTab(settingsTab));
// Expense Tracker Logic
const expenseForm = document.getElementById('expenseForm');
const expenseList = document.getElementById('expenseList');
const clearExpenses = document.getElementById('clearExpenses');
let expenses = JSON.parse(localStorage.getItem('expenses')) || [];
// Sample data if empty
if (expenses.length === 0) {
expenses = [
{ id: 1, amount: 45.50, category: 'food', date: '2023-06-15', description: 'Dinner at restaurant', color: '#F87171' },
{ id: 2, amount: 22.30, category: 'transport', date: '2023-06-14', description: 'Taxi ride', color: '#60A5FA' },
{ id: 3, amount: 120.00, category: 'shopping', date: '2023-06-12', description: 'New clothes', color: '#A78BFA' },
{ id: 4, amount: 15.99, category: 'entertainment', date: '2023-06-10', description: 'Movie tickets', color: '#F472B6' },
{ id: 5, amount: 89.50, category: 'housing', date: '2023-06-05', description: 'Home supplies', color: '#34D399' }
];
saveExpenses();
}
// Initialize expense list
renderExpenseList();
// Expense form submission
expenseForm.addEventListener('submit', function(e) {
e.preventDefault();
const amount = parseFloat(document.getElementById('expenseAmount').value);
const category = document.getElementById('expenseCategory').value;
const date = document.getElementById('expenseDate').value;
const description = document.getElementById('expenseDescription').value;
const color = document.getElementById('expenseCategory').options[document.getElementById('expenseCategory').selectedIndex].getAttribute('data-color');
if (!amount || !category || !date) return;
const newExpense = {
id: Date.now(),
amount: amount,
category: category,
date: date,
description: description || 'No description',
color: color
};
expenses.push(newExpense);
saveExpenses();
renderExpenseList();
renderExpenseCharts();
// Reset form
expenseForm.reset();
document.getElementById('expenseDate').valueAsDate = new Date();
});
// Set default date to today
document.getElementById('expenseDate').valueAsDate = new Date();
// Clear all expenses
clearExpenses.addEventListener('click', function() {
if (confirm('Are you sure you want to clear all expenses? This cannot be undone.')) {
expenses = [];
saveExpenses();
renderExpenseList();
renderExpenseCharts();
}
});
// Render expense list
function renderExpenseList() {
if (expenses.length === 0) {
expenseList.innerHTML = `
<div class="text-center py-8 text-gray-500">
<i class="fas fa-receipt text-4xl mb-2"></i>
<p>No expenses recorded yet</p>
</div>
`;
return;
}
// Sort by date (newest first)
const sortedExpenses = [...expenses].sort((a, b) => new Date(b.date) - new Date(a.date));
expenseList.innerHTML = sortedExpenses.slice(0, 10).map(expense => `
<div class="flex items-center justify-between p-3 bg-gray-50 rounded-lg">
<div class="flex items-center space-x-3">
<span class="category-color" style="background-color: ${expense.color}"></span>
<div>
<p class="font-medium capitalize">${expense.category}</p>
<p class="text-sm text-gray-500">${formatDate(expense.date)}</p>
</div>
</div>
<div class="text-right">
<p class="font-medium text-red-600">-$${expense.amount.toFixed(2)}</p>
<p class="text-sm text-gray-500 truncate max-w-xs">${expense.description}</p>
</div>
</div>
`).join('');
// Update summary
updateExpenseSummary();
}
// Format date
function formatDate(dateString) {
const options = { year: 'numeric', month: 'short', day: 'numeric' };
return new Date(dateString).toLocaleDateString(undefined, options);
}
// Update expense summary
function updateExpenseSummary() {
const monthlyTotal = expenses.reduce((sum, expense) => {
const expenseDate = new Date(expense.date);
const currentDate = new Date();
if (expenseDate.getMonth() === currentDate.getMonth() &&
expenseDate.getFullYear() === currentDate.getFullYear()) {
return sum + expense.amount;
}
return sum;
}, 0);
const daysInMonth = new Date(new Date().getFullYear(), new Date().getMonth() + 1, 0).getDate();
const daysPassed = new Date().getDate();
const dailyAverage = monthlyTotal / daysPassed;
const budget = 1500;
const remaining = budget - monthlyTotal;
document.getElementById('monthlyTotal').textContent = `-$${monthlyTotal.toFixed(2)}`;
document.getElementById('dailyAverage').textContent = `$${dailyAverage.toFixed(2)}`;
document.getElementById('budgetRemaining').textContent = `$${remaining.toFixed(2)}`;
}
// Save expenses to localStorage
function saveExpenses() {
localStorage.setItem('expenses', JSON.stringify(expenses));
}
// Expense Charts
let expenseChart, monthlyTrendChart, categoryBreakdownChart;
function renderExpenseCharts() {
// Donut chart for expense categories
const ctx = document.getElementById('expenseChart').getContext('2d');
// Group expenses by category
const categories = {};
expenses.forEach(expense => {
if (!categories[expense.category]) {
categories[expense.category] = {
total: 0,
color: expense.color
};
}
categories[expense.category].total += expense.amount;
});
const categoryLabels = Object.keys(categories);
const categoryData = Object.values(categories).map(c => c.total);
const categoryColors = Object.values(categories).map(c => c.color);
if (expenseChart) expenseChart.destroy();
expenseChart = new Chart(ctx, {
type: 'doughnut',
data: {
labels: categoryLabels.map(c => c.charAt(0).toUpperCase() + c.slice(1)),
datasets: [{
data: categoryData,
backgroundColor: categoryColors,
borderWidth: 0
}]
},
options: {
cutout: '70%',
plugins: {
legend: {
position: 'right',
labels: {
boxWidth: 12,
padding: 20
}
}
},
maintainAspectRatio: false
}
});
updateExpenseSummary();
}
function renderReportCharts() {
// Monthly trend chart
const monthlyCtx = document.getElementById('monthlyTrendChart').getContext('2d');
// Group by month
const monthlyData = {};
expenses.forEach(expense => {
const date = new Date(expense.date);
const monthYear = `${date.getFullYear()}-${date.getMonth()}`;
if (!monthlyData[monthYear]) {
monthlyData[monthYear] = 0;
}
monthlyData[monthYear] += expense.amount;
});
// Sort by date
const sortedMonths = Object.keys(monthlyData).sort();
const monthLabels = sortedMonths.map(month => {
const [year, month] = month.split('-');
return new Date(year, month).toLocaleDateString(undefined, { month: 'short', year: 'numeric' });
});
const monthValues = sortedMonths.map(month => monthlyData[month]);
if (monthlyTrendChart) monthlyTrendChart.destroy();
monthlyTrendChart = new Chart(monthlyCtx, {
type: 'line',
data: {
labels: monthLabels,
datasets: [{
label: 'Monthly Expenses',
data: monthValues,
backgroundColor: 'rgba(139, 92, 246, 0.1)',
borderColor: '#8b5cf6',
borderWidth: 2,
tension: 0.3,
fill: true
}]
},
options: {
responsive: true,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: true,
grid: {
drawBorder: false
}
},
x: {
grid: {
display: false
}
}
}
}
});
// Category breakdown chart
const categoryCtx = document.getElementById('categoryBreakdownChart').getContext('2d');
// Group by category
const categoryData = {};
expenses.forEach(expense => {
if (!categoryData[expense.category]) {
categoryData[expense.category] = {
total: 0,
color: expense.color
};
}
categoryData[expense.category].total += expense.amount;
});
const categoryLabels = Object.keys(categoryData).map(c => c.charAt(0).toUpperCase() + c.slice(1));
const categoryValues = Object.values(categoryData).map(c => c.total);
const categoryColors = Object.values(categoryData).map(c => c.color);
if (categoryBreakdownChart) categoryBreakdownChart.destroy();
categoryBreakdownChart = new Chart(categoryCtx, {
type: 'bar',
data: {
labels: categoryLabels,
datasets: [{
label: 'Amount',
data: categoryValues,
backgroundColor: categoryColors,
borderWidth: 0
}]
},
options: {
responsive: true,
plugins: {
legend: {
display: false
}
},
scales: {
y: {
beginAtZero: true,
grid: {
drawBorder: false
}
},
x: {
grid: {
display: false
}
}
}
}
});
// Render expense history table
renderExpenseHistory();
}
function renderExpenseHistory() {
const expenseHistory = document.getElementById('expenseHistory');
if (expenses.length === 0) {
expenseHistory.innerHTML = `
<tr>
<td colspan="4", class="px-6 py-4 text-center text-gray-500">No expense data available</td>
</tr>
`;
return;
}
// Sort by date (newest first)
const sortedExpenses = [...expenses].sort((a, b) => new Date(b.date) - new Date(a.date));
expenseHistory.innerHTML = sortedExpenses.map(expense => `
<tr>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500">${formatDate(expense.date)}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm font-medium text-red-600">-$${expense.amount.toFixed(2)}</td>
<td class="px-6 py-4 whitespace-nowrap text-sm text-gray-500 capitalize">${expense.category}</td>
<td class="px-6 py-4 text-sm text-gray-500">${expense.description}</td>
</tr>
`).join('');
}
});
</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 <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=Fleetpaw/simplepay" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SimplePay - Financial Dashboard</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">
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
.gradient-bg {
background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
}
.card-shadow {
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.slide-fade-enter-active {
transition: all 0.3s ease-out;
}
.slide-fade-leave-active {
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-fade-enter-from,
.slide-fade-leave-to {
transform: translateY(20px);
opacity: 0;
}
.tab-active {
border-bottom: 3px solid #8b5cf6;
color: #8b5cf6;
font-weight: 600;
}
.category-color {
width: 16px;
height: 16px;
border-radius: 4px;
display: inline-block;
margin-right: 8px;
}
.toggle-checkbox:checked {
right: 0;
border-color: #8b5cf6;
}
.toggle-checkbox:checked + .toggle-label {
background-color: #8b5cf6;
}
.verification-code-input {
letter-spacing: 10px;
font-size: 24px;
text-align: center;
}
</style>
</head>
<body class="bg-gray-50 min-h-screen">
<!-- Login Modal -->
<div id="loginModal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
<div class="bg-white rounded-xl p-8 w-full max-w-md mx-4">
<div class="flex justify-between items-center mb-6">
<h2 class="text-2xl font-bold text-gray-800">Welcome Back</h2>
<button id="closeLoginModal" class="text-gray-500 hover:text-gray-700">
<i class="fas fa-times"></i>
</button>
</div>
<!-- Login Form -->
<div id="loginForm">
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Email</label>
<input type="email" id="loginEmail" class="block w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500" placeholder="your@email.com">
</div>
<div class="mb-4">
<label class="block text-sm font-medium text-gray-700 mb-1">Password</label>
<input type="password" id="loginPassword" class="block w-full px-4 py-3 rounded-lg border border-gray-300 focus:ring-2 focus:ring-purple-500 focus:border-purple-500" placeholder="••••••••">
</div>
<div class="flex items-center justify-between mb-6">
<div class="flex items-center">
<input type="checkbox" id="rememberMe" class="h-4 w-4 text-purple-600 focus:ring-purple-500 border-gray-300 rounded">
<label for="rememberMe" class="ml-2 block text-sm text-gray-700">Remember me</label>
</div>
<a href="#" class="text-sm text-purple-600 hover:text-purple-800">Forgot password?</a>
</div>
<button id="loginSubmit" class="w-full gradient-bg text-white py-3 px-6 rounded-lg font-semibold hover:opacity-90 transition">
Sign In
</button>
<div class="mt-4 text-center text-sm text-gray-600">
Don't have an account? <a href="#" class="text-purple-600 hover:text-purple-800 font-medium">Sign up</a>
</div>
</div>
<!-- Verification Form (hidden initially) -->
<div id="verificationForm" class="hidden">
<div class="text-center mb-6">
<div class="w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4">
<i class="fas fa-lock text-purple-600 text-2xl"></i>
</div>
<h3 class="text-lg font-bold text-gray-800 mb-1">Two-Step Verification</h3>