mirror of
https://github.com/RedGrox2013/AloeGames-Site.git
synced 2026-09-18 19:55:36 +00:00
74 lines
3.3 KiB
JavaScript
74 lines
3.3 KiB
JavaScript
let currentLang = 'en';
|
||
|
||
const translations = {
|
||
en: {
|
||
title: 'We Build Worlds',
|
||
desc: 'AloeGames is a modern, cool company that creates exciting next-generation gaming experiences (actually, we do everything but games).',
|
||
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',
|
||
mirrorsTitle: 'Mirrors',
|
||
mirrorsText: 'We support a free internet and provide mirrors in censorship-resistant networks:',
|
||
contactTitle: 'Contact',
|
||
contactText: 'Get in touch with us for partnerships, collaborations, or just to say hello.'
|
||
},
|
||
ru: {
|
||
title: 'Мы создаём миры',
|
||
desc: 'AloeGames — современная крутая контора, создающая захватывающий игровой опыт нового поколения (на самом деле мы делаем всё, кроме игр).',
|
||
button: 'Смотреть',
|
||
aboutTitle: 'О нас',
|
||
aboutText: 'Мы команда разработчиков, дизайнеров и мечтателей. Наша цель — расширять границы интерактивных развлечений и создавать незабываемые игры.',
|
||
projectsTitle: 'Наши проекты',
|
||
mirrorsTitle: 'Зеркала',
|
||
mirrorsText: 'Мы поддерживаем свободный интернет и предоставляем зеркала в цензуроустойчивых сетях:',
|
||
contactTitle: 'Контакты',
|
||
contactText: 'Свяжитесь с нами для сотрудничества или просто чтобы сказать привет.'
|
||
}
|
||
};
|
||
|
||
function toggleLang() {
|
||
currentLang = currentLang === 'en' ? 'ru' : 'en';
|
||
const t = translations[currentLang];
|
||
|
||
tryToggleTextContent('title', t.title);
|
||
tryToggleTextContent('desc', t.desc);
|
||
tryToggleTextContent('button', t.button);
|
||
tryToggleTextContent('aboutTitle', t.aboutTitle);
|
||
tryToggleTextContent('aboutText', t.aboutText);
|
||
tryToggleTextContent('projectsTitle', t.projectsTitle);
|
||
tryToggleTextContent('mirrorsTitle', t.mirrorsTitle);
|
||
tryToggleTextContent('mirrorsText', t.mirrorsText);
|
||
tryToggleTextContent('contactTitle', t.contactTitle);
|
||
tryToggleTextContent('contactText', t.contactText);
|
||
}
|
||
|
||
function tryToggleTextContent(elementId, textContent) {
|
||
let el = document.getElementById(elementId);
|
||
if (el != null)
|
||
el.textContent = textContent;
|
||
}
|
||
|
||
function searchQuery(event) {
|
||
event.preventDefault();
|
||
|
||
const engine = document.getElementById('searchEngine').value;
|
||
const query = document.getElementById('searchInput').value.trim();
|
||
|
||
if (!query) {
|
||
document.getElementById('searchInput').focus();
|
||
return;
|
||
}
|
||
|
||
const encodedQuery = encodeURIComponent(query);
|
||
let url = 'https://www.google.com/search?q=' + encodedQuery;
|
||
|
||
if (engine === 'duckduckgo') {
|
||
url = 'https://duckduckgo.com/?q=' + encodedQuery;
|
||
} else if (engine === 'perplexity') {
|
||
url = 'https://www.perplexity.ai/search?q=' + encodedQuery;
|
||
}
|
||
|
||
window.location.href = url;
|
||
}
|