@randomdev/pulsedev 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +15 -0
- package/README.md +585 -0
- package/bin/cli.js +75 -0
- package/core/init.js +48 -0
- package/core/run.js +341 -0
- package/core/serverManager.js +299 -0
- package/helpers/counterChar.js +40 -0
- package/helpers/hashFingerprint.js +39 -0
- package/helpers/mimeTypes.js +75 -0
- package/helpers/resourceHasher.js +33 -0
- package/helpers/watcher.js +158 -0
- package/helpers/websocket.js +82 -0
- package/helpers/writter.js +85 -0
- package/package.json +37 -0
- package/web/assets/Arimo-VariableFont_wght.ttf +0 -0
- package/web/assets/favicon.png +0 -0
- package/web/assets/github.svg +1 -0
- package/web/assets/logo.png +0 -0
- package/web/assets/npm.svg +1 -0
- package/web/templates/documentation.html +65 -0
- package/web/templates/index.css +397 -0
- package/web/templates/index.html +64 -0
- package/web/templates/index.js +45 -0
- package/web/templates/pulsedev.json +10 -0
- package/web/templates/socket-client.js +6 -0
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: "Arimo Regular";
|
|
3
|
+
src: url(../assets/Arimo-VariableFont_wght.ttf);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
--bg-main: #0b0f19;
|
|
8
|
+
--bg-card: #131b2e;
|
|
9
|
+
--bg-surface: #1e293b;
|
|
10
|
+
--border-color: #334155;
|
|
11
|
+
--text-main: #f8fafc;
|
|
12
|
+
--text-muted: #94a3b8;
|
|
13
|
+
--accent: #38bdf8;
|
|
14
|
+
--accent-hover: #7dd3fc;
|
|
15
|
+
--success: #10b981;
|
|
16
|
+
--success-bg: rgba(16, 185, 129, 0.1);
|
|
17
|
+
--font-sans: "Arimo Regular", -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
18
|
+
--font-mono: 'SFMono-Regular', Menlo, Monaco, Consolas, "Liberation Mono", monospace;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
* {
|
|
22
|
+
margin: 0;
|
|
23
|
+
padding: 0;
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
body {
|
|
28
|
+
font-family: var(--font-sans);
|
|
29
|
+
background-color: var(--bg-main);
|
|
30
|
+
color: var(--text-main);
|
|
31
|
+
min-height: 100vh;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
line-height: 1.5;
|
|
35
|
+
-webkit-font-smoothing: antialiased;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/* --- HEADER --- */
|
|
39
|
+
.site-header {
|
|
40
|
+
display: flex;
|
|
41
|
+
justify-content: space-between;
|
|
42
|
+
align-items: center;
|
|
43
|
+
background-color: rgba(19, 27, 46, 0.8);
|
|
44
|
+
backdrop-filter: blur(12px);
|
|
45
|
+
padding: 0.85rem 2rem;
|
|
46
|
+
border-bottom: 1px solid var(--border-color);
|
|
47
|
+
position: sticky;
|
|
48
|
+
top: 0;
|
|
49
|
+
z-index: 100;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.brand-group {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
gap: 12px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.header-logo {
|
|
59
|
+
width: 56px;
|
|
60
|
+
height: 56px;
|
|
61
|
+
object-fit: contain;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.brand-text {
|
|
65
|
+
display: flex;
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.brand-name {
|
|
70
|
+
font-size: 1.1rem;
|
|
71
|
+
font-weight: 700;
|
|
72
|
+
letter-spacing: -0.3px;
|
|
73
|
+
color: var(--text-main);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.brand-tagline {
|
|
77
|
+
font-size: 0.75rem;
|
|
78
|
+
color: var(--text-muted);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.actions-group {
|
|
82
|
+
display: flex;
|
|
83
|
+
align-items: center;
|
|
84
|
+
gap: 1.5rem;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.social-icons {
|
|
88
|
+
display: flex;
|
|
89
|
+
gap: 1rem;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.social-icons a {
|
|
93
|
+
display: flex;
|
|
94
|
+
align-items: center;
|
|
95
|
+
opacity: 0.75;
|
|
96
|
+
transition: opacity 0.2s ease, transform 0.2s ease;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.social-icons a:hover {
|
|
100
|
+
opacity: 1;
|
|
101
|
+
transform: translateY(-1px);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.social-icons img {
|
|
105
|
+
width: 20px;
|
|
106
|
+
height: 20px;
|
|
107
|
+
filter: invert(1); /* Convierte íconos oscuros a claros para el Dark Mode */
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/* --- INTERRUPTOR (TOGGLE BUTTON) --- */
|
|
111
|
+
.toggle-btn {
|
|
112
|
+
background-color: var(--bg-surface);
|
|
113
|
+
color: var(--text-main);
|
|
114
|
+
border: 1px solid var(--border-color);
|
|
115
|
+
padding: 6px 14px;
|
|
116
|
+
font-size: 0.85rem;
|
|
117
|
+
font-weight: 600;
|
|
118
|
+
border-radius: 6px;
|
|
119
|
+
cursor: pointer;
|
|
120
|
+
transition: background-color 0.2s ease, border-color 0.2s ease;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.toggle-btn:hover {
|
|
124
|
+
background-color: var(--border-color);
|
|
125
|
+
border-color: var(--accent);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* --- LAYOUT PRINCIPAL --- */
|
|
129
|
+
.main-content {
|
|
130
|
+
flex: 1;
|
|
131
|
+
width: 100%;
|
|
132
|
+
max-width: 840px;
|
|
133
|
+
margin: 0 auto;
|
|
134
|
+
padding: 3rem 1.5rem;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.view-container {
|
|
138
|
+
animation: fadeIn 0.25s ease-out;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@keyframes fadeIn {
|
|
142
|
+
from { opacity: 0; transform: translateY(4px); }
|
|
143
|
+
to { opacity: 1; transform: translateY(0); }
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/* --- SECTION: DEMO --- */
|
|
147
|
+
.hero-section {
|
|
148
|
+
margin-bottom: 2.5rem;
|
|
149
|
+
text-align: center;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.hero-section h2 {
|
|
153
|
+
font-size: 1.75rem;
|
|
154
|
+
font-weight: 700;
|
|
155
|
+
margin-bottom: 0.5rem;
|
|
156
|
+
letter-spacing: -0.5px;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.hero-section p {
|
|
160
|
+
color: var(--text-muted);
|
|
161
|
+
font-size: 1rem;
|
|
162
|
+
max-width: 600px;
|
|
163
|
+
margin: 0 auto;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.counter-card {
|
|
167
|
+
background-color: var(--bg-card);
|
|
168
|
+
border: 1px solid var(--border-color);
|
|
169
|
+
border-radius: 12px;
|
|
170
|
+
padding: 2.5rem;
|
|
171
|
+
text-align: center;
|
|
172
|
+
margin-bottom: 2rem;
|
|
173
|
+
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.counter-card h3 {
|
|
177
|
+
font-size: 1.1rem;
|
|
178
|
+
color: var(--text-muted);
|
|
179
|
+
margin-bottom: 1.5rem;
|
|
180
|
+
text-transform: uppercase;
|
|
181
|
+
letter-spacing: 1px;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.counter-display {
|
|
185
|
+
font-size: 4.5rem;
|
|
186
|
+
font-weight: 800;
|
|
187
|
+
color: var(--accent);
|
|
188
|
+
line-height: 1;
|
|
189
|
+
margin-bottom: 1.5rem;
|
|
190
|
+
font-family: var(--font-mono);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.counter-buttons {
|
|
194
|
+
display: flex;
|
|
195
|
+
gap: 1rem;
|
|
196
|
+
justify-content: center;
|
|
197
|
+
margin-bottom: 1.5rem;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.counter-btn {
|
|
201
|
+
background-color: var(--bg-surface);
|
|
202
|
+
border: 1px solid var(--border-color);
|
|
203
|
+
color: var(--text-main);
|
|
204
|
+
font-size: 1.25rem;
|
|
205
|
+
width: 46px;
|
|
206
|
+
height: 46px;
|
|
207
|
+
border-radius: 8px;
|
|
208
|
+
cursor: pointer;
|
|
209
|
+
transition: all 0.15s ease;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.counter-btn:hover {
|
|
213
|
+
background-color: var(--accent);
|
|
214
|
+
color: var(--bg-main);
|
|
215
|
+
border-color: var(--accent);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.counter-status {
|
|
219
|
+
color: var(--text-muted);
|
|
220
|
+
font-size: 0.85rem;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.server-status {
|
|
224
|
+
display: inline-flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
gap: 0.6rem;
|
|
227
|
+
padding: 0.5rem 1rem;
|
|
228
|
+
background-color: var(--success-bg);
|
|
229
|
+
border: 1px solid rgba(16, 185, 129, 0.2);
|
|
230
|
+
border-radius: 20px;
|
|
231
|
+
margin: 0 auto;
|
|
232
|
+
display: flex;
|
|
233
|
+
width: max-content;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
.status-indicator {
|
|
237
|
+
width: 8px;
|
|
238
|
+
height: 8px;
|
|
239
|
+
background-color: var(--success);
|
|
240
|
+
border-radius: 50%;
|
|
241
|
+
box-shadow: 0 0 8px var(--success);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.status-text {
|
|
245
|
+
font-size: 0.85rem;
|
|
246
|
+
color: var(--success);
|
|
247
|
+
font-weight: 500;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
/* --- SECTION: DOCUMENTACIÓN --- */
|
|
251
|
+
.docs-header {
|
|
252
|
+
margin-bottom: 2.5rem;
|
|
253
|
+
border-bottom: 1px solid var(--border-color);
|
|
254
|
+
padding-bottom: 1.5rem;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
.docs-header h1 {
|
|
258
|
+
font-size: 2rem;
|
|
259
|
+
font-weight: 800;
|
|
260
|
+
letter-spacing: -0.5px;
|
|
261
|
+
margin-bottom: 0.35rem;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
.docs-subtitle {
|
|
265
|
+
color: var(--text-muted);
|
|
266
|
+
font-size: 1.05rem;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
.docs-content h2 {
|
|
270
|
+
font-size: 1.35rem;
|
|
271
|
+
font-weight: 700;
|
|
272
|
+
margin: 2.5rem 0 1rem 0;
|
|
273
|
+
color: var(--text-main);
|
|
274
|
+
letter-spacing: -0.3px;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
.docs-content h3 {
|
|
278
|
+
font-size: 1.1rem;
|
|
279
|
+
font-weight: 600;
|
|
280
|
+
margin: 1.75rem 0 0.75rem 0;
|
|
281
|
+
color: var(--accent);
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.docs-content p {
|
|
285
|
+
color: var(--text-muted);
|
|
286
|
+
font-size: 0.95rem;
|
|
287
|
+
line-height: 1.6;
|
|
288
|
+
margin-bottom: 1.25rem;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.docs-content ul, .docs-content ol {
|
|
292
|
+
margin: 1rem 0 1.5rem 2rem;
|
|
293
|
+
color: var(--text-muted);
|
|
294
|
+
font-size: 0.95rem;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.docs-content li {
|
|
298
|
+
margin-bottom: 0.5rem;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/* Código e Bloques */
|
|
302
|
+
.docs-content code {
|
|
303
|
+
background-color: var(--bg-surface);
|
|
304
|
+
padding: 0.2rem 0.4rem;
|
|
305
|
+
border-radius: 4px;
|
|
306
|
+
font-family: var(--font-mono);
|
|
307
|
+
font-size: 0.85em;
|
|
308
|
+
color: var(--accent);
|
|
309
|
+
border: 1px solid rgba(255, 255, 255, 0.05);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.docs-content pre {
|
|
313
|
+
background-color: var(--bg-card);
|
|
314
|
+
border: 1px solid var(--border-color);
|
|
315
|
+
padding: 1.25rem;
|
|
316
|
+
border-radius: 8px;
|
|
317
|
+
overflow-x: auto;
|
|
318
|
+
margin: 1.25rem 0;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
.docs-content pre code {
|
|
322
|
+
background-color: transparent;
|
|
323
|
+
color: #e2e8f0;
|
|
324
|
+
padding: 0;
|
|
325
|
+
border: none;
|
|
326
|
+
font-size: 0.9rem;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/* Tablas Responsivas */
|
|
330
|
+
.table-container {
|
|
331
|
+
width: 100%;
|
|
332
|
+
overflow-x: auto;
|
|
333
|
+
margin: 1.5rem 0;
|
|
334
|
+
border: 1px solid var(--border-color);
|
|
335
|
+
border-radius: 8px;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.docs-content table {
|
|
339
|
+
width: 100%;
|
|
340
|
+
border-collapse: collapse;
|
|
341
|
+
text-align: left;
|
|
342
|
+
font-size: 0.9rem;
|
|
343
|
+
background-color: var(--bg-card);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
.docs-content th {
|
|
347
|
+
background-color: var(--bg-surface);
|
|
348
|
+
color: var(--text-main);
|
|
349
|
+
padding: 0.75rem 1rem;
|
|
350
|
+
font-weight: 600;
|
|
351
|
+
border-bottom: 1px solid var(--border-color);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.docs-content td {
|
|
355
|
+
padding: 0.85rem 1rem;
|
|
356
|
+
border-bottom: 1px solid rgba(51, 65, 85, 0.5);
|
|
357
|
+
color: var(--text-muted);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.docs-content tr:last-child td {
|
|
361
|
+
border-bottom: none;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/* Bloques de Citas (Quote) */
|
|
365
|
+
.docs-content blockquote {
|
|
366
|
+
border-left: 3px solid var(--accent);
|
|
367
|
+
background-color: var(--bg-card);
|
|
368
|
+
padding: 1rem 1.25rem;
|
|
369
|
+
margin: 2rem 0;
|
|
370
|
+
border-radius: 0 8px 8px 0;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
.docs-content blockquote p {
|
|
374
|
+
margin-bottom: 0;
|
|
375
|
+
color: var(--text-main);
|
|
376
|
+
font-weight: 500;
|
|
377
|
+
font-size: 0.9rem;
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
/* --- RESPONSIVE --- */
|
|
381
|
+
@media (max-width: 640px) {
|
|
382
|
+
.site-header {
|
|
383
|
+
padding: 1rem;
|
|
384
|
+
}
|
|
385
|
+
.brand-tagline, .social-icons {
|
|
386
|
+
display: none; /* Simplifica UI en pantallas móviles muy chicas */
|
|
387
|
+
}
|
|
388
|
+
.main-content {
|
|
389
|
+
padding: 1.5rem 1rem;
|
|
390
|
+
}
|
|
391
|
+
.counter-card {
|
|
392
|
+
padding: 1.5rem;
|
|
393
|
+
}
|
|
394
|
+
.counter-display {
|
|
395
|
+
font-size: 3.5rem;
|
|
396
|
+
}
|
|
397
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
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>PulseDev · Servidor de Desarrollo</title>
|
|
7
|
+
<link rel="icon" href="assets/favicon.png" type="image/png">
|
|
8
|
+
<link rel="stylesheet" href="css/index.css">
|
|
9
|
+
</head>
|
|
10
|
+
<body>
|
|
11
|
+
<header class="site-header">
|
|
12
|
+
<div class="brand-group">
|
|
13
|
+
<img src="assets/logo.png" alt="PulseDev Logo" class="header-logo">
|
|
14
|
+
<div class="brand-text">
|
|
15
|
+
<span class="brand-name">PulseDev</span>
|
|
16
|
+
<span class="brand-tagline">Servidor web nativo para desarrollo</span>
|
|
17
|
+
</div>
|
|
18
|
+
</div>
|
|
19
|
+
<div class="actions-group">
|
|
20
|
+
<button id="toggleDocsBtn" class="toggle-btn">Ver Documentación</button>
|
|
21
|
+
<div class="social-icons">
|
|
22
|
+
<a href="https://github.com/pabloacisera/pulsedev_linux" target="_blank" rel="noopener noreferrer" title="GitHub">
|
|
23
|
+
<img src="assets/github.svg" alt="GitHub">
|
|
24
|
+
</a>
|
|
25
|
+
<a href="https://www.npmjs.com/package/pulsedev" target="_blank" rel="noopener noreferrer" title="NPM">
|
|
26
|
+
<img src="assets/npm.svg" alt="NPM">
|
|
27
|
+
</a>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
</header>
|
|
31
|
+
|
|
32
|
+
<main id="main" class="main-content">
|
|
33
|
+
<section id="demoContainer" class="view-container">
|
|
34
|
+
<div class="hero-section">
|
|
35
|
+
<h2>Entorno de desarrollo activo</h2>
|
|
36
|
+
<p>Tu servidor está corriendo de manera óptima. Usa esta interfaz para validar las capacidades del Live Reload y WebSocket.</p>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="counter-card">
|
|
40
|
+
<h3>Demo Interactiva</h3>
|
|
41
|
+
<div class="counter-display">
|
|
42
|
+
<span id="counterValue">0</span>
|
|
43
|
+
</div>
|
|
44
|
+
<div class="counter-buttons">
|
|
45
|
+
<button id="decrementBtn" class="counter-btn" aria-label="Decrementar">-</button>
|
|
46
|
+
<button id="incrementBtn" class="counter-btn" aria-label="Incrementar">+</button>
|
|
47
|
+
</div>
|
|
48
|
+
<p class="counter-status">Eventos reactivos en tiempo real vía JavaScript</p>
|
|
49
|
+
</div>
|
|
50
|
+
|
|
51
|
+
<div class="server-status">
|
|
52
|
+
<span class="status-indicator"></span>
|
|
53
|
+
<span class="status-text">PulseDev activo · Puerto 3003</span>
|
|
54
|
+
</div>
|
|
55
|
+
</section>
|
|
56
|
+
|
|
57
|
+
<section id="docsContainer" class="view-container" style="display: none;">
|
|
58
|
+
</section>
|
|
59
|
+
</main>
|
|
60
|
+
|
|
61
|
+
<script type="module" src="js/socket-client.js"></script>
|
|
62
|
+
<script type="module" src="js/index.js"></script>
|
|
63
|
+
</body>
|
|
64
|
+
</html>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Estado del toggle
|
|
2
|
+
let showingDocs = false;
|
|
3
|
+
|
|
4
|
+
document.addEventListener("DOMContentLoaded", () => {
|
|
5
|
+
const toggleBtn = document.getElementById('toggleDocsBtn');
|
|
6
|
+
const demoContainer = document.getElementById('demoContainer');
|
|
7
|
+
const docsContainer = document.getElementById('docsContainer');
|
|
8
|
+
|
|
9
|
+
// Cargar documentación HTML (inyectado por el servidor)
|
|
10
|
+
const documentationHTML = __DOCUMENTATION_HTML__;
|
|
11
|
+
docsContainer.innerHTML = documentationHTML;
|
|
12
|
+
|
|
13
|
+
// Configurar demo interactivo
|
|
14
|
+
let counter = 0;
|
|
15
|
+
const counterValue = document.getElementById('counterValue');
|
|
16
|
+
const incrementBtn = document.getElementById('incrementBtn');
|
|
17
|
+
const decrementBtn = document.getElementById('decrementBtn');
|
|
18
|
+
|
|
19
|
+
incrementBtn.addEventListener('click', () => {
|
|
20
|
+
counter++;
|
|
21
|
+
counterValue.textContent = counter;
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
decrementBtn.addEventListener('click', () => {
|
|
25
|
+
counter--;
|
|
26
|
+
counterValue.textContent = counter;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Toggle fluido entre vista de demo y documentación
|
|
30
|
+
toggleBtn.addEventListener('click', () => {
|
|
31
|
+
showingDocs = !showingDocs;
|
|
32
|
+
|
|
33
|
+
if (showingDocs) {
|
|
34
|
+
demoContainer.style.display = 'none';
|
|
35
|
+
docsContainer.style.display = 'block';
|
|
36
|
+
toggleBtn.textContent = 'Ver Demo Interactivo';
|
|
37
|
+
} else {
|
|
38
|
+
demoContainer.style.display = 'block';
|
|
39
|
+
docsContainer.style.display = 'none';
|
|
40
|
+
toggleBtn.textContent = 'Ver Documentación';
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
console.log('✅ PulseDev inicializado correctamente - Puerto 3003');
|
|
45
|
+
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
(function() {
|
|
2
|
+
let ws = new WebSocket("ws://localhost:" + location.port);
|
|
3
|
+
ws.onmessage = (e) => { if (e.data === "reload") location.reload(); };
|
|
4
|
+
ws.onclose = () => setTimeout(() => location.reload(), 1000);
|
|
5
|
+
ws.onerror = () => setTimeout(() => location.reload(), 1000);
|
|
6
|
+
})()
|