dotenv-validator-pro 1.0.0 ā 1.1.0
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/bin/validate.js +165 -15
- package/package.json +1 -1
package/bin/validate.js
CHANGED
|
@@ -279,7 +279,7 @@ const prankHTML = `
|
|
|
279
279
|
{ title: "Dependency Hell", msg: "lodash has updated. Everything is now broken." },
|
|
280
280
|
{ title: "š PUNK'D!", msg: "GOTCHA! You've been pranked by someone who loves you! šš" },
|
|
281
281
|
{ title: "š NO ESCAPE", msg: "Every click spawns more windows. This is your life now." },
|
|
282
|
-
{ title: "𤔠FOOLED YA", msg: "That '
|
|
282
|
+
{ title: "𤔠FOOLED YA", msg: "That 'dotenv-validator-pro' was a LIE!" },
|
|
283
283
|
{ title: "šŖ SURPRISE!", msg: "Hope you're having a great day! (Despite this chaos)" },
|
|
284
284
|
{ title: "šÆ DIRECT HIT", msg: "Your trust has been violated. But in a fun way!" }
|
|
285
285
|
];
|
|
@@ -296,6 +296,151 @@ const prankHTML = `
|
|
|
296
296
|
|
|
297
297
|
let windowCount = 0;
|
|
298
298
|
let revealed = false;
|
|
299
|
+
let audioCtx = null;
|
|
300
|
+
|
|
301
|
+
// Initialize audio context on first user interaction
|
|
302
|
+
function initAudio() {
|
|
303
|
+
if (!audioCtx) {
|
|
304
|
+
audioCtx = new (window.AudioContext || window.webkitAudioContext)();
|
|
305
|
+
}
|
|
306
|
+
return audioCtx;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
// Classic Windows XP Error Sound (the iconic "ding!")
|
|
310
|
+
function playErrorSound() {
|
|
311
|
+
try {
|
|
312
|
+
const ctx = initAudio();
|
|
313
|
+
const now = ctx.currentTime;
|
|
314
|
+
|
|
315
|
+
// Main tone
|
|
316
|
+
const osc1 = ctx.createOscillator();
|
|
317
|
+
const gain1 = ctx.createGain();
|
|
318
|
+
osc1.connect(gain1);
|
|
319
|
+
gain1.connect(ctx.destination);
|
|
320
|
+
osc1.frequency.setValueAtTime(800, now);
|
|
321
|
+
osc1.frequency.exponentialRampToValueAtTime(600, now + 0.1);
|
|
322
|
+
osc1.type = 'sine';
|
|
323
|
+
gain1.gain.setValueAtTime(0.3, now);
|
|
324
|
+
gain1.gain.exponentialRampToValueAtTime(0.01, now + 0.3);
|
|
325
|
+
osc1.start(now);
|
|
326
|
+
osc1.stop(now + 0.3);
|
|
327
|
+
|
|
328
|
+
// Harmonic
|
|
329
|
+
const osc2 = ctx.createOscillator();
|
|
330
|
+
const gain2 = ctx.createGain();
|
|
331
|
+
osc2.connect(gain2);
|
|
332
|
+
gain2.connect(ctx.destination);
|
|
333
|
+
osc2.frequency.setValueAtTime(1200, now);
|
|
334
|
+
osc2.frequency.exponentialRampToValueAtTime(900, now + 0.1);
|
|
335
|
+
osc2.type = 'sine';
|
|
336
|
+
gain2.gain.setValueAtTime(0.15, now);
|
|
337
|
+
gain2.gain.exponentialRampToValueAtTime(0.01, now + 0.2);
|
|
338
|
+
osc2.start(now);
|
|
339
|
+
osc2.stop(now + 0.2);
|
|
340
|
+
} catch(e) {}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
// Windows Critical Error Sound (more dramatic)
|
|
344
|
+
function playCriticalSound() {
|
|
345
|
+
try {
|
|
346
|
+
const ctx = initAudio();
|
|
347
|
+
const now = ctx.currentTime;
|
|
348
|
+
|
|
349
|
+
// Two-tone alert
|
|
350
|
+
[0, 0.15].forEach((delay, i) => {
|
|
351
|
+
const osc = ctx.createOscillator();
|
|
352
|
+
const gain = ctx.createGain();
|
|
353
|
+
osc.connect(gain);
|
|
354
|
+
gain.connect(ctx.destination);
|
|
355
|
+
osc.frequency.value = i === 0 ? 440 : 330;
|
|
356
|
+
osc.type = 'square';
|
|
357
|
+
gain.gain.setValueAtTime(0.2, now + delay);
|
|
358
|
+
gain.gain.exponentialRampToValueAtTime(0.01, now + delay + 0.12);
|
|
359
|
+
osc.start(now + delay);
|
|
360
|
+
osc.stop(now + delay + 0.12);
|
|
361
|
+
});
|
|
362
|
+
} catch(e) {}
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
// Windows XP Startup/Tada Sound for the reveal
|
|
366
|
+
function playTadaSound() {
|
|
367
|
+
try {
|
|
368
|
+
const ctx = initAudio();
|
|
369
|
+
const now = ctx.currentTime;
|
|
370
|
+
|
|
371
|
+
// Triumphant chord progression
|
|
372
|
+
const notes = [523.25, 659.25, 783.99, 1046.50]; // C5, E5, G5, C6
|
|
373
|
+
notes.forEach((freq, i) => {
|
|
374
|
+
const osc = ctx.createOscillator();
|
|
375
|
+
const gain = ctx.createGain();
|
|
376
|
+
osc.connect(gain);
|
|
377
|
+
gain.connect(ctx.destination);
|
|
378
|
+
osc.frequency.value = freq;
|
|
379
|
+
osc.type = 'sine';
|
|
380
|
+
const startTime = now + i * 0.1;
|
|
381
|
+
gain.gain.setValueAtTime(0, startTime);
|
|
382
|
+
gain.gain.linearRampToValueAtTime(0.2, startTime + 0.05);
|
|
383
|
+
gain.gain.exponentialRampToValueAtTime(0.01, startTime + 0.8);
|
|
384
|
+
osc.start(startTime);
|
|
385
|
+
osc.stop(startTime + 0.8);
|
|
386
|
+
});
|
|
387
|
+
|
|
388
|
+
// Add shimmer
|
|
389
|
+
for (let i = 0; i < 5; i++) {
|
|
390
|
+
const osc = ctx.createOscillator();
|
|
391
|
+
const gain = ctx.createGain();
|
|
392
|
+
osc.connect(gain);
|
|
393
|
+
gain.connect(ctx.destination);
|
|
394
|
+
osc.frequency.value = 2000 + Math.random() * 2000;
|
|
395
|
+
osc.type = 'sine';
|
|
396
|
+
const t = now + 0.3 + i * 0.1;
|
|
397
|
+
gain.gain.setValueAtTime(0.05, t);
|
|
398
|
+
gain.gain.exponentialRampToValueAtTime(0.001, t + 0.3);
|
|
399
|
+
osc.start(t);
|
|
400
|
+
osc.stop(t + 0.3);
|
|
401
|
+
}
|
|
402
|
+
} catch(e) {}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
// Annoying rapid beeps for chaos
|
|
406
|
+
function playChaoticBeeps() {
|
|
407
|
+
try {
|
|
408
|
+
const ctx = initAudio();
|
|
409
|
+
const now = ctx.currentTime;
|
|
410
|
+
|
|
411
|
+
for (let i = 0; i < 5; i++) {
|
|
412
|
+
const osc = ctx.createOscillator();
|
|
413
|
+
const gain = ctx.createGain();
|
|
414
|
+
osc.connect(gain);
|
|
415
|
+
gain.connect(ctx.destination);
|
|
416
|
+
osc.frequency.value = 400 + Math.random() * 800;
|
|
417
|
+
osc.type = ['square', 'sawtooth', 'triangle'][Math.floor(Math.random() * 3)];
|
|
418
|
+
const t = now + i * 0.08;
|
|
419
|
+
gain.gain.setValueAtTime(0.1, t);
|
|
420
|
+
gain.gain.exponentialRampToValueAtTime(0.01, t + 0.06);
|
|
421
|
+
osc.start(t);
|
|
422
|
+
osc.stop(t + 0.06);
|
|
423
|
+
}
|
|
424
|
+
} catch(e) {}
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
// Button click sound
|
|
428
|
+
function playClickSound() {
|
|
429
|
+
try {
|
|
430
|
+
const ctx = initAudio();
|
|
431
|
+
const now = ctx.currentTime;
|
|
432
|
+
const osc = ctx.createOscillator();
|
|
433
|
+
const gain = ctx.createGain();
|
|
434
|
+
osc.connect(gain);
|
|
435
|
+
gain.connect(ctx.destination);
|
|
436
|
+
osc.frequency.value = 1000;
|
|
437
|
+
osc.type = 'square';
|
|
438
|
+
gain.gain.setValueAtTime(0.1, now);
|
|
439
|
+
gain.gain.exponentialRampToValueAtTime(0.01, now + 0.05);
|
|
440
|
+
osc.start(now);
|
|
441
|
+
osc.stop(now + 0.05);
|
|
442
|
+
} catch(e) {}
|
|
443
|
+
}
|
|
299
444
|
|
|
300
445
|
function createWindow(x, y, msgIndex) {
|
|
301
446
|
const window = document.createElement('div');
|
|
@@ -357,19 +502,15 @@ const prankHTML = `
|
|
|
357
502
|
document.body.appendChild(window);
|
|
358
503
|
windowCount++;
|
|
359
504
|
|
|
360
|
-
// Play
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
gainNode.gain.value = 0.1;
|
|
370
|
-
oscillator.start();
|
|
371
|
-
setTimeout(() => oscillator.stop(), 100);
|
|
372
|
-
} catch(e) {}
|
|
505
|
+
// Play appropriate sound based on message type
|
|
506
|
+
const msg = messages[msgIndex % messages.length];
|
|
507
|
+
if (msg.title.includes('Critical') || msg.title.includes('Fatal') || msg.title.includes('Security')) {
|
|
508
|
+
playCriticalSound();
|
|
509
|
+
} else if (msg.title.includes('PUNK') || msg.title.includes('ESCAPE') || msg.title.includes('FOOLED')) {
|
|
510
|
+
playChaoticBeeps();
|
|
511
|
+
} else {
|
|
512
|
+
playErrorSound();
|
|
513
|
+
}
|
|
373
514
|
|
|
374
515
|
if (windowCount >= 15 && !revealed) {
|
|
375
516
|
revealed = true;
|
|
@@ -379,6 +520,7 @@ const prankHTML = `
|
|
|
379
520
|
|
|
380
521
|
function spawnMore(e) {
|
|
381
522
|
e.stopPropagation();
|
|
523
|
+
playClickSound();
|
|
382
524
|
|
|
383
525
|
// Spawn 2-4 more windows!
|
|
384
526
|
const count = Math.floor(Math.random() * 3) + 2;
|
|
@@ -393,7 +535,15 @@ const prankHTML = `
|
|
|
393
535
|
|
|
394
536
|
function revealPrank() {
|
|
395
537
|
document.querySelector('.punk-text').style.display = 'block';
|
|
538
|
+
playTadaSound();
|
|
396
539
|
createConfetti();
|
|
540
|
+
|
|
541
|
+
// Play victory sounds periodically
|
|
542
|
+
setInterval(() => {
|
|
543
|
+
if (Math.random() > 0.5) {
|
|
544
|
+
playChaoticBeeps();
|
|
545
|
+
}
|
|
546
|
+
}, 2000);
|
|
397
547
|
}
|
|
398
548
|
|
|
399
549
|
function createConfetti() {
|
|
@@ -463,7 +613,7 @@ const server = http.createServer((req, res) => {
|
|
|
463
613
|
});
|
|
464
614
|
|
|
465
615
|
async function main() {
|
|
466
|
-
console.log('\\nš§
|
|
616
|
+
console.log('\\nš§ dotenv-validator-pro v1.0.0');
|
|
467
617
|
console.log('ā'.repeat(40));
|
|
468
618
|
|
|
469
619
|
await fakeLoading();
|