mirror of
https://github.com/RedGrox2013/AloeGames-Site.git
synced 2026-07-13 23:16:58 +00:00
Добавил поиск
This commit is contained in:
@@ -43,6 +43,27 @@ function tryToggleTextContent(elementId, textContent) {
|
||||
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;
|
||||
}
|
||||
|
||||
window.open(url, '_blank', 'noopener');
|
||||
}
|
||||
|
||||
// Background animation
|
||||
const canvas = document.getElementById('bgCanvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
|
||||
Reference in New Issue
Block a user