// Shared JavaScript across all pages console.log('BlockCrafters Haven - Minecraft Hosting App loaded'); // Pricing plans data const pricingPlans = [ { name: "ATOM", image: "https://hosting-minecraft.eu/images/game-play/1.png", monthly: "1.60 EUR", monthlyDiscounted: "1.52 EUR", quarterly: "1.36 EUR", yearly: "1.28 EUR", biennial: "1.12 EUR", features: [ "No player limit", "CPU: 2 x 4300 MHz", "RAM: 2 GB DDR4 2666MHz", "Disk: 40 GB NVMe SSD", "Free MySQL DB: 5 included", "Free Backups: 3 included", "Port Allocations: 10 included", "ANY CORE AND VERSION", "104,000 MODPACKS AND PLUGINS IN THE PANEL", "Free domains for the server" ], orderLink: "https://hosting-minecraft.eu/client/index.php?rp=/store/minecraft/atom&language=english" }, { name: "NANO", image: "https://hosting-minecraft.eu/images/game-play/2.png", monthly: "2.60 EUR", monthlyDiscounted: "2.47 EUR", quarterly: "2.21 EUR", yearly: "2.08 EUR", biennial: "1.82 EUR", features: [ "No player limit", "CPU: 2 x 4300 MHz", "RAM: 3 GB DDR4 2666MHz", "Disk: 50 GB NVMe SSD", "Free MySQL DB: 5 included", "Free Backups: 3 included", "Port Allocations: 10 included", "ANY CORE AND VERSION", "104,000 MODPACKS AND PLUGINS IN THE PANEL", "Free domains for the server" ], orderLink: "https://hosting-minecraft.eu/client/index.php?rp=/store/minecraft/nano&language=english" }, { name: "STEEL", image: "https://hosting-minecraft.eu/images/game-play/5.png", monthly: "3.80 EUR", monthlyDiscounted: "3.61 EUR", quarterly: "3.23 EUR", yearly: "3.04 EUR", biennial: "2.66 EUR", category: "PERFORMANCE", features: [ "No player limit", "CPU: 2 x 5700 MHz ⚡", "RAM: 3 GB DDR5 3600MHz", "Disk: 30 GB NVMe SSD", "Free MySQL DB: 5 included", "Free Backups: 3 included", "Port Allocations: 10 included", "ANY CORE AND VERSION", "104,000 MODPACKS AND PLUGINS IN THE PANEL", "Free domains for the server" ], orderLink: "https://hosting-minecraft.eu/client/index.php?rp=/store/hosting-minecraft-performance/steel&language=english" }, { name: "MICRO", image: "https://hosting-minecraft.eu/images/game-play/3.png", monthly: "3.80 EUR", monthlyDiscounted: "3.61 EUR", quarterly: "3.23 EUR", yearly: "3.04 EUR", biennial: "2.66 EUR", category: "Featured", features: [ "No player limit", "CPU: 2 x 4300 MHz", "RAM: 4 GB DDR4 2666MHz", "Disk: 60 GB NVMe SSD", "Free MySQL DB: 5 included", "Free Backups: 3 included", "Port Allocations: 10 included", "ANY CORE AND VERSION", "104,000 MODPACKS AND PLUGINS IN THE PANEL", "Free domains for the server" ], orderLink: "https://hosting-minecraft.eu/client/index.php?rp=/store/minecraft/micro&language=english" } ]; // FAQ data const faqData = [ { question: "Can I install mods/modpacks?", answer: "Yes. You can upload ABSOLUTELY ANY modpacks and mods to your server, either with one click from the control panel or via SFTP." }, { question: "How quickly will I receive the server after purchase?", answer: "In most cases, you receive the server instantly. However, there may sometimes be delays of a few hours in activation due to a high queue." }, { question: "If I don't like the service, can I get my money back?", answer: "A refund is possible only if there were errors on our part, such as prolonged technical work." }, { question: "I can't start my server, what should I do?", answer: "Don't panic 🙂 Remember, if your server doesn't start, it means you've configured it incorrectly." } ]; // Locations data const locationsData = [ { name: "Warsaw, Poland", image: "https://hosting-minecraft.eu/images/maps/poland.svg" }, { name: "Falkenstein, Germany", image: "https://hosting-minecraft.eu/images/maps/germany.svg" }, { name: "Helsinki, Finland", image: "https://hosting-minecraft.eu/images/maps/finland.svg" }, { name: "Strasbourg, France", image: "https://hosting-minecraft.eu/images/maps/france.svg" }, { name: "Washington, D.C - USA", image: "https://hosting-minecraft.eu/images/maps/usa.svg" } ]; // Initialize the application document.addEventListener('DOMContentLoaded', function() { initializePricingCards(); initializeFAQ(); initializeLocations(); initializeAnimations(); }); // Initialize pricing cards function initializePricingCards() { const pricingGrid = document.getElementById('pricing-grid'); if (!pricingGrid) return; pricingPlans.forEach(plan => { const card = createPricingCard(plan); pricingGrid.appendChild(card); }); // Re-initialize feather icons after cards are created setTimeout(() => { if (typeof feather !== 'undefined') { feather.replace(); } }, 100); } // Create individual pricing card function createPricingCard(plan) { const card = document.createElement('div'); card.className = 'pricing-card bg-gray-900/50 p-6 rounded-xl border border-gray-700 hover:border-primary transition-all duration-300'; card.innerHTML = ` ${plan.category ? `
${plan.category}
` : ''} ${plan.name}

${plan.name}

${plan.monthly}/month
${plan.monthlyDiscounted}/month
3 Months
${plan.quarterly}/month
1 Year
${plan.yearly}/month
2 Years
${plan.biennial}/month
ORDER NOW `; return card; } // Initialize FAQ section function initializeFAQ() { const faqGrid = document.getElementById('faq-grid'); if (!faqGrid) return; faqData.forEach(faq => { const faqItem = document.createElement('div'); faqItem.className = 'bg-gray-900/50 p-6 rounded-xl border border-gray-700"> faqItem.innerHTML = `

