undefined - Initial Deployment
Browse files- README.md +7 -5
- index.html +587 -19
README.md
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
emoji:
|
| 4 |
-
colorFrom:
|
| 5 |
-
colorTo:
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 1 |
---
|
| 2 |
+
title: cookie-slot-browser-click
|
| 3 |
+
emoji: ๐ณ
|
| 4 |
+
colorFrom: purple
|
| 5 |
+
colorTo: purple
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite
|
| 10 |
---
|
| 11 |
|
| 12 |
+
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
index.html
CHANGED
|
@@ -1,19 +1,587 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Tab Cookie Garden</title>
|
| 7 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 8 |
+
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
| 9 |
+
<style>
|
| 10 |
+
@keyframes pulse {
|
| 11 |
+
0% { transform: scale(1); }
|
| 12 |
+
50% { transform: scale(1.1); }
|
| 13 |
+
100% { transform: scale(1); }
|
| 14 |
+
}
|
| 15 |
+
|
| 16 |
+
@keyframes spin {
|
| 17 |
+
0% { transform: rotate(0deg); }
|
| 18 |
+
100% { transform: rotate(360deg); }
|
| 19 |
+
}
|
| 20 |
+
|
| 21 |
+
.cookie-pulse {
|
| 22 |
+
animation: pulse 2s infinite;
|
| 23 |
+
}
|
| 24 |
+
|
| 25 |
+
.flower-grow {
|
| 26 |
+
transition: all 0.5s ease-out;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
.slot-spin {
|
| 30 |
+
animation: spin 0.5s ease-out;
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
.sidebar {
|
| 34 |
+
transition: transform 0.3s ease-in-out;
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
.domain-news {
|
| 38 |
+
background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
.domain-social {
|
| 42 |
+
background: linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
.domain-shopping {
|
| 46 |
+
background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
|
| 47 |
+
}
|
| 48 |
+
|
| 49 |
+
.domain-entertainment {
|
| 50 |
+
background: linear-gradient(135deg, #a78bfa 0%, #8b5cf6 100%);
|
| 51 |
+
}
|
| 52 |
+
|
| 53 |
+
.domain-other {
|
| 54 |
+
background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
.tooltip {
|
| 58 |
+
visibility: hidden;
|
| 59 |
+
opacity: 0;
|
| 60 |
+
transition: opacity 0.3s;
|
| 61 |
+
}
|
| 62 |
+
|
| 63 |
+
.cookie-container:hover .tooltip {
|
| 64 |
+
visibility: visible;
|
| 65 |
+
opacity: 1;
|
| 66 |
+
}
|
| 67 |
+
|
| 68 |
+
@media (max-width: 768px) {
|
| 69 |
+
.sidebar {
|
| 70 |
+
width: 100%;
|
| 71 |
+
height: auto;
|
| 72 |
+
bottom: 0;
|
| 73 |
+
left: 0;
|
| 74 |
+
transform: translateY(100%);
|
| 75 |
+
}
|
| 76 |
+
|
| 77 |
+
.sidebar.open {
|
| 78 |
+
transform: translateY(0);
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.cookie-bar {
|
| 82 |
+
flex-direction: column;
|
| 83 |
+
align-items: flex-start;
|
| 84 |
+
padding: 0.5rem;
|
| 85 |
+
}
|
| 86 |
+
}
|
| 87 |
+
</style>
|
| 88 |
+
</head>
|
| 89 |
+
<body class="bg-gray-100 font-sans">
|
| 90 |
+
<!-- Main Browser Simulation -->
|
| 91 |
+
<div class="max-w-6xl mx-auto p-4">
|
| 92 |
+
<div class="bg-white rounded-lg shadow-lg overflow-hidden">
|
| 93 |
+
<!-- Browser Toolbar -->
|
| 94 |
+
<div class="bg-gray-800 text-white p-3 flex items-center justify-between">
|
| 95 |
+
<div class="flex items-center space-x-2">
|
| 96 |
+
<button class="p-1 rounded hover:bg-gray-700">
|
| 97 |
+
<i class="fas fa-arrow-left"></i>
|
| 98 |
+
</button>
|
| 99 |
+
<button class="p-1 rounded hover:bg-gray-700">
|
| 100 |
+
<i class="fas fa-arrow-right"></i>
|
| 101 |
+
</button>
|
| 102 |
+
<button class="p-1 rounded hover:bg-gray-700">
|
| 103 |
+
<i class="fas fa-redo"></i>
|
| 104 |
+
</button>
|
| 105 |
+
</div>
|
| 106 |
+
<div class="flex-1 mx-4">
|
| 107 |
+
<input type="text" class="w-full bg-gray-700 rounded-full py-1 px-4 text-sm focus:outline-none focus:ring-2 focus:ring-blue-500" placeholder="Search or enter address">
|
| 108 |
+
</div>
|
| 109 |
+
<div class="flex items-center space-x-2">
|
| 110 |
+
<button class="p-1 rounded hover:bg-gray-700">
|
| 111 |
+
<i class="fas fa-star"></i>
|
| 112 |
+
</button>
|
| 113 |
+
<button class="p-1 rounded hover:bg-gray-700">
|
| 114 |
+
<i class="fas fa-ellipsis-h"></i>
|
| 115 |
+
</button>
|
| 116 |
+
</div>
|
| 117 |
+
</div>
|
| 118 |
+
|
| 119 |
+
<!-- Cookie Bar -->
|
| 120 |
+
<div class="bg-gray-100 border-b flex items-center justify-between px-4 py-2 cookie-bar">
|
| 121 |
+
<div class="flex items-center space-x-2 overflow-x-auto py-2">
|
| 122 |
+
<!-- Cookies will appear here -->
|
| 123 |
+
</div>
|
| 124 |
+
<button id="toggleSidebar" class="bg-blue-500 hover:bg-blue-600 text-white px-3 py-1 rounded-full text-sm flex items-center">
|
| 125 |
+
<i class="fas fa-gamepad mr-1"></i> Play
|
| 126 |
+
</button>
|
| 127 |
+
</div>
|
| 128 |
+
|
| 129 |
+
<!-- Browser Content Area -->
|
| 130 |
+
<div class="h-96 bg-white flex items-center justify-center">
|
| 131 |
+
<div class="text-center p-8">
|
| 132 |
+
<h1 class="text-3xl font-bold text-gray-800 mb-4">Welcome to Tab Cookie Garden</h1>
|
| 133 |
+
<p class="text-gray-600 mb-6">Open new tabs to grow cookies that blossom into flowers!</p>
|
| 134 |
+
<button id="simulateNewTab" class="bg-green-500 hover:bg-green-600 text-white font-medium py-2 px-6 rounded-full">
|
| 135 |
+
Simulate New Tab
|
| 136 |
+
</button>
|
| 137 |
+
</div>
|
| 138 |
+
</div>
|
| 139 |
+
</div>
|
| 140 |
+
</div>
|
| 141 |
+
|
| 142 |
+
<!-- Sidebar Game -->
|
| 143 |
+
<div id="sidebar" class="sidebar fixed top-0 right-0 h-full w-80 bg-white shadow-lg z-10 transform translate-x-full">
|
| 144 |
+
<div class="p-4 border-b flex justify-between items-center">
|
| 145 |
+
<h2 class="text-xl font-bold">Cookie Slots</h2>
|
| 146 |
+
<button id="closeSidebar" class="text-gray-500 hover:text-gray-700">
|
| 147 |
+
<i class="fas fa-times"></i>
|
| 148 |
+
</button>
|
| 149 |
+
</div>
|
| 150 |
+
|
| 151 |
+
<div class="p-4">
|
| 152 |
+
<div class="bg-gray-100 rounded-lg p-4 mb-4">
|
| 153 |
+
<div class="flex justify-between items-center mb-2">
|
| 154 |
+
<span class="font-medium">Cookie Coins:</span>
|
| 155 |
+
<span id="coinCount" class="font-bold text-blue-600">0</span>
|
| 156 |
+
</div>
|
| 157 |
+
<div class="flex justify-between items-center">
|
| 158 |
+
<span class="font-medium">Flowers Grown:</span>
|
| 159 |
+
<span id="flowerCount" class="font-bold text-green-600">0</span>
|
| 160 |
+
</div>
|
| 161 |
+
</div>
|
| 162 |
+
|
| 163 |
+
<div class="mb-6">
|
| 164 |
+
<h3 class="text-lg font-semibold mb-2">Slot Machine</h3>
|
| 165 |
+
<div class="bg-gray-800 rounded-lg p-4">
|
| 166 |
+
<div class="flex justify-between mb-4">
|
| 167 |
+
<div id="slot1" class="slot w-16 h-16 bg-white rounded flex items-center justify-center text-3xl font-bold">
|
| 168 |
+
๐ช
|
| 169 |
+
</div>
|
| 170 |
+
<div id="slot2" class="slot w-16 h-16 bg-white rounded flex items-center justify-center text-3xl font-bold">
|
| 171 |
+
๐ธ
|
| 172 |
+
</div>
|
| 173 |
+
<div id="slot3" class="slot w-16 h-16 bg-white rounded flex items-center justify-center text-3xl font-bold">
|
| 174 |
+
๐ฐ
|
| 175 |
+
</div>
|
| 176 |
+
</div>
|
| 177 |
+
<button id="spinButton" class="w-full bg-yellow-500 hover:bg-yellow-600 text-white font-bold py-2 px-4 rounded">
|
| 178 |
+
Spin (Cost: 5 coins)
|
| 179 |
+
</button>
|
| 180 |
+
</div>
|
| 181 |
+
</div>
|
| 182 |
+
|
| 183 |
+
<div>
|
| 184 |
+
<h3 class="text-lg font-semibold mb-2">Global Garden</h3>
|
| 185 |
+
<div class="grid grid-cols-3 gap-2" id="globalGarden">
|
| 186 |
+
<!-- Global flowers will appear here -->
|
| 187 |
+
</div>
|
| 188 |
+
</div>
|
| 189 |
+
</div>
|
| 190 |
+
</div>
|
| 191 |
+
|
| 192 |
+
<script>
|
| 193 |
+
// Game state
|
| 194 |
+
const state = {
|
| 195 |
+
cookies: [],
|
| 196 |
+
coins: 0,
|
| 197 |
+
flowers: 0,
|
| 198 |
+
globalFlowers: [],
|
| 199 |
+
slotItems: ['๐ช', '๐ธ', '๐ฟ', '๐ป', '๐ผ', '๐บ', '๐น', '๐ท', '๐', '๐ฐ'],
|
| 200 |
+
domainCategories: {
|
| 201 |
+
news: ['cnn.com', 'bbc.com', 'nytimes.com', 'theguardian.com'],
|
| 202 |
+
social: ['facebook.com', 'twitter.com', 'instagram.com', 'reddit.com'],
|
| 203 |
+
shopping: ['amazon.com', 'ebay.com', 'etsy.com', 'walmart.com'],
|
| 204 |
+
entertainment: ['youtube.com', 'netflix.com', 'spotify.com', 'twitch.tv'],
|
| 205 |
+
other: ['wikipedia.org', 'github.com', 'stackoverflow.com', 'medium.com']
|
| 206 |
+
},
|
| 207 |
+
activeUsers: {}
|
| 208 |
+
};
|
| 209 |
+
|
| 210 |
+
// DOM elements
|
| 211 |
+
const cookieBar = document.querySelector('.cookie-bar > div');
|
| 212 |
+
const sidebar = document.getElementById('sidebar');
|
| 213 |
+
const toggleSidebarBtn = document.getElementById('toggleSidebar');
|
| 214 |
+
const closeSidebarBtn = document.getElementById('closeSidebar');
|
| 215 |
+
const simulateNewTabBtn = document.getElementById('simulateNewTab');
|
| 216 |
+
const coinCountEl = document.getElementById('coinCount');
|
| 217 |
+
const flowerCountEl = document.getElementById('flowerCount');
|
| 218 |
+
const spinButton = document.getElementById('spinButton');
|
| 219 |
+
const slot1 = document.getElementById('slot1');
|
| 220 |
+
const slot2 = document.getElementById('slot2');
|
| 221 |
+
const slot3 = document.getElementById('slot3');
|
| 222 |
+
const globalGarden = document.getElementById('globalGarden');
|
| 223 |
+
|
| 224 |
+
// Initialize
|
| 225 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 226 |
+
// Load saved state
|
| 227 |
+
const savedState = localStorage.getItem('tabCookieGame');
|
| 228 |
+
if (savedState) {
|
| 229 |
+
Object.assign(state, JSON.parse(savedState));
|
| 230 |
+
updateUI();
|
| 231 |
+
renderGlobalGarden();
|
| 232 |
+
}
|
| 233 |
+
|
| 234 |
+
// Simulate some initial global flowers
|
| 235 |
+
if (state.globalFlowers.length === 0) {
|
| 236 |
+
state.globalFlowers = [
|
| 237 |
+
{ domain: 'news', type: '๐ป', clicks: 42 },
|
| 238 |
+
{ domain: 'social', type: '๐บ', clicks: 78 },
|
| 239 |
+
{ domain: 'shopping', type: '๐น', clicks: 35 },
|
| 240 |
+
{ domain: 'entertainment', type: '๐ธ', clicks: 120 }
|
| 241 |
+
];
|
| 242 |
+
renderGlobalGarden();
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
// Simulate some active users
|
| 246 |
+
simulateActiveUsers();
|
| 247 |
+
});
|
| 248 |
+
|
| 249 |
+
// Toggle sidebar
|
| 250 |
+
toggleSidebarBtn.addEventListener('click', () => {
|
| 251 |
+
sidebar.classList.toggle('translate-x-full');
|
| 252 |
+
sidebar.classList.toggle('translate-x-0');
|
| 253 |
+
});
|
| 254 |
+
|
| 255 |
+
closeSidebarBtn.addEventListener('click', () => {
|
| 256 |
+
sidebar.classList.add('translate-x-full');
|
| 257 |
+
sidebar.classList.remove('translate-x-0');
|
| 258 |
+
});
|
| 259 |
+
|
| 260 |
+
// Simulate new tab
|
| 261 |
+
simulateNewTabBtn.addEventListener('click', () => {
|
| 262 |
+
const domains = [
|
| 263 |
+
'cnn.com', 'facebook.com', 'amazon.com', 'youtube.com',
|
| 264 |
+
'wikipedia.org', 'twitter.com', 'nytimes.com', 'github.com',
|
| 265 |
+
'reddit.com', 'netflix.com', 'bbc.com', 'stackoverflow.com'
|
| 266 |
+
];
|
| 267 |
+
const randomDomain = domains[Math.floor(Math.random() * domains.length)];
|
| 268 |
+
createCookie(randomDomain);
|
| 269 |
+
});
|
| 270 |
+
|
| 271 |
+
// Spin slots
|
| 272 |
+
spinButton.addEventListener('click', () => {
|
| 273 |
+
if (state.coins < 5) {
|
| 274 |
+
alert("You need at least 5 coins to spin!");
|
| 275 |
+
return;
|
| 276 |
+
}
|
| 277 |
+
|
| 278 |
+
state.coins -= 5;
|
| 279 |
+
updateUI();
|
| 280 |
+
|
| 281 |
+
// Disable button during spin
|
| 282 |
+
spinButton.disabled = true;
|
| 283 |
+
spinButton.classList.add('opacity-50');
|
| 284 |
+
|
| 285 |
+
// Spin animation
|
| 286 |
+
const spins = 10 + Math.floor(Math.random() * 10);
|
| 287 |
+
let spinCount = 0;
|
| 288 |
+
|
| 289 |
+
const spinInterval = setInterval(() => {
|
| 290 |
+
slot1.textContent = getRandomSlotItem();
|
| 291 |
+
slot2.textContent = getRandomSlotItem();
|
| 292 |
+
slot3.textContent = getRandomSlotItem();
|
| 293 |
+
|
| 294 |
+
spinCount++;
|
| 295 |
+
if (spinCount >= spins) {
|
| 296 |
+
clearInterval(spinInterval);
|
| 297 |
+
finishSpin();
|
| 298 |
+
}
|
| 299 |
+
}, 100);
|
| 300 |
+
});
|
| 301 |
+
|
| 302 |
+
function finishSpin() {
|
| 303 |
+
// Final slot values
|
| 304 |
+
const val1 = getRandomSlotItem();
|
| 305 |
+
const val2 = getRandomSlotItem();
|
| 306 |
+
const val3 = getRandomSlotItem();
|
| 307 |
+
|
| 308 |
+
slot1.textContent = val1;
|
| 309 |
+
slot2.textContent = val2;
|
| 310 |
+
slot3.textContent = val3;
|
| 311 |
+
|
| 312 |
+
// Add slot spin animation
|
| 313 |
+
slot1.classList.add('slot-spin');
|
| 314 |
+
slot2.classList.add('slot-spin');
|
| 315 |
+
slot3.classList.add('slot-spin');
|
| 316 |
+
|
| 317 |
+
setTimeout(() => {
|
| 318 |
+
slot1.classList.remove('slot-spin');
|
| 319 |
+
slot2.classList.remove('slot-spin');
|
| 320 |
+
slot3.classList.remove('slot-spin');
|
| 321 |
+
|
| 322 |
+
// Check for win
|
| 323 |
+
if (val1 === val2 && val2 === val3) {
|
| 324 |
+
// Big win!
|
| 325 |
+
const winAmount = val1 === '๐ฐ' ? 50 : 20;
|
| 326 |
+
state.coins += winAmount;
|
| 327 |
+
alert(`JACKPOT! You won ${winAmount} coins!`);
|
| 328 |
+
} else if (val1 === val2 || val2 === val3 || val1 === val3) {
|
| 329 |
+
// Small win
|
| 330 |
+
state.coins += 5;
|
| 331 |
+
alert("You won 5 coins!");
|
| 332 |
+
}
|
| 333 |
+
|
| 334 |
+
updateUI();
|
| 335 |
+
spinButton.disabled = false;
|
| 336 |
+
spinButton.classList.remove('opacity-50');
|
| 337 |
+
saveGame();
|
| 338 |
+
}, 500);
|
| 339 |
+
}
|
| 340 |
+
|
| 341 |
+
function getRandomSlotItem() {
|
| 342 |
+
return state.slotItems[Math.floor(Math.random() * state.slotItems.length)];
|
| 343 |
+
}
|
| 344 |
+
|
| 345 |
+
function createCookie(domain) {
|
| 346 |
+
// Determine domain category
|
| 347 |
+
let category = 'other';
|
| 348 |
+
for (const [cat, domains] of Object.entries(state.domainCategories)) {
|
| 349 |
+
if (domains.some(d => domain.includes(d))) {
|
| 350 |
+
category = cat;
|
| 351 |
+
break;
|
| 352 |
+
}
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
// Check if cookie already exists for this domain
|
| 356 |
+
const existingCookie = state.cookies.find(c => c.domain === domain);
|
| 357 |
+
if (existingCookie) {
|
| 358 |
+
existingCookie.clicks++;
|
| 359 |
+
animateCookie(existingCookie.id);
|
| 360 |
+
return;
|
| 361 |
+
}
|
| 362 |
+
|
| 363 |
+
// Create new cookie
|
| 364 |
+
const cookieId = 'cookie-' + Date.now();
|
| 365 |
+
const newCookie = {
|
| 366 |
+
id: cookieId,
|
| 367 |
+
domain,
|
| 368 |
+
category,
|
| 369 |
+
clicks: 1,
|
| 370 |
+
growth: 0,
|
| 371 |
+
type: null,
|
| 372 |
+
activeUsers: Math.floor(Math.random() * 100) + 1
|
| 373 |
+
};
|
| 374 |
+
|
| 375 |
+
state.cookies.push(newCookie);
|
| 376 |
+
state.activeUsers[domain] = newCookie.activeUsers;
|
| 377 |
+
|
| 378 |
+
// Render cookie
|
| 379 |
+
renderCookie(newCookie);
|
| 380 |
+
|
| 381 |
+
// Start growth timer
|
| 382 |
+
startCookieGrowth(newCookie);
|
| 383 |
+
|
| 384 |
+
// Save game
|
| 385 |
+
saveGame();
|
| 386 |
+
}
|
| 387 |
+
|
| 388 |
+
function renderCookie(cookie) {
|
| 389 |
+
const cookieEl = document.createElement('div');
|
| 390 |
+
cookieEl.id = cookie.id;
|
| 391 |
+
cookieEl.className = 'cookie-container relative';
|
| 392 |
+
|
| 393 |
+
const cookieIcon = document.createElement('div');
|
| 394 |
+
cookieIcon.className = 'w-10 h-10 rounded-full flex items-center justify-center text-white cursor-pointer shadow-md cookie-pulse';
|
| 395 |
+
cookieIcon.innerHTML = '<i class="fas fa-cookie-bite text-xl"></i>';
|
| 396 |
+
|
| 397 |
+
// Set color based on domain category
|
| 398 |
+
cookieIcon.classList.add(`domain-${cookie.category}`);
|
| 399 |
+
|
| 400 |
+
// Tooltip
|
| 401 |
+
const tooltip = document.createElement('div');
|
| 402 |
+
tooltip.className = 'tooltip absolute bottom-full left-1/2 transform -translate-x-1/2 mb-2 bg-gray-800 text-white text-xs rounded py-1 px-2 whitespace-nowrap z-20';
|
| 403 |
+
tooltip.innerHTML = `
|
| 404 |
+
<div class="font-bold">${cookie.domain}</div>
|
| 405 |
+
<div>Visitors: ${cookie.activeUsers.toLocaleString()}</div>
|
| 406 |
+
<div>Clicks: ${cookie.clicks}</div>
|
| 407 |
+
`;
|
| 408 |
+
|
| 409 |
+
// Arrow
|
| 410 |
+
const arrow = document.createElement('div');
|
| 411 |
+
arrow.className = 'absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-b-0 border-t-4 border-l-transparent border-r-transparent border-t-gray-800';
|
| 412 |
+
|
| 413 |
+
tooltip.appendChild(arrow);
|
| 414 |
+
cookieEl.appendChild(cookieIcon);
|
| 415 |
+
cookieEl.appendChild(tooltip);
|
| 416 |
+
cookieBar.appendChild(cookieEl);
|
| 417 |
+
|
| 418 |
+
// Click handler
|
| 419 |
+
cookieIcon.addEventListener('click', () => {
|
| 420 |
+
handleCookieClick(cookie);
|
| 421 |
+
});
|
| 422 |
+
}
|
| 423 |
+
|
| 424 |
+
function handleCookieClick(cookie) {
|
| 425 |
+
// Increment clicks
|
| 426 |
+
cookie.clicks++;
|
| 427 |
+
|
| 428 |
+
// Add coin
|
| 429 |
+
state.coins++;
|
| 430 |
+
updateUI();
|
| 431 |
+
|
| 432 |
+
// Animate
|
| 433 |
+
animateCookie(cookie.id);
|
| 434 |
+
|
| 435 |
+
// Update tooltip
|
| 436 |
+
const tooltip = document.querySelector(`#${cookie.id} .tooltip`);
|
| 437 |
+
if (tooltip) {
|
| 438 |
+
tooltip.innerHTML = `
|
| 439 |
+
<div class="font-bold">${cookie.domain}</div>
|
| 440 |
+
<div>Visitors: ${cookie.activeUsers.toLocaleString()}</div>
|
| 441 |
+
<div>Clicks: ${cookie.clicks}</div>
|
| 442 |
+
`;
|
| 443 |
+
tooltip.appendChild(document.createElement('div')).className = 'absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-b-0 border-t-4 border-l-transparent border-r-transparent border-t-gray-800';
|
| 444 |
+
}
|
| 445 |
+
|
| 446 |
+
// Save game
|
| 447 |
+
saveGame();
|
| 448 |
+
}
|
| 449 |
+
|
| 450 |
+
function animateCookie(cookieId) {
|
| 451 |
+
const cookieEl = document.getElementById(cookieId);
|
| 452 |
+
if (!cookieEl) return;
|
| 453 |
+
|
| 454 |
+
cookieEl.classList.add('animate-ping');
|
| 455 |
+
setTimeout(() => {
|
| 456 |
+
cookieEl.classList.remove('animate-ping');
|
| 457 |
+
}, 1000);
|
| 458 |
+
}
|
| 459 |
+
|
| 460 |
+
function startCookieGrowth(cookie) {
|
| 461 |
+
const growthInterval = setInterval(() => {
|
| 462 |
+
cookie.growth += 5;
|
| 463 |
+
|
| 464 |
+
// Check if fully grown
|
| 465 |
+
if (cookie.growth >= 100) {
|
| 466 |
+
clearInterval(growthInterval);
|
| 467 |
+
cookieGrown(cookie);
|
| 468 |
+
}
|
| 469 |
+
}, 1000);
|
| 470 |
+
}
|
| 471 |
+
|
| 472 |
+
function cookieGrown(cookie) {
|
| 473 |
+
// Determine flower type based on domain category and clicks
|
| 474 |
+
const flowerTypes = {
|
| 475 |
+
news: ['๐ป', '๐ฐ', '๐๏ธ'],
|
| 476 |
+
social: ['๐บ', '๐ฌ', '๐ฅ'],
|
| 477 |
+
shopping: ['๐น', '๐๏ธ', '๐ฐ'],
|
| 478 |
+
entertainment: ['๐ธ', '๐ฌ', '๐ฎ'],
|
| 479 |
+
other: ['๐ผ', 'โ', '๐']
|
| 480 |
+
};
|
| 481 |
+
|
| 482 |
+
// More clicks = rarer flower
|
| 483 |
+
const rarity = Math.min(Math.floor(cookie.clicks / 10), 2);
|
| 484 |
+
cookie.type = flowerTypes[cookie.category][rarity];
|
| 485 |
+
|
| 486 |
+
// Add to flowers count
|
| 487 |
+
state.flowers++;
|
| 488 |
+
|
| 489 |
+
// Add to global garden if enough clicks
|
| 490 |
+
if (cookie.clicks >= 15) {
|
| 491 |
+
state.globalFlowers.push({
|
| 492 |
+
domain: cookie.category,
|
| 493 |
+
type: cookie.type,
|
| 494 |
+
clicks: cookie.clicks
|
| 495 |
+
});
|
| 496 |
+
renderGlobalGarden();
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
// Update cookie to show flower
|
| 500 |
+
const cookieEl = document.getElementById(cookie.id);
|
| 501 |
+
if (cookieEl) {
|
| 502 |
+
const cookieIcon = cookieEl.querySelector('div:first-child');
|
| 503 |
+
cookieIcon.innerHTML = `<span class="text-2xl">${cookie.type}</span>`;
|
| 504 |
+
cookieIcon.classList.remove('cookie-pulse');
|
| 505 |
+
cookieIcon.classList.add('flower-grow');
|
| 506 |
+
|
| 507 |
+
// Update tooltip
|
| 508 |
+
const tooltip = cookieEl.querySelector('.tooltip');
|
| 509 |
+
if (tooltip) {
|
| 510 |
+
tooltip.innerHTML = `
|
| 511 |
+
<div class="font-bold">${cookie.domain}</div>
|
| 512 |
+
<div>Flower: ${cookie.type}</div>
|
| 513 |
+
<div>Visitors: ${cookie.activeUsers.toLocaleString()}</div>
|
| 514 |
+
<div>Clicks: ${cookie.clicks}</div>
|
| 515 |
+
`;
|
| 516 |
+
tooltip.appendChild(document.createElement('div')).className = 'absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-b-0 border-t-4 border-l-transparent border-r-transparent border-t-gray-800';
|
| 517 |
+
}
|
| 518 |
+
}
|
| 519 |
+
|
| 520 |
+
updateUI();
|
| 521 |
+
saveGame();
|
| 522 |
+
}
|
| 523 |
+
|
| 524 |
+
function renderGlobalGarden() {
|
| 525 |
+
globalGarden.innerHTML = '';
|
| 526 |
+
|
| 527 |
+
state.globalFlowers.forEach((flower, index) => {
|
| 528 |
+
const flowerEl = document.createElement('div');
|
| 529 |
+
flowerEl.className = 'flex flex-col items-center p-2 bg-gray-100 rounded';
|
| 530 |
+
|
| 531 |
+
const flowerIcon = document.createElement('div');
|
| 532 |
+
flowerIcon.className = 'text-3xl mb-1';
|
| 533 |
+
flowerIcon.textContent = flower.type;
|
| 534 |
+
|
| 535 |
+
const flowerText = document.createElement('div');
|
| 536 |
+
flowerText.className = 'text-xs text-center';
|
| 537 |
+
flowerText.textContent = `${flower.domain} (${flower.clicks})`;
|
| 538 |
+
|
| 539 |
+
flowerEl.appendChild(flowerIcon);
|
| 540 |
+
flowerEl.appendChild(flowerText);
|
| 541 |
+
globalGarden.appendChild(flowerEl);
|
| 542 |
+
});
|
| 543 |
+
}
|
| 544 |
+
|
| 545 |
+
function updateUI() {
|
| 546 |
+
coinCountEl.textContent = state.coins;
|
| 547 |
+
flowerCountEl.textContent = state.flowers;
|
| 548 |
+
|
| 549 |
+
// Disable spin button if not enough coins
|
| 550 |
+
spinButton.disabled = state.coins < 5;
|
| 551 |
+
spinButton.classList.toggle('opacity-50', state.coins < 5);
|
| 552 |
+
}
|
| 553 |
+
|
| 554 |
+
function saveGame() {
|
| 555 |
+
localStorage.setItem('tabCookieGame', JSON.stringify({
|
| 556 |
+
cookies: state.cookies,
|
| 557 |
+
coins: state.coins,
|
| 558 |
+
flowers: state.flowers,
|
| 559 |
+
globalFlowers: state.globalFlowers
|
| 560 |
+
}));
|
| 561 |
+
}
|
| 562 |
+
|
| 563 |
+
function simulateActiveUsers() {
|
| 564 |
+
// Randomly fluctuate active users
|
| 565 |
+
setInterval(() => {
|
| 566 |
+
state.cookies.forEach(cookie => {
|
| 567 |
+
const change = Math.floor(Math.random() * 10) - 3; // -3 to +6
|
| 568 |
+
cookie.activeUsers = Math.max(1, cookie.activeUsers + change);
|
| 569 |
+
state.activeUsers[cookie.domain] = cookie.activeUsers;
|
| 570 |
+
|
| 571 |
+
// Update tooltip if exists
|
| 572 |
+
const tooltip = document.querySelector(`#${cookie.id} .tooltip`);
|
| 573 |
+
if (tooltip) {
|
| 574 |
+
tooltip.innerHTML = `
|
| 575 |
+
<div class="font-bold">${cookie.domain}</div>
|
| 576 |
+
${cookie.type ? `<div>Flower: ${cookie.type}</div>` : ''}
|
| 577 |
+
<div>Visitors: ${cookie.activeUsers.toLocaleString()}</div>
|
| 578 |
+
<div>Clicks: ${cookie.clicks}</div>
|
| 579 |
+
`;
|
| 580 |
+
tooltip.appendChild(document.createElement('div')).className = 'absolute top-full left-1/2 transform -translate-x-1/2 w-0 h-0 border-l-4 border-r-4 border-b-0 border-t-4 border-l-transparent border-r-transparent border-t-gray-800';
|
| 581 |
+
}
|
| 582 |
+
});
|
| 583 |
+
}, 5000);
|
| 584 |
+
}
|
| 585 |
+
</script>
|
| 586 |
+
<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=Juno360219/cookie-slot-browser-click" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
|
| 587 |
+
</html>
|