Spaces:
Running
Running
Update index.html
Browse files- index.html +28 -16
index.html
CHANGED
@@ -1,19 +1,31 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
<html>
|
3 |
+
<head>
|
4 |
+
<title>Image Combiner</title>
|
5 |
+
</head>
|
6 |
+
<body>
|
7 |
+
<img id="image1" src="https://drive.google.com/uc?id=1qxfPHJXyTeS60Jqou6TG6g13AWLPweZZ" crossorigin="anonymous" style="display: none;">
|
8 |
+
<img id="image2" src="https://drive.google.com/uc?id=11WKe16T11m70GVmXj5O3u-Tk85MQHPf8" crossorigin="anonymous" style="display: none;">
|
9 |
+
<button onclick="combineImages()">Combine</button>
|
10 |
+
<canvas id="canvas" width="600" height="300"></canvas>
|
11 |
+
|
12 |
+
<script>
|
13 |
+
function combineImages() {
|
14 |
+
var image1 = document.getElementById('image1');
|
15 |
+
var image2 = document.getElementById('image2');
|
16 |
+
|
17 |
+
var canvas = document.getElementById('canvas');
|
18 |
+
var ctx = canvas.getContext('2d');
|
19 |
+
|
20 |
+
image1.onload = function () {
|
21 |
+
ctx.drawImage(image1, 0, 0, canvas.width / 2, canvas.height);
|
22 |
+
image2.onload = function () {
|
23 |
+
ctx.drawImage(image2, canvas.width / 2, 0, canvas.width / 2, canvas.height);
|
24 |
+
};
|
25 |
+
image2.src = "https://drive.google.com/uc?id=11WKe16T11m70GVmXj5O3u-Tk85MQHPf8";
|
26 |
+
};
|
27 |
+
image1.src = "https://drive.google.com/uc?id=1qxfPHJXyTeS60Jqou6TG6g13AWLPweZZ";
|
28 |
+
}
|
29 |
+
</script>
|
30 |
+
</body>
|
31 |
</html>
|