virtual-keypad 5.4.0 → 5.6.0

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.
@@ -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: [..."CDHKNORSVZ".split(""), "ESC", "SPACE"], // Set of symbols to display; array perfered
78
+ alphabet: [..."CDHKNORSVZ".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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "virtual-keypad",
3
- "version": "5.4.0",
3
+ "version": "5.6.0",
4
4
  "description": "User response at a distance. Simple utility to summon forth a virtual keypad webapp.",
5
5
  "main": "dist/main.js",
6
6
  "directories": {
package/src/keypad.css CHANGED
@@ -7,7 +7,7 @@
7
7
  display: grid;
8
8
  grid-template-columns: 1fr;
9
9
  /* Make header text as big as the text, keys take up as much space as needed, and control keys take up bottom space */
10
- grid-template-rows: max-content auto max-content;
10
+ grid-template-rows: max-content auto 15vh;
11
11
 
12
12
  align-items: center;
13
13
  justify-content: center;
@@ -48,7 +48,7 @@
48
48
  width: 100%;
49
49
  height: 100%;
50
50
  display: flex;
51
- flex-wrap: wrap;
51
+ flex-wrap: wrap-reverse;
52
52
  flex-direction: row;
53
53
  column-gap: 5px;
54
54
  row-gap: 5px;
@@ -57,15 +57,22 @@
57
57
  justify-content: center;
58
58
 
59
59
  /* Vertical shift of buttons */
60
- /* align-items: center; */
61
- align-items: flex-end;
60
+ align-items: center;
61
+
62
+ /* Hide scrollbar */
63
+ -ms-overflow-style: none;
64
+ scrollbar-width: none;
65
+ }
66
+ #keypad-keys::-webkit-scrollbar {
67
+ /* Hide scrollbar */
68
+ display: none;
62
69
  }
63
70
 
64
71
  .response-button {
65
72
  width: 100%;
66
73
  height: 100%;
67
- max-width: min(25vw, 150px);
68
- max-height: min(25vw, 150px);
74
+ max-width: min(25vw, 25vh, 150px);
75
+ max-height: min(25vw, 25vh, 150px);
69
76
  min-width: 44px;
70
77
  min-height: 44px;
71
78
  cursor: pointer;
@@ -76,7 +83,7 @@
76
83
  justify-content: center;
77
84
 
78
85
  /* Curve corners of buttons */
79
- border-radius: 25px;
86
+ border-radius: min(25px, 15%);
80
87
 
81
88
  /* Make buttons square */
82
89
  aspect-ratio: 1;
@@ -106,17 +113,18 @@
106
113
  height: 95%;
107
114
  width: 95%;
108
115
  min-width: 95%;
116
+ max-height: min(15vh, 150px);
109
117
  }
110
118
 
111
119
  .response-button#SPACE {
112
120
  /* TODO actually make sure test doesn't clip */
113
- font-size: 2rem;
121
+ font-size: 1.5rem;
114
122
  grid-column: 1;
115
123
  grid-row: 1;
116
124
  }
117
- .response-button#ESC {
125
+ .response-button#RETURN {
118
126
  /* TODO actually make sure test doesn't clip */
119
- font-size: 2rem;
127
+ font-size: 1.5rem;
120
128
  grid-column: 2;
121
129
  grid-row: 1;
122
130
  }
package/src/keypad.js CHANGED
@@ -134,7 +134,7 @@ class Keypad extends KeypadPeer {
134
134
  * |e f g h |
135
135
  * |i j k l |
136
136
  * ----------
137
- * |space esc| <- keypad-control-keys
137
+ * |space ret| <- keypad-control-keys
138
138
  */
139
139
  // Keypad elem is a container for a message and all keys
140
140
  const keypadElem = document.createElement("div");
@@ -259,7 +259,7 @@ class Keypad extends KeypadPeer {
259
259
  // Add the label to the button
260
260
  button.appendChild(buttonLabel);
261
261
  // Add the labeled-button to the HTML
262
- if (["SPACE", "ESC"].includes(symbol.toUpperCase())){
262
+ if (["SPACE", "RETURN"].includes(symbol.toUpperCase())){
263
263
  document.querySelector("#keypad-control-keys").appendChild(button);
264
264
  } else {
265
265
  document.querySelector("#keypad-keys").appendChild(button);