-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
175 lines (162 loc) · 5.69 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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IVP Project</title>
<!-- <meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" /> -->
<!-- <meta http-equiv="Content-Security-Policy" content="img-src 'self' data:; default-src 'self'; script-src 'self'" />
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'" /> -->
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 20px;
/* background-color: #f2f2f2; */
background-image: url('backgroundImage.jpg');
}
h1 {
text-align: center;
color: #333;
}
#info {
text-align: center;
margin-bottom: 20px;
}
#inputImage {
align-items: center;
display: block;
margin: 0 auto;
margin-bottom: 20px;
}
#inputImageDisplay {
margin: 3px solid #000000;
border: 2px solid #000000;
/* margin-bottom: 20px; */
}
#outputImage {
margin: 3px solid #ffffff;
border: 2px solid #000000;
margin-bottom: 20px;
}
#myResult {
margin: 3px solid #ffffff;
margin-bottom: 20px;
}
#processImage {
align-items: center;
display: block;
margin: 0 auto;
padding: 10px 20px;
font-size: 16px;
background-color: #4CAF50;
color: white;
border: none;
border-radius: 5px;
cursor: pointer;
}
#processImage[disabled] {
background-color: #cccccc;
cursor: not-allowed;
color: #666666;
}
.versions-container {
display: flex;
/* justify-content: space-between; */
align-items: center;
margin-top: 20px;
margin-bottom: 20px;
color: rgb(0, 30, 255);
}
.input-container {
align-items: center;
text-align: center;
margin-bottom: 20px;
}
* {box-sizing: border-box;}
.inputImageDisplay-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 20px;
margin-bottom: 50px;
}
.img-zoom-container {
display: flex;
justify-content: center;
gap: 20px;
}
.img-zoom-lens {
position: absolute;
width: 40px;
height: 40px;
}
.img-zoom-result {
border: 1px solid #d4d4d4;
border: 2px solid #000000;
width: 300px;
height: 240px;
}
</style>
<script>
document.addEventListener("DOMContentLoaded", function() {
var inputImage = document.getElementById("inputImage");
var processImageBtn = document.getElementById("processImage");
inputImage.addEventListener("change", function() {
if (inputImage.files.length > 0) {
processImageBtn.disabled = false;
processImageBtn.style.backgroundColor = "#4CAF50"; // Green background for enabled button
processImageBtn.style.color = "white"; // White text color for enabled button
} else {
processImageBtn.disabled = true;
processImageBtn.style.backgroundColor = "#cccccc"; // Gray background for disabled button
processImageBtn.style.color = "#666666"; // Dark gray text color for disabled button
}
});
processImageBtn.addEventListener("click", function() {
processImageBtn.disabled = true;
processImageBtn.style.backgroundColor = "#cccccc"; // Gray background for disabled button
processImageBtn.style.color = "#666666"; // Dark gray text color for disabled button
});
});
</script>
<script type = "text/javascript" src="zoom.js"></script>
</head>
<body>
<div class="versions-container">
We are using Node.js <span id="node-version"></span>,
Chromium <span id="chrome-version"></span>,
and Electron <span id="electron-version"></span>.
</div>
<div class="input-container">
<input type="file" id="inputImage" style="text-align: center;">
<button id="processImage">Process Image</button>
</div>
<div class="inputImageDisplay-container">
<img id="inputImageDisplay" width="300" height="240">
<br>
<label for="inputImageDisplay">Input Image</label>
</div>
<div class="img-zoom-container">
<div>
<img id="outputImage" width="300" height="240">
<br>
<label for="outputImage">Output Image</label>
</div>
<div>
<div id="myresult" class="img-zoom-result" width="300" height="240"></div>
<br>
<label for="myresult">Zoomed Image</label>
</div>
</div>
<!-- <img id="outputImage"> -->
<script>
var img = document.getElementById('outputImage');
img.onload = function() {
imageZoom("outputImage", "myresult");
};
</script>
<script src="index.js"></script>
</body>
</html>