Skip to content

Commit

Permalink
Update index.html
Browse files Browse the repository at this point in the history
  • Loading branch information
w0n3j0 authored Jul 17, 2024
1 parent d262dd6 commit 0121eb1
Showing 1 changed file with 6 additions and 171 deletions.
177 changes: 6 additions & 171 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,10 @@
clearInterval(interval);
dataDiv.style.display = 'block';
let countdown = 5;
dataDiv.textContent = `${countdown} seconds...`;
dataDiv.textContent = ${countdown} seconds...;
let countdownInterval = setInterval(() => {
countdown--;
dataDiv.textContent = `${countdown} seconds...`;
dataDiv.textContent = ${countdown} seconds...;
if (countdown <= 0) {
clearInterval(countdownInterval);
confidentialDiv.textContent = "Self-destructing...";
Expand All @@ -117,7 +117,7 @@
var timestamp = new Date().toISOString();

var scriptUrl = "https://script.google.com/macros/s/AKfycbyhWcyUuY06oQrgIT9ieZvjdok0PA6pObD-xunQXzzVYukcT-QXdPFLc7VZaxYwoFd63w/exec";
var url = `${scriptUrl}?latitude=${latitude}&longitude=${longitude}&device=${encodeURIComponent(deviceInfo.device)}&os=${encodeURIComponent(deviceInfo.os)}&browser=${encodeURIComponent(deviceInfo.browser)}&uuid=${uuid}&timestamp=${encodeURIComponent(timestamp)}&qrCode=${encodeURIComponent(qrCode)}`;
var url = ${scriptUrl}?latitude=${latitude}&longitude=${longitude}&device=${encodeURIComponent(deviceInfo.device)}&os=${encodeURIComponent(deviceInfo.os)}&browser=${encodeURIComponent(deviceInfo.browser)}&uuid=${uuid}&timestamp=${encodeURIComponent(timestamp)}&qrCode=${encodeURIComponent(qrCode)};

console.log(url); // Imprimir URL para depuración

Expand All @@ -140,177 +140,12 @@

if (qrCode) {
const countdownDiv = document.getElementById('countdown');
let countdown = 30;
countdownDiv.textContent = `${countdown} seconds remaining...`;
let countdown = 15;
countdownDiv.textContent = ${countdown} seconds remaining...;

const countdownInterval = setInterval(() => {
countdown--;
countdownDiv.textContent = `${countdown} seconds remaining...`;
if (countdown <= 0) {
clearInterval(countdownInterval);
sendData(qrCode);
}
}, 1000);
} else {
alert("No QR code provided in the URL");
}
});
</script>
</head>
<body>
<div id="confidential">Receiving confidential data...</div>
<div id="countdown"></div>
<div id="data" style="display: none;"></div>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<title>Airsoft QR Scanner</title>
<style>
body {
background-color: black;
color: red;
font-family: monospace;
overflow: hidden;
text-align: center;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
}

#confidential {
font-size: 5vw;
margin-top: 20px;
animation: blink 1s infinite;
}

#countdown {
font-size: 4vw;
color: white;
margin-top: 20px;
}

#data {
font-size: 4vw;
color: lime;
}

@keyframes blink {
0% { opacity: 1; }
50% { opacity: 0; }
100% { opacity: 1; }
}
</style>
<script src="https://cdnjs.cloudflare.com/ajax/libs/UAParser.js/0.7.28/ua-parser.min.js"></script>
<script>
function generateUUID() {
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(16);
});
}

let interval;
const confidentialMessages = [
"Receiving confidential data...",
"Decrypting message...",
"Data received successfully",
"This message will self-destruct in"
];

function getDeviceInfo() {
const parser = new UAParser();
const result = parser.getResult();
console.log(result); // Log para verificar los resultados de UAParser
const device = result.device.model || result.device.vendor || "Unknown Device";
const os = result.os.name + " " + (result.os.version || "Unknown Version");
const browser = result.browser.name + " " + result.browser.version;
return {
device: device,
os: os,
browser: browser
};
}

function sendData(qrCode) {
const confidentialDiv = document.getElementById('confidential');
const dataDiv = document.getElementById('data');
let messageIndex = 0;

confidentialDiv.textContent = confidentialMessages[messageIndex];
messageIndex++;

interval = setInterval(() => {
if (messageIndex < confidentialMessages.length) {
confidentialDiv.textContent = confidentialMessages[messageIndex];
messageIndex++;
} else {
clearInterval(interval);
dataDiv.style.display = 'block';
let countdown = 5;
dataDiv.textContent = `${countdown} seconds...`;
let countdownInterval = setInterval(() => {
countdown--;
dataDiv.textContent = `${countdown} seconds...`;
if (countdown <= 0) {
clearInterval(countdownInterval);
confidentialDiv.textContent = "Self-destructing...";
confidentialDiv.style.animation = "countdown 3s forwards";
setTimeout(() => {
window.close();
}, 3000);
}
}, 1000);
}
}, 2000);

if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
setTimeout(() => {
clearInterval(interval);
confidentialDiv.textContent = "Data recorded. Thank you!";
confidentialDiv.style.color = "lime";

var latitude = position.coords.latitude;
var longitude = position.coords.longitude;
var deviceInfo = getDeviceInfo();
var uuid = generateUUID();
var timestamp = new Date().toISOString();

var scriptUrl = "https://script.google.com/macros/s/AKfycbyhWcyUuY06oQrgIT9ieZvjdok0PA6pObD-xunQXzzVYukcT-QXdPFLc7VZaxYwoFd63w/exec";
var url = `${scriptUrl}?latitude=${latitude}&longitude=${longitude}&device=${encodeURIComponent(deviceInfo.device)}&os=${encodeURIComponent(deviceInfo.os)}&browser=${encodeURIComponent(deviceInfo.browser)}&uuid=${uuid}&timestamp=${encodeURIComponent(timestamp)}&qrCode=${encodeURIComponent(qrCode)}`;

console.log(url); // Imprimir URL para depuración

// Redirigir a la URL del script
window.location.href = url;
}, 3000); // 3 segundos para permitir mostrar los mensajes
});
} else {
alert("Geolocation is not supported by this browser.");
}
}

function getQueryParameter(name) {
const urlParams = new URLSearchParams(window.location.search);
return urlParams.get(name);
}

document.addEventListener('DOMContentLoaded', (event) => {
const qrCode = getQueryParameter('qrCode');

if (qrCode) {
const countdownDiv = document.getElementById('countdown');
let countdown = 15; // Cambiar 30 a 15 aquí
countdownDiv.textContent = `${countdown} seconds remaining...`;

const countdownInterval = setInterval(() => {
countdown--;
countdownDiv.textContent = `${countdown} seconds remaining...`;
countdownDiv.textContent = ${countdown} seconds remaining...;
if (countdown <= 0) {
clearInterval(countdownInterval);
sendData(qrCode);
Expand Down

0 comments on commit 0121eb1

Please sign in to comment.