Files
dns-things/assets/js/main.js
dwindown e5195ba1f1 Initial commit: DNS Things - Comprehensive DNS utility website
Features implemented:
- Modular JavaScript architecture (theme.js, dns-tools.js, whois.js, punycode.js, ip-tools.js, main.js)
- Responsive design with dark/light theme toggle
- DNS Lookup and Reverse DNS Lookup tools
- Whois Lookup functionality
- IDN Punycode Converter with full Unicode support
- Comprehensive IP Address Tools (validation, IPv4-to-IPv6 mapping, IPv6 compression/expansion)
- Dynamic tab descriptions that change based on active tool
- Mobile-responsive horizontal scrollable tabs
- Copy-to-clipboard functionality for all results
- Clean footer with dynamic year
- IPv4-mapped IPv6 address explanation with clear warnings

Technical improvements:
- Separated concerns with modular JS files
- Fixed browser compatibility issues with punycode library
- Implemented proper error handling and user feedback
- Added comprehensive input validation
- Optimized for mobile devices with touch-friendly UI
2025-08-01 23:13:52 +07:00

34 lines
848 B
JavaScript

// DNS Things - Main Application Initialization
// Initialize everything when DOM is loaded
document.addEventListener('DOMContentLoaded', function() {
// Initialize core UI components
initTheme();
initTabs();
initCopyButtons();
// Initialize DNS tools
initIPDisplay();
initDNSForm();
initReverseDNSForm();
// Initialize additional tools
initWhoisForm();
initPunycodeConverter();
initIPTools();
// Set dynamic year in footer
initFooter();
console.log('DNS Things application initialized successfully');
});
// Initialize footer with dynamic year
function initFooter() {
const yearElement = document.getElementById('current-year');
if (yearElement) {
const currentYear = new Date().getFullYear();
yearElement.textContent = currentYear;
}
}