-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport.ejs
More file actions
51 lines (51 loc) · 1.56 KB
/
Copy pathreport.ejs
File metadata and controls
51 lines (51 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
<link rel="icon" href='data:image/svg+xml;utf8,<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48"><path d="m14 7 10-7 10 7v10h5v7h-5l5 24H9l5-24H9v-7h5V7Z" fill="%23F63"/><path d="M31.561 24H14l-1.689 8.105L31.561 24ZM18.983 48H9l1.022-4.907L35.723 32.27l1.663 7.98L18.983 48Z" fill="%23FFA385"/><path fill="%23FF3" d="M20.5 10h7v7h-7z"/></svg>'>
<title>Lighthouse Report</title>
<style>
body {
margin: 0;
display: flex;
}
section {
display: flex;
flex-direction: column;
flex-grow: 1;
}
h3 {
position: sticky;
top: 5px;
z-index: 1;
align-self: center;
font-size: 16px;
padding: 5px 15px;
background: #e0e0e0;
border-radius: 9999px;
color: #363636;
margin: 5px;
}
iframe {
width: 100%;
height: 100vh;
border: 0;
border-top: 1px solid #e0e0e0;
}
</style>
</head>
<body>
<% for (let i = 0; i < runs; i++) { %>
<section>
<h3>Test #<%= i + 1 %></h3>
<iframe src="<%= i + 1 %>.html"></iframe>
</section>
<% } %>
<script>
addEventListener('message', (e) => {
const frame = [...document.querySelectorAll('iframe')].find((f) => f.contentWindow === e.source);
if (frame && e.data?.lhrunHeight) frame.style.height = `${e.data.lhrunHeight}px`;
});
</script>
</body>