-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocs.html
297 lines (258 loc) · 9.9 KB
/
docs.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>ReadLine</title>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-99907893-3"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-99907893-3');
</script>
<link rel="shortcut icon" href="https://amitchambial.netlify.com/assets/img/favicon.png" type="image/x-icon">
<!-- Twitter -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:creator" content="Amit Chambial">
<meta name="twitter:site" content="https://devaman.github.io/readline-js/">
<meta name="twitter:title" content="readline-js">
<meta name="twitter:description" content="A position indicator at the top of the page to visually display how far you have scrolled on a webpage.">
<meta name="twitter:image:src" content="https://amitchambial.netlify.com/assets/img/favicon.png">
<meta name="twitter:image:width" content="312">
<meta name="twitter:image:height" content="141">
<!-- Facebook -->
<meta property="og:url" content="https://devaman.github.io/readline-js/" />
<meta property="og:type" content="article" />
<link href="https://fonts.googleapis.com/css?family=Advent+Pro" rel="stylesheet">
<meta property="og:title" content="readline-js" />
<meta property="og:description" content="A position indicator at the top of the page to visually display how far you have scrolled on a webpage." />
<meta property="og:image" content="https://amitchambial.netlify.com/assets/img/favicon.png"
/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://cdn.rawgit.com/konpa/devicon/df6431e323547add1b4cf45992913f15286456d3/devicon.min.css">
<!-- Font Awesome -->
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.8.1/css/all.css">
<!-- Bootstrap core CSS -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/css/bootstrap.min.css" rel="stylesheet">
<!-- Material Design Bootstrap -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.7.6/css/mdb.min.css" rel="stylesheet">
<!-- JQuery -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<!-- Bootstrap tooltips -->
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.4/umd/popper.min.js"></script>
<!-- Bootstrap core JavaScript -->
<script type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
<!-- MDB core JavaScript -->
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.7.6/js/mdb.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="https://unpkg.com/readline-js@1.0.1/lib/readline-js.js"></script>
<script src="https://cdn.jsdelivr.net/gh/google/code-prettify@master/loader/run_prettify.js"></script>
<style>
* {
margin: 0px;
padding: 0px;
box-sizing: border-box;
}
footer {
width: 100vw;
height: 100px;
display: flex;
font-family: 'Advent Pro';
justify-content: space-around;
align-items: center;
}
footer .social {
font-size: 20px;
}
footer .social i {
padding: 2px 8px;
}
.col-amit {
width: 100%;
display: flex;
flex-flow: column;
align-items: center;
padding: 2px 4px;
}
pre.prettyprint {
border: none !important;
}
.docs-code {
display: flex;
width: 80%;
flex-flow: column;
overflow: scroll;
margin: 20px;
padding: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.274);
border-radius: 4px;
transition: box-shadow 0.2s ease-in-out;
}
.docs-code:hover{
box-shadow: 0px 4px 20px rgba(0, 0, 0, 0.274);
}
#list-example {
position: sticky;
top: 0;
}
</style>
</head>
<body style="margin:0px;">
<!--Navbar -->
<nav class="mb-1 navbar navbar-expand-lg navbar-dark red lighten-1">
<a class="navbar-brand" href="#">readline-js</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent-555"
aria-controls="navbarSupportedContent-555" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent-555">
<ul class="navbar-nav mr-auto">
<li class="nav-item ">
<a class="nav-link" href="https://devaman.github.io/readline-js/">Home
</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="docs.html">Docs</a>
<span class="sr-only">(current)</span>
</li>
<li class="nav-item">
<a class="nav-link" href="donate.html">Donate</a>
</li>
</ul>
<ul class="navbar-nav ml-auto nav-flex-icons">
<li class="nav-item avatar">
<a class="nav-link p-0" href="#">
<img src="https://avatars1.githubusercontent.com/u/17355480?s=400&u=3bec8ccf4393ce1393d108d4e2fdb80987fa3cd1&v=4"
class="rounded-circle z-depth-0" alt="avatar image" height="35">
</a>
</li>
</ul>
</div>
</nav>
<div class="col-amit" id="target">
<h2 id="list-item-1">
# Adding Readline
</h2>
<div class="docs-code">
<pre class="prettyprint">
<code>
<script src="https://unpkg.com/readline-js/lib/readline-js.js"></script>
</code>
or
<code>npm install readline-js</code>
</pre>
<hr class="mb-3">
<div class="content">
Add this code in <head>
</div>
</div>
<h2 id="list-item-2">
# Initializing ReadLine (for v1.0 latest)
</h2>
<div class="docs-code">
Calling ReadLine in body.
<pre class="prettyprint js">
<script>
let readLine = new ReadLine({
showPercentage:true,
id:"target",
height: "4px",
color: "#00b8e6"
});
//destroying the readline-js
readLine.destroy();
</script>
</pre>
You can call this function in head also.
<pre class="prettyprint">
<script>
window.onload=function(){
new ReadLine({
id: "target",
height: "3px",
color: "red"
});
};
</script></pre>
In React js
<pre class="prettyprint lang-js">
import Readline from 'readline-js';
...
useEffect(() => {
let readline = new Readline({
height: "3px",
color: "red"
})
return ()=>{
readline.destroy();
}
})
</pre>
<hr class="mb-3">
<div class="content">
<b style="display:inline-block;">id(optional): </b> id of the targeted content / Default whole
body<br />
<b style="display:inline-block;">showPercentage(optional): </b> show percentage of content covered (slow in mobile)<br />
<b style="display:inline-block;">height(optional): </b> height of line / Default 6px<br />
<b style="display:inline-block;">color(optional): </b> color of line (rgb/rbga) / Default blue<br />
<b style="display:inline-block;">.destroy(): </b> Use this method on the readline object created to destroy or remove it <br />
</div>
</div>
<h2 id="list-item-2">
# Initializing ReadLine (For Old version v0.1)
</h2>
<div class="docs-code">
Calling ReadLine in body.
<pre class="prettyprint">
<script>
ReadLine({
showPercentage:true,
id:"target",
height: "4px",
color: "#00b8e6"
});
</script></pre>
You can call this function in head also.
<pre class="prettyprint">
<script>
window.onload=function(){
ReadLine({
id: "target",
height: "3px",
color: "red"
});
};
</script></pre>
<hr class="mb-3">
<div class="content">
<b style="display:inline-block;">id(optional): </b> id of the targeted content / Default whole
body<br />
<b style="display:inline-block;">showPercentage(optional): </b> show percentage of content covered (slow in mobile)<br />
<b style="display:inline-block;">height(optional): </b> height of line / Default 6px<br />
<b style="display:inline-block;">color(optional): </b> color of line (rgb/rbga) / Default blue<br />
</div>
</div>
</div>
</div>
<footer>
<label> © 2019 Amit Chambial</label>
<div class="social">
<a href="https://twitter.com/amit_chambial"> <i class="devicon-twitter-plain colored"></i></a>
<a href="https://www.facebook.com/amitchambial5"> <i class="devicon-facebook-plain colored"></i></a>
<a href="https://github.com/devaman"> <i class="devicon-github-plain colored"></i></a>
</div>
</div>
</footer>
<script>
let readline = new ReadLine({
id: "target",
height: "3px",
color: "red"
});
</script>
</body>
</html>