-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
91 lines (83 loc) · 2.08 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>カードプロキシ</title>
<style>
table {
border-collapse: separate;
border-spacing: 0;
line-height: 0;
}
td {
padding: 0;
border: 1px solid red;
width: 230px;
min-width: 230px;
max-width: 230px;
height: 320px;
min-height: 320px;
max-height: 320px;
text-align: center;
vertical-align: middle;
}
img.card {
min-width: 230px;
max-width: 230px;
min-height: 320px;
max-height: 320px;
}
img.key-card {
min-width: 320px;
max-width: 320px;
min-height: 230px;
max-height: 230px;
transform: rotate(90deg) translateY(45px);
}
</style>
<script type="text/javascript">
window.onload = function () {
const card_list = location.search.substring(1).split(',');
const imgs = document.querySelectorAll("img");
const last = card_list.length < imgs.length ? card_list.length : imgs.length;
for (let i = 0; i < last; i++) {
imgs[i].src = card_list[i];
imgs[i].onload = function () {
if (imgs[i].naturalWidth / imgs[i].naturalHeight < 1) {
imgs[i].classList.add('card');
}
else {
imgs[i].classList.add('key-card');
}
}
}
if (imgs.length < card_list.length) {
const url = location.href.substring(0, location.href.indexOf("?") + 1);
const param = card_list.slice(imgs.length);
window.open(url + param);
}
};
</script>
</head>
<body>
<table>
<tr>
<td><img></td>
<td><img></td>
<td><img></td>
</tr>
<tr>
<td><img></td>
<td><img></td>
<td><img></td>
</tr>
<tr>
<td><img></td>
<td><img></td>
<td><img></td>
</tr>
</table>
</body>
</html>