Download index.html from shad2/mything: direct link, hf CLI and curl.
- Browser
- Download file 20.1 kB
-
https://huggingface.co/spaces/shad2/mything/resolve/main/index.html
- Command line
-
hf download hf://spaces/shad2/mything/index.html
-
curl -L -o index.html https://huggingface.co/spaces/shad2/mything/resolve/main/index.html
20.1 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Earnify - Earn by Watching Ads</title> | |
| <script src="https://cdn.tailwindcss.com"></script> | |
| <link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet"> | |
| <script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script> | |
| <script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script> | |
| <script src="https://unpkg.com/feather-icons"></script> | |
| <script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-app.js"></script> | |
| <script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-auth.js"></script> | |
| <script src="https://www.gstatic.com/firebasejs/8.10.0/firebase-database.js"></script> | |
| <style> | |
| .gradient-text { | |
| background: linear-gradient(90deg, #3b82f6, #1d4ed8); | |
| -webkit-background-clip: text; | |
| background-clip: text; | |
| color: transparent; | |
| } | |
| .ad-container { | |
| height: 250px; | |
| background-color: #f3f4f6; | |
| display: flex; | |
| align-items: center; | |
| justify-content: center; | |
| border-radius: 12px; | |
| margin: 1rem 0; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-black text-white min-h-screen"> | |
| <div id="auth-container" class="flex flex-col items-center justify-center min-h-screen p-4"> | |
| <div class="w-full max-w-md bg-gray-900 rounded-lg shadow-lg p-8" data-aos="fade-up"> | |
| <div class="text-center mb-8"> | |
| <h1 class="text-4xl font-bold mb-2 gradient-text">Earnify</h1> | |
| <p class="text-gray-400">Watch ads, earn coins, withdraw rewards</p> | |
| </div> | |
| <div id="login-form" class="space-y-4"> | |
| <div> | |
| <label for="login-email" class="block text-gray-400 mb-2">Email</label> | |
| <input type="email" id="login-email" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 text-white focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| </div> | |
| <div> | |
| <label for="login-password" class="block text-gray-400 mb-2">Password</label> | |
| <input type="password" id="login-password" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 text-white focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| </div> | |
| <button onclick="login()" class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded-lg transition duration-200"> | |
| Login | |
| </button> | |
| <p class="text-center text-gray-400">Don't have an account? <span class="text-blue-500 cursor-pointer" onclick="showRegister()">Register</span></p> | |
| </div> | |
| <div id="register-form" class="space-y-4 hidden"> | |
| <div> | |
| <label for="register-name" class="block text-gray-400 mb-2">Full Name</label> | |
| <input type="text" id="register-name" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 text-white focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| </div> | |
| <div> | |
| <label for="register-email" class="block text-gray-400 mb-2">Email</label> | |
| <input type="email" id="register-email" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 text-white focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| </div> | |
| <div> | |
| <label for="register-password" class="block text-gray-400 mb-2">Password</label> | |
| <input type="password" id="register-password" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 text-white focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| </div> | |
| <button onclick="register()" class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded-lg transition duration-200"> | |
| Register | |
| </button> | |
| <p class="text-center text-gray-400">Already have an account? <span class="text-blue-500 cursor-pointer" onclick="showLogin()">Login</span></p> | |
| </div> | |
| </div> | |
| </div> | |
| <div id="app-container" class="hidden"> | |
| <nav class="bg-gray-900 fixed bottom-0 w-full flex justify-around items-center h-16 border-t border-gray-800"> | |
| <button onclick="showTab('tasks')" class="flex flex-col items-center justify-center p-2 text-gray-400 hover:text-white transition"> | |
| <i data-feather="list"></i> | |
| <span class="text-xs mt-1">Tasks</span> | |
| </button> | |
| <button onclick="showTab('withdraw')" class="flex flex-col items-center justify-center p-2 text-gray-400 hover:text-white transition"> | |
| <i data-feather="dollar-sign"></i> | |
| <span class="text-xs mt-1">Withdraw</span> | |
| </button> | |
| <button onclick="showTab('profile')" class="flex flex-col items-center justify-center p-2 text-gray-400 hover:text-white transition"> | |
| <i data-feather="user"></i> | |
| <span class="text-xs mt-1">Profile</span> | |
| </button> | |
| </nav> | |
| <div class="container mx-auto px-4 pb-20 pt-6"> | |
| <!-- Tasks Tab --> | |
| <div id="tasks-tab" class="tab-content"> | |
| <div class="flex justify-between items-center mb-6"> | |
| <h2 class="text-2xl font-bold">Daily Tasks</h2> | |
| <div class="flex items-center bg-gray-800 px-3 py-1 rounded-full"> | |
| <i data-feather="coin" class="w-4 h-4 text-yellow-400 mr-1"></i> | |
| <span id="coin-balance" class="font-medium">0</span> | |
| </div> | |
| </div> | |
| <p class="text-gray-400 mb-4">Complete tasks to earn coins. Daily limit: 15 tasks</p> | |
| <div id="tasks-list" class="space-y-4"> | |
| <!-- Tasks will be dynamically added here --> | |
| </div> | |
| </div> | |
| <!-- Withdraw Tab --> | |
| <div id="withdraw-tab" class="tab-content hidden"> | |
| <h2 class="text-2xl font-bold mb-6">Withdraw Earnings</h2> | |
| <div class="bg-gray-900 rounded-lg p-6 mb-6"> | |
| <div class="flex justify-between items-center mb-4"> | |
| <h3 class="text-lg font-medium">Available Balance</h3> | |
| <div class="flex items-center"> | |
| <i data-feather="coin" class="w-4 h-4 text-yellow-400 mr-1"></i> | |
| <span id="withdraw-balance" class="font-medium">0</span> | |
| </div> | |
| </div> | |
| <p class="text-gray-400 mb-6">Minimum withdrawal: 100 coins</p> | |
| <div class="space-y-4"> | |
| <div> | |
| <label class="block text-gray-400 mb-2">Payment Method</label> | |
| <select class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 text-white focus:outline-none focus:ring-2 focus:ring-blue-500"> | |
| <option>PayPal</option> | |
| <option>Bank Transfer</option> | |
| <option>Gift Card</option> | |
| </select> | |
| </div> | |
| <div> | |
| <label class="block text-gray-400 mb-2">Account Details</label> | |
| <input type="text" class="w-full bg-gray-800 border border-gray-700 rounded-lg px-4 py-3 text-white focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Enter your payment details"> | |
| </div> | |
| <button class="w-full bg-blue-600 hover:bg-blue-700 text-white font-bold py-3 px-4 rounded-lg transition duration-200"> | |
| Request Withdrawal | |
| </button> | |
| </div> | |
| </div> | |
| <div class="bg-gray-900 rounded-lg p-6"> | |
| <h3 class="text-lg font-medium mb-4">Contact Support</h3> | |
| <p class="text-gray-400 mb-4">For withdrawal assistance, contact our support team:</p> | |
| <div class="flex items-center text-blue-500"> | |
| <i data-feather="phone" class="w-4 h-4 mr-2"></i> | |
| <span>+1 (555) 123-4567</span> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Profile Tab --> | |
| <div id="profile-tab" class="tab-content hidden"> | |
| <div class="flex items-center mb-6"> | |
| <div class="w-16 h-16 rounded-full bg-gray-800 flex items-center justify-center mr-4"> | |
| <i data-feather="user" class="w-8 h-8 text-gray-400"></i> | |
| </div> | |
| <div> | |
| <h2 id="user-name" class="text-xl font-bold">User Name</h2> | |
| <p id="user-email" class="text-gray-400">user@example.com</p> | |
| </div> | |
| </div> | |
| <div class="bg-gray-900 rounded-lg p-6 mb-6"> | |
| <h3 class="text-lg font-medium mb-4">Account Information</h3> | |
| <div class="space-y-3"> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-400">User ID</span> | |
| <span id="user-id" class="font-medium">UID123456</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-400">Joined Date</span> | |
| <span id="join-date" class="font-medium">Jan 1, 2023</span> | |
| </div> | |
| <div class="flex justify-between"> | |
| <span class="text-gray-400">Total Earnings</span> | |
| <span class="font-medium flex items-center"> | |
| <i data-feather="coin" class="w-4 h-4 text-yellow-400 mr-1"></i> | |
| <span id="total-earnings">0</span> | |
| </span> | |
| </div> | |
| </div> | |
| </div> | |
| <button onclick="logout()" class="w-full bg-red-600 hover:bg-red-700 text-white font-bold py-3 px-4 rounded-lg transition duration-200 flex items-center justify-center"> | |
| <i data-feather="log-out" class="w-4 h-4 mr-2"></i> | |
| Logout | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| <!-- Firebase Config --> | |
| <script> | |
| const firebaseConfig = { | |
| apiKey: "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", | |
| authDomain: "earnify-app.firebaseapp.com", | |
| databaseURL: "https://earnify-app-default-rtdb.firebaseio.com", | |
| projectId: "earnify-app", | |
| storageBucket: "earnify-app.appspot.com", | |
| messagingSenderId: "123456789012", | |
| appId: "1:123456789012:web:abcdef1234567890abcdef" | |
| }; | |
| firebase.initializeApp(firebaseConfig); | |
| </script> | |
| <!-- App Script --> | |
| <script> | |
| // Initialize AOS and Feather Icons | |
| AOS.init(); | |
| feather.replace(); | |
| // Firebase references | |
| const auth = firebase.auth(); | |
| const database = firebase.database(); | |
| // DOM elements | |
| const authContainer = document.getElementById('auth-container'); | |
| const appContainer = document.getElementById('app-container'); | |
| const loginForm = document.getElementById('login-form'); | |
| const registerForm = document.getElementById('register-form'); | |
| // Tab management | |
| function showTab(tabName) { | |
| document.querySelectorAll('.tab-content').forEach(tab => { | |
| tab.classList.add('hidden'); | |
| }); | |
| document.getElementById(`${tabName}-tab`).classList.remove('hidden'); | |
| } | |
| // Auth form toggles | |
| function showRegister() { | |
| loginForm.classList.add('hidden'); | |
| registerForm.classList.remove('hidden'); | |
| } | |
| function showLogin() { | |
| registerForm.classList.add('hidden'); | |
| loginForm.classList.remove('hidden'); | |
| } | |
| // Login function | |
| function login() { | |
| const email = document.getElementById('login-email').value; | |
| const password = document.getElementById('login-password').value; | |
| auth.signInWithEmailAndPassword(email, password) | |
| .then((userCredential) => { | |
| // User logged in | |
| authContainer.classList.add('hidden'); | |
| appContainer.classList.remove('hidden'); | |
| loadUserData(userCredential.user.uid); | |
| initializeTasks(); | |
| }) | |
| .catch((error) => { | |
| alert(error.message); | |
| }); | |
| } | |
| // Register function | |
| function register() { | |
| const name = document.getElementById('register-name').value; | |
| const email = document.getElementById('register-email').value; | |
| const password = document.getElementById('register-password').value; | |
| auth.createUserWithEmailAndPassword(email, password) | |
| .then((userCredential) => { | |
| // Save additional user data | |
| const user = userCredential.user; | |
| const userId = user.uid; | |
| const userData = { | |
| name: name, | |
| email: email, | |
| coins: 0, | |
| totalEarnings: 0, | |
| joinDate: new Date().toISOString(), | |
| tasksCompleted: 0, | |
| tasksCompletedToday: 0, | |
| lastTaskDate: null | |
| }; | |
| return database.ref('users/' + userId).set(userData); | |
| }) | |
| .then(() => { | |
| alert('Registration successful!'); | |
| showLogin(); | |
| }) | |
| .catch((error) => { | |
| alert(error.message); | |
| }); | |
| } | |
| // Logout function | |
| function logout() { | |
| auth.signOut().then(() => { | |
| authContainer.classList.remove('hidden'); | |
| appContainer.classList.add('hidden'); | |
| showLogin(); | |
| }); | |
| } | |
| // Load user data | |
| function loadUserData(userId) { | |
| database.ref('users/' + userId).on('value', (snapshot) => { | |
| const userData = snapshot.val(); | |
| // Update profile tab | |
| document.getElementById('user-name').textContent = userData.name; | |
| document.getElementById('user-email').textContent = userData.email; | |
| document.getElementById('user-id').textContent = userId; | |
| document.getElementById('join-date').textContent = new Date(userData.joinDate).toLocaleDateString(); | |
| document.getElementById('total-earnings').textContent = userData.totalEarnings || 0; | |
| // Update coin balance | |
| document.getElementById('coin-balance').textContent = userData.coins || 0; | |
| document.getElementById('withdraw-balance').textContent = userData.coins || 0; | |
| }); | |
| } | |
| // Initialize tasks | |
| function initializeTasks() { | |
| const tasksList = document.getElementById('tasks-list'); | |
| tasksList.innerHTML = ''; | |
| // Create 15 tasks | |
| for (let i = 1; i <= 15; i++) { | |
| const taskElement = document.createElement('div'); | |
| taskElement.className = 'bg-gray-900 rounded-lg p-4'; | |
| taskElement.innerHTML = ` | |
| <div class="flex justify-between items-center mb-3"> | |
| <h3 class="font-medium">Watch Ad #${i}</h3> | |
| <div class="flex items-center text-yellow-400"> | |
| <i data-feather="coin" class="w-4 h-4 mr-1"></i> | |
| <span>5</span> | |
| </div> | |
| </div> | |
| <div class="ad-container"> | |
| <p class="text-gray-400">Ad will load here</p> | |
| </div> | |
| <button onclick="completeTask(${i})" class="w-full mt-3 bg-blue-600 hover:bg-blue-700 text-white font-medium py-2 px-4 rounded-lg transition duration-200"> | |
| Complete Task | |
| </button> | |
| `; | |
| tasksList.appendChild(taskElement); | |
| } | |
| feather.replace(); | |
| } | |
| // Complete task function | |
| function completeTask(taskNumber) { | |
| const user = auth.currentUser; | |
| if (!user) return; | |
| const userId = user.uid; | |
| const today = new Date().toISOString().split('T')[0]; | |
| database.ref('users/' + userId).once('value').then((snapshot) => { | |
| const userData = snapshot.val(); | |
| let { coins, tasksCompleted, tasksCompletedToday, lastTaskDate } = userData; | |
| // Reset daily counter if it's a new day | |
| if (lastTaskDate !== today) { | |
| tasksCompletedToday = 0; | |
| } | |
| // Check daily limit | |
| if (tasksCompletedToday >= 15) { | |
| alert('You have reached your daily task limit!'); | |
| return; | |
| } | |
| // Update user data | |
| coins = (coins || 0) + 5; | |
| tasksCompleted = (tasksCompleted || 0) + 1; | |
| tasksCompletedToday = (tasksCompletedToday || 0) + 1; | |
| lastTaskDate = today; | |
| return database.ref('users/' + userId).update({ | |
| coins, | |
| tasksCompleted, | |
| tasksCompletedToday, | |
| lastTaskDate, | |
| totalEarnings: (userData.totalEarnings || 0) + 5 | |
| }); | |
| }).then(() => { | |
| alert(`Task #${taskNumber} completed! You earned 5 coins.`); | |
| // Here you would typically load an ad from AdMob | |
| // For demo purposes, we're just simulating it | |
| simulateAd(); | |
| }).catch((error) => { | |
| alert(error.message); | |
| }); | |
| } | |
| // Simulate ad loading (in a real app, this would be AdMob integration) | |
| function simulateAd() { | |
| console.log('Ad would be loaded here with AdMob ID: ca-app-pub-5013540956051758~9704696980'); | |
| } | |
| // Auth state listener | |
| auth.onAuthStateChanged((user) => { | |
| if (user) { | |
| authContainer.classList.add('hidden'); | |
| appContainer.classList.remove('hidden'); | |
| loadUserData(user.uid); | |
| initializeTasks(); | |
| showTab('tasks'); | |
| } else { | |
| authContainer.classList.remove('hidden'); | |
| appContainer.classList.add('hidden'); | |
| } | |
| }); | |
| </script> | |
| </body> | |
| </html> | |