-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwp.js
More file actions
50 lines (41 loc) · 2.02 KB
/
wp.js
File metadata and controls
50 lines (41 loc) · 2.02 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
function unlockPremiumGrid(event, btn) {
const unlockedUntil = localStorage.getItem('ns_premium_unlocked');
const now = Date.now();
// 1. Agar premium unlocked hai (Offerwall complete ho chuka hai)
if (unlockedUntil && now < parseInt(unlockedUntil)) {
// REDIRECT KO ROKO! Kyunki premium unlock ho chuka hai, ab waha nahi jana.
event.preventDefault();
btn.innerHTML = '<i class="fa-solid fa-box-open"></i> PREMIUM UNLOCKED';
btn.style.pointerEvents = 'none';
if (typeof initWallpaperData === "function") {
initWallpaperData('premium').then(() => {
let grid = document.getElementById('wallpaperGrid');
if(grid) {
grid.style.opacity = '1';
let cards = grid.querySelectorAll('.wp-card');
cards.forEach(card => {
card.style.opacity = '0';
card.style.transform = 'translateY(50px) scale(0.95)';
card.style.transition = 'all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1)';
});
cards.forEach((card, index) => {
setTimeout(() => {
card.style.opacity = '1';
card.style.transform = 'translateY(0) scale(1)';
}, 100 * index);
});
}
btn.style.pointerEvents = 'all';
if (navigator.vibrate) navigator.vibrate([50, 50]);
});
}
return false; // Function yahi ruk jayega
}
// 2. Agar unlocked nahi hai (Pehli baar aaya hai)
// Hum JavaScript se koi zabardasti redirect nahi kar rahe hain.
// Aapka <a> tag (HTML) apna normal redirect karega.
btn.innerHTML = '<i class="fa-solid fa-spinner fa-spin"></i> REDIRECTING...';
btn.style.pointerEvents = 'none';
// true return karne se browser ko permission mil jayegi wp.html par jane ki
return true;
}