forked from asciinema/asciinema-player
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.html
More file actions
109 lines (96 loc) · 2.6 KB
/
test.html
File metadata and controls
109 lines (96 loc) · 2.6 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>T-Bench Player Test</title>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
margin: 0;
padding: 20px;
background-color: #f5f5f5;
}
.container {
max-width: 1200px;
margin: 0 auto;
background-color: white;
padding: 20px;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
h1 {
margin-top: 0;
}
#player {
width: 100%;
height: 500px;
}
/* Responsive styles for the player */
/* @media (max-width: 768px) {
.container {
padding: 10px;
}
#player {
height: 400px;
}
} */
/* Adjust the sidebar width for mobile */
/* .ap-timeline {
width: 85% !important;
max-width: 300px;
}
/* Adjust text size for better readability */
/* .ap-timeline .ap-timeline-header {
font-size: 14px;
padding: 8px;
}
.ap-timeline .ap-marker-details {
font-size: 11px;
padding: 8px;
}
.ap-timeline .ap-marker-details .ap-marker-header h3 {
font-size: 13px;
}
.ap-timeline .ap-marker-details .ap-marker-section h4 {
font-size: 11px;
}
.ap-timeline .ap-marker-details .ap-marker-section code {
font-size: 10px;
} */
/* Adjust the terminal font size for mobile */
/* .ap-player {
font-size: 13px !important;
} */
/* Make control bar more visible on mobile */
/* .ap-player .ap-control-bar {
background-color: rgba(0, 0, 0, 0.8);
opacity: 1 !important;
} */
</style>
</head>
<body>
<div class="container">
<h1>T-Bench Player Test</h1>
<div id="player"></div>
</div>
<!-- Load the asciinema player script -->
<link rel="stylesheet" href="dist/bundle/asciinema-player.css">
<script src="dist/bundle/asciinema-player.min.js"></script>
<script>
// Check if we're on a mobile device
const isMobile = window.innerWidth <= 768;
console.log("isMobile");
console.log(isMobile);
// Initialize the player with our sample recording with markers
AsciinemaPlayer.create('sample-with-markers.cast', document.getElementById('player'), {
theme: 'asciinema',
autoPlay: true,
loop: false,
fit: 'width', // Ensure the player fits the width of the container
...(isMobile && { controls: true }),
// The markers are already in the recording file
});
</script>
</body>
</html>