-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
300 lines (271 loc) · 11 KB
/
index.html
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Orange Cloud Search</title>
<style>
/* Default styles applied regardless of theme */
/* Removed default background and color from here to avoid conflict */
/* body {
font-family: 'Courier New', Courier, monospace;
margin: 0;
overflow: hidden;
} */
.logo {
position: relative;
z-index: 10;
display: flex;
align-items: center;
justify-content: center;
margin-top: 20px;
}
.logo img {
width: 100px;
height: auto;
margin-right: 20px;
}
.logo-text {
font-size: 40px;
}
.container {
position: relative;
z-index: 10;
display: flex;
flex-direction: column;
align-items: center;
/* Removed: color: white; To be set by the theme */
}
.content {
display: flex;
width: 100%;
max-width: 1000px;
}
.main-section {
flex: 3;
padding: 20px;
margin-right: 20px;
box-sizing: border-box;
height: 500px;
overflow-y: auto;
}
.gcse-searchresults {
max-height: 400px;
overflow-y: auto;
}
.side-section {
flex: 1;
height: 300px;
box-sizing: border-box;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
border-radius: 8px;
padding: 20px;
}
.theme-name {
margin: 10px;
padding: 10px;
cursor: pointer;
border-radius: 5px;
text-align: center;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
/* Background and color to be set dynamically by JS */
}
canvas {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1;
}
</style>
</head>
<body>
<!-- Canvas background for matrix effect -->
<canvas id="matrix"></canvas>
<!-- Logo section -->
<div class="logo">
<img src="Resources/My-meme-base.png" alt="Logo">
<div class="logo-text">Orange Cloud Search</div>
</div>
<!-- Main container -->
<div class="container">
<div class="content">
<div class="main-section">
<!-- Google Custom Search Engine integration -->
<script async src="https://cse.google.com/cse.js?cx=818b0291bd5164886"></script>
<div class="gcse-searchbox"></div>
<div class="gcse-searchresults"></div>
</div>
<div class="side-section"></div>
</div>
</div>
<script>
/** Theme Definitions **/
// Define themes as objects with respective styling properties
const themes = {
// Golden Hour theme settings
'Golden Hour': {
bodyBg: 'linear-gradient(135deg, #ffd180, #ff8a80)',
textColor: '#f7f1e3',
logoColor: '#ff5722',
logoShadow: '0 0 10px #ff3d00, 0 0 20px #ff3d00',
mainSectionBg: 'rgba(255, 193, 7, 0.8)',
sideSectionBg: 'rgba(255, 193, 7, 0.8)',
sideSectionBorder: '#ff5722',
gscCompletionTextColor: '#f7f1e3', // Match textColor for consistency
gscCompletionBg: '#663300',
gscCompletionHighlightBg: '#ff7043', // Highlight background
gscCompletionHighlightTextColor: '#000000'
},
// Midnight theme settings
'Midnight': {
bodyBg: 'black',
textColor: '#ffa500',
logoColor: '#ffaa77',
logoShadow: 'none',
mainSectionBg: 'rgba(0, 0, 0, 0.8)',
sideSectionBg: 'rgba(0, 0, 0, 0.8)',
sideSectionBorder: '#ffa500',
gscCompletionTextColor: '#ffa500', // Matches textColor for high contrast
gscCompletionBg: '#333333',
gscCompletionHighlightBg: '#005f73', // Teal color
gscCompletionHighlightTextColor: '#ffffff' // White for contrast
},
// Synth Wave theme settings
'Synth Wave': {
bodyBg: 'linear-gradient(135deg, #8e2de2, #4a00e0)',
textColor: '#ff00ff',
logoColor: '#00ffff',
logoShadow: '0 0 10px #ff00ff, 0 0 20px #ff00ff',
mainSectionBg: 'rgba(70, 0, 140, 0.8)',
sideSectionBg: 'rgba(70, 0, 140, 0.8)',
sideSectionBorder: '#ff00ff',
gscCompletionTextColor: '#ff00ff', // Consistent with textColor
gscCompletionBg: '#331144',
gscCompletionHighlightBg: '#ff1493', // Dark pink
gscCompletionHighlightTextColor: '#ffffff' // White for contrast
},
// Matrix theme settings
'Matrix': {
bodyBg: 'black',
textColor: '#00ff00',
logoColor: '#00ff00',
logoShadow: '0 0 10px #00ff00, 0 0 20px #00ff00',
mainSectionBg: 'rgba(0, 0, 0, 0.8)',
sideSectionBg: 'rgba(0, 0, 0, 0.8)',
sideSectionBorder: '#00ff00',
gscCompletionTextColor: '#00ff00', // Matches textColor for consistency
gscCompletionBg: '#001a00',
gscCompletionHighlightBg: '#003300', // Dark green
gscCompletionHighlightTextColor: '#ffffff' // White for contrast
},
// Miami Vibe theme settings
'Miami Vibe': {
bodyBg: 'linear-gradient(135deg, #50c9c3, #96deda)',
textColor: '#ff69b4',
logoColor: '#ff1493',
logoShadow: '0 0 10px #ff1493, 0 0 20px #ff1493',
mainSectionBg: 'rgba(80, 201, 195, 0.8)',
sideSectionBg: 'rgba(80, 201, 195, 0.8)',
sideSectionBorder: '#ff1493',
gscCompletionTextColor: '#ff69b4', // Matches textColor
gscCompletionBg: '#009688',
gscCompletionHighlightBg: '#ffcccb', // Light pink
gscCompletionHighlightTextColor: '#000000' // Black for contrast
}
};
// Default theme
let currentTheme = 'Golden Hour';
// Apply selected theme styling
function applyTheme(theme) {
document.body.style.background = theme.bodyBg;
document.body.style.color = theme.textColor;
const logo = document.querySelector('.logo-text');
logo.style.color = theme.logoColor;
logo.style.textShadow = theme.logoShadow;
const mainSection = document.querySelector('.main-section');
mainSection.style.backgroundColor = theme.mainSectionBg;
const sideSection = document.querySelector('.side-section');
sideSection.style.backgroundColor = theme.sideSectionBg;
sideSection.style.border = `2px solid ${theme.sideSectionBorder}`;
// Update theme names to reflect current theme
const themeNames = document.querySelectorAll('.theme-name');
themeNames.forEach(themeName => {
themeName.style.background = theme.mainSectionBg;
themeName.style.color = theme.textColor;
});
const gscContainer = document.querySelector('.gsc-completion-container');
if (gscContainer) {
gscContainer.style.color = theme.gscCompletionTextColor;
gscContainer.style.backgroundColor = theme.gscCompletionBg;
}
// Apply highlight styles for better readability
const highlights = document.querySelectorAll('.gsc-completion-container .gsc-completion-selected');
highlights.forEach(highlight => {
highlight.style.backgroundColor = theme.gscCompletionHighlightBg;
highlight.style.color = theme.gscCompletionHighlightTextColor;
});
}
// Setup clickable theme selector interface
function setupThemeSwitcher() {
const sideSection = document.querySelector('.side-section');
Object.keys(themes).forEach(themeName => {
// Create clickable element for each theme
const themeElement = document.createElement('div');
themeElement.className = 'theme-name';
themeElement.innerText = themeName;
themeElement.onclick = () => switchTheme(themeName);
sideSection.appendChild(themeElement);
});
}
// Update current theme and apply new styles
function switchTheme(themeName) {
currentTheme = themeName;
applyTheme(themes[currentTheme]);
}
/** Initial setup and matrix effect **/
// Initial theme application and setup the theme switcher
applyTheme(themes[currentTheme]);
setupThemeSwitcher();
// Function returns the current theme color for canvas text effect
function getMatrixColor() {
return themes[currentTheme].logoColor;
}
// Initialize canvas for matrix falling effect
const canvas = document.getElementById('matrix');
const ctx = canvas.getContext('2d');
// Set canvas dimensions to cover full window size
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
// Characters used in matrix effect
const letters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
const fontSize = 16;
const columns = canvas.width / fontSize;
// Initialize array to track drop positions for each column
const drops = Array.from({ length: columns }).fill(1);
// Function to render matrix effect
function draw() {
ctx.fillStyle = 'rgba(0, 0, 0, 0.05)'; // Slight clearing effect to create trail effect
ctx.fillRect(0, 0, canvas.width, canvas.height);
ctx.fillStyle = getMatrixColor(); // Set text color based on current theme
ctx.font = fontSize + 'px monospace';
drops.forEach((y, i) => {
const text = letters[Math.floor(Math.random() * letters.length)];
ctx.fillText(text, i * fontSize, y * fontSize);
if (y * fontSize > canvas.height && Math.random() > 0.975) {
drops[i] = 0;
}
drops[i] += 0.5;
});
// Recursively call draw function for continuous animation
requestAnimationFrame(draw);
}
// Start the matrix display animation
draw();
</script>
</body>
</html>