ffcc9393's picture
я не вижу списка тарифов и криво отображен дизайн! исправляй
beb7e3a verified
Raw History Blame Contribute Delete
11.4 kB
// 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 ? `<div class="bg-accent text-white px-3 py-1 rounded-full text-sm font-semibold mb-4 inline-block">${plan.category}</div>` : ''}
<img src="${plan.image}" alt="${plan.name}" class="w-24 h-24 mx-auto mb-4 rounded-lg">
<h3 class="text-2xl font-bold text-white text-center mb-4">${plan.name}</h3>
<div class="text-center mb-6">
<div class="text-gray-400 text-sm line-through mb-1">${plan.monthly}/month</div>
<div class="text-secondary text-xl font-bold mb-4">${plan.monthlyDiscounted}/month</div>
<div class="grid grid-cols-2 gap-2 text-sm mb-6">
<div class="text-gray-400">3 Months</div>
<div class="text-white font-semibold">${plan.quarterly}/month</div>
<div class="text-gray-400">1 Year</div>
<div class="text-white font-semibold">${plan.yearly}/month</div>
<div class="text-gray-400">2 Years</div>
<div class="text-white font-semibold">${plan.biennial}/month</div>
</div>
<ul class="space-y-2 mb-6">
${plan.features.slice(0, 3).map(feature => `
<li class="flex items-center gap-2 text-gray-300">
<i data-feather="check" class="w-4 h-4 text-secondary"></i>
<span class="text-sm">${feature}</span>
</li>
`).join('')}
</ul>
<a href="${plan.orderLink}"
class="bg-primary hover:bg-indigo-700 text-white px-4 py-3 rounded-lg font-semibold transition-all duration-300 block w-full text-center">
ORDER NOW
</a>
`;
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 = `
<h4 class="text-lg font-semibold text-white mb-3">${faq.question}</h4>
<p class="text-gray-400">${faq.answer}</p>
`;
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 = `
<img src="${location.image}" alt="${location.name}" class="w-16 h-16 mx-auto mb-4">
<h4 class="text-lg font-semibold text-white">${location.name}</h4>
`;
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
}