Files
Web-Page-Performance-Test/waterfall.html

266 lines
7.2 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Waterfall View - Web Page Performance Test</title>
<link rel="icon" type="image/png" href="Logo.png">
<link rel="stylesheet" href="styles.css?v=3.0">
<style>
.waterfall-container {
margin: 2rem auto;
max-width: 1400px;
background: var(--color-bg-secondary);
padding: 2rem;
border-radius: 12px;
}
.waterfall-canvas {
width: 100%;
overflow-x: auto;
background: var(--color-bg-tertiary);
border-radius: 8px;
padding: 1rem;
position: relative;
}
.waterfall-timescale {
height: 25px;
position: relative;
margin-bottom: 10px;
margin-left: 370px;
border-bottom: 2px solid var(--color-border);
}
.time-marker {
position: absolute;
top: 0;
font-size: 11px;
color: var(--color-text-secondary);
transform: translateX(-50%);
}
.grid-line {
position: absolute;
top: 25px;
bottom: 0;
width: 1px;
background: rgba(119, 119, 119, 0.15);
pointer-events: none;
}
.waterfall-row {
display: flex;
align-items: center;
height: 28px;
margin-bottom: 1px;
cursor: pointer;
transition: background 0.2s ease;
gap: 8px;
}
.waterfall-row:hover {
background: rgba(114, 9, 183, 0.2);
}
.request-number {
width: 35px;
text-align: right;
font-size: 11px;
color: var(--color-text-secondary);
font-weight: 600;
}
.status-badge {
width: 40px;
height: 20px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
font-size: 10px;
font-weight: 700;
color: white;
}
.request-label {
width: 250px;
padding: 0 8px;
font-size: 11px;
color: var(--color-text-primary);
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.request-size {
width: 65px;
font-size: 10px;
color: var(--color-text-secondary);
text-align: right;
}
.request-time {
width: 60px;
font-size: 10px;
color: var(--color-text-secondary);
text-align: right;
font-weight: 600;
}
.timeline {
flex: 1;
position: relative;
height: 20px;
}
.timing-bar {
position: absolute;
height: 18px;
border-radius: 2px;
opacity: 0.8;
transition: opacity 0.2s ease;
}
.timing-bar:hover {
opacity: 1;
}
.bar-dns { background: #4CAF50; }
.bar-connect { background: #2196F3; }
.bar-ssl { background: #FFC107; }
.bar-wait { background: #9C27B0; }
.bar-receive { background: #00BCD4; }
.request-dialog {
display: none;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: var(--color-bg-secondary);
padding: 2rem;
border-radius: 12px;
box-shadow: 0 10px 40px rgba(0,0,0,0.5);
max-width: 800px;
max-height: 80vh;
overflow-y: auto;
z-index: 1000;
}
.dialog-overlay {
display: none;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0,0,0,0.7);
z-index: 999;
}
.dialog-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
padding-bottom: 1rem;
border-bottom: 2px solid var(--color-border);
}
.close-btn {
background: none;
border: none;
font-size: 24px;
cursor: pointer;
color: var(--color-text-secondary);
}
.close-btn:hover {
color: var(--color-accent);
}
.detail-section {
margin-bottom: 1.5rem;
}
.detail-section h3 {
color: var(--color-accent);
margin-bottom: 0.5rem;
font-size: 1.1rem;
}
.detail-row {
padding: 0.5rem 0;
border-bottom: 1px solid var(--color-border-light);
}
.detail-label {
font-weight: 600;
color: var(--color-text-secondary);
display: inline-block;
width: 200px;
}
.detail-value {
color: var(--color-text-primary);
}
.filter-controls {
margin-bottom: 1.5rem;
display: flex;
gap: 1rem;
flex-wrap: wrap;
}
.filter-btn {
padding: 0.5rem 1rem;
background: var(--color-bg-tertiary);
border: 2px solid var(--color-border);
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
}
.filter-btn:hover {
background: var(--color-accent);
color: white;
border-color: var(--color-accent);
}
.filter-btn.active {
background: var(--color-accent);
color: white;
border-color: var(--color-accent);
}
</style>
</head>
<body>
<div class="waterfall-container">
<h1>Request Waterfall</h1>
<div class="filter-controls" id="filterControls">
<button class="filter-btn active" data-type="all">All</button>
<button class="filter-btn" data-type="Document">HTML</button>
<button class="filter-btn" data-type="Script">JS</button>
<button class="filter-btn" data-type="Stylesheet">CSS</button>
<button class="filter-btn" data-type="Image">Images</button>
<button class="filter-btn" data-type="Font">Fonts</button>
</div>
<div class="waterfall-canvas" id="waterfallCanvas"></div>
</div>
<div class="dialog-overlay" id="dialogOverlay"></div>
<div class="request-dialog" id="requestDialog">
<div class="dialog-header">
<h2 id="dialogTitle">Request Details</h2>
<button class="close-btn" id="closeDialog">&times;</button>
</div>
<div id="dialogContent"></div>
</div>
<script src="waterfall.js"></script>
</body>
</html>