This repository has been archived by the owner on May 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
96 lines (84 loc) · 1.99 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
<html>
<head>
<title>OCR Scanner</title>
<script>window.$ = window.jQuery = require('jquery');</script>
<style>
body{
background: rgba(0,0,0,0.9);
}
.box {
height: 45%;
width: 98%;
border: 5px dashed white;
}
.box input {
position: absolute;
height: 45%;
width: 98%;
margin: 0;
padding: 0;
outline: none;
opacity: 0;
}
.box p {
text-align: center;
line-height: 200px;
color: #ffffff;
font-family: Arial;
}
form button{
margin: 0;
color: #fff;
background: #e84118;
border: none;
width: 100%;
height: 35px;
margin-top: 20px;
border-radius: 4px;
border-bottom: 4px solid #c23616;
transition: all .2s ease;
outline: none;
}
form button:hover {
height: 40px;
cursor: pointer;
}
.result {
width: 100%;
max-width: 100%;
height:37%;
}
span {
color: white;
}
</style>
</head>
<body>
<form id="ocr_form">
<div class="box">
<input id="image" type="file">
<p id="paragraph">Choose Image</p>
</div>
<button type="submit">Convert</button>
</form>
<textarea id="output" class="result"></textarea>
<span>Coded by CuzImPeter/peter12908</span>
<script>
const electron = require('electron');
const {ipcRenderer} = electron;
document.getElementById('ocr_form').addEventListener('submit', submitForm);
function submitForm(e) {
e.preventDefault();
ipcRenderer.send('convert', document.getElementById("image").files[0]["path"]);
}
ipcRenderer.on('get_result', function(e, rslt) {
document.getElementById("output").value = rslt;
})
$(document).ready(function(){
$('input[id=image]').change(function () {
$('form p').text(this.files[0].name + " selected");
});
});
</script>
</body>
</html>