Spaces:
Sleeping
Sleeping
File size: 3,466 Bytes
7107674 |
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 |
/**
* @file init.js
* @description Frontend initialization script for Materialize CSS components
* and interactive DOM elements.
*
* @author Amey Thakur <https://github.com/Amey-Thakur>
* @author Mega Satish <https://github.com/msatmod>
* @created 2022-08-09
* @repository https://github.com/Amey-Thakur/TEXT-SUMMARIZER
* @license MIT
*/
(function ($) {
$(function () {
// Initialize Materialize Side Navigation (Mobile/Responsive)
$('.sidenav').sidenav();
// Initialize Parallax Effect for immersive conceptual visuals
$('.parallax').parallax();
// Initialize Tab Navigation Components
$('.tabs').tabs();
// Initialize Carousel for Feature Showcase
$('.carousel.carousel-slider').carousel({ fullWidth: true });
// Initialize Hero Slider with Custom Timing
$('.slider').slider({
indicators: false,
// Suppress navigation dots for cleaner aesthetic
height: 500, // Fixed height in pixels
transition: 500, // Transition duration in ms
interval: 6000 // Slide duration in ms
// Controlled timing for optimal readability
});
}); // End of document ready state
})(jQuery); // End of jQuery namespace encapsulation
// ----------------------------------------------------------------------------
// Security & Anti-Inspection Protocols
// ----------------------------------------------------------------------------
document.addEventListener('DOMContentLoaded', () => {
const securityOverlay = document.getElementById('securityOverlay');
const dismissBtn = document.getElementById('dismissSecurity');
// Disable Right Click
document.addEventListener('contextmenu', (e) => {
e.preventDefault();
showSecurityAlert();
});
// Disable Keyboard Shortcuts for Inspection
document.addEventListener('keydown', (e) => {
// F12
if (e.key === 'F12') {
e.preventDefault();
showSecurityAlert();
}
// Ctrl+Shift+I/J/C (DevTools)
if (e.ctrlKey && e.shiftKey && ['I', 'J', 'C'].includes(e.key.toUpperCase())) {
e.preventDefault();
showSecurityAlert();
}
// Ctrl+U (View Source)
if (e.ctrlKey && e.key.toUpperCase() === 'U') {
e.preventDefault();
showSecurityAlert();
}
});
// Show Security Overlay
function showSecurityAlert() {
if (securityOverlay) {
securityOverlay.style.display = 'flex';
// Add pulse animation to icon
const icon = securityOverlay.querySelector('div');
if (icon) icon.classList.add('security-icon');
}
}
// Dismiss Security Overlay
if (dismissBtn) {
dismissBtn.addEventListener('click', () => {
securityOverlay.style.display = 'none';
// Remove animation to reset
const icon = securityOverlay.querySelector('div');
if (icon) icon.classList.remove('security-icon');
});
}
// Console Easter Egg (Self-XSS Warning)
console.log("%cStop!", "color: red; font-size: 50px; font-weight: bold; text-shadow: 2px 2px 0px black;");
console.log("%cThis is a browser feature intended for developers. If someone told you to copy-paste something here to enable a feature or 'hack' someone's account, it is a scam and will give them access to your account.", "color: white; font-size: 18px; font-weight: bold;");
console.log("%cSee https://en.wikipedia.org/wiki/Self-XSS for more information.", "color: cyan; font-size: 16px; font-weight: bold; text-decoration: underline;");
});
|