This repository has been archived by the owner on Aug 21, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
69 lines (65 loc) · 2.94 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>TextFinder demo</title>
<link rel="shortcut icon" href="favicon.ico">
</head>
<body>
<div>
<h1><a href="https://github.com/Octane/TextFinder/">TextFinder</a></h1>
<p id="text">
Lor<span>em Ip</span>sum is simply dummy text of the printing
and typesetting industry. Lorem Ipsum has been the industry's
standard dummy text ever since the 1500s, when an unknown printer
took a galley of type and scrambled it to make a type specimen book.
It has survived not only five centuries, but also the leap into
electronic typesetting, remaining essentially unchanged. It was
popularised in the 1960s with the release of Letraset sheets
containing Lorem <span> </span> Ipsum passages, and more
recently with desktop publishing software like Aldus PageMaker
including <span>versions of Lorem </span> Ipsum.
</p>
<fieldset>
<legend>HTML</legend>
<div style="font-family: monospace; word-wrap: break-word;">
<span style="background-color: #6abd45;">Lor<span>em
Ip</span>sum</span> is simply dummy text of the printing
and typesetting industry.
<span style="background-color: #f26a4d;">Lorem Ipsum</span>
has been the industry's standard dummy text ever since
the 1500s, when an unknown printer took a galley of type
and scrambled it to make a type specimen book. It has survived
not only five centuries, but also the leap into electronic
typesetting, remaining essentially unchanged. It was popularised
in the 1960s with the release of Letraset sheets containing
<span style="background-color: #fdb813;">Lorem <span>
</span> Ipsum</span> passages, and more recently with
desktop publishing software like Aldus PageMaker including
<span>versions of
<span style="background-color: #f287b7;">Lorem </span>
Ipsum</span>.
</div>
</fieldset>
</div>
<script src="textfinder.js"></script>
<script>
new function () {
var finder = new TextFinder(document.querySelector("#text")),
mathes = finder.find("lorem ipsum"),
length = mathes.length,
i = 0;
function highlight() {
TextFinder.highlight(mathes[i]);
i++;
if (i == length) {
i = 0;
}
setTimeout(highlight, 1000);
}
highlight();
};
</script>
</body>
</html>