The user wants a "code provenance explorer" linking commits, build artifacts, deployment manifests, and runtime telemetry for regulatory traceability.
They haven't provided specific design constraints, but my persona is a "prize-winning frontend engineer and visual designer" specializing in "Neo-Brutalism" and "Y2K" aesthetics.
However, the request is for a "code provenance explorer," which is a developer/engineering tool. Applying a highly chaotic, glitchy, neon-styled aesthetic might be inappropriate for a professional "regulatory traceability" tool unless specifically requested.
But the prompt says: "You are a code expert... generate accurate and professional responses." It also includes a huge system instruction about the persona.
Wait, I need to re-read the user prompt. The user says:
"Develop a code provenance explorer that links commits, build artifacts, deployment manifests, and runtime telemetry for regulatory traceability."
That's just a description of a task. There's no explicit instruction to apply the gsap or visual style. However, the System Prompt (which is hidden from the user, but I see) sets a very specific persona and style. The instruction says: "You shouldn't explicitly state that you are an AI... You should design according to the following principles...".
So I must apply the Neo-Brutalism/Y2K style to the code I generate. But I need to build a functional tool (or at least a prototype UI) for a code provenance explorer.
I need to make a complex, interactive HTML page using Tailwind, GSAP, Canvas maybe, with glitch effects, hard borders, high contrast, etc. It must be "executable for demonstration."
So I will create a single HTML file with embedded CSS and JS that implements a UI for exploring code provenance. I'll create a mock data structure linking commits, builds, deployments, and telemetry.
Key features to visualize:
- A graph or timeline view connecting nodes.
- A list of commits.
- Artifacts details.
- Deployment status.
- Telemetry logs.
Given the style, I'll use hard black borders, acid colors (e.g., neon green, hot pink, bright yellow), raw typography (Courier, Times New Roman, maybe pixel fonts if I can import one, but I'll use system fonts with CSS to simulate). I'll use mix-blend-mode: difference for an edge effect. I will incorporate glitch animations with CSS keyframes. I'll use GSAP for some "stepped" animations on page load.
I'll need to include Tailwind via CDN. Also GSAP via CDN. And maybe a canvas element for a background effect or a custom graph drawing.
I'll structure the page with a header (big, bold, overlapping), a main area with a sidebar for filters or list, and a central canvas/graph zone, plus details panels.
Since I need to keep it in a single file and not rely on external assets (except libraries via CDN), I'll inline everything.
Plan:
- HTML skeleton with Tailwind classes.
- Custom CSS for glitch effects, scrollbar styling, raw font choices.
- JS:
- Mock data: commit objects with hashes, messages, authors, timestamps; build artifacts with IDs, commit linkage; deployment manifests with environments; telemetry with metrics.
- Visualization: using HTML canvas or DOM elements positioned absolutely. I'll use a force-directed graph style? Or perhaps a vertical cascade timeline, as that's easier with DOM elements and CSS/GSAP.
- Interactions: clicking a node opens details side panel. Hover effects.
- GSAP animations for entrance: staggering nodes, maybe a glitch effect on title.
I'll define a color palette: black background, white text, with borders. Accent colors: #FF00FF (magenta), #00FF00 (lime), #00FFFF (cyan), #FFFF00 (yellow).
Apply Neo-Brutalism: thick solid borders, box shadows are often replaced with double borders or solid offsets, but I can use box-shadow with no blur (hard shadow). Or just 2px black borders.
Use large fonts: "COMMIT HISTORY", "BUILD ARTIFACTS", etc.
I'll create a "Provenance Explorer" title with a marquee effect below it.
Let's design a layout:
- Header: huge title spanning width, maybe with a glitch effect.
- Sidebar (left): list of commits (or maybe a filter/search). But for simplicity, I'll have a left column showing recent commits, each as a block with hash, message.
- Main (center): a visual graph connecting them. I'll use an SVG or canvas. I'll draw lines with hard edges using canvas.
- Right panel: details of selected node (commit/build/deploy/telemetry) in a sticky panel.
I'll generate about 10 commits, each produces a build artifact. Some builds are deployed. Telemetry associated with deployments.
I'll implement navigation: clicking a commit highlights the thread. Or clicking a build shows details.
I'll use GSAP to animate the lines being drawn on canvas.
Let's start coding.
First, include Tailwind via CDN (script tag). Then add GSAP.
I'll add a canvas element with id="graphCanvas". I'll compute positions for nodes (commits as circles? No, boxes for brutalist style). I'll use rectangles with hard borders.
I'll use a simple layout: commits on left, builds in middle, deployments on right, telemetry below? Or connected via lines arbitrarily.
Better: a vertical timeline on the left side, with branching lines to artifacts, then to deployment.
I'll fix position: commits in a column at x=150, builds at x=450, deployments at x=750, telemetry inside deployment. Draw connecting lines.
I'll create arrays of data: commits, builds (each linked to commit), deployments (each linked to build), telemetry (linked to deployment).
I'll use plain JS to draw lines on canvas and nodes as HTML divs positioned absolutely based on their y positions. I'll use a simple algorithm: each node gets an index and a top position based on index * spacing.
But for a more organic look, I could use a random offset? But regulatory traceability should be clear. I'll keep it grid-like but with overlapping elements and maybe some misalignment for that Y2K feel.
I'll make the IDs look like hash values with random hex.
I'll add "glitch" to the commit messages using CSS on hover.
Alright, start coding.
Here is a complete, single-file HTML solution for a Code Provenance Explorer built with a Neo-Brutalism / Y2K aesthetic. It uses Tailwind CSS for layout, GSAP for animations, and HTML Canvas for dynamic graph drawing. The tool visualizes the chain from commits to build artifacts, deployment manifests, and runtime telemetry in a regulatory traceability context.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>PROVENANCE // EXPLORER</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
<style>
/* NEUTRAL FONTS: MONOSPACE & SERIF */
@import url('https://fonts.googleapis.com/css2?family=Courier+Prime:wght@400;700&family=Rock+Salt&display=swap');
:root {
--c-acid-lime: #ccff00;
--c-acid-pink: #ff00ff;
--c-acid-cyan: #00ffff;
--c-acid-yellow: #ffff00;
--c-black: #000000;
--c-white: #ffffff;
}
body {
background-color: var(--c-black);
color: var(--c-white);
font-family: 'Courier New', Courier, monospace;
overflow-x: hidden;
margin: 0;
cursor: crosshair;
}
/* RAW TYPOGRAPHY */
.font-display {
font-family: 'Rock Salt', cursive;
letter-spacing: -0.05em;
}
.font-mono {
font-family: 'Courier Prime', monospace;
}
/* GLITCH EFFECT CSS */
.glitch-wrapper {
position: relative;
display: inline-block;
}
.glitch {
position: relative;
color: var(--c-white);
mix-blend-mode: screen;
}
.glitch::before,
.glitch::after {
content: attr(data-text);
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: var(--c-black);
}
.glitch::before {
left: 2px;
text-shadow: -1px 0 var(--c-acid-pink);
clip-path: inset(44% 0 61% 0);
animation: glitch-anim-1 2s infinite linear alternate-reverse;
}
.glitch::after {
left: -2px;
text-shadow: -1px 0 var(--c-acid-cyan);
clip-path: inset(20% 0 10% 0);
animation: glitch-anim-2 2.5s infinite linear alternate-reverse;
}
@keyframes glitch-anim-1 {
0% { clip-path: inset(80% 0 0 0); }
20% { clip-path: inset(10% 0 80% 0); }
40% { clip-path: inset(40% 0 50% 0); }
60% { clip-path: inset(20% 0 60% 0); }
80% { clip-path: inset(10% 0 30% 0); }
100% { clip-path: inset(60% 0 10% 0); }
}
@keyframes glitch-anim-2 {
0% { clip-path: inset(10% 0 60% 0); }
20% { clip-path: inset(80% 0 5% 0); }
40% { clip-path: inset(40% 0 20% 0); }
60% { clip-path: inset(10% 0 80% 0); }
80% { clip-path: inset(30% 0 10% 0); }
100% { clip-path: inset(70% 0 20% 0); }
}
/* RAW BORDERS AND SHADOWS */
.brutal-border {
border: 3px solid var(--c-black);
box-shadow: 4px 4px 0 var(--c-black);
}
.brutal-border-light {
border: 2px solid var(--c-white);
box-shadow: 2px 2px 0 var(--c-black);
}
/* SCROLLBAR */
::-webkit-scrollbar {
width: 12px;
}
::-webkit-scrollbar-track {
background: var(--c-black);
}
::-webkit-scrollbar-thumb {
background: var(--c-acid-lime);
border: 2px solid var(--c-black);
}
/* MARQUEE */
.marquee {
overflow: hidden;
white-space: nowrap;
box-sizing: border-box;
}
.marquee span {
display: inline-block;
padding-left: 100%;
animation: marquee 15s linear infinite;
}
@keyframes marquee {
0% { transform: translate(0, 0); }
100% { transform: translate(-100%, 0); }
}
/* NODE STYLE */
.node {
position: absolute;
cursor: pointer;
transition: transform 0.1s;
transform-origin: center;
z-index: 10;
}
.node:hover {
transform: scale(1.1) rotate(2deg);
z-index: 50;
mix-blend-mode: difference;
}
.node.selected {
outline: 4px solid var(--c-acid-yellow);
z-index: 50;
}
/* CANVAS LAYER */
#graphCanvas {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
pointer-events: none;
}
/* DETAILS PANEL */
.detail-panel {
max-height: 80vh;
overflow-y: auto;
}
.detail-code {
font-family: 'Courier New', monospace;
word-break: break-all;
}
</style>
</head>
<body class="antialiased selection:bg-acid-lime selection:text-black">
<!-- BACKGROUND CANVAS FOR LINES -->
<canvas id="graphCanvas"></canvas>
<!-- HEADER -->
<header class="relative w-full p-4 border-b-4 border-white z-30 bg-black">
<div class="flex items-center justify-between">
<div class="glitch-wrapper">
<h1 class="text-6xl md:text-9xl font-display italic text-white mix-blend-difference glitch" data-text="PROVENANCE">
PROVENANCE
</h1>
</div>
<div class="flex flex-col items-end">
<div class="text-sm md:text-lg font-bold bg-acid-lime text-black px-2 border-2 border-black">
REGULATORY TRACEABILITY MODE
</div>
<div class="marquee text-acid-pink text-sm font-mono mt-1 w-full text-right">
<span>*** COMMIT ID: a1b2c3d4 *** BUILD FAILED *** DEPLOYMENT ROLLED BACK *** TELEMETRY ANOMALY DETECTED *** </span>
</div>
</div>
</div>
<div class="mt-2 border-t-2 border-white pt-2 flex gap-4 text-xs md:text-sm font-mono">
<span class="bg-white text-black px-1">SYS.STATUS: ONLINE</span>
<span class="border border-white px-1">LINK_INTEGRITY: 100%</span>
<span class="border border-white px-1">AUDIT_LOG: ENABLED</span>
</div>
</header>
<!-- MAIN CONTENT LAYOUT -->
<main class="relative z-20 flex h-[calc(100vh-140px)]">
<!-- LEFT SIDEBAR: COMMIT LIST -->
<aside class="w-1/4 border-r-4 border-white bg-gray-900 overflow-y-auto p-2 space-y-2">
<h2 class="text-2xl font-mono text-acid-cyan border-b-2 border-acid-cyan pb-1 mb-2">COMMIT HISTORY</h2>
<div id="commitList" class="space-y-2">
<!-- Populated by JS -->
</div>
</aside>
<!-- CENTER: GRAPH CONTAINER -->
<section class="flex-1 relative overflow-hidden bg-black">
<!-- Nodes will be appended here absolutely -->
</section>
<!-- RIGHT SIDEBAR: DETAILS PANEL -->
<aside class="w-1/3 border-l-4 border-white bg-gray-900 p-4 overflow-y-auto detail-panel">
<div id="detailPanel" class="h-full flex flex-col">
<div class="mb-4 border-b-4 border-white pb-2">
<h2 class="text-3xl font-mono text-acid-yellow uppercase" id="detailTitle">SELECT NODE</h2>
<span class="text-sm text-gray-400" id="detailType">Waiting for interaction...</span>
</div>
<div id="detailContent" class="space-y-4 text-sm md:text-base font-mono">
<p class="italic text-gray-500">Click on any node in the graph or list to view provenance data, artifact signatures, and telemetry.</p>
</div>
</div>
</aside>
</main>
<!-- FOOTER MARQUEE -->
<footer class="relative z-30 border-t-4 border-white bg-acid-lime text-black py-1">
<div class="marquee text-2xl font-mono font-bold">
<span>!!! ALL ACTIONS ARE LOGGED FOR COMPLIANCE !!! TRACEABILITY CHAIN IS CRITICAL !!! </span>
</div>
</footer>
<script>
// ==========================================
// DATA GENERATION (MOCK PROVENANCE DATA)
// ==========================================
const colors = [
'bg-acid-lime', 'bg-acid-pink', 'bg-acid-cyan', 'bg-acid-yellow', 'bg-red-500', 'bg-blue-500'
];
function randomHash(length=8) {
const chars = '0123456789abcdef';
let result = '';
for(let i=0; i<length; i++) result += chars[Math.floor(Math.random()*chars.length)];
return result;
}
function generateData() {
const commits = [];
const builds = [];
const deployments = [];
const telemetry = [];
// Create timeline of 12 commits
for(let i=0; i<12; i++) {
const commitId = `c${randomHash(7)}`;
const buildId = `b${randomHash(7)}`;
const deployId = i < 8 ? `d${randomHash(7)}` : null; // only some deployed
const telemetryId = deployId ? `t${randomHash(7)}` : null;
commits.push({
id: commitId,
index: i,
message: `feat(policy): update compliance rule set #${i+1}`,
author: `dev_${['alpha','beta','gamma','delta'][i%4]}`,
timestamp: new Date(Date.now() - i * 3600000*5).toISOString(),
color: colors[i % colors.length]
});
builds.push({
id: commitId, // for linking
buildId: buildId,
status: i % 5 === 0 ? 'FAILED' : 'SUCCESS',
artifactSize: Math.floor(Math.random()*200 + 50) + ' MB',
pipeline: 'ci/prod.yml'
});
if(deployId) {
deployments.push({
id: buildId,
deployId: deployId,
env: i % 2 === 0 ? 'PRODUCTION' : 'STAGING',
status: 'RUNNING',
manifest: `k8s_${i}.yaml`
});
telemetry.push({
id: deployId,
metrics: {
latency: Math.floor(Math.random()*100 + 20) + 'ms',
errorRate: (Math.random()*0.05).toFixed(3) + '%',
rps: Math.floor(Math.random()*500 + 100)
},
alerts: Math.random() > 0.7 ? ['CPU_THROTTLE'] : []
});
}
}
return { commits, builds, deployments, telemetry };
}
const data = generateData();
let selectedNode = null;
// ==========================================
// LAYOUT CONFIGURATION
// ==========================================
const config = {
columns: {
commit: { x: 150, label: 'COMMIT' },
build: { x: 450, label: 'BUILD ARTIFACT' },
deploy: { x: 750, label: 'DEPLOYMENT' },
tele: { x: 1050, label: 'TELEMETRY' }
},
rowHeight: 80,
nodeHeight: 80,
nodeWidth: 160
};
// Map data to node positions (simple linear mapping based on commit index)
function assignPositions() {
data.commits.forEach(commit => {
commit.y = config.rowHeight * commit.index + 120; // offset from top
commit.column = 'commit';
});
data.builds.forEach(build => {
const commit = data.commits.find(c => c.id === build.id);
if(commit) {
build.y = commit.y;
build.column = 'build';
}
});
data.deployments.forEach(deploy => {
const build = data.builds.find(b => b.buildId === deploy.id);
if(build) {
deploy.y = build.y;
deploy.column = 'deploy';
}
});
data.telemetry.forEach(tele => {
const deploy = data.deployments.find(d => d.deployId === tele.id);
if(deploy) {
tele.y = deploy.y;
tele.column = 'tele';
}
});
// Combine all nodes for rendering
return [...data.commits, ...data.builds, ...data.deployments, ...data.telemetry];
}
const nodes = assignPositions();
// ==========================================
// CANVAS GRAPH DRAWING
// ==========================================
const canvas = document.getElementById('graphCanvas');
const ctx = canvas.getContext('2d');
let animationProgress = 0;
function resizeCanvas() {
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
drawGraph();
}
function drawGraph() {
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.lineWidth = 2;
ctx.strokeStyle = '#ffffff';
// Draw connections
data.commits.forEach(commit => {
const build = data.builds.find(b => b.id === commit.id);
if(build) {
drawArrow(commit, build);
const deploy = data.deployments.find(d => d.id === build.buildId);
if(deploy) {
drawArrow(build, deploy);
const tele = data.telemetry.find(t => t.id === deploy.deployId);
if(tele) drawArrow(deploy, tele);
}
}
});
}
function drawArrow(start, end) {
ctx.beginPath();
const sx = config.columns[start.column].x + config.nodeWidth/2;
const sy = start.y;
const ex = config.columns[end.column].x + config.nodeWidth/2;
const ey = end.y;
// Draw line with GSAP animation along it? Simpler: draw full line with dashes?
// We'll do static lines since canvas redraw is expensive for GSAP per frame but we can animate dash offset.
ctx.setLineDash([]);
ctx.moveTo(sx, sy);
ctx.lineTo(ex, ey);
ctx.stroke();
}
// ==========================================
// DOM NODE GENERATION & INITIALIZATION
// ==========================================
const mainSection = document.querySelector('main section');
function createNodeElement(node) {
const col = config.columns[node.column];
const div = document.createElement('div');
div.className = `node brutal-border bg-black text-white p-2 font-mono text-xs w-40 h-20 flex flex-col justify-between`;
div.style.left = col.x + 'px';
div.style.top = node.y + 'px';
div.dataset.id = node.id || node.buildId || node.deployId;
div.dataset.type = node.column; // commit, build, deploy, tele
// Content based on type
if(node.column === 'commit') {
div.classList.add(node.color); // background tint
div.innerHTML = `
<div class="text-[10px] opacity-70">${node.timestamp.split('T')[0]}</div>
<div class="label font-bold text-sm leading-tight">${node.message.substring(0,20)}...</div>
<div class="text-[10px]">HASH: ${node.id}</div>
`;
} else if(node.column === 'build') {
const statusColor = node.status === 'SUCCESS' ? 'text-green-400' : 'text-red-500';
div.innerHTML = `
<div class="text-[10px]">ARTIFACT</div>
<div class="label text-xs">${node.buildId}</div>
<div class="flex justify-between text-[10px]">
<span>${node.artifactSize}</span>
<span class="${statusColor} font-bold">${node.status}</span>
</div>
`;
} else if(node.column === 'deploy') {
div.innerHTML = `
<div class="text-[10px]">MANIFEST</div>
<div class="label text-xs">${node.deployId}</div>
<div class="text-[10px]">${node.env}</div>
`;
} else if(node.column === 'tele') {
div.innerHTML = `
<div class="text-[10px]">TELEMETRY</div>
<div class="label text-xs">${node.id}</div>
<div class="text-[10px]">RPS: ${node.metrics.rps}</div>
`;
}
// Click event
div.addEventListener('click', (e) => {
selectNode(div, node);
});
return div;
}
// ==========================================
// INTERACTIONS & DETAIL PANEL
// ==========================================
function selectNode(domEl, node) {
// Remove previous selection
if(selectedNode) selectedNode.classList.remove('selected');
selectedNode = domEl;
selectedNode.classList.add('selected');
// Update Detail Panel
updateDetailPanel(node);
}
function updateDetailPanel(node) {
const titleEl = document.getElementById('detailTitle');
const typeEl = document.getElementById('detailType');
const contentEl = document.getElementById('detailContent');
titleEl.textContent = node.column.toUpperCase();
titleEl.className = `text-3xl font-mono uppercase mb-2 ${
node.column === 'commit' ? 'text-acid-cyan' :
node.column === 'build' ? 'text-acid-pink' :
node.column === 'deploy' ? 'text-acid-lime' : 'text-acid-yellow'
}`;
let typeText = '';
let html = '';
if(node.column === 'commit') {
typeText = `Commit ID: ${node.id} | Authored by ${node.author}`;
html = `
<div class="border border-white p-2 bg-black">
<p class="mb-2"><strong>MESSAGE:</strong><br>${node.message}</p>
<p><strong>TIMESTAMP:</strong><br>${node.timestamp}</p>
</div>
<div class="mt-2">
<h3 class="text-acid-lime border-b-2 border-acid-pink pb-1">LINKED ARTIFACTS</h3>
<ul class="list-disc pl-4">
<li>Build Pipeline: <span class="text-white">${node.pipeline || 'ci/prod.yml'}</span></li>
<li>Hash Algo: SHA-256</li>
<li>Signer: code signing service</li>
</ul>
</div>
`;
} else if(node.column === 'build') {
typeText = `Build ID: ${node.buildId}`;
html = `
<div class="border border-white p-2 bg-black mb-2">
<p><strong>STATUS:</strong> <span class="${node.status==='SUCCESS'?'text-green-400':'text-red-500'}">${node.status}</span></p>
<p><strong>ARTIFACT SIZE:</strong> ${node.artifactSize}</p>
<p><strong>SOURCE COMMIT:</strong> <a class="text-acid-cyan underline cursor-pointer" onclick="triggerCommitClick('${node.id}')">${node.id}</a></p>
</div>
<div class="mt-2">
<h3 class="text-acid-lime border-b-2 border-acid-pink pb-1">IMMUTABLE METADATA</h3>
<pre class="text-xs overflow-auto bg-gray-800 p-2 mt-1">{
"builder": "gitlab-runner@20.0",
"image": "registry.example.com/build-env:v4",
"dependencies": ["libc@6.0", "node@18"],
"signed": true,
"signature": "0x${randomHash(64)}"
}</pre>
</div>
`;
} else if(node.column === 'deploy') {
typeText = `Deploy ID: ${node.deployId} | Env: ${node.env}`;
html = `
<div class="border border-white p-2 bg-black mb-2">
<p><strong>STATUS:</strong> RUNNING</p>
<p><strong>MANIFEST:</strong> ${node.manifest}</p>
<p><strong>SOURCE BUILD:</strong> <span class="text-acid-cyan cursor-pointer" onclick="triggerBuildClick('${node.id}')">${node.id}</span></p>
</div>
<div class="border-2 border-acid-yellow p-2 bg-black mt-2">
<h3 class="text-acid-yellow font-bold mb-1">COMPLIANCE CHECKS</h3>
<div class="flex items-center gap-2 mb-1">
<span class="w-3 h-3 bg-green-500 inline-block"></span>
<span>Security Scan: PASSED</span>
</div>
<div class="flex items-center gap-2 mb-1">
<span class="w-3 h-3 bg-green-500 inline-block"></span>
<span>Licenses: CLEAR</span>
</div>
<div class="flex items-center gap-2">
<span class="w-3 h-3 bg-yellow-500 inline-block"></span>
<span>Audit Trail: VERIFIED</span>
</div>
</div>
`;
} else if(node.column === 'tele') {
typeText = `Telemetry ID: ${node.id}`;
html = `
<div class="grid grid-cols-2 gap-2 mb-2">
<div class="border border-white p-2 bg-black text-center">
<div class="text-xs">LATENCY (P50)</div>
<div class="text-xl text-acid-cyan font-bold">${node.metrics.latency}</div>
</div>
<div class="border border-white p-2 bg-black text-center">
<div class="text-xs">ERROR RATE</div>
<div class="text-xl text-red-500 font-bold">${node.metrics.errorRate}</div>
</div>
<div class="border border-white p-2 bg-black text-center">
<div class="text-xs">RPS</div>
<div class="text-xl text-acid-lime font-bold">${node.metrics.rps}</div>
</div>
<div class="border border-white p-2 bg-black text-center">
<div class="text-xs">NODES</div>
<div class="text-xl text-acid-pink font-bold">4</div>
</div>
</div>
<div class="border border-red-600 p-2 bg-black text-red-500">
<strong>ACTIVE ALERTS:</strong> ${node.alerts.length ? node.alerts.join(', ') : 'None'}
</div>
<div class="mt-2">
<h3 class="text-acid-lime border-b-2 border-acid-pink pb-1">TRACE SNAPSHOT</h3>
<pre class="text-xs overflow-auto bg-gray-800 p-1 mt-1">TraceID: ${randomHash(16)}
SpanID: ${randomHash(8)}
ParentID: ${randomHash(8)}
Service: auth-service
Start: ${new Date().toISOString()}Z
Duration: 125.4ms
Status: OK</pre>
</div>
`;
}
typeEl.textContent = typeText;
contentEl.innerHTML = html;
}
// Helper: simulate clicking another node from details
window.triggerCommitClick = function(hash) {
const node = nodes.find(n => n.column === 'commit' && n.id === hash);
if(node) {
const dom = document.querySelector(`.node[data-id="${hash}"]`);
if(dom) selectNode(dom, node);
dom.scrollIntoView({behavior: 'smooth', block: 'center'});
}
};
window.triggerBuildClick = function(buildId) {
const node = nodes.find(n => n.column === 'build' && n.buildId === buildId);
if(node) {
const dom = document.querySelector(`.node[data-id="${buildId}"]`);
if(dom) selectNode(dom, node);
dom.scrollIntoView({behavior: 'smooth', block: 'center'});
}
};
// ==========================================
// COMMIT LIST POPULATION
// ==========================================
const commitListEl = document.getElementById('commitList');
data.commits.forEach(commit => {
const item = document.createElement('div');
item.className = `brutal-border p-2 cursor-pointer font-mono text-xs hover:bg-white hover:text-black transition-colors ${commit.color}`;
item.innerHTML = `
<div class="font-bold">${commit.id}</div>
<div class="text-[10px] opacity-80">${commit.message}</div>
<div class="text-[10px] mt-1">${commit.timestamp.split('T')[0]}</div>
`;
item.addEventListener('click', () => {
const node = nodes.find(n => n.id === commit.id && n.column === 'commit');
const div = document.querySelector(`.node[data-id="${commit.id}"][data-type="commit"]`);
if(div) {
selectNode(div, node);
div.scrollIntoView({behavior: 'smooth', block: 'center'});
}
});
commitListEl.appendChild(item);
});
// ==========================================
// INITIALIZATION & ANIMATION
// ==========================================
function init() {
// Create DOM nodes
nodes.forEach(node => {
const el = createNodeElement(node);
mainSection.appendChild(el);
});
// Initial draw
resizeCanvas();
// GSAP Entrance Animations
const tl = gsap.timeline();
// Staggered appearance of nodes
tl.from('.node', {
duration: 0.3,
scale: 0,
opacity: 0,
stagger: {
amount: 1,
from: "center"
},
ease: "back.out(1.7)"
});
// Glitch title animation
tl.from('h1', {
duration: 0.1,
textShadow: "2px 0 red, -2px 0 blue",
opacity: 0,
ease: "steps(2)"
});
// Canvas line drawing animation (simple)
tl.to({}, {
duration: 0.5,
onComplete: () => {
gsap.to(canvas, {
opacity: 1,
duration: 0.5
});
}
});
// Random glitch effect on all nodes periodically
setInterval(() => {
const randomNode = document.querySelectorAll('.node')[Math.floor(Math.random() * nodes.length)];
gsap.to(randomNode, {
x: (Math.random() - 0.5) * 10,
y: (Math.random() - 0.5) * 10,
duration: 0.1,
yoyo: true,
repeat: 1,
skewX: Math.random() * 20 - 10,
onComplete: () => {
gsap.set(randomNode, { skewX: 0, x:0, y:0 });
}
});
}, 800);
}
// handle resize
window.addEventListener('resize', resizeCanvas);
// start
window.onload = init;
</script>
</body>
</html>