enacimie commited on
Commit
fd50cb7
·
verified ·
1 Parent(s): a4a9f45

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +315 -19
index.html CHANGED
@@ -1,19 +1,315 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width" />
6
- <title>My static Space</title>
7
- <link rel="stylesheet" href="style.css" />
8
- </head>
9
- <body>
10
- <div class="card">
11
- <h1>Welcome to your static Space!</h1>
12
- <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p>
13
- <p>
14
- Also don't forget to check the
15
- <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>.
16
- </p>
17
- </div>
18
- </body>
19
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="es">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>Buscador Avanzado Google</title>
7
+ <style>
8
+ * {
9
+ margin: 0;
10
+ padding: 0;
11
+ box-sizing: border-box;
12
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
13
+ }
14
+
15
+ body {
16
+ background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
17
+ min-height: 100vh;
18
+ display: flex;
19
+ justify-content: center;
20
+ align-items: center;
21
+ padding: 20px;
22
+ }
23
+
24
+ .container {
25
+ background: rgba(255, 255, 255, 0.95);
26
+ border-radius: 20px;
27
+ box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
28
+ width: 100%;
29
+ max-width: 600px;
30
+ padding: 40px;
31
+ transition: transform 0.3s ease;
32
+ }
33
+
34
+ .container:hover {
35
+ transform: translateY(-5px);
36
+ }
37
+
38
+ h1 {
39
+ text-align: center;
40
+ color: #333;
41
+ margin-bottom: 30px;
42
+ font-size: 2.5rem;
43
+ background: linear-gradient(90deg, #667eea, #764ba2);
44
+ -webkit-background-clip: text;
45
+ -webkit-text-fill-color: transparent;
46
+ background-clip: text;
47
+ }
48
+
49
+ .form-group {
50
+ margin-bottom: 25px;
51
+ }
52
+
53
+ label {
54
+ display: block;
55
+ margin-bottom: 8px;
56
+ font-weight: 600;
57
+ color: #555;
58
+ }
59
+
60
+ input, select {
61
+ width: 100%;
62
+ padding: 15px;
63
+ border: 2px solid #e1e5e9;
64
+ border-radius: 12px;
65
+ font-size: 16px;
66
+ transition: all 0.3s ease;
67
+ }
68
+
69
+ input:focus, select:focus {
70
+ outline: none;
71
+ border-color: #667eea;
72
+ box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
73
+ }
74
+
75
+ .site-options {
76
+ display: flex;
77
+ flex-wrap: wrap;
78
+ gap: 10px;
79
+ margin-top: 10px;
80
+ }
81
+
82
+ .site-btn {
83
+ flex: 1;
84
+ min-width: 120px;
85
+ padding: 12px;
86
+ background: #f8f9fa;
87
+ border: 2px solid #e1e5e9;
88
+ border-radius: 10px;
89
+ cursor: pointer;
90
+ text-align: center;
91
+ font-weight: 600;
92
+ transition: all 0.3s ease;
93
+ }
94
+
95
+ .site-btn:hover {
96
+ background: #667eea;
97
+ color: white;
98
+ border-color: #667eea;
99
+ }
100
+
101
+ .time-options {
102
+ display: grid;
103
+ grid-template-columns: repeat(2, 1fr);
104
+ gap: 15px;
105
+ }
106
+
107
+ .time-option {
108
+ padding: 15px;
109
+ background: #f8f9fa;
110
+ border: 2px solid #e1e5e9;
111
+ border-radius: 10px;
112
+ cursor: pointer;
113
+ text-align: center;
114
+ transition: all 0.3s ease;
115
+ }
116
+
117
+ .time-option:hover, .time-option.active {
118
+ background: #667eea;
119
+ color: white;
120
+ border-color: #667eea;
121
+ }
122
+
123
+ .search-btn {
124
+ width: 100%;
125
+ padding: 18px;
126
+ background: linear-gradient(90deg, #667eea, #764ba2);
127
+ color: white;
128
+ border: none;
129
+ border-radius: 12px;
130
+ font-size: 18px;
131
+ font-weight: 600;
132
+ cursor: pointer;
133
+ transition: all 0.3s ease;
134
+ box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
135
+ }
136
+
137
+ .search-btn:hover {
138
+ transform: translateY(-3px);
139
+ box-shadow: 0 8px 20px rgba(102, 126, 234, 0.6);
140
+ }
141
+
142
+ .search-btn:active {
143
+ transform: translateY(0);
144
+ }
145
+
146
+ .preview {
147
+ margin-top: 25px;
148
+ padding: 20px;
149
+ background: #f8f9fa;
150
+ border-radius: 12px;
151
+ border-left: 4px solid #667eea;
152
+ }
153
+
154
+ .preview h3 {
155
+ margin-bottom: 10px;
156
+ color: #555;
157
+ }
158
+
159
+ .preview-url {
160
+ word-break: break-all;
161
+ color: #667eea;
162
+ font-weight: 500;
163
+ }
164
+
165
+ @media (max-width: 600px) {
166
+ .container {
167
+ padding: 25px;
168
+ }
169
+
170
+ h1 {
171
+ font-size: 2rem;
172
+ }
173
+
174
+ .time-options {
175
+ grid-template-columns: 1fr;
176
+ }
177
+ }
178
+ </style>
179
+ </head>
180
+ <body>
181
+ <div class="container">
182
+ <h1>🔍 Buscador Avanzado</h1>
183
+
184
+ <div class="form-group">
185
+ <label for="searchQuery">Términos de búsqueda:</label>
186
+ <input type="text" id="searchQuery" placeholder="Ej: ofertas de trabajo tenerife">
187
+ </div>
188
+
189
+ <div class="form-group">
190
+ <label for="site">Sitio web (opcional):</label>
191
+ <input type="text" id="site" placeholder="Ej: linkedin.com o deja en blanco para buscar en todo Google">
192
+
193
+ <div class="site-options">
194
+ <div class="site-btn" data-site="linkedin.com">LinkedIn</div>
195
+ <div class="site-btn" data-site="facebook.com">Facebook</div>
196
+ <div class="site-btn" data-site="youtube.com">YouTube</div>
197
+ <div class="site-btn" data-site="twitter.com">X (Twitter)</div>
198
+ </div>
199
+ </div>
200
+
201
+ <div class="form-group">
202
+ <label>Periodo de tiempo:</label>
203
+ <div class="time-options">
204
+ <div class="time-option" data-time="">Cualquier momento</div>
205
+ <div class="time-option" data-time="qdr:d">Últimas 24 horas</div>
206
+ <div class="time-option" data-time="qdr:w">Última semana</div>
207
+ <div class="time-option" data-time="qdr:m">Último mes</div>
208
+ <div class="time-option" data-time="qdr:y">Último año</div>
209
+ </div>
210
+ </div>
211
+
212
+ <button class="search-btn" id="searchButton">Buscar en Google</button>
213
+
214
+ <div class="preview">
215
+ <h3>Vista previa de la búsqueda:</h3>
216
+ <div class="preview-url" id="previewUrl">https://www.google.com/search?q=...</div>
217
+ </div>
218
+ </div>
219
+
220
+ <script>
221
+ // Elementos del DOM
222
+ const searchQuery = document.getElementById('searchQuery');
223
+ const siteInput = document.getElementById('site');
224
+ const searchButton = document.getElementById('searchButton');
225
+ const previewUrl = document.getElementById('previewUrl');
226
+ const siteButtons = document.querySelectorAll('.site-btn');
227
+ const timeOptions = document.querySelectorAll('.time-option');
228
+
229
+ // Variables de estado
230
+ let selectedTime = '';
231
+
232
+ // Event listeners para los botones de sitio
233
+ siteButtons.forEach(button => {
234
+ button.addEventListener('click', () => {
235
+ siteInput.value = button.getAttribute('data-site');
236
+ updatePreview();
237
+ });
238
+ });
239
+
240
+ // Event listeners para las opciones de tiempo
241
+ timeOptions.forEach(option => {
242
+ option.addEventListener('click', () => {
243
+ // Remover clase activa de todos
244
+ timeOptions.forEach(opt => opt.classList.remove('active'));
245
+
246
+ // Agregar clase activa al seleccionado
247
+ option.classList.add('active');
248
+
249
+ // Guardar el valor seleccionado
250
+ selectedTime = option.getAttribute('data-time');
251
+
252
+ updatePreview();
253
+ });
254
+ });
255
+
256
+ // Event listeners para inputs
257
+ searchQuery.addEventListener('input', updatePreview);
258
+ siteInput.addEventListener('input', updatePreview);
259
+
260
+ // Función para actualizar la vista previa
261
+ function updatePreview() {
262
+ const query = searchQuery.value.trim();
263
+ const site = siteInput.value.trim();
264
+ let url = 'https://www.google.com/search?q=';
265
+
266
+ if (query) {
267
+ url += encodeURIComponent(query);
268
+ }
269
+
270
+ if (site) {
271
+ url += encodeURIComponent(` site:${site}`);
272
+ }
273
+
274
+ if (selectedTime) {
275
+ url += `&tbs=${selectedTime}`;
276
+ }
277
+
278
+ previewUrl.textContent = url;
279
+ }
280
+
281
+ // Función para realizar la búsqueda
282
+ function performSearch() {
283
+ const query = searchQuery.value.trim();
284
+ const site = siteInput.value.trim();
285
+
286
+ if (!query) {
287
+ alert('Por favor, introduce términos de búsqueda');
288
+ return;
289
+ }
290
+
291
+ let searchUrl = 'https://www.google.com/search?q=' + encodeURIComponent(query);
292
+
293
+ if (site) {
294
+ searchUrl += encodeURIComponent(` site:${site}`);
295
+ }
296
+
297
+ if (selectedTime) {
298
+ searchUrl += `&tbs=${selectedTime}`;
299
+ }
300
+
301
+ // Abrir en una nueva pestaña/ventana
302
+ window.open(searchUrl, '_blank', 'noopener noreferrer'); // Agregamos 'noopener noreferrer' para evitar problemas de seguridad
303
+ }
304
+
305
+ // Event listener para el botón de búsqueda
306
+ searchButton.addEventListener('click', performSearch);
307
+
308
+ // Inicializar vista previa
309
+ updatePreview();
310
+
311
+ // Establecer opción por defecto
312
+ document.querySelector('.time-option[data-time=""]').classList.add('active');
313
+ </script>
314
+ </body>
315
+ </html>