-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
181 lines (178 loc) · 5.86 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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta
name="description"
content="A simple yet effective app to help you understand more per second :)"
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, minimum-scale=1.0"
/>
<title>Faster Read</title>
<!-- Add to homescreen for Chrome on Android -->
<meta name="mobile-web-app-capable" content="yes" />
<link rel="icon" sizes="192x192" href="images/android-desktop.png" />
<!-- Add to homescreen for Safari on iOS -->
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="apple-mobile-web-app-title" content="Faster Read" />
<link rel="apple-touch-icon-precomposed" href="images/ios-desktop.png" />
<meta
name="msapplication-TileImage"
content="images/touch/ms-touch-icon-144x144-precomposed.png"
/>
<meta name="msapplication-TileColor" content="#3372DF" />
<link rel="shortcut icon" href="images/favicon.png" />
<link
rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous"
/>
<style>
@keyframes bewo {
0% {
transform: scale(1);
}
50% {
transform: scale(1.1, 1.2);
color: red;
}
100% {
transform: scale(1);
}
}
.words {
margin: 10px 5px;
font-weight: lighter;
}
.target0 {
color: red !important;
text-shadow: 2px 2px #ff0000;
}
.read {
color: initial;
font-weight: bolder;
font-style: italic;
}
.enlarge {
animation: bewo 1s 1;
}
</style>
</head>
<body>
<script
src="//instant.page/3.0.0"
type="module"
defer
integrity="sha384-OeDn4XE77tdHo8pGtE1apMPmAipjoxUQ++eeJa6EtJCfHlvijigWiJpD7VDPWXV1"
></script>
<main>
<section
class="d-flex justify-content-center align-items-center flex-column"
>
<h1>Read Faster</h1>
<form
class="w-100"
onsubmit="words = [];currentWord = 0;formSubmit(event)"
>
<div
class="d-flex justify-content-center align-items-center flex-column"
>
<div class="input-group">
<div class="input-group-prepend">
<span class="input-group-text">Paste your text here:</span>
</div>
<textarea class="form-control" rows=7 aria-label="With textarea">
FasterRead¼ help you understand more words per minute by focusing your attention and making it easier to keep up with the speed that you are potentionally able to read. as the result you can do what your mind is wired for naturally; chasing a moving target if you read it so far using FasterRead technique you may be able to twice your words per minute by a 10 minute practice; happy reading!</textarea
>
</div>
<div class="form-group">
<label for="customRange1">speed</label>
<input
onchange="delayByFrame=event.target.value"
min="0"
max="15"
step="1"
type="range"
class="custom-range"
id="customRange1"
/>
</div>
<button type="submit" class="btn btn-info">let it Rip!</button>
</div>
</form>
<div id="results"></div>
<div class="d-flex p-2 m-5 border flex-wrap" id="read-area"></div>
</section>
</main>
<script>
let raf;
let words = [];
let delayByFrame = 5;
let offset = 3;
let elapsedTime = 0;
let t0;
let t1;
function formSubmit(e) {
e.preventDefault();
const textAreaValue = e.target.elements[0].value;
const spaceSeprated = textAreaValue.split(" ");
const readArea = document.getElementById("read-area");
readArea.innerHTML = "";
spaceSeprated.forEach((word, index) => {
const wordSpan = document.createElement("span");
wordSpan.textContent = word;
wordSpan.className = `words`;
wordSpan.id = `w${index}`;
words[index] = wordSpan;
readArea.appendChild(wordSpan);
});
t0 = performance.now();
if(raf) cancelAnimationFrame(raf);
fire();
}
let currentWord = 0;
let delayCounter = 1;
function fire() {
if (delayCounter < delayByFrame) {
delayCounter++;
raf = requestAnimationFrame(fire);
} else {
if (currentWord < words.length) {
if (currentWord >= 1) {
words[currentWord - 1].className += " read";
}
// if (currentWord >= offset) {
// let temp = currentWord - offset;
// words[temp].className += " target";
// requestAnimationFrame(() =>
// words[temp].classList.remove("target")
// );
// }
words[currentWord].className += " enlarge";
currentWord++;
delayCounter = 1;
raf = requestAnimationFrame(fire);
// debugger;
} else {
t1 = performance.now();
cancelAnimationFrame(raf);
showReadTime();
}
}
}
function showReadTime() {
elapsedTime = ((t1 - t0) / 1000).toFixed(2);
document.getElementById("results").innerHTML =
"" +
"" +
((words.length * 60) / elapsedTime).toFixed(0) +
" word/minutes";
}
</script>
</body>
</html>