mirror of
https://github.com/RedGrox2013/AloeGames-Site.git
synced 2026-07-14 08:56:58 +00:00
86 lines
3.2 KiB
JavaScript
86 lines
3.2 KiB
JavaScript
let currentLang = 'en';
|
||
|
||
const translations = {
|
||
en: {
|
||
title: 'We Build Worlds',
|
||
desc: 'AloeGames is a modern game development studio focused on creating immersive, next-generation experiences.',
|
||
button: 'Explore',
|
||
aboutTitle: 'About Us',
|
||
aboutText: 'We are a team of passionate developers, designers, and dreamers. Our mission is to push the boundaries of interactive entertainment and deliver unforgettable gaming experiences.',
|
||
projectsTitle: 'Our Projects',
|
||
contactTitle: 'Contact',
|
||
contactText: 'Get in touch with us for partnerships, collaborations, or just to say hello.'
|
||
},
|
||
ru: {
|
||
title: 'Мы создаём миры',
|
||
desc: 'AloeGames — современная игровая студия, создающая захватывающий игровой опыт нового поколения.',
|
||
button: 'Смотреть',
|
||
aboutTitle: 'О нас',
|
||
aboutText: 'Мы команда разработчиков, дизайнеров и мечтателей. Наша цель — расширять границы интерактивных развлечений и создавать незабываемые игры.',
|
||
projectsTitle: 'Наши проекты',
|
||
contactTitle: 'Контакты',
|
||
contactText: 'Свяжитесь с нами для сотрудничества или просто чтобы сказать привет.'
|
||
}
|
||
};
|
||
|
||
function toggleLang() {
|
||
currentLang = currentLang === 'en' ? 'ru' : 'en';
|
||
const t = translations[currentLang];
|
||
|
||
document.getElementById('title').textContent = t.title;
|
||
document.getElementById('desc').textContent = t.desc;
|
||
document.getElementById('button').textContent = t.button;
|
||
document.getElementById('aboutTitle').textContent = t.aboutTitle;
|
||
document.getElementById('aboutText').textContent = t.aboutText;
|
||
document.getElementById('projectsTitle').textContent = t.projectsTitle;
|
||
document.getElementById('contactTitle').textContent = t.contactTitle;
|
||
document.getElementById('contactText').textContent = t.contactText;
|
||
}
|
||
|
||
// Background animation
|
||
const canvas = document.getElementById('bgCanvas');
|
||
const ctx = canvas.getContext('2d');
|
||
|
||
function resize() {
|
||
canvas.width = window.innerWidth;
|
||
canvas.height = window.innerHeight;
|
||
}
|
||
|
||
window.addEventListener('resize', resize);
|
||
resize();
|
||
|
||
const particles = [];
|
||
|
||
for (let i = 0; i < 80; i++) {
|
||
particles.push({
|
||
x: Math.random() * canvas.width,
|
||
y: Math.random() * canvas.height,
|
||
vx: (Math.random() - 0.5) * 0.5,
|
||
vy: (Math.random() - 0.5) * 0.5,
|
||
size: Math.random() * 2 + 1
|
||
});
|
||
}
|
||
|
||
function animate() {
|
||
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
||
|
||
particles.forEach(p => {
|
||
p.x += p.vx;
|
||
p.y += p.vy;
|
||
|
||
if (p.x < 0 || p.x > canvas.width) p.vx *= -1;
|
||
if (p.y < 0 || p.y > canvas.height) p.vy *= -1;
|
||
|
||
ctx.beginPath();
|
||
ctx.arc(p.x, p.y, p.size, 0, Math.PI * 2);
|
||
ctx.fillStyle = 'rgba(34,197,94,0.8)';
|
||
ctx.shadowBlur = 10;
|
||
ctx.shadowColor = 'rgba(34,197,94,0.8)';
|
||
ctx.fill();
|
||
ctx.shadowBlur = 0;
|
||
});
|
||
|
||
requestAnimationFrame(animate);
|
||
}
|
||
|
||
animate(); |