-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
215 lines (215 loc) · 10.6 KB
/
index.html
File metadata and controls
215 lines (215 loc) · 10.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HackerOS Search</title>
<link rel="icon" type="image/png" href="HackerOS.png">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<canvas id="particles"></canvas>
<div class="logo-container">
<a href="https://hackeros-linux-system.github.io/HackerOS-Website/" target="_blank">
<img src="HackerOS.png" alt="HackerOS Logo">
</a>
</div>
<div class="theme-toggle" id="themeToggle">Change</div>
<section class="main-container">
<div class="search-container">
<form class="search-form" action="https://www.ecosia.org/search" method="GET" role="search" aria-label="Wyszukiwarka Ecosia">
<input type="text" class="search-input" name="q" placeholder="Wyszukaj w Ecosia..." required aria-label="Wprowadź frazę wyszukiwania">
<button type="submit" class="search-button" aria-label="Szukaj">
<img src="https://cdn-icons-png.flaticon.com/512/622/622669.png" alt="Ikona wyszukiwania">
</button>
</form>
</div>
</section>
<div class="bottom-left-link">
<a href="https://hackeros-linux-system.github.io/HackerOS-Website/hacker-lang/docs.html" target="_blank" aria-label="Discover our programming language">Discover our programming language</a>
</div>
<footer>
Powered by <a href="https://www.ecosia.org" target="_blank" aria-label="Strona Ecosia">Ecosia</a> |
<a href="https://hackeros-linux-system.github.io/HackerOS-Website/" target="_blank" aria-label="Strona HackerOS">HackerOS</a> | © 2026
</footer>
<script>
// Ensure DOM is fully loaded before accessing elements
document.addEventListener('DOMContentLoaded', () => {
// Particle animation
const canvas = document.getElementById('particles');
const ctx = canvas.getContext('2d');
let isSpaceTheme = false;
if (ctx) {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
const particlesArray = [];
let mouse = { x: null, y: null, radius: 100 };
class Particle {
constructor() {
this.x = Math.random() * canvas.width;
this.y = Math.random() * canvas.height;
this.size = Math.random() * (isSpaceTheme ? 1.5 : 2) + (isSpaceTheme ? 0.5 : 1);
this.baseSize = this.size;
this.speedX = Math.random() * (isSpaceTheme ? 0.2 : 0.3) - (isSpaceTheme ? 0.1 : 0.15);
this.speedY = Math.random() * (isSpaceTheme ? 0.2 : 0.3) - (isSpaceTheme ? 0.1 : 0.15);
this.opacity = Math.random() * (isSpaceTheme ? 0.6 : 0.4) + (isSpaceTheme ? 0.4 : 0.2);
this.hue = Math.random() * 30 + 200;
}
update() {
this.x += this.speedX;
this.y += this.speedY;
if (!isSpaceTheme) {
if (this.size > 0.5) this.size -= 0.003;
if (this.opacity > 0.2) this.opacity -= 0.0003;
}
// Simpler mouse interaction
if (mouse.x !== null && mouse.y !== null && !isSpaceTheme) {
const dx = mouse.x - this.x;
const dy = mouse.y - this.y;
const distance = Math.sqrt(dx * dx + dy * dy);
if (distance < mouse.radius) {
const force = (mouse.radius - distance) / mouse.radius;
this.speedX += dx * force * 0.01;
this.speedY += dy * force * 0.01;
this.size = this.baseSize + force * 1.5;
}
}
if (this.x < 0 || this.x > canvas.width) this.speedX *= -1;
if (this.y < 0 || this.y > canvas.height) this.speedY *= -1;
}
draw() {
let fillStyle;
if (isSpaceTheme) {
fillStyle = `hsla(0, 0%, 100%, ${this.opacity})`;
} else {
fillStyle = `hsla(${this.hue}, 20%, 90%, ${this.opacity})`;
}
ctx.fillStyle = fillStyle;
ctx.beginPath();
ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);
ctx.fill();
}
}
function connectParticles() {
if (isSpaceTheme) return;
for (let i = 0; i < particlesArray.length; i++) {
for (let j = i + 1; j < particlesArray.length; j++) {
const dx = particlesArray[i].x - particlesArray[j].x;
const dy = particlesArray[i].y - particlesArray[j].y;
const distance = Math.sqrt(dx * dx + dy * dy);
if (distance < 100) {
ctx.strokeStyle = `hsla(${particlesArray[i].hue}, 20%, 90%, ${(1 - distance / 100) * 0.2})`;
ctx.lineWidth = 0.3;
ctx.beginPath();
ctx.moveTo(particlesArray[i].x, particlesArray[i].y);
ctx.lineTo(particlesArray[j].x, particlesArray[j].y);
ctx.stroke();
}
}
}
}
function initParticles() {
particlesArray.length = 0;
const numberOfParticles = isSpaceTheme ? 200 : 50;
for (let i = 0; i < numberOfParticles; i++) {
particlesArray.push(new Particle());
}
}
function animateParticles() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
for (let i = 0; i < particlesArray.length; i++) {
particlesArray[i].update();
particlesArray[i].draw();
if (particlesArray[i].size <= 0.5 || particlesArray[i].opacity <= 0.2) {
particlesArray.splice(i, 1);
particlesArray.push(new Particle());
i--;
}
}
connectParticles();
requestAnimationFrame(animateParticles);
}
// Mouse movement for particle interaction
document.addEventListener('mousemove', (e) => {
mouse.x = e.clientX;
mouse.y = e.clientY;
});
document.addEventListener('mouseout', () => {
mouse.x = null;
mouse.y = null;
});
window.addEventListener('resize', () => {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
initParticles();
});
// Theme toggle
const themeToggle = document.getElementById('themeToggle');
let currentTheme = localStorage.getItem('theme') || 'default';
applyTheme(currentTheme);
themeToggle.addEventListener('click', () => {
currentTheme = currentTheme === 'default' ? 'space' : 'default';
localStorage.setItem('theme', currentTheme);
applyTheme(currentTheme);
});
function applyTheme(theme) {
isSpaceTheme = theme === 'space';
if (isSpaceTheme) {
document.body.classList.add('space-theme');
} else {
document.body.classList.remove('space-theme');
}
initParticles();
}
initParticles();
animateParticles();
} else {
console.warn('Canvas not supported in this browser.');
}
// Form validation
const searchForm = document.querySelector('.search-form');
const input = document.querySelector('.search-input');
if (searchForm) {
searchForm.addEventListener('submit', function(e) {
const query = input.value.trim();
if (!query) {
e.preventDefault();
alert('Proszę wpisać frazę wyszukiwania!');
}
});
}
// Remove placeholder animation for minimalism
// Search bar mouse movement reaction removed for minimalism
// Keyboard accessibility
if (input) {
document.addEventListener('keydown', (e) => {
if (e.key === 'Enter' && document.activeElement !== input) {
input.focus();
}
});
}
// Language detection
const userLang = navigator.language || navigator.userLanguage;
if (userLang.startsWith('pl')) {
document.documentElement.lang = 'pl';
} else {
document.documentElement.lang = 'en';
if (input) {
input.placeholder = 'Search with Ecosia...';
}
const footer = document.querySelector('footer');
if (footer) {
footer.innerHTML = `
Powered by <a href="https://www.ecosia.org" target="_blank" aria-label="Ecosia Website">Ecosia</a> |
<a href="https://hackeros-linux-system.github.io/HackerOS-Website/" target="_blank" aria-label="HackerOS Website">HackerOS</a> | © 2026
`;
}
const bottomLeftLink = document.querySelector('.bottom-left-link a');
if (bottomLeftLink) {
bottomLeftLink.textContent = 'Discover our programming language';
}
}
});
</script>
</body>
</html>