-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
67 lines (50 loc) · 1.26 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
<!DOCTYPE html>
<html>
<head>
<style>
div {
margin-top: 3cm;"
width: 100px;
}
*{
position: sticky;
margin-left: auto;
margin-right: auto;
text-align:center
}
</style>
</head>
<body>
<div style="z-index: 1;">
<h1> Matrizomat</h1>
<table>
<tbody>
<tr>
<td> <input id="11" value="1" type="number"></td>
<td> <input id="12" value="0" type="number"></td>
</tr>
<tr>
<td> <input id="21" value="0" type="number"></td>
<td> <input id="22" value="1" type="number"></td>
</tr>
</tbody>
</table>
<button style="margin-bottom: 3cm; z-index: 5;" onclick="myFunction()" >Anwenden</button>
</div>
<div style="left: 50%;z-index: -1; " id="bild">
<img src="a.jpg" style="width: 200px">
</div>
<script>
// https://stackoverflow.com/questions/54169955/trying-to-apply-css-transform-in-javascript
// https://developer.mozilla.org/en-US/docs/Web/CSS/transform-function/matrix
const bild = document.getElementById("bild");
function myFunction() {
i11 = document.getElementById("11").value;
i12 = document.getElementById("12").value;
i21 = document.getElementById("21").value;
i22 = document.getElementById("22").value;
bild.style.transform = "matrix(" + i11 + "," + i21 + "," + i12 + "," + i22 + ",0,0)";
}
</script>
</body>
</html>