Spaces:
Running
Running
Download index.html from ShaBoingar/skib: direct link, hf CLI and curl.
- Browser
- Download file 30.1 kB
-
https://huggingface.co/spaces/ShaBoingar/skib/resolve/main/index.html
- Command line
-
hf download hf://spaces/ShaBoingar/skib/index.html
-
curl -L -o index.html https://huggingface.co/spaces/ShaBoingar/skib/resolve/main/index.html
30.1 kB
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Weed Clicker</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> | |
| @keyframes bounce { | |
| 0%, 100% { transform: scale(1); } | |
| 50% { transform: scale(1.1); } | |
| } | |
| @keyframes float { | |
| 0% { transform: translateY(0px); } | |
| 50% { transform: translateY(-10px); } | |
| 100% { transform: translateY(0px); } | |
| } | |
| @keyframes spin { | |
| 0% { transform: rotate(0deg); } | |
| 100% { transform: rotate(360deg); } | |
| } | |
| @keyframes shake { | |
| 0%, 100% { transform: translateX(0); } | |
| 10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); } | |
| 20%, 40%, 60%, 80% { transform: translateX(5px); } | |
| } | |
| .bounce { | |
| animation: bounce 0.5s; | |
| } | |
| .float { | |
| animation: float 3s ease-in-out infinite; | |
| } | |
| .spin { | |
| animation: spin 2s linear infinite; | |
| } | |
| .shake { | |
| animation: shake 0.5s; | |
| } | |
| .prize-appear { | |
| animation: prize-appear 0.5s ease-out; | |
| } | |
| @keyframes prize-appear { | |
| 0% { transform: scale(0); opacity: 0; } | |
| 100% { transform: scale(1); opacity: 1; } | |
| } | |
| .smoke { | |
| position: absolute; | |
| background-color: rgba(255, 255, 255, 0.7); | |
| border-radius: 50%; | |
| pointer-events: none; | |
| } | |
| .shop-item:hover { | |
| transform: translateY(-3px); | |
| box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1); | |
| } | |
| .shop-item:active { | |
| transform: translateY(0); | |
| } | |
| .tab-button { | |
| transition: all 0.2s ease; | |
| } | |
| .tab-button.active { | |
| background-color: #4ade80; | |
| color: white; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-green-50 min-h-screen flex flex-col items-center justify-center p-4 font-mono"> | |
| <div class="absolute top-0 left-0 w-full h-full overflow-hidden pointer-events-none"> | |
| <div id="smoke-container"></div> | |
| </div> | |
| <div class="text-center mb-8"> | |
| <h1 class="text-4xl font-bold text-green-800 mb-2">Weed Clicker</h1> | |
| <p class="text-green-600">Click the weed to harvest buds!</p> | |
| </div> | |
| <div class="relative mb-8"> | |
| <div id="counter" class="text-5xl font-bold text-green-900 mb-6 text-center">0</div> | |
| <div id="weed" class="relative w-64 h-64 cursor-pointer transition-all duration-100 active:scale-95"> | |
| <div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2"> | |
| <i class="fas fa-cannabis text-8xl text-green-700 float"></i> | |
| </div> | |
| </div> | |
| <div id="click-effect" class="absolute top-0 left-0 w-full h-full pointer-events-none opacity-0 transition-opacity duration-200"></div> | |
| </div> | |
| <div class="grid grid-cols-2 md:grid-cols-4 gap-4 w-full max-w-2xl mb-8"> | |
| <div class="bg-green-100 p-4 rounded-lg border border-green-200"> | |
| <div class="text-green-800 font-bold">Buds per click:</div> | |
| <div id="per-click" class="text-2xl text-green-600">1</div> | |
| </div> | |
| <div class="bg-green-100 p-4 rounded-lg border border-green-200"> | |
| <div class="text-green-800 font-bold">Total harvested:</div> | |
| <div id="total-count" class="text-2xl text-green-600">0</div> | |
| </div> | |
| <div class="bg-green-100 p-4 rounded-lg border border-green-200"> | |
| <div class="text-green-800 font-bold">Click streak:</div> | |
| <div id="streak" class="text-2xl text-green-600">0</div> | |
| </div> | |
| <div class="bg-green-100 p-4 rounded-lg border border-green-200"> | |
| <div class="text-green-800 font-bold">Next prize at:</div> | |
| <div id="next-prize" class="text-2xl text-green-600">50</div> | |
| </div> | |
| </div> | |
| <!-- Tab Navigation --> | |
| <div class="flex mb-4 gap-2"> | |
| <button id="prizes-tab" class="tab-button active px-4 py-2 rounded-lg bg-green-200 text-green-800">Prizes</button> | |
| <button id="shop-tab" class="tab-button px-4 py-2 rounded-lg bg-green-200 text-green-800">Shop</button> | |
| <button id="upgrades-tab" class="tab-button px-4 py-2 rounded-lg bg-green-200 text-green-800">Upgrades</button> | |
| </div> | |
| <!-- Tab Content --> | |
| <div id="prizes-content" class="flex flex-wrap justify-center gap-4 max-w-2xl w-full mb-8"> | |
| <!-- Prizes will appear here --> | |
| </div> | |
| <div id="shop-content" class="hidden grid grid-cols-1 md:grid-cols-2 gap-4 w-full max-w-2xl mb-8"> | |
| <!-- Shop items will appear here --> | |
| </div> | |
| <div id="upgrades-content" class="hidden grid grid-cols-1 md:grid-cols-2 gap-4 w-full max-w-2xl mb-8"> | |
| <!-- Upgrades will appear here --> | |
| </div> | |
| <div id="achievements" class="fixed bottom-4 right-4 flex flex-col gap-2 max-h-64 overflow-y-auto"> | |
| <!-- Achievements will appear here --> | |
| </div> | |
| <script> | |
| let count = 0; | |
| let totalCount = 0; | |
| let perClick = 1; | |
| let streak = 0; | |
| let lastClickTime = 0; | |
| let nextPrizeAt = 50; | |
| let prizeLevel = 1; | |
| let prizesUnlocked = 0; | |
| // Shop items data | |
| const shopItems = [ | |
| { | |
| id: 'joint', | |
| name: 'Joint', | |
| description: 'Basic smoking tool (+1 per click)', | |
| icon: 'joint', | |
| price: 25, | |
| owned: 0, | |
| effect: () => { perClick += 1; updatePerClick(); } | |
| }, | |
| { | |
| id: 'bong', | |
| name: 'Bong', | |
| description: 'Powerful smoking device (+3 per click)', | |
| icon: 'bong', | |
| price: 100, | |
| owned: 0, | |
| effect: () => { perClick += 3; updatePerClick(); } | |
| }, | |
| { | |
| id: 'vaporizer', | |
| name: 'Vaporizer', | |
| description: 'Efficient modern tech (+5 per click)', | |
| icon: 'wind', | |
| price: 250, | |
| owned: 0, | |
| effect: () => { perClick += 5; updatePerClick(); } | |
| }, | |
| { | |
| id: 'grower', | |
| name: 'Grower', | |
| description: 'Automatically harvests 1 bud per second', | |
| icon: 'user-tie', | |
| price: 500, | |
| owned: 0, | |
| effect: () => { startAutoHarvest(); } | |
| } | |
| ]; | |
| // Upgrades data | |
| const upgrades = [ | |
| { | |
| id: 'double-joints', | |
| name: 'Double Joints', | |
| description: 'Doubles the effectiveness of all joints', | |
| icon: 'joint', | |
| price: 1000, | |
| purchased: false, | |
| effect: () => { | |
| perClick += shopItems.filter(i => i.id === 'joint').length; | |
| updatePerClick(); | |
| } | |
| }, | |
| { | |
| id: 'premium-buds', | |
| name: 'Premium Buds', | |
| description: 'Increases all click values by 50%', | |
| icon: 'cannabis', | |
| price: 2500, | |
| purchased: false, | |
| effect: () => { | |
| perClick = Math.floor(perClick * 1.5); | |
| updatePerClick(); | |
| } | |
| }, | |
| { | |
| id: 'stoner-gang', | |
| name: 'Stoner Gang', | |
| description: 'Adds 5 growers to your team', | |
| icon: 'users', | |
| price: 5000, | |
| purchased: false, | |
| effect: () => { | |
| for (let i = 0; i < 5; i++) { | |
| count += 1; | |
| counter.textContent = count; | |
| totalCount += 1; | |
| totalCounter.textContent = totalCount; | |
| } | |
| } | |
| }, | |
| { | |
| id: 'golden-leaf', | |
| name: 'Golden Leaf', | |
| description: 'Permanently doubles your per-click value', | |
| icon: 'leaf', | |
| price: 10000, | |
| purchased: false, | |
| effect: () => { | |
| perClick *= 2; | |
| updatePerClick(); | |
| } | |
| } | |
| ]; | |
| const weed = document.getElementById('weed'); | |
| const counter = document.getElementById('counter'); | |
| const totalCounter = document.getElementById('total-count'); | |
| const perClickDisplay = document.getElementById('per-click'); | |
| const streakDisplay = document.getElementById('streak'); | |
| const nextPrizeDisplay = document.getElementById('next-prize'); | |
| const prizesContainer = document.getElementById('prizes-content'); | |
| const shopContainer = document.getElementById('shop-content'); | |
| const upgradesContainer = document.getElementById('upgrades-content'); | |
| const achievementsContainer = document.getElementById('achievements'); | |
| const clickEffect = document.getElementById('click-effect'); | |
| const smokeContainer = document.getElementById('smoke-container'); | |
| // Tab elements | |
| const prizesTab = document.getElementById('prizes-tab'); | |
| const shopTab = document.getElementById('shop-tab'); | |
| const upgradesTab = document.getElementById('upgrades-tab'); | |
| const prizeMilestones = [ | |
| 50, 100, 200, 350, 500, 750, 1000, 1500, 2000, 3000, 5000 | |
| ]; | |
| const prizeItems = [ | |
| { icon: 'joint', name: 'Joint', color: 'bg-green-200', text: 'text-green-800' }, | |
| { icon: 'bong', name: 'Bong', color: 'bg-purple-200', text: 'text-purple-800' }, | |
| { icon: 'leaf', name: 'Premium Leaf', color: 'bg-yellow-200', text: 'text-yellow-800' }, | |
| { icon: 'cookie', name: 'Edible', color: 'bg-red-200', text: 'text-red-800' }, | |
| { icon: 'tint', name: 'Oil', color: 'bg-blue-200', text: 'text-blue-800' }, | |
| { icon: 'seedling', name: 'Seed', color: 'bg-brown-200', text: 'text-brown-800' }, | |
| { icon: 'sun', name: 'Grow Light', color: 'bg-orange-200', text: 'text-orange-800' }, | |
| { icon: 'flask', name: 'Extract', color: 'bg-indigo-200', text: 'text-indigo-800' }, | |
| { icon: 'crown', name: 'King Size', color: 'bg-amber-200', text: 'text-amber-800' }, | |
| { icon: 'gem', name: 'Diamond', color: 'bg-teal-200', text: 'text-teal-800' }, | |
| { icon: 'trophy', name: 'Champion', color: 'bg-pink-200', text: 'text-pink-800' } | |
| ]; | |
| // Initialize tabs | |
| prizesTab.addEventListener('click', () => switchTab('prizes')); | |
| shopTab.addEventListener('click', () => switchTab('shop')); | |
| upgradesTab.addEventListener('click', () => switchTab('upgrades')); | |
| // Initialize shop | |
| initializeShop(); | |
| initializeUpgrades(); | |
| weed.addEventListener('click', handleClick); | |
| function handleClick() { | |
| // Update count and display | |
| count += perClick; | |
| totalCount += perClick; | |
| counter.textContent = count; | |
| totalCounter.textContent = totalCount; | |
| // Handle click streak | |
| const now = Date.now(); | |
| if (now - lastClickTime < 1000) { // 1 second window for streak | |
| streak++; | |
| } else { | |
| streak = 1; | |
| } | |
| lastClickTime = now; | |
| streakDisplay.textContent = streak; | |
| // Visual feedback | |
| weed.classList.add('bounce'); | |
| setTimeout(() => weed.classList.remove('bounce'), 500); | |
| createClickEffect(); | |
| createSmoke(); | |
| // Check for prizes | |
| checkForPrizes(); | |
| // Random chance to increase per-click | |
| if (Math.random() < 0.05) { | |
| perClick++; | |
| updatePerClick(); | |
| showAchievement('Upgrade!', 'Your click power increased!', 'fas fa-arrow-up'); | |
| } | |
| // Special bonus for high streaks | |
| if (streak % 10 === 0) { | |
| const bonus = Math.floor(streak / 5); | |
| count += bonus; | |
| counter.textContent = count; | |
| showAchievement('Streak Bonus!', `+${bonus} for ${streak} clicks!`, 'fas fa-bolt'); | |
| } | |
| // Update shop items (enable/disable based on affordability) | |
| updateShopItems(); | |
| updateUpgrades(); | |
| } | |
| function updatePerClick() { | |
| perClickDisplay.textContent = perClick; | |
| } | |
| function createClickEffect() { | |
| clickEffect.style.opacity = '1'; | |
| clickEffect.innerHTML = `<div class="text-green-700 text-2xl font-bold absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2">+${perClick}</div>`; | |
| setTimeout(() => { | |
| clickEffect.style.opacity = '0'; | |
| }, 300); | |
| } | |
| function createSmoke() { | |
| const smoke = document.createElement('div'); | |
| smoke.className = 'smoke'; | |
| const size = Math.random() * 30 + 10; | |
| const x = Math.random() * window.innerWidth; | |
| const y = Math.random() * window.innerHeight; | |
| smoke.style.width = `${size}px`; | |
| smoke.style.height = `${size}px`; | |
| smoke.style.left = `${x}px`; | |
| smoke.style.top = `${y}px`; | |
| smoke.style.opacity = '0.7'; | |
| smokeContainer.appendChild(smoke); | |
| // Animate smoke | |
| let opacity = 0.7; | |
| const fadeInterval = setInterval(() => { | |
| opacity -= 0.02; | |
| smoke.style.opacity = opacity; | |
| smoke.style.transform = `translateY(-${(0.7 - opacity) * 20}px) scale(${1 + (0.7 - opacity)})`; | |
| if (opacity <= 0) { | |
| clearInterval(fadeInterval); | |
| smoke.remove(); | |
| } | |
| }, 50); | |
| } | |
| function checkForPrizes() { | |
| if (count >= nextPrizeAt && prizeLevel <= prizeMilestones.length) { | |
| // Unlock prize | |
| unlockPrize(); | |
| // Set next prize milestone | |
| nextPrizeAt = prizeMilestones[prizeLevel]; | |
| nextPrizeDisplay.textContent = nextPrizeAt; | |
| prizeLevel++; | |
| // Increase per-click every few prizes | |
| if (prizesUnlocked % 3 === 0) { | |
| perClick += 2; | |
| updatePerClick(); | |
| } | |
| } | |
| } | |
| function unlockPrize() { | |
| prizesUnlocked++; | |
| const prize = prizeItems[prizesUnlocked - 1]; | |
| const prizeElement = document.createElement('div'); | |
| prizeElement.className = `flex flex-col items-center justify-center p-4 rounded-lg ${prize.color} ${prize.text} border-2 border-green-300 prize-appear`; | |
| prizeElement.style.minWidth = '100px'; | |
| prizeElement.innerHTML = ` | |
| <i class="fas fa-${prize.icon} text-4xl mb-2"></i> | |
| <div class="font-bold">${prize.name}</div> | |
| <div class="text-xs">#${prizesUnlocked}</div> | |
| `; | |
| prizesContainer.appendChild(prizeElement); | |
| // Special effects for certain prizes | |
| if (prizesUnlocked === 5) { | |
| document.body.classList.add('bg-green-100'); | |
| showAchievement('Halfway There!', 'You unlocked 5 prizes!', 'fas fa-star-half-alt'); | |
| } else if (prizesUnlocked === prizeItems.length) { | |
| showAchievement('Grand Master!', 'All prizes unlocked!', 'fas fa-trophy'); | |
| } else { | |
| showAchievement('New Prize!', `You unlocked ${prize.name}!`, `fas fa-${prize.icon}`); | |
| } | |
| // Make prize interactive | |
| prizeElement.addEventListener('click', () => { | |
| prizeElement.classList.add('spin'); | |
| setTimeout(() => { | |
| prizeElement.classList.remove('spin'); | |
| }, 2000); | |
| // Bonus when clicking prizes | |
| const bonus = prizesUnlocked * 5; | |
| count += bonus; | |
| counter.textContent = count; | |
| const bonusElement = document.createElement('div'); | |
| bonusElement.className = 'absolute text-xl font-bold text-green-700'; | |
| bonusElement.textContent = `+${bonus}`; | |
| bonusElement.style.top = `${prizeElement.offsetTop}px`; | |
| bonusElement.style.left = `${prizeElement.offsetLeft + prizeElement.offsetWidth/2}px`; | |
| bonusElement.style.transform = 'translateX(-50%)'; | |
| document.body.appendChild(bonusElement); | |
| // Animate bonus text | |
| let opacity = 1; | |
| let top = prizeElement.offsetTop; | |
| const bonusInterval = setInterval(() => { | |
| opacity -= 0.05; | |
| top -= 2; | |
| bonusElement.style.opacity = opacity; | |
| bonusElement.style.top = `${top}px`; | |
| if (opacity <= 0) { | |
| clearInterval(bonusInterval); | |
| bonusElement.remove(); | |
| } | |
| }, 50); | |
| }); | |
| } | |
| function showAchievement(title, description, icon) { | |
| const achievement = document.createElement('div'); | |
| achievement.className = 'bg-green-700 text-white p-3 rounded-lg shadow-lg transform transition-all duration-300 opacity-0 translate-y-4'; | |
| achievement.style.minWidth = '200px'; | |
| achievement.innerHTML = ` | |
| <div class="flex items-center gap-3"> | |
| <i class="${icon} text-xl"></i> | |
| <div> | |
| <div class="font-bold">${title}</div> | |
| <div class="text-xs">${description}</div> | |
| </div> | |
| </div> | |
| `; | |
| achievementsContainer.appendChild(achievement); | |
| // Animate in | |
| setTimeout(() => { | |
| achievement.classList.remove('opacity-0'); | |
| achievement.classList.remove('translate-y-4'); | |
| }, 10); | |
| // Auto-remove after delay | |
| setTimeout(() => { | |
| achievement.classList.add('opacity-0'); | |
| achievement.classList.add('translate-y-4'); | |
| setTimeout(() => achievement.remove(), 300); | |
| }, 3000); | |
| } | |
| function switchTab(tabName) { | |
| // Hide all content | |
| document.getElementById('prizes-content').classList.add('hidden'); | |
| document.getElementById('shop-content').classList.add('hidden'); | |
| document.getElementById('upgrades-content').classList.add('hidden'); | |
| // Remove active class from all tabs | |
| prizesTab.classList.remove('active'); | |
| shopTab.classList.remove('active'); | |
| upgradesTab.classList.remove('active'); | |
| // Show selected content and mark tab as active | |
| document.getElementById(`${tabName}-content`).classList.remove('hidden'); | |
| document.getElementById(`${tabName}-tab`).classList.add('active'); | |
| } | |
| function initializeShop() { | |
| shopItems.forEach(item => { | |
| const shopItem = document.createElement('div'); | |
| shopItem.className = 'shop-item bg-white p-4 rounded-lg border border-green-200 transition-all cursor-pointer'; | |
| shopItem.id = `shop-${item.id}`; | |
| shopItem.innerHTML = ` | |
| <div class="flex items-center gap-4"> | |
| <i class="fas fa-${item.icon} text-3xl text-green-600"></i> | |
| <div> | |
| <div class="font-bold text-green-800">${item.name}</div> | |
| <div class="text-sm text-gray-600">${item.description}</div> | |
| <div class="mt-2 flex justify-between items-center"> | |
| <span class="text-green-700 font-bold">${item.price} buds</span> | |
| <span class="text-xs bg-green-100 px-2 py-1 rounded">Owned: <span id="owned-${item.id}">0</span></span> | |
| </div> | |
| </div> | |
| </div> | |
| `; | |
| shopItem.addEventListener('click', () => purchaseItem(item)); | |
| shopContainer.appendChild(shopItem); | |
| }); | |
| } | |
| function initializeUpgrades() { | |
| upgrades.forEach(upgrade => { | |
| const upgradeElement = document.createElement('div'); | |
| upgradeElement.className = `upgrade-item bg-white p-4 rounded-lg border ${upgrade.purchased ? 'border-green-400' : 'border-green-200'} transition-all cursor-pointer`; | |
| upgradeElement.id = `upgrade-${upgrade.id}`; | |
| upgradeElement.innerHTML = ` | |
| <div class="flex items-center gap-4"> | |
| <i class="fas fa-${upgrade.icon} text-3xl ${upgrade.purchased ? 'text-green-600' : 'text-gray-400'}"></i> | |
| <div> | |
| <div class="font-bold ${upgrade.purchased ? 'text-green-800' : 'text-gray-600'}">${upgrade.name}</div> | |
| <div class="text-sm ${upgrade.purchased ? 'text-gray-600' : 'text-gray-500'}">${upgrade.description}</div> | |
| <div class="mt-2"> | |
| <span class="${upgrade.purchased ? 'text-green-600' : 'text-green-700'} font-bold">${upgrade.purchased ? 'PURCHASED' : `${upgrade.price} buds`}</span> | |
| </div> | |
| </div> | |
| </div> | |
| `; | |
| if (!upgrade.purchased) { | |
| upgradeElement.addEventListener('click', () => purchaseUpgrade(upgrade)); | |
| } | |
| upgradesContainer.appendChild(upgradeElement); | |
| }); | |
| } | |
| function purchaseItem(item) { | |
| if (count >= item.price) { | |
| count -= item.price; | |
| counter.textContent = count; | |
| item.owned++; | |
| item.effect(); | |
| // Update display | |
| document.getElementById(`owned-${item.id}`).textContent = item.owned; | |
| document.getElementById(`shop-${item.id}`).classList.add('bg-green-50'); | |
| setTimeout(() => { | |
| document.getElementById(`shop-${item.id}`).classList.remove('bg-green-50'); | |
| }, 200); | |
| showAchievement('Purchased!', `You bought a ${item.name}!`, `fas fa-${item.icon}`); | |
| // Update shop items | |
| updateShopItems(); | |
| } else { | |
| // Not enough buds | |
| document.getElementById(`shop-${item.id}`).classList.add('shake'); | |
| document.getElementById(`shop-${item.id}`).classList.add('bg-red-50'); | |
| setTimeout(() => { | |
| document.getElementById(`shop-${item.id}`).classList.remove('shake'); | |
| document.getElementById(`shop-${item.id}`).classList.remove('bg-red-50'); | |
| }, 500); | |
| showAchievement('Not enough!', `You need ${item.price} buds for ${item.name}`, 'fas fa-times-circle'); | |
| } | |
| } | |
| function purchaseUpgrade(upgrade) { | |
| if (count >= upgrade.price && !upgrade.purchased) { | |
| count -= upgrade.price; | |
| counter.textContent = count; | |
| upgrade.purchased = true; | |
| upgrade.effect(); | |
| // Update display | |
| const upgradeElement = document.getElementById(`upgrade-${upgrade.id}`); | |
| upgradeElement.innerHTML = ` | |
| <div class="flex items-center gap-4"> | |
| <i class="fas fa-${upgrade.icon} text-3xl text-green-600"></i> | |
| <div> | |
| <div class="font-bold text-green-800">${upgrade.name}</div> | |
| <div class="text-sm text-gray-600">${upgrade.description}</div> | |
| <div class="mt-2"> | |
| <span class="text-green-600 font-bold">PURCHASED</span> | |
| </div> | |
| </div> | |
| </div> | |
| `; | |
| upgradeElement.classList.add('bg-green-50'); | |
| setTimeout(() => { | |
| upgradeElement.classList.remove('bg-green-50'); | |
| }, 200); | |
| showAchievement('Upgrade!', `You unlocked ${upgrade.name}!`, `fas fa-${upgrade.icon}`); | |
| // Update upgrades | |
| updateUpgrades(); | |
| } else if (!upgrade.purchased) { | |
| // Not enough buds | |
| document.getElementById(`upgrade-${upgrade.id}`).classList.add('shake'); | |
| document.getElementById(`upgrade-${upgrade.id}`).classList.add('bg-red-50'); | |
| setTimeout(() => { | |
| document.getElementById(`upgrade-${upgrade.id}`).classList.remove('shake'); | |
| document.getElementById(`upgrade-${upgrade.id}`).classList.remove('bg-red-50'); | |
| }, 500); | |
| showAchievement('Not enough!', `You need ${upgrade.price} buds for ${upgrade.name}`, 'fas fa-times-circle'); | |
| } | |
| } | |
| function updateShopItems() { | |
| shopItems.forEach(item => { | |
| const shopItem = document.getElementById(`shop-${item.id}`); | |
| if (count >= item.price) { | |
| shopItem.classList.remove('opacity-50'); | |
| shopItem.classList.add('hover:bg-green-50'); | |
| } else { | |
| shopItem.classList.add('opacity-50'); | |
| shopItem.classList.remove('hover:bg-green-50'); | |
| } | |
| }); | |
| } | |
| function updateUpgrades() { | |
| upgrades.forEach(upgrade => { | |
| if (!upgrade.purchased) { | |
| const upgradeElement = document.getElementById(`upgrade-${upgrade.id}`); | |
| if (count >= upgrade.price) { | |
| upgradeElement.classList.remove('opacity-50'); | |
| upgradeElement.classList.add('hover:bg-green-50'); | |
| } else { | |
| upgradeElement.classList.add('opacity-50'); | |
| upgradeElement.classList.remove('hover:bg-green-50'); | |
| } | |
| } | |
| }); | |
| } | |
| function startAutoHarvest() { | |
| // Check if auto-harvest is already running | |
| if (window.autoHarvestInterval) return; | |
| window.autoHarvestInterval = setInterval(() => { | |
| count += 1; | |
| totalCount += 1; | |
| counter.textContent = count; | |
| totalCounter.textContent = totalCount; | |
| // Create a small visual effect | |
| const smoke = document.createElement('div'); | |
| smoke.className = 'smoke'; | |
| smoke.style.width = '10px'; | |
| smoke.style.height = '10px'; | |
| smoke.style.left = `${Math.random() * window.innerWidth}px`; | |
| smoke.style.top = `${Math.random() * window.innerHeight}px`; | |
| smoke.style.opacity = '0.5'; | |
| smokeContainer.appendChild(smoke); | |
| setTimeout(() => smoke.remove(), 1000); | |
| // Check for prizes | |
| checkForPrizes(); | |
| }, 1000); | |
| } | |
| // Initialize next prize display | |
| nextPrizeDisplay.textContent = nextPrizeAt; | |
| // Initialize shop items (enable/disable based on affordability) | |
| updateShopItems(); | |
| updateUpgrades(); | |
| </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=ShaBoingar/skib" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |