Repository navigation
Expand file tree
/
Copy pathembed-tests.html
More file actions
139 lines (123 loc) · 3.77 KB
/
Copy pathembed-tests.html
File metadata and controls
139 lines (123 loc) · 3.77 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>test embed</title>
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<iframe
src="http://localhost:5173/embed?kbd=sme&layout=se-FI&platform=macOS"
width="100%"
frameborder="0"
></iframe>
<iframe
src="http://localhost:5173/embed?kbd=mhr&layout=mhr&platform=macOS"
width="100%"
frameborder="0"
></iframe>
<iframe
src="http://localhost:5173/embed?kbd=liv&layout=liv&platform=iOS"
width="100%"
frameborder="0"
></iframe>
<hr>
<h3 style="font-family: sans-serif">No-JS (interactive=false)</h3>
<iframe
src="http://localhost:5173/embed?kbd=mhr&layout=mhr&platform=macOS&interactive=false"
width="100%"
height="400"
frameborder="0"
></iframe>
<iframe
src="http://localhost:5173/embed?kbd=sme&layout=se-FI&platform=macOS&interactive=false"
width="100%"
height="400"
frameborder="0"
></iframe>
<iframe
src="http://localhost:5173/embed?kbd=liv&layout=liv&platform=iOS&interactive=false"
width="100%"
height="500"
frameborder="0"
></iframe>
<iframe
src="http://localhost:5173/embed?kbd=sme&layout=se-FI&platform=macOS&interactive=false&layer=shift"
width="100%"
height="400"
frameborder="0"
></iframe>
<hr>
<h3 style="font-family: sans-serif">No-JS scaled by width</h3>
<p style="font-family: sans-serif">
Set ?width=N and iframe width="N". Read data-embed-height off the root
element for the exact iframe height.
</p>
<p style="font-family: sans-serif">width=400</p>
<iframe
src="http://localhost:5173/embed?kbd=sme&layout=se-FI&platform=macOS&interactive=false&width=400"
width="400"
height="230"
frameborder="0"
></iframe>
<p style="font-family: sans-serif">width=700</p>
<iframe
src="http://localhost:5173/embed?kbd=sme&layout=se-FI&platform=macOS&interactive=false&width=700"
width="700"
height="350"
frameborder="0"
></iframe>
<p style="font-family: sans-serif">
width=1000 (at or above natural size — renders at natural size)
</p>
<iframe
src="http://localhost:5173/embed?kbd=sme&layout=se-FI&platform=macOS&interactive=false&width=1000"
width="960"
height="390"
frameborder="0"
></iframe>
<hr>
<h3 style="font-family: sans-serif">
No-JS many layers (tab bar scroll test)
</h3>
<p style="font-family: sans-serif">mhr at natural size</p>
<iframe
src="http://localhost:5173/embed?kbd=mhr&layout=mhr&platform=macOS&interactive=false"
width="100%"
height="400"
frameborder="0"
></iframe>
<p style="font-family: sans-serif">
mhr at width=500 (many tabs, should scroll)
</p>
<iframe
src="http://localhost:5173/embed?kbd=mhr&layout=mhr&platform=macOS&interactive=false&width=500"
width="500"
height="290"
frameborder="0"
></iframe>
<div style="background-color: #333">
<iframe
src="http://localhost:5173/embed?kbd=mhr&layout=mhr&platform=macOS&interactive=false"
width="100%"
height="400"
frameborder="0"
></iframe>
</div>
</body>
<script>
window.addEventListener("message", (event) => {
if (event.data.type === "giellalt-keyboard-resize") {
// Find the iframe that sent this message
const iframes = document.querySelectorAll("iframe");
for (const iframe of iframes) {
if (iframe.contentWindow === event.source) {
iframe.style.height = event.data.height + "px";
break;
}
}
}
});
</script>
</html>