File size: 2,232 Bytes
95b8b70 8dfbe50 95b8b70 8dfbe50 e2db16f 8dfbe50 e2db16f 8dfbe50 95b8b70 e36f700 95b8b70 e36f700 8dfbe50 95b8b70 8dfbe50 e36f700 8dfbe50 95b8b70 | 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 | 'use strict';
document.addEventListener('DOMContentLoaded', () => {
setupCopyShortUrl();
setupSecurityLocks();
});
let toastTimeout = null;
function setupCopyShortUrl() {
const shortUrlCard = document.getElementById('shortUrlCard');
if (!shortUrlCard) return;
shortUrlCard.addEventListener('click', () => {
const urlToCopy = 'https://minispace-links.static.hf.space';
navigator.clipboard.writeText(urlToCopy).then(() => {
showToast('¡Enlace copiado al portapapeles!');
}).catch(() => {
showToast('minispace-links.static.hf.space');
});
});
}
function handleLinkClick(event, brandName) {
const routes = {
'BEAT': 'beat.html',
'Pi Juguetes': 'pi.html',
'Pi': 'pi.html',
'Mundo Stand': 'stand.html',
'Stand': 'stand.html',
'Interactive': 'interactive.html'
};
if (routes[brandName]) {
event.preventDefault();
window.location.href = routes[brandName];
}
}
function handleAppClick(event, appName) {
event.preventDefault();
showToast(`¡Aplicación "${appName}" en desarrollo!`);
}
function showToast(message) {
const toast = document.getElementById('toast');
const toastMessage = document.getElementById('toastMessage');
if (!toast || !toastMessage) return;
toastMessage.textContent = message;
toast.classList.remove('hidden');
if (toastTimeout) {
clearTimeout(toastTimeout);
}
toastTimeout = setTimeout(() => {
toast.classList.add('hidden');
}, 3000);
}
function setupSecurityLocks() {
document.addEventListener('contextmenu', (e) => e.preventDefault());
document.addEventListener('keydown', (e) => {
if (e.keyCode === 123 ||
(e.ctrlKey && e.shiftKey && (e.keyCode === 73 || e.keyCode === 74 || e.keyCode === 67)) ||
(e.ctrlKey && (e.keyCode === 85 || e.keyCode === 83)) ||
(e.metaKey && e.altKey && (e.keyCode === 73 || e.keyCode === 74)) ||
(e.metaKey && (e.keyCode === 85 || e.keyCode === 83))) {
e.preventDefault();
return false;
}
});
document.addEventListener('dragstart', (e) => e.preventDefault());
}
|