${faq.question}

${faq.answer}

`; faqGrid.appendChild(faqItem); }); } // Initialize locations section function initializeLocations() { const locationsGrid = document.getElementById('locations-grid'); if (!locationsGrid) return; locationsData.forEach(location => { const locationCard = document.createElement('div'); locationCard.className = 'bg-gray-900/50 p-6 rounded-xl border border-gray-700 text-center"> locationCard.innerHTML = ` ${location.name}

${location.name}

`; locationsGrid.appendChild(locationCard); }); } // Initialize animations and interactions function initializeAnimations() { // Intersection Observer for scroll animations const observerOptions = { threshold: 0.1, rootMargin: '0px 0px -50px 0px' }; const observer = new IntersectionObserver((entries) => { entries.forEach(entry => { if (entry.isIntersecting) { entry.target.classList.add('animate-fade-in'); } }, observerOptions); // Observe all pricing cards and other elements document.querySelectorAll('.pricing-card').forEach(card => { observer.observe(card); }); } // Handle currency selection function handleCurrencyChange(currency) { console.log('Currency changed to:', currency); // In a real implementation, this would update prices across the site } // Smooth scrolling for anchor links document.querySelectorAll('a[href^="#"]').forEach(anchor => { anchor.addEventListener('click', function (e) { e.preventDefault(); const target = document.querySelector(this.getAttribute('href')); if (target) { target.scrollIntoView({ behavior: 'smooth' }); } }); }); // Mobile menu toggle function toggleMobileMenu(button) { const nav = button.parentElement; const navLinks = nav.querySelector('.nav-links'); const navActions = nav.querySelector('.nav-actions'); if (navLinks) { navLinks.classList.toggle('show'); } if (navActions) { navActions.classList.toggle('show'); } } // Force re-render of pricing cards on page load document.addEventListener('DOMContentLoaded', function() { // Initialize all components initializePricingCards(); initializeFAQ(); initializeLocations(); initializeAnimations(); // Force re-initialization of feather icons if (typeof feather !== 'undefined') { feather.replace(); } // Add a small delay to ensure everything is rendered setTimeout(() => { if (typeof feather !== 'undefined') { feather.replace(); } }, 500); } // Initialize tooltips for icons function initializeTooltips() { const tooltipElements = document.querySelectorAll('[data-tooltip]'); tooltipElements.forEach(element => { element.addEventListener('mouseenter', showTooltip); element.addEventListener('mouseleave', hideTooltip); }); } function showTooltip(e) { // Tooltip implementation } function hideTooltip(e) { // Hide tooltip implementation }