Tasks – JumpTask
Available Tasks
Product Satisfaction Survey
Brand Research Inc.
Progress: 42%
4:38 remaining
`);
window.addEventListener('message', (event) => {
if (event.data.type === 'adComplete') {
userBalance += event.data.amount;
updateBalanceDisplay();
const notification = document.createElement('div');
notification.className = 'fixed top-4 right-4 bg-blue-500 text-white px-4 py-2 rounded-md shadow-lg flex items-center';
notification.innerHTML = `
Earned ${event.data.amount.toFixed(2)} for watching ad
`;
document.body.appendChild(notification);
setTimeout(() => {
notification.remove();
}, 3000);
}
});
}
// Initialize
document.addEventListener('DOMContentLoaded', () => {
// Update all balance displays
updateBalanceDisplay();
// Task buttons
document.querySelectorAll('.task-start-btn').forEach(btn => {
btn.addEventListener('click', (e) => {
const card = e.target.closest('.task-card');
const amount = parseFloat(card.querySelector('.task-amount').textContent.replace('