-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
55 lines (53 loc) · 1.65 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
<!DOCTYPE html>
<html>
<head>
<title>Easy Reading</title>
<style>
.bionic-reader-container{
width: 600px;
}
</style>
<script src="https://code.jquery.com/jquery-3.6.0.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
</head>
<body>
<h1>Easy Reading</h1>
<p>Use the Bionic Reading API to read text easier</p>
<h2>Text Input</h2>
<input type="text" id="textInput">
<input type="button" value="Convert" id="convertButton">
<h2>Text Output</h2>
<p id="textOutput"></p>
<script>
const textInput = $("#textInput");
const textOutput = $("#textOutput");
const convertButton = $("#convertButton");
var bionicReaderSettings = {
"async": true,
"crossDomain": true,
"url": "https://bionic-reading1.p.rapidapi.com/convert",
"method": "POST",
"headers": {
"content-type": "application/x-www-form-urlencoded",
"X-RapidAPI-Host": "bionic-reading1.p.rapidapi.com",
"X-RapidAPI-Key": "1ded8cf890msh5037887e02fcf05p1f2011jsn72f6214618de"
},
"data": {
"content": "",
"response_type": "html",
"request_type": "html",
"fixation": "1",
"saccade": "10"
}
};
$(document).ready(function(){
convertButton.click(function(){
bionicReaderSettings.data.content= textInput.val();
$.ajax(bionicReaderSettings).done(function(response){
console.log(response);
textOutput.html(response);
});
});
});
</script>
</body>
</html>