Repository navigation
Expand file tree
/
Copy path1.html
More file actions
824 lines (718 loc) · 28 KB
/
Copy path1.html
File metadata and controls
824 lines (718 loc) · 28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dragon Elite - Fixed Floating</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Syncopate:wght@700&family=JetBrains+Mono:wght@500&family=Outfit:wght@900&family=Inter:wght@400;500;600&display=swap');
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
background: linear-gradient(135deg, #020205 0%, #0a0a1a 50%, #050510 100%);
min-height: 100vh;
margin: 0;
overflow: hidden;
font-family: 'Inter', sans-serif;
color: #fff;
}
/* Premium Background Particle Canvas */
#particle-canvas {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
pointer-events: none;
opacity: 0.8;
}
/* Premium Animations */
@keyframes borderGlow {
0% {
box-shadow:
0 0 20px rgba(0, 242, 255, 0.3),
0 0 40px rgba(112, 0, 255, 0.1),
inset 0 0 20px rgba(0, 242, 255, 0.1);
}
50% {
box-shadow:
0 0 30px rgba(0, 242, 255, 0.5),
0 0 60px rgba(112, 0, 255, 0.2),
inset 0 0 30px rgba(0, 242, 255, 0.15);
}
100% {
box-shadow:
0 0 20px rgba(0, 242, 255, 0.3),
0 0 40px rgba(112, 0, 255, 0.1),
inset 0 0 20px rgba(0, 242, 255, 0.1);
}
}
@keyframes floatAnimation {
0%, 100% { transform: translateY(0) rotate(0deg); }
50% { transform: translateY(-10px) rotate(0.5deg); }
}
@keyframes iconPulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.1); }
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(20px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
.floating-widget {
position: fixed;
z-index: 10000;
user-select: none;
touch-action: none;
transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.floating-widget.dragging {
transition: none;
z-index: 10001;
}
.collapsed-view {
width: 65px;
height: 65px;
background: linear-gradient(145deg, rgba(10, 10, 25, 0.95), rgba(5, 5, 15, 0.95));
backdrop-filter: blur(20px);
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
cursor: grab;
border: 1px solid rgba(0, 242, 255, 0.2);
animation: borderGlow 4s ease-in-out infinite, floatAnimation 6s ease-in-out infinite;
transition: all 0.3s ease;
position: relative;
overflow: hidden;
}
.collapsed-view:before {
content: '';
position: absolute;
top: -2px;
left: -2px;
right: -2px;
bottom: -2px;
background: linear-gradient(45deg, #00f2ff, #7000ff, #00f2ff);
border-radius: 22px;
z-index: -1;
opacity: 0.5;
filter: blur(5px);
}
.collapsed-view:hover {
transform: scale(1.05);
box-shadow:
0 0 30px rgba(0, 242, 255, 0.5),
0 0 60px rgba(112, 0, 255, 0.3);
}
.collapsed-view i {
font-size: 24px;
color: #fff;
filter: drop-shadow(0 0 8px rgba(0, 242, 255, 0.7));
animation: iconPulse 2s ease-in-out infinite;
}
/* Premium Expanded View */
.expanded-view {
display: none; /* Initially hidden */
flex-direction: column;
width: 320px;
height: 380px;
background: linear-gradient(165deg, rgba(10, 10, 30, 0.98), rgba(5, 5, 20, 0.98));
backdrop-filter: blur(40px);
border-radius: 24px;
border: 1px solid rgba(255, 255, 255, 0.1);
animation:
borderGlow 4s ease-in-out infinite,
slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
overflow: hidden;
box-shadow:
0 25px 60px rgba(0, 0, 0, 0.8),
inset 0 1px 0 rgba(255, 255, 255, 0.1);
position: relative;
}
.expanded-view:before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1px;
background: linear-gradient(90deg, transparent, rgba(0, 242, 255, 0.5), transparent);
}
.nav-header {
padding: 12px 16px;
background: linear-gradient(to right, rgba(0, 242, 255, 0.05), rgba(112, 0, 255, 0.05));
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid rgba(255, 255, 255, 0.08);
position: relative;
}
.nav-header:after {
content: '';
position: absolute;
bottom: -1px;
left: 16px;
right: 16px;
height: 1px;
background: linear-gradient(90deg, transparent, rgba(0, 242, 255, 0.3), transparent);
}
.brand {
font-family: 'Syncopate', sans-serif;
font-size: 10px;
font-weight: 700;
color: #00f2ff;
letter-spacing: 1.5px;
text-shadow: 0 0 10px rgba(0, 242, 255, 0.5);
}
.ping {
font-size: 9px;
font-weight: 600;
color: #00ff88;
background: rgba(0, 255, 136, 0.1);
padding: 4px 8px;
border-radius: 10px;
font-family: 'JetBrains Mono', monospace;
}
.close-btn {
color: rgba(255, 59, 92, 0.8);
cursor: pointer;
font-size: 20px;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
transition: all 0.2s ease;
}
.close-btn:hover {
color: #ff3b5c;
background: rgba(255, 59, 92, 0.1);
transform: scale(1.1);
}
/* Enhanced Card Content */
.card-content {
height: 180px;
margin: 16px;
background: rgba(255, 255, 255, 0.02);
border-radius: 18px;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border: 1px solid rgba(255, 255, 255, 0.05);
position: relative;
overflow: hidden;
}
.card-content:before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background:
radial-gradient(circle at 20% 80%, rgba(0, 242, 255, 0.03) 0%, transparent 50%),
radial-gradient(circle at 80% 20%, rgba(112, 0, 255, 0.03) 0%, transparent 50%);
pointer-events: none;
}
.main-val {
font-family: 'Outfit', sans-serif;
font-size: 68px;
font-weight: 900;
color: #fff;
line-height: 1;
text-shadow: 0 0 20px currentColor;
}
.sub-val {
font-family: 'Syncopate', sans-serif;
font-size: 18px;
margin-top: 8px;
letter-spacing: 3px;
color: rgba(255, 255, 255, 0.8);
}
/* Enhanced Period Box */
.period-box {
margin: 0 16px 16px;
padding: 12px;
background: linear-gradient(145deg, rgba(0, 0, 0, 0.4), rgba(20, 20, 40, 0.4));
border-radius: 14px;
border: 1px solid rgba(255, 255, 255, 0.05);
text-align: center;
position: relative;
overflow: hidden;
}
.period-box:before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
height: 1px;
background: linear-gradient(90deg, transparent, rgba(0, 242, 255, 0.3), transparent);
}
.label {
font-size: 8px;
color: rgba(255, 255, 255, 0.5);
text-transform: uppercase;
letter-spacing: 1px;
display: block;
margin-bottom: 4px;
}
.value {
color: #fff;
font-size: 11px;
font-weight: 600;
font-family: 'JetBrains Mono', monospace;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: 4px 0;
}
/* Premium Button */
.gen-btn {
margin: 0 16px 16px;
height: 44px;
background: linear-gradient(90deg, #00ffa3, #00f2ff);
border: none;
border-radius: 12px;
color: #000;
font-family: 'Syncopate', sans-serif;
font-size: 10px;
font-weight: 900;
cursor: pointer;
transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
letter-spacing: 1px;
position: relative;
overflow: hidden;
}
.gen-btn:before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 100%;
height: 100%;
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
transition: left 0.6s ease;
}
.gen-btn:hover {
transform: translateY(-2px);
box-shadow:
0 10px 20px rgba(0, 242, 255, 0.3),
0 0 30px rgba(0, 255, 163, 0.2);
}
.gen-btn:hover:before {
left: 100%;
}
.gen-btn:active {
transform: translateY(0);
}
/* Enhanced Loader */
.loader {
width: 40px;
height: 40px;
border: 3px solid rgba(0, 242, 255, 0.1);
border-top: 3px solid #00f2ff;
border-right: 3px solid #7000ff;
border-radius: 50%;
animation: spin 0.8s linear infinite;
display: none;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Color Themes */
.color-green {
color: #00ffa3 !important;
text-shadow: 0 0 25px #00ffa3 !important;
}
.color-red {
color: #ff3b5c !important;
text-shadow: 0 0 25px #ff3b5c !important;
}
/* Notification Badge */
.notification-badge {
position: absolute;
top: -5px;
right: -5px;
width: 20px;
height: 20px;
background: linear-gradient(45deg, #ff3b5c, #ff0066);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
font-size: 10px;
font-weight: bold;
color: white;
box-shadow: 0 0 10px rgba(255, 59, 92, 0.7);
z-index: 10;
animation: pulse 2s infinite;
}
@keyframes pulse {
0%, 100% { transform: scale(1); }
50% { transform: scale(1.1); }
}
/* Responsive adjustments */
@media (max-width: 768px) {
.expanded-view {
width: 300px;
height: 360px;
}
.floating-widget {
transform: scale(0.9);
}
}
</style>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
</head>
<body>
<canvas id="particle-canvas"></canvas>
<div id="widget-1" class="floating-widget" style="top: 40px; left: 40px;">
<div class="notification-badge" id="badge-1">!</div>
<div id="col-1" class="collapsed-view" onclick="toggleWidget(1)">
<i class="fas fa-dragon"></i>
</div>
<div id="exp-1" class="expanded-view">
<div class="nav-header">
<span class="brand">ELITE B/S</span>
<span class="ping" id="ping-1">22ms</span>
<span class="close-btn" onclick="toggleWidget(1)">×</span>
</div>
<div class="card-content">
<div id="loader-1" class="loader"></div>
<div id="res-1" style="text-align:center">
<div class="main-val" id="val-1">?</div>
<div class="sub-val" id="txt-1">READY</div>
</div>
</div>
<div class="period-box">
<span class="label">Target Period</span>
<span class="value" id="per-1">20260207100051842</span>
</div>
<button class="gen-btn" onclick="generateBS()">
<i class="fas fa-bolt" style="margin-right: 8px;"></i>
INJECT LOGIC
</button>
</div>
</div>
<div id="widget-2" class="floating-widget" style="top: 140px; left: 40px;">
<div id="col-2" class="collapsed-view" onclick="toggleWidget(2)">
<i class="fas fa-microchip"></i>
</div>
<div id="exp-2" class="expanded-view">
<div class="nav-header">
<span class="brand">ELITE NUM</span>
<span class="ping" id="ping-2">19ms</span>
<span class="close-btn" onclick="toggleWidget(2)">×</span>
</div>
<div class="card-content">
<div id="loader-2" class="loader"></div>
<div id="res-2">
<div class="main-val" id="val-2" style="font-size:72px">?</div>
</div>
</div>
<div class="period-box">
<span class="label">Target Period</span>
<span class="value" id="per-2">20260207100051842</span>
</div>
<button class="gen-btn" onclick="generateNum()">
<i class="fas fa-cogs" style="margin-right: 8px;"></i>
GENERATE
</button>
</div>
</div>
<script>
// SIMPLE TOGGLE FUNCTION - Yeh definitely kaam karega
function toggleWidget(n) {
console.log("Toggle function called for widget", n);
const col = document.getElementById('col-' + n);
const exp = document.getElementById('exp-' + n);
// Check current state
if (exp.style.display === 'flex' || exp.style.display === '') {
// Close the widget
exp.style.display = 'none';
col.style.display = 'flex';
} else {
// Open the widget
col.style.display = 'none';
exp.style.display = 'flex';
// Bring to front
document.querySelectorAll('.floating-widget').forEach(w => {
w.style.zIndex = 10000;
});
document.getElementById('widget-' + n).style.zIndex = 10001;
}
}
// Live Ping with realistic variation
setInterval(() => {
const basePing = Math.floor(Math.random()*10)+15;
const jitter = Math.floor(Math.random()*8)-4;
document.getElementById('ping-1').textContent = Math.max(5, basePing + jitter) + 'ms';
document.getElementById('ping-2').textContent = Math.max(5, basePing + jitter - 2) + 'ms';
}, 3000);
// Premium Particle System
const canvas = document.getElementById('particle-canvas');
const ctx = canvas.getContext('2d');
let particles = [];
function initParticles() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
particles = [];
// Create more particles for premium effect
for(let i = 0; i < 150; i++) {
particles.push({
x: Math.random() * canvas.width,
y: Math.random() * canvas.height,
size: Math.random() * 2 + 0.5,
speedX: Math.random() * 0.5 - 0.25,
speedY: Math.random() * 0.5 - 0.25,
color: Math.random() > 0.5 ?
`rgba(0, 242, 255, ${Math.random() * 0.3 + 0.1})` :
`rgba(112, 0, 255, ${Math.random() * 0.3 + 0.1})`
});
}
}
function updateParticles() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
particles.forEach(p => {
p.x += p.speedX;
p.y += p.speedY;
// Wrap around edges
if (p.x > canvas.width) p.x = 0;
if (p.x < 0) p.x = canvas.width;
if (p.y > canvas.height) p.y = 0;
if (p.y < 0) p.y = canvas.height;
// Draw particle with glow effect
ctx.beginPath();
ctx.arc(p.x, p.y, p.size, 0, Math.PI * 2);
ctx.fillStyle = p.color;
ctx.fill();
// Add glow
ctx.beginPath();
ctx.arc(p.x, p.y, p.size * 3, 0, Math.PI * 2);
ctx.fillStyle = p.color.replace(')', ', 0.1)').replace('rgba', 'rgba');
ctx.fill();
});
// Connect nearby particles with lines
for(let i = 0; i < particles.length; i++) {
for(let j = i + 1; j < particles.length; j++) {
const dx = particles[i].x - particles[j].x;
const dy = particles[i].y - particles[j].y;
const distance = Math.sqrt(dx * dx + dy * dy);
if (distance < 100) {
ctx.beginPath();
ctx.strokeStyle = `rgba(0, 242, 255, ${0.1 * (1 - distance/100)})`;
ctx.lineWidth = 0.5;
ctx.moveTo(particles[i].x, particles[i].y);
ctx.lineTo(particles[j].x, particles[j].y);
ctx.stroke();
}
}
}
requestAnimationFrame(updateParticles);
}
// Initialize particles
window.addEventListener('load', () => {
initParticles();
updateParticles();
// Test: Log that widgets are loaded
console.log("Widgets loaded successfully");
console.log("Click on the dragon or chip icons to open widgets");
});
window.addEventListener('resize', initParticles);
// Enhanced Draggable Logic - SIMPLIFIED
function makeDraggable(id) {
const el = document.getElementById(id);
let isDragging = false;
let offsetX, offsetY;
let startX, startY;
const startDrag = (e) => {
// Only drag from collapsed view or header
const target = e.target;
if (!target.closest('.collapsed-view') && !target.closest('.nav-header')) return;
isDragging = true;
el.classList.add('dragging');
const rect = el.getBoundingClientRect();
if (e.type === 'touchstart') {
startX = e.touches[0].clientX;
startY = e.touches[0].clientY;
} else {
startX = e.clientX;
startY = e.clientY;
}
offsetX = startX - rect.left;
offsetY = startY - rect.top;
e.preventDefault();
};
const drag = (e) => {
if (!isDragging) return;
let clientX, clientY;
if (e.type === 'touchmove') {
clientX = e.touches[0].clientX;
clientY = e.touches[0].clientY;
} else {
clientX = e.clientX;
clientY = e.clientY;
}
// Calculate new position
const newX = clientX - offsetX;
const newY = clientY - offsetY;
// Apply boundary limits
const boundedX = Math.max(10, Math.min(window.innerWidth - el.offsetWidth - 10, newX));
const boundedY = Math.max(10, Math.min(window.innerHeight - el.offsetHeight - 10, newY));
el.style.left = `${boundedX}px`;
el.style.top = `${boundedY}px`;
};
const stopDrag = () => {
if (isDragging) {
isDragging = false;
el.classList.remove('dragging');
// Add a little bounce effect
el.style.transform = 'scale(1.02)';
setTimeout(() => {
el.style.transform = 'scale(1)';
}, 100);
}
};
// Mouse events
el.addEventListener('mousedown', startDrag);
document.addEventListener('mousemove', drag);
document.addEventListener('mouseup', stopDrag);
// Touch events
el.addEventListener('touchstart', startDrag, { passive: false });
document.addEventListener('touchmove', drag, { passive: false });
document.addEventListener('touchend', stopDrag);
// Prevent context menu on drag
el.addEventListener('contextmenu', (e) => {
if (isDragging) e.preventDefault();
});
}
// Initialize draggable widgets
makeDraggable('widget-1');
makeDraggable('widget-2');
// Logic & Predictions
let lastN = 6;
function getRes(p) {
const s = p.toString().slice(-3).split('').reduce((a,b) => parseInt(a) + parseInt(b), 0);
return (Math.floor(((s + lastN) * 7) / 3) % 2 === 0) ? "BIG" : "SMALL";
}
function generateBS() {
const loader = document.getElementById('loader-1');
const result = document.getElementById('res-1');
const period = document.getElementById('per-1');
const badge = document.getElementById('badge-1');
// Show loader
loader.style.display = 'block';
result.style.display = 'none';
// Simulate processing delay
setTimeout(() => {
const res = getRes(period.textContent);
const valEl = document.getElementById('val-1');
const txtEl = document.getElementById('txt-1');
// Update display
valEl.textContent = res[0];
txtEl.textContent = res;
result.className = res === "BIG" ? "color-red" : "color-green";
// Show badge for new result
if (badge) {
badge.style.display = 'flex';
badge.textContent = res[0];
}
// Hide loader and show result
loader.style.display = 'none';
result.style.display = 'block';
// Update periods
const nextPeriod = (BigInt(period.textContent) + 1n).toString();
period.textContent = nextPeriod;
document.getElementById('per-2').textContent = nextPeriod;
// Add visual feedback
result.style.animation = 'none';
setTimeout(() => {
result.style.animation = 'slideIn 0.5s ease';
}, 10);
}, 1200);
}
function generateNum() {
const loader = document.getElementById('loader-2');
const result = document.getElementById('res-2');
const period = document.getElementById('per-2');
// Show loader
loader.style.display = 'block';
result.style.display = 'none';
// Simulate processing delay
setTimeout(() => {
const n = Math.floor(Math.random() * 10);
lastN = n;
const valEl = document.getElementById('val-2');
valEl.textContent = n;
// Apply color based on number
if ([1, 3, 7, 9].includes(n)) {
result.className = "main-val color-green";
} else {
result.className = "main-val color-red";
}
// Hide loader and show result
loader.style.display = 'none';
result.style.display = 'block';
// Update periods
const nextPeriod = (BigInt(period.textContent) + 1n).toString();
period.textContent = nextPeriod;
document.getElementById('per-1').textContent = nextPeriod;
// Add visual feedback
valEl.style.transform = 'scale(1.2)';
setTimeout(() => {
valEl.style.transform = 'scale(1)';
}, 300);
}, 1200);
}
// Initialize with random positions
function randomizePositions() {
const widgets = document.querySelectorAll('.floating-widget');
widgets.forEach(widget => {
const maxX = window.innerWidth - widget.offsetWidth - 40;
const maxY = window.innerHeight - widget.offsetHeight - 40;
const randomX = 40 + Math.random() * (maxX - 40);
const randomY = 40 + Math.random() * (maxY - 40);
widget.style.left = `${randomX}px`;
widget.style.top = `${randomY}px`;
});
}
// Call on load
window.addEventListener('load', randomizePositions);
// Debug: Add click listeners directly for testing
document.addEventListener('DOMContentLoaded', function() {
// Direct click handlers for testing
document.getElementById('col-1').addEventListener('click', function() {
console.log("Dragon icon clicked");
toggleWidget(1);
});
document.getElementById('col-2').addEventListener('click', function() {
console.log("Chip icon clicked");
toggleWidget(2);
});
// Close buttons
document.querySelectorAll('.close-btn').forEach((btn, index) => {
btn.addEventListener('click', function() {
console.log("Close button clicked for widget", index + 1);
toggleWidget(index + 1);
});
});
console.log("All event listeners attached");
});
</script>
</body>
</html>