virtual-keypad 5.11.2 → 5.11.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/receiver.html +1 -1
- package/package.json +1 -1
- package/src/keypad.css +1 -44
- package/src/maxKeySize.js +8 -6
- package/src/receiver.js +2 -1
package/dist/receiver.html
CHANGED
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
let keypad_options = {
|
|
76
76
|
// Specify a 'keypadUrl' field to redirect to a keypad hosted elsewhere
|
|
77
77
|
// FUTURE should be able to have a visual keypress or not from here
|
|
78
|
-
alphabet: [..."
|
|
78
|
+
alphabet: [..."ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789".split(""), "RETURN", "SPACE"], // Set of symbols to display; array perfered
|
|
79
79
|
font: "Arial", // Supported font, in which to display letters
|
|
80
80
|
targetElementId: "display", // id of the the div where messages should be displayed
|
|
81
81
|
visualResponseFeedback: false,
|
package/package.json
CHANGED
package/src/keypad.css
CHANGED
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
}
|
|
18
18
|
#keypad-header {
|
|
19
19
|
height: 100%;
|
|
20
|
-
/* min-height: 5vh; */
|
|
21
20
|
font-size: 1.5rem;
|
|
22
21
|
font-weight: 700;
|
|
23
22
|
text-align: center;
|
|
@@ -25,11 +24,6 @@
|
|
|
25
24
|
grid-row: 1;
|
|
26
25
|
overflow-y: auto;
|
|
27
26
|
|
|
28
|
-
/* padding: 0.5em;
|
|
29
|
-
margin-top: 0.5em;
|
|
30
|
-
margin-left: 0.5em;
|
|
31
|
-
margin-right: 0.5em; */
|
|
32
|
-
|
|
33
27
|
border-radius: 0.5em;
|
|
34
28
|
|
|
35
29
|
box-shadow: inset 2px 2px 4px #888888,
|
|
@@ -51,27 +45,6 @@
|
|
|
51
45
|
padding: 10px;
|
|
52
46
|
|
|
53
47
|
margin: 15px;
|
|
54
|
-
|
|
55
|
-
/* overflow-y: auto;
|
|
56
|
-
overflow-x: visible; */
|
|
57
|
-
|
|
58
|
-
/* width: 100%;
|
|
59
|
-
height: 100%;
|
|
60
|
-
display: flex;
|
|
61
|
-
flex-wrap: wrap-reverse;
|
|
62
|
-
flex-direction: row;
|
|
63
|
-
column-gap: 5px;
|
|
64
|
-
row-gap: 5px; */
|
|
65
|
-
|
|
66
|
-
/* Horizontal shift of buttons */
|
|
67
|
-
/* justify-content: center; */
|
|
68
|
-
|
|
69
|
-
/* Vertical shift of buttons */
|
|
70
|
-
/* align-items: center; */
|
|
71
|
-
|
|
72
|
-
/* Hide scrollbar */
|
|
73
|
-
/* -ms-overflow-style: none;
|
|
74
|
-
scrollbar-width: none; */
|
|
75
48
|
}
|
|
76
49
|
/* Hide scrollbar */
|
|
77
50
|
/* #keypad-keys::-webkit-scrollbar {
|
|
@@ -81,14 +54,6 @@
|
|
|
81
54
|
.response-button {
|
|
82
55
|
cursor: pointer;
|
|
83
56
|
|
|
84
|
-
/* width: 100%;
|
|
85
|
-
height: 100%;
|
|
86
|
-
max-width: min(25vw, 25vh, 150px);
|
|
87
|
-
max-height: min(25vw, 25vh, 150px);
|
|
88
|
-
min-width: 32px;
|
|
89
|
-
min-height: 32px;
|
|
90
|
-
cursor: pointer;
|
|
91
|
-
|
|
92
57
|
/* Center text within button */
|
|
93
58
|
display: flex;
|
|
94
59
|
align-items: center;
|
|
@@ -97,11 +62,8 @@
|
|
|
97
62
|
/* Curve corners of buttons */
|
|
98
63
|
border-radius: min(25px, 15%);
|
|
99
64
|
|
|
100
|
-
/* Make buttons square */
|
|
101
|
-
aspect-ratio: 1;
|
|
102
|
-
|
|
103
65
|
/* Style button text */
|
|
104
|
-
font-size:
|
|
66
|
+
font-size: larger;
|
|
105
67
|
font-weight: 700;
|
|
106
68
|
|
|
107
69
|
|
|
@@ -111,7 +73,6 @@
|
|
|
111
73
|
.response-button:active {
|
|
112
74
|
box-shadow: 1px 2px 2px 1px #999;
|
|
113
75
|
background-color: #aaa;
|
|
114
|
-
font-size: large;
|
|
115
76
|
}
|
|
116
77
|
|
|
117
78
|
/* Only do on a hover-enabled device, ie not a phone/tablet */
|
|
@@ -122,10 +83,6 @@
|
|
|
122
83
|
}
|
|
123
84
|
}
|
|
124
85
|
|
|
125
|
-
/* .response-button:active {
|
|
126
|
-
background-color: steelblue;
|
|
127
|
-
box-shadow: 1px 5px 5px 1px lightslategray;
|
|
128
|
-
} */
|
|
129
86
|
|
|
130
87
|
.response-button-label {
|
|
131
88
|
text-align: center;
|
package/src/maxKeySize.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
const getKeysDimensions = (elem, n, aspect=0.5) => {
|
|
3
2
|
/**** translation of maxKeySize.m, original provided courtesy of Prof Denis Pelli ****/
|
|
4
3
|
let keyHeightPx;
|
|
@@ -8,7 +7,7 @@ const getKeysDimensions = (elem, n, aspect=0.5) => {
|
|
|
8
7
|
const heightPx = elem.clientHeight;
|
|
9
8
|
let screenArea=widthPx*heightPx
|
|
10
9
|
|
|
11
|
-
keyHeightPx= (-1+Math.sqrt(1+4*n*heightPx/widthPx))/(2*n/widthPx);
|
|
10
|
+
keyHeightPx = (-1+Math.sqrt(1+4*n*heightPx/widthPx))/(2*n/widthPx);
|
|
12
11
|
keyHeightPx = (-1+Math.sqrt(1+4*n*heightPx*aspect/widthPx))/(2*aspect*n/widthPx);
|
|
13
12
|
|
|
14
13
|
while (n > (Math.floor(heightPx/keyHeightPx - 1)*Math.floor(widthPx/(aspect*keyHeightPx)))){
|
|
@@ -55,9 +54,10 @@ export const applyMaxKeySize = (numberOfKeys) => {
|
|
|
55
54
|
const controlKey = controlKeyElemsMask[i];
|
|
56
55
|
let top, left, width;
|
|
57
56
|
if (controlKey) {
|
|
58
|
-
top = (heightPx-keyHeightPx)
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
top = (heightPx-keyHeightPx);
|
|
58
|
+
const m = (widthPx*0.1)/4
|
|
59
|
+
left = (k.id.toLowerCase().includes("space") ? 0 : widthPx/2) + m;
|
|
60
|
+
width = (widthPx*0.9)/2;
|
|
61
61
|
|
|
62
62
|
k.style.height = "auto";
|
|
63
63
|
k.style.width = "auto";
|
|
@@ -73,15 +73,17 @@ export const applyMaxKeySize = (numberOfKeys) => {
|
|
|
73
73
|
// Set font size to s*r
|
|
74
74
|
const f = Math.floor(s*r);
|
|
75
75
|
k.style.fontSize = f + "px";
|
|
76
|
+
k.style.borderRadius = "25px";
|
|
77
|
+
k.style.height = (keyHeightPx - 5)+ "px";
|
|
76
78
|
} else {
|
|
77
79
|
width = keyHeightPx*aspect;
|
|
78
80
|
const [y,x] = gridCoords[j];
|
|
79
81
|
j += 1;
|
|
80
82
|
top = y*keyHeightPx + verticalMarginOffset ;
|
|
81
83
|
left = x*width+horizontalMarginOffset;
|
|
84
|
+
k.style.height = keyHeightPx + "px";
|
|
82
85
|
}
|
|
83
86
|
k.style.width = width + "px";
|
|
84
|
-
k.style.height = keyHeightPx + "px";
|
|
85
87
|
k.style.top = top + "px";
|
|
86
88
|
k.style.left = left + "px";
|
|
87
89
|
k.style.visibility = "visible";
|
package/src/receiver.js
CHANGED
|
@@ -141,7 +141,8 @@ class Receiver extends KeypadPeer {
|
|
|
141
141
|
|
|
142
142
|
let queryString = this.queryStringFromObject(params);
|
|
143
143
|
const uri = this.keypadUrl + queryString;
|
|
144
|
-
|
|
144
|
+
this.qrURL = uri;
|
|
145
|
+
console.log(this.qrURL);
|
|
145
146
|
|
|
146
147
|
// Display QR code for the participant to scan
|
|
147
148
|
const qrCanvas = document.createElement("canvas");
|