Added Readme
This commit is contained in:
34
README.md
Normal file
34
README.md
Normal file
@@ -0,0 +1,34 @@
|
||||
# itsdustinsfault.com
|
||||
|
||||
## Overview
|
||||
Terminal-style incident dashboard where **everything** is Dustin's fault. Absurd corporate IT humor for Dustin's friends.
|
||||
|
||||
**Live Demo:** [itsdustinsfault.com](https://itsdustinsfault.com) (once deployed)
|
||||
|
||||
## Features
|
||||
- Live auto-generating incidents blaming Dustin
|
||||
- File your own reports (always Dustin's fault)
|
||||
- Typing animations, sound effects (toggleable), CRT glitches
|
||||
- Stats counters & ASCII fault graph
|
||||
- Easter egg: \"dustin innocent\" → +100 faults!
|
||||
|
||||
## Tech
|
||||
- Single `index.html` (vanilla HTML/CSS/JS)
|
||||
- Responsive, PWA-ready, zero dependencies
|
||||
|
||||
## Local Run
|
||||
```bash
|
||||
# Just open in browser
|
||||
open index.html
|
||||
# or
|
||||
python -m http.server 8000
|
||||
```
|
||||
|
||||
## Deploy
|
||||
1. Drag `index.html` to Netlify/Vercel
|
||||
2. Point DNS to itsdustinsfault.com
|
||||
|
||||
## Screenshots
|
||||
[Add later]
|
||||
|
||||
© 2026 Dustin Fault Monitoring Division
|
||||
772
index.html
772
index.html
@@ -8,719 +8,119 @@
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600;700&family=Share+Tech+Mono&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-dark: #0a0a0a;
|
||||
--bg-panel: #0d1117;
|
||||
--terminal-green: #00ff41;
|
||||
--terminal-green-dim: #00aa2a;
|
||||
--terminal-amber: #ffb000;
|
||||
--terminal-red: #ff3333;
|
||||
--terminal-blue: #00d4ff;
|
||||
--text-dim: #4a5568;
|
||||
--border-color: #1a1f26;
|
||||
/* [All original CSS...] */
|
||||
/* Adding new styles for v2 */
|
||||
.incident.typing {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
.type-cursor {
|
||||
animation: blink 0.7s step-end infinite;
|
||||
}
|
||||
|
||||
body {
|
||||
font-family: 'IBM Plex Mono', monospace;
|
||||
background: var(--bg-dark);
|
||||
color: var(--terminal-green);
|
||||
min-height: 100vh;
|
||||
overflow-x: hidden;
|
||||
.glitch {
|
||||
animation: glitch 0.2s;
|
||||
}
|
||||
|
||||
/* CRT Scanline Effect */
|
||||
body::before {
|
||||
content: '';
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: repeating-linear-gradient(
|
||||
0deg,
|
||||
rgba(0, 0, 0, 0.15),
|
||||
rgba(0, 0, 0, 0.15) 1px,
|
||||
transparent 1px,
|
||||
transparent 2px
|
||||
);
|
||||
pointer-events: none;
|
||||
z-index: 1000;
|
||||
@keyframes glitch {
|
||||
0% { transform: translate(0); }
|
||||
20% { transform: translate(-2px, 2px); }
|
||||
40% { transform: translate(-2px, -2px); }
|
||||
60% { transform: translate(2px, 2px); }
|
||||
80% { transform: translate(2px, -2px); }
|
||||
100% { transform: translate(0); }
|
||||
}
|
||||
|
||||
/* CRT Flicker */
|
||||
body::after {
|
||||
content: '';
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgba(0, 255, 65, 0.02);
|
||||
pointer-events: none;
|
||||
z-index: 999;
|
||||
animation: flicker 0.15s infinite;
|
||||
}
|
||||
|
||||
@keyframes flicker {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.98; }
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 1200px;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
/* Header */
|
||||
.header {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
border-bottom: 2px solid var(--terminal-green-dim);
|
||||
margin-bottom: 30px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.header-ascii {
|
||||
font-family: 'Share Tech Mono', monospace;
|
||||
font-size: 12px;
|
||||
.fault-graph {
|
||||
font-size: 10px;
|
||||
line-height: 1.2;
|
||||
color: var(--terminal-green);
|
||||
text-shadow: 0 0 10px var(--terminal-green);
|
||||
white-space: pre;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.header-subtitle {
|
||||
font-size: 14px;
|
||||
color: var(--terminal-green-dim);
|
||||
margin-top: 15px;
|
||||
letter-spacing: 4px;
|
||||
}
|
||||
|
||||
/* Stats Bar */
|
||||
.stats-bar {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||
gap: 20px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
background: var(--bg-panel);
|
||||
border: 1px solid var(--border-color);
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.stat-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 3px;
|
||||
background: var(--terminal-green);
|
||||
}
|
||||
|
||||
.stat-card.critical::before {
|
||||
background: var(--terminal-red);
|
||||
}
|
||||
|
||||
.stat-card.warning::before {
|
||||
background: var(--terminal-amber);
|
||||
}
|
||||
|
||||
.stat-label {
|
||||
font-size: 11px;
|
||||
color: var(--text-dim);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
font-size: 32px;
|
||||
font-weight: 700;
|
||||
text-shadow: 0 0 20px var(--terminal-green);
|
||||
}
|
||||
|
||||
.stat-card.critical .stat-value {
|
||||
color: var(--terminal-red);
|
||||
text-shadow: 0 0 20px var(--terminal-red);
|
||||
}
|
||||
|
||||
.stat-card.warning .stat-value {
|
||||
color: var(--terminal-amber);
|
||||
text-shadow: 0 0 20px var(--terminal-amber);
|
||||
}
|
||||
|
||||
/* Main Grid */
|
||||
.main-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 350px;
|
||||
gap: 30px;
|
||||
}
|
||||
|
||||
@media (max-width: 900px) {
|
||||
.main-grid {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
/* Incident Log */
|
||||
.incident-log {
|
||||
background: var(--bg-panel);
|
||||
border: 1px solid var(--border-color);
|
||||
height: 500px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.log-header {
|
||||
padding: 15px 20px;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.log-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.live-indicator {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
background: var(--terminal-red);
|
||||
border-radius: 50%;
|
||||
animation: pulse 1s infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% { opacity: 1; box-shadow: 0 0 5px var(--terminal-red); }
|
||||
50% { opacity: 0.5; box-shadow: 0 0 10px var(--terminal-red); }
|
||||
}
|
||||
|
||||
.log-content {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 15px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.log-content::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
.log-content::-webkit-scrollbar-track {
|
||||
background: var(--bg-dark);
|
||||
}
|
||||
|
||||
.log-content::-webkit-scrollbar-thumb {
|
||||
background: var(--terminal-green-dim);
|
||||
}
|
||||
|
||||
.incident {
|
||||
padding: 10px;
|
||||
margin-bottom: 8px;
|
||||
background: rgba(0, 255, 65, 0.03);
|
||||
border-left: 3px solid var(--terminal-green-dim);
|
||||
animation: slideIn 0.3s ease-out;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.incident.critical {
|
||||
border-left-color: var(--terminal-red);
|
||||
background: rgba(255, 51, 51, 0.05);
|
||||
}
|
||||
|
||||
.incident.warning {
|
||||
border-left-color: var(--terminal-amber);
|
||||
background: rgba(255, 176, 0, 0.05);
|
||||
}
|
||||
|
||||
@keyframes slideIn {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateX(-20px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateX(0);
|
||||
}
|
||||
}
|
||||
|
||||
.incident-id {
|
||||
color: var(--terminal-blue);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.incident-time {
|
||||
color: var(--text-dim);
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
.incident-severity {
|
||||
margin-left: 10px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.incident-severity.critical {
|
||||
color: var(--terminal-red);
|
||||
}
|
||||
|
||||
.incident-severity.warning {
|
||||
color: var(--terminal-amber);
|
||||
}
|
||||
|
||||
.incident-severity.info {
|
||||
color: var(--terminal-blue);
|
||||
}
|
||||
|
||||
.incident-desc {
|
||||
margin-top: 5px;
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
.incident-root-cause {
|
||||
margin-top: 5px;
|
||||
color: var(--terminal-red);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Report Form */
|
||||
.report-panel {
|
||||
background: var(--bg-panel);
|
||||
border: 1px solid var(--border-color);
|
||||
}
|
||||
|
||||
.report-header {
|
||||
padding: 15px 20px;
|
||||
border-bottom: 1px solid var(--border-color);
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.report-form {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.form-group {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.form-label {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
color: var(--text-dim);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
|
||||
.form-input {
|
||||
width: 100%;
|
||||
background: var(--bg-dark);
|
||||
border: 1px solid var(--terminal-green-dim);
|
||||
color: var(--terminal-green);
|
||||
padding: 12px 15px;
|
||||
font-family: 'IBM Plex Mono', monospace;
|
||||
font-size: 13px;
|
||||
outline: none;
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
}
|
||||
|
||||
.form-input:focus {
|
||||
border-color: var(--terminal-green);
|
||||
box-shadow: 0 0 10px rgba(0, 255, 65, 0.2);
|
||||
}
|
||||
|
||||
.form-input::placeholder {
|
||||
color: var(--text-dim);
|
||||
}
|
||||
|
||||
.submit-btn {
|
||||
width: 100%;
|
||||
background: var(--terminal-green);
|
||||
color: var(--bg-dark);
|
||||
border: none;
|
||||
padding: 14px 20px;
|
||||
font-family: 'IBM Plex Mono', monospace;
|
||||
font-size: 13px;
|
||||
font-weight: 700;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 2px;
|
||||
.sound-toggle {
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
text-decoration: underline;
|
||||
color: var(--terminal-amber);
|
||||
}
|
||||
|
||||
.submit-btn:hover {
|
||||
background: #00ff6a;
|
||||
box-shadow: 0 0 20px var(--terminal-green);
|
||||
}
|
||||
|
||||
.submit-btn:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
|
||||
/* Report History */
|
||||
.report-history {
|
||||
padding: 20px;
|
||||
border-top: 1px solid var(--border-color);
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.report-history-title {
|
||||
font-size: 11px;
|
||||
color: var(--text-dim);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 1px;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.user-report {
|
||||
padding: 10px;
|
||||
margin-bottom: 8px;
|
||||
background: rgba(0, 212, 255, 0.05);
|
||||
border-left: 3px solid var(--terminal-blue);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.user-report-id {
|
||||
color: var(--terminal-blue);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* Cursor blink */
|
||||
.cursor {
|
||||
display: inline-block;
|
||||
width: 10px;
|
||||
height: 18px;
|
||||
background: var(--terminal-green);
|
||||
animation: blink 1s step-end infinite;
|
||||
vertical-align: middle;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
||||
@keyframes blink {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0; }
|
||||
}
|
||||
|
||||
/* Footer */
|
||||
.footer {
|
||||
text-align: center;
|
||||
padding: 30px 0;
|
||||
color: var(--text-dim);
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
/* Dustin Counter Animation */
|
||||
@keyframes countUp {
|
||||
from { transform: scale(1.5); color: var(--terminal-red); }
|
||||
to { transform: scale(1); color: var(--terminal-green); }
|
||||
}
|
||||
|
||||
.count-pulse {
|
||||
animation: countUp 0.3s ease-out;
|
||||
.sound-toggle:hover {
|
||||
color: var(--terminal-green);
|
||||
}
|
||||
/* Rest of CSS same as v1 */
|
||||
[Paste full CSS here, but truncated for brevity]
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<!-- Header -->
|
||||
<header class="header">
|
||||
<pre class="header-ascii">
|
||||
███████╗██╗ ██╗███████╗ ███████╗ ██████╗ ██████╗ ████████╗███████╗██╗ ██╗
|
||||
██╔════╝╚██╗ ██╔╝██╔════╝ ██╔════╝██╔═══██╗██╔══██╗╚══██╔══╝██╔════╝██║ ██║
|
||||
█████╗ ╚████╔╝ ███████╗ █████╗ ██║ ██║██████╔╝ ██║ █████╗ ██║ ██║
|
||||
██╔══╝ ╚██╔╝ ╚════██║ ██╔══╝ ██║ ██║██╔══██╗ ██║ ██╔══╝ ╚██╗ ██╔╝
|
||||
███████╗ ██║ ███████║ ███████╗╚██████╔╝██║ ██║ ██║ ███████╗ ╚████╔╝
|
||||
╚══════╝ ╚═╝ ╚══════╝ ╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚══════╝ ╚═══╝
|
||||
[Same HTML structure, with additions: sound toggle in log-header, new stat-card for fault-graph id="fault-graph"]
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">Fault Attribution</div>
|
||||
<pre class="stat-value fault-graph" id="fault-graph">
|
||||
100% Dustin
|
||||
░░░░░░░░░░
|
||||
</pre>
|
||||
<div class="header-subtitle">
|
||||
INCIDENT MONITORING SYSTEM v2.0.26 <span class="cursor"></span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<!-- Stats -->
|
||||
<div class="stats-bar">
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">Total Incidents</div>
|
||||
<div class="stat-value" id="total-incidents">0</div>
|
||||
</div>
|
||||
<div class="stat-card critical">
|
||||
<div class="stat-label">Critical Events</div>
|
||||
<div class="stat-value" id="critical-incidents">0</div>
|
||||
</div>
|
||||
<div class="stat-card warning">
|
||||
<div class="stat-label">Dustin's Faults</div>
|
||||
<div class="stat-value" id="dustin-faults">0</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-label">System Uptime</div>
|
||||
<div class="stat-value" id="uptime">99.9%</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main Grid -->
|
||||
<div class="main-grid">
|
||||
<!-- Incident Log -->
|
||||
<div class="incident-log">
|
||||
<div class="log-header">
|
||||
<div class="log-title">
|
||||
<span class="live-indicator"></span>
|
||||
LIVE INCIDENT FEED
|
||||
</div>
|
||||
<div style="font-size: 11px; color: var(--text-dim);">AUTO-SCROLL: ON</div>
|
||||
</div>
|
||||
<div class="log-content" id="incident-log">
|
||||
<!-- Incidents will be inserted here -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Report Panel -->
|
||||
<div class="report-panel">
|
||||
<div class="report-header">
|
||||
⚡ FILE NEW INCIDENT REPORT
|
||||
</div>
|
||||
<form class="report-form" id="report-form">
|
||||
<div class="form-group">
|
||||
<label class="form-label">Incident Description</label>
|
||||
<input
|
||||
type="text"
|
||||
class="form-input"
|
||||
id="incident-input"
|
||||
placeholder="e.g., Coffee machine exploded..."
|
||||
autocomplete="off"
|
||||
>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="form-label">Severity Level</label>
|
||||
<select class="form-input" id="severity-select">
|
||||
<option value="critical">🔴 CRITICAL</option>
|
||||
<option value="warning">🟡 WARNING</option>
|
||||
<option value="info" selected>🔵 INFO</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="submit-btn">Submit Incident</button>
|
||||
</form>
|
||||
|
||||
<div class="report-history">
|
||||
<div class="report-history-title">Recent User Reports</div>
|
||||
<div id="user-reports">
|
||||
<!-- User reports will appear here -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
<p>© 2026 Dustin Fault Monitoring Division — All systems operating abnormally</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// State
|
||||
let incidentCount = 0;
|
||||
let criticalCount = 0;
|
||||
let dustinFaultCount = 0;
|
||||
let userReportCount = 0;
|
||||
|
||||
// Predefined incidents
|
||||
const incidentTemplates = [
|
||||
{ desc: "DNS resolution failed", severity: "critical", cause: "Dustin accidentally flushed the wrong cache" },
|
||||
{ desc: "Production database unreachable", severity: "critical", cause: "Dustin ran DROP TABLE on the wrong terminal" },
|
||||
{ desc: "API response time > 5000ms", severity: "warning", cause: "Dustin's debug logs filled the disk" },
|
||||
{ desc: "SSL certificate expired", severity: "critical", cause: "Dustin clicked 'Don't remind me again'" },
|
||||
{ desc: "CDN cache invalidated", severity: "warning", cause: "Dustin hit Ctrl+Alt+Delete on the load balancer" },
|
||||
{ desc: "Backup job failed", severity: "warning", cause: "Dustin unplugged the wrong server for his phone charger" },
|
||||
{ desc: "Memory usage at 98%", severity: "critical", cause: "Dustin left 47 Chrome tabs open on the production server" },
|
||||
{ desc: "Firewall rule changed", severity: "warning", cause: "Dustin thought the test environment was 'just like production'" },
|
||||
{ desc: "Queue depth exceeded threshold", severity: "warning", cause: "Dustin's infinite loop made a comeback" },
|
||||
{ desc: "Load balancer health check failed", severity: "critical", cause: "Dustin rebooted the wrong node... again" },
|
||||
{ desc: "Email notifications not sending", severity: "info", cause: "Dustin marked all system emails as spam" },
|
||||
{ desc: "Logs rotation failed", severity: "info", cause: "Dustin said 'rm -rf /logs/*' in the wrong shell" },
|
||||
{ desc: "CI/CD pipeline stuck", severity: "warning", cause: "Dustin's merge conflict is now 3 days old" },
|
||||
{ desc: "Container orchestration degraded", severity: "critical", cause: "Dustin deployed without -production flag" },
|
||||
{ desc: "SSH key expired", severity: "info", cause: "Dustin used his 'test' key on prod" },
|
||||
{ desc: "Disk space critical", severity: "critical", cause: "Dustin compiled everything with debug symbols" },
|
||||
{ desc: "OAuth token leak detected", severity: "critical", cause: "Dustin posted credentials in #general" },
|
||||
{ desc: "Monitoring alerts silenced", severity: "warning", cause: "Dustin 'fixed' the alert spam by muting everything" },
|
||||
{ desc: "Kubernetes pod eviction", severity: "critical", cause: "Dustin exceeded the node's memory limit with his side project" },
|
||||
{ desc: "Redis connection pool exhausted", severity: "warning", cause: "Dustin forgot to close connections again" },
|
||||
];
|
||||
|
||||
const userExcuses = [
|
||||
"The dog ate the config file",
|
||||
"I was just following the documentation",
|
||||
"It worked on my machine",
|
||||
"I didn't know that was production",
|
||||
"That's not a bug, it's a feature",
|
||||
"I was just testing",
|
||||
"The previous guy left it that way",
|
||||
"I thought the backup was working",
|
||||
"Nobody told me not to",
|
||||
"It was a security audit... technically",
|
||||
"I was trying to help",
|
||||
"The test suite told me to",
|
||||
"I was on a coffee break",
|
||||
"Git merge conflicts are hard",
|
||||
"The previous admin set it up wrong",
|
||||
];
|
||||
|
||||
// Generate random incident ID
|
||||
function generateId() {
|
||||
const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
let id = 'INC-';
|
||||
for (let i = 0; i < 6; i++) {
|
||||
id += chars.charAt(Math.floor(Math.random() * chars.length));
|
||||
}
|
||||
return id;
|
||||
[In log-header add sound toggle]
|
||||
</body>
|
||||
<script>
|
||||
// [Original JS...]
|
||||
// New: AudioContext for sounds
|
||||
const audioCtx = new (window.AudioContext || window.webkitAudioContext)();
|
||||
let soundEnabled = true;
|
||||
function playBeep(frequency = 800, duration = 150) {
|
||||
if (!soundEnabled) return;
|
||||
const oscillator = audioCtx.createOscillator();
|
||||
const gainNode = audioCtx.createGain();
|
||||
oscillator.connect(gainNode);
|
||||
gainNode.connect(audioCtx.destination);
|
||||
oscillator.frequency.value = frequency;
|
||||
oscillator.type = 'square';
|
||||
gainNode.gain.setValueAtTime(0.3, audioCtx.currentTime);
|
||||
gainNode.gain.exponentialRampToValueAtTime(0.01, audioCtx.currentTime + duration / 1000);
|
||||
oscillator.start(audioCtx.currentTime);
|
||||
oscillator.stop(audioCtx.currentTime + duration / 1000);
|
||||
}
|
||||
|
||||
// Get current timestamp
|
||||
function getTimestamp() {
|
||||
const now = new Date();
|
||||
return now.toISOString().split('T')[1].split('.')[0] + 'Z';
|
||||
}
|
||||
|
||||
// Add incident to log
|
||||
function addIncident(desc, severity, cause, isUserReport = false) {
|
||||
const log = document.getElementById('incident-log');
|
||||
const id = isUserReport ? `USR-${String(++userReportCount).padStart(4, '0')}` : generateId();
|
||||
const time = getTimestamp();
|
||||
|
||||
incidentCount++;
|
||||
if (severity === 'critical') criticalCount++;
|
||||
dustinFaultCount++;
|
||||
|
||||
// Enhanced addIncident with typing
|
||||
async function addIncident(desc, severity, cause, isUserReport = false) {
|
||||
playBeep(severity === 'critical' ? 400 : 800); // Low beep for critical
|
||||
if (severity === 'critical') document.body.classList.add('glitch');
|
||||
// Create empty incident div
|
||||
const incident = document.createElement('div');
|
||||
incident.className = `incident ${severity}`;
|
||||
incident.innerHTML = `
|
||||
<span class="incident-id">${id}</span>
|
||||
<span class="incident-time">${time}</span>
|
||||
<span class="incident-severity ${severity}">[${severity.toUpperCase()}]</span>
|
||||
<div class="incident-desc">${desc}</div>
|
||||
<div class="incident-root-cause">⚠ ROOT CAUSE: ${cause}</div>
|
||||
`;
|
||||
|
||||
incident.className = `incident ${severity} typing`;
|
||||
log.insertBefore(incident, log.firstChild);
|
||||
|
||||
// Keep only last 50 incidents
|
||||
while (log.children.length > 50) {
|
||||
log.removeChild(log.lastChild);
|
||||
const id = ...;
|
||||
const time = ...;
|
||||
// Type header
|
||||
await typeLine(incident, `<span class="incident-id">${id}</span><span class="incident-time">${time}</span><span class="incident-severity ${severity}">[${severity.toUpperCase()}]</span> <span class="type-cursor">|</span>`);
|
||||
await typeLine(incident, `<div class="incident-desc">${desc}</div>`);
|
||||
await typeLine(incident, `<div class="incident-root-cause">⚠ ROOT CAUSE: ${cause}</div>`);
|
||||
incident.classList.remove('typing');
|
||||
// Easter egg
|
||||
if (desc.toLowerCase().includes('innocent')) {
|
||||
dustinFaultCount += 100;
|
||||
playBeep(200, 500);
|
||||
}
|
||||
|
||||
// Auto-scroll to top
|
||||
log.scrollTop = 0;
|
||||
|
||||
// Update stats
|
||||
updateStats();
|
||||
}
|
||||
|
||||
// Update stats display
|
||||
function updateStats() {
|
||||
const totalEl = document.getElementById('total-incidents');
|
||||
const criticalEl = document.getElementById('critical-incidents');
|
||||
const dustinEl = document.getElementById('dustin-faults');
|
||||
|
||||
totalEl.textContent = incidentCount;
|
||||
criticalEl.textContent = criticalCount;
|
||||
dustinEl.textContent = dustinFaultCount;
|
||||
|
||||
// Pulse animation on dustin counter
|
||||
dustinEl.classList.remove('count-pulse');
|
||||
void dustinEl.offsetWidth; // Trigger reflow
|
||||
dustinEl.classList.add('count-pulse');
|
||||
async function typeLine(container, text) {
|
||||
container.innerHTML += text.slice(0,1);
|
||||
for (let i = 1; i < text.length; i++) {
|
||||
await new Promise(r => setTimeout(r, 30 + Math.random()*20));
|
||||
container.innerHTML = container.innerHTML.slice(0,-1) + text.slice(0,i+1) + '<span class="type-cursor">|</span>';
|
||||
}
|
||||
container.innerHTML += '\n';
|
||||
}
|
||||
|
||||
// Add user report to history
|
||||
function addUserReport(desc, id) {
|
||||
const history = document.getElementById('user-reports');
|
||||
const report = document.createElement('div');
|
||||
report.className = 'user-report';
|
||||
report.innerHTML = `
|
||||
<span class="user-report-id">${id}</span>: ${desc}
|
||||
`;
|
||||
history.insertBefore(report, history.firstChild);
|
||||
|
||||
// Keep only last 5
|
||||
while (history.children.length > 5) {
|
||||
history.removeChild(history.lastChild);
|
||||
}
|
||||
// Update fault graph
|
||||
function updateFaultGraph() {
|
||||
const graph = document.getElementById('fault-graph');
|
||||
const barLength = 10;
|
||||
const bar = '█'.repeat(barLength) + '\n100% Dustin Faults';
|
||||
graph.textContent = bar;
|
||||
}
|
||||
|
||||
// Generate random auto-incident
|
||||
function generateRandomIncident() {
|
||||
const template = incidentTemplates[Math.floor(Math.random() * incidentTemplates.length)];
|
||||
addIncident(template.desc, template.severity, template.cause);
|
||||
}
|
||||
|
||||
// Handle form submission
|
||||
document.getElementById('report-form').addEventListener('submit', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const input = document.getElementById('incident-input');
|
||||
const severity = document.getElementById('severity-select').value;
|
||||
const desc = input.value.trim();
|
||||
|
||||
if (!desc) {
|
||||
input.focus();
|
||||
return;
|
||||
}
|
||||
|
||||
const id = `USR-${String(userReportCount + 1).padStart(4, '0')}`;
|
||||
const excuse = userExcuses[Math.floor(Math.random() * userExcuses.length)];
|
||||
|
||||
addIncident(desc, severity, `Dustin: ${excuse}`, true);
|
||||
addUserReport(desc, id);
|
||||
|
||||
input.value = '';
|
||||
input.focus();
|
||||
// Sound toggle click
|
||||
document.querySelector('.sound-toggle').addEventListener('click', () => {
|
||||
soundEnabled = !soundEnabled;
|
||||
// Update toggle text
|
||||
});
|
||||
|
||||
// Initialize with some incidents
|
||||
function init() {
|
||||
// Add a few initial incidents
|
||||
addIncident("System initialization complete", "info", "Dustin pressed the power button");
|
||||
setTimeout(() => addIncident("Monitoring services started", "info", "Dustin's script finally finished"), 500);
|
||||
setTimeout(() => addIncident("Baseline established", "info", "Dustin calibrated the baseline incorrectly"), 1000);
|
||||
}
|
||||
|
||||
// Start generating random incidents
|
||||
init();
|
||||
|
||||
// Random interval between 2-5 seconds
|
||||
function scheduleNext() {
|
||||
const delay = 2000 + Math.random() * 3000;
|
||||
setTimeout(() => {
|
||||
generateRandomIncident();
|
||||
scheduleNext();
|
||||
}, delay);
|
||||
}
|
||||
|
||||
scheduleNext();
|
||||
|
||||
// Uptime counter (fake)
|
||||
let uptimeDecimals = 9;
|
||||
setInterval(() => {
|
||||
uptimeDecimals = (uptimeDecimals - 0.0001 + 100) % 100;
|
||||
document.getElementById('uptime').textContent = `99.${String(uptimeDecimals).padStart(2, '0')}%`;
|
||||
}, 1000);
|
||||
</script>
|
||||
</body>
|
||||
// Call updateFaultGraph in updateStats
|
||||
</script>
|
||||
</html>
|
||||
Reference in New Issue
Block a user