-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
161 lines (136 loc) · 4 KB
/
index.html
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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ttyplayer.js Docs</title>
<link rel="stylesheet" href="./dist/ttyplayer.css"/>
<script src="./dist/ttyplayer.js"></script>
<script src="./ttyplayer.autoload.js"></script>
<link href="https://fonts.googleapis.com/css?family=Lekton" rel="stylesheet">
<style>
body {
padding: 0;
margin: 0;
color: #ddd;
padding-bottom: 60px;
background: #000;
font-family: monospace;
}
ul {
padding-left: 2em;
}
h2 {
margin-top: 40px;
}
h3 {
margin-top: 30px;
}
.header, .body {
position: absolute;
width: 100%;
}
.header {
box-sizing: border-box;
height: 100%;
padding-top: 200px;
}
.body {
position: absolute;
top: 100%;
}
.header .ttyplayer-header,
.header .ttyplayer-footer {
display: none;
}
.center {
width: 600px;
margin: 0 auto;
padding: 0 40px;
}
a {
color: #4078c0;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
pre {
border: 1px solid #999;
padding: 10px;
}
.icon-down {
position: absolute;
padding: 10px;
left: 50%;
transform: translate(50%);
bottom: 50px;
background: none;
text-align:center;
cursor: pointer;
color: #999;
transition: color ease 0.4s;
}
.icon-down:before {
content: '';
display: block;
width: 10px;
height: 10px;
border: 1px solid currentColor;
border-top-width: 0;
border-right-width: 0;
transform: rotate(-45deg);
}
.icon-down:hover {
color: #fff;
cursor: pointer;
}
</style>
</head>
<body>
<div class="header">
<div class="center" id="header"></div>
<a href="#body" class="icon-down" id="down"></a href="#body">
</div>
<div class="body" id="body">
<div class="center">
<h1><a href="https://github.com/meowtec/ttyplayer.js">TTYPlayer.js</a></h1>
<p><a href="https://github.com/meowtec/ttyplayer.js">TTYPlayer</a> is a player that playback terminal session.<br></p>
<h2>How To use</h2>
<h3>Install ttyrec</h3>
<p>Before use ttyplayer, you should install <a href="https://github.com/mjording/ttyrec">ttyrec</a>, and record your tty session using ttyrec.</p>
<p>For Mac OSX users, ttyrec can be installed with homebrew:</p>
<pre><code>brew install ttyrec</code></pre>
<h3>Record tty</h3>
<p>Use <code>ttyrec</code> command to record terminal session:</p>
<pre><code>ttyrec your.rec</code></pre>
<p>Use exit command to finish.</p>
<pre><code>exit</code></pre>
<h3>New TTYPlayer</h3>
<p>Include ttyplayer.min.css and ttyplayer.min.js in your page, then create a player:</p>
<pre class="highlight"><code>new TTYPlayer({
parent: document.getElement('player-parent')
}).load('/your.rec')</code></pre>
<p>Now we get one:</p>
<div
class="player-container"
style="border: 1px solid #999;"
tp-src="./pages/demo.rec"
></div>
<h3>With markdown</h3>
<p>Read my <a href="http://meowtec.github.io/blog/2016/09/01/tty-player.html">blog</a> and <a href="https://raw.githubusercontent.com/meowtec/meowtec.github.io/master/_posts/2016-09-01-tty-player.markdown">the markdown source code</a> to know how to generate ttyplayer in markdown.</p>
<h2>Notice</h2>
<p>The default cols and rows are 80 and 20. Before you record, make sure your terminal size is cols 80 and rows 20.</p>
<p>Or give a custom size:</p>
<pre class="highlight"><code>new TTYPlayer({
parent: document.getElement('player-parent'),
cols: 90,
rows: 30
}).load('/your.rec')</code></pre>
<h2>Github</h2>
<p><a href="https://github.com/meowtec/ttyplayer.js">https://meowtec.github.io/ttyplayer.js/</a></p>
<p>Starts or pull requests welcome.</p>
</div>
</div>
<script src="./pages/doc.js"></script>
</body>
</html>