grevlingui 0.1.42 → 0.1.44
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.
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
.numberSelect {
|
|
4
4
|
position: relative;
|
|
5
5
|
z-index: 2;
|
|
6
|
-
|
|
7
|
-
|
|
8
6
|
}
|
|
9
7
|
|
|
10
8
|
.swipeBlobContainer {
|
|
@@ -20,12 +18,41 @@
|
|
|
20
18
|
}
|
|
21
19
|
|
|
22
20
|
.swipeBlobContainer .swipeBlob {
|
|
23
|
-
background-color: hotpink
|
|
21
|
+
/*background-color: hotpink;*/
|
|
24
22
|
position: absolute;
|
|
25
23
|
/*border-radius: 100%;*/
|
|
24
|
+
/*clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);*/
|
|
25
|
+
/*clip-path: polygon(0 25%, 50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%);*/
|
|
26
|
+
/*clip-path: polygon(15% 15%, 50% 0, 85% 15%, 100% 50%, 85% 85%, 50% 100%, 15% 85%, 0 50%);*/
|
|
27
|
+
/*clip-path: polygon(15% 25%, 50% 0, 85% 25%, 100% 50%, 75% 85%, 50% 100%, 25% 85%, 0 50%);*/
|
|
28
|
+
clip-path: polygon(15% 20%, 50% 0, 85% 20%, 100% 50%, 80% 85%, 50% 100%, 20% 85%, 0 50%);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.plusMinus {
|
|
32
|
+
position: absolute;
|
|
33
|
+
left: 0;
|
|
34
|
+
right: 0;
|
|
35
|
+
text-align: center;
|
|
36
|
+
z-index: 3;
|
|
37
|
+
color: white;
|
|
38
|
+
|
|
39
|
+
display: flex;
|
|
40
|
+
align-items: center;
|
|
41
|
+
justify-content: center;
|
|
42
|
+
|
|
43
|
+
/*background-color: hotpink!important;*/
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.plusMinus svg {
|
|
47
|
+
margin: 0
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.plusMinus.plus{
|
|
51
|
+
/*top: 0;*/
|
|
26
52
|
}
|
|
27
53
|
|
|
28
|
-
.
|
|
54
|
+
.plusMinus.minus{
|
|
55
|
+
/*bottom: 0;*/
|
|
29
56
|
}
|
|
30
57
|
|
|
31
58
|
.numberSelect_doneClosing {
|
|
@@ -153,11 +153,26 @@ const NumberSelect = _ref => {
|
|
|
153
153
|
}, icon()));
|
|
154
154
|
const gety = e => e.touches[0].clientY;
|
|
155
155
|
const onTouchStart = e => {
|
|
156
|
-
if (noFlick
|
|
156
|
+
if (noFlick) return;
|
|
157
157
|
setTouchStartPosition(gety(e));
|
|
158
158
|
};
|
|
159
|
-
const onTouchMove = e =>
|
|
160
|
-
|
|
159
|
+
const onTouchMove = e => {
|
|
160
|
+
if (noFlick) return;
|
|
161
|
+
const newVal = touchStartPosition - gety(e);
|
|
162
|
+
const bottom = min === value && !invert || max === value && invert;
|
|
163
|
+
const top = max === value && !invert || min === value && invert;
|
|
164
|
+
if (bottom && newVal < 0 || top && newVal > 0) {
|
|
165
|
+
console.group('boink');
|
|
166
|
+
console.log('newVal', newVal);
|
|
167
|
+
console.log('top', top);
|
|
168
|
+
console.log('bottom', bottom);
|
|
169
|
+
console.groupEnd();
|
|
170
|
+
return;
|
|
171
|
+
}
|
|
172
|
+
if (min === value && newVal < 0) return;
|
|
173
|
+
setVerticalDistanceSwiped(touchStartPosition - gety(e));
|
|
174
|
+
};
|
|
175
|
+
const swipeDistance = 30;
|
|
161
176
|
const onTouchEnd = () => {
|
|
162
177
|
if (noFlick || editing) return;
|
|
163
178
|
if (Math.abs(verticalDistanceSwiped) > swipeDistance) {
|
|
@@ -167,14 +182,11 @@ const NumberSelect = _ref => {
|
|
|
167
182
|
// do haptix?
|
|
168
183
|
};
|
|
169
184
|
const offset = Math.min(Math.max(verticalDistanceSwiped, swipeDistance * -1), swipeDistance) / swipeDistance;
|
|
170
|
-
const blobOffsetUnit = "".concat(size * (1 - 0.7) / 2, "rem");
|
|
171
|
-
// const blobSize = `${size * .65}rem`;
|
|
172
|
-
const blobRadius = "".concat(size * .65 / 2, "rem");
|
|
173
185
|
let top = 0,
|
|
174
186
|
bottom = 0;
|
|
175
187
|
if (offset !== 0) {
|
|
176
188
|
const absValue = Math.abs(offset);
|
|
177
|
-
const distance = size /
|
|
189
|
+
const distance = size / 5 * absValue;
|
|
178
190
|
const boop = "-".concat(distance, "rem");
|
|
179
191
|
if (offset > 0) {
|
|
180
192
|
top = boop;
|
|
@@ -186,19 +198,49 @@ const NumberSelect = _ref => {
|
|
|
186
198
|
top,
|
|
187
199
|
bottom
|
|
188
200
|
};
|
|
201
|
+
|
|
202
|
+
// const florp = Math.max(0, Math.abs(offset) - 0.3) * 1.5;
|
|
203
|
+
const florp = Math.max(0, Math.abs(offset) - 0.5) * 1.5;
|
|
189
204
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
190
205
|
onTouchStart: onTouchStart,
|
|
191
206
|
onTouchMove: onTouchMove,
|
|
192
207
|
onTouchEnd: onTouchEnd,
|
|
193
208
|
className: "numberSelect ".concat(editing ? 'numberSelect_editing' : '', " ").concat(doneClosing ? 'numberSelect_doneClosing' : '')
|
|
194
209
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
210
|
+
className: "plusMinus plus",
|
|
211
|
+
style: {
|
|
212
|
+
top: "-".concat(size / 5, "rem"),
|
|
213
|
+
opacity: offset > 0 ? florp : 0,
|
|
214
|
+
height: "".concat(size / 3, "rem")
|
|
215
|
+
}
|
|
216
|
+
}, /*#__PURE__*/_react.default.createElement("svg", {
|
|
217
|
+
height: "".concat(size / 4, "rem"),
|
|
218
|
+
viewBox: "0 0 271 153",
|
|
219
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
220
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
221
|
+
d: "M136.68 19.1619L17.4993 133.606H47.2944L136.68 64.9149L226.065 133.606H255.86L136.68 19.1619Z",
|
|
222
|
+
fill: color
|
|
223
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
224
|
+
className: "plusMinus minus",
|
|
225
|
+
style: {
|
|
226
|
+
bottom: "-".concat(size / 5, "rem"),
|
|
227
|
+
opacity: offset < 0 ? florp : 0,
|
|
228
|
+
height: "".concat(size / 3, "rem")
|
|
229
|
+
}
|
|
230
|
+
}, /*#__PURE__*/_react.default.createElement("svg", {
|
|
231
|
+
height: "".concat(size / 4, "rem"),
|
|
232
|
+
viewBox: "0 0 271 153",
|
|
233
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
234
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
235
|
+
d: "M136.68 133.606L17.4993 19.1621H47.2944L136.68 87.8532L226.065 19.1621H255.86L136.68 133.606Z",
|
|
236
|
+
fill: color
|
|
237
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
195
238
|
className: "swipeBlobContainer"
|
|
196
239
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
197
240
|
className: "swipeBlob",
|
|
198
241
|
style: _objectSpread({
|
|
199
|
-
left: "".concat(
|
|
200
|
-
right: "".concat(
|
|
201
|
-
borderRadius: blobRadius,
|
|
242
|
+
left: "".concat(size * 0.02, "rem"),
|
|
243
|
+
right: "".concat(size * 0.02, "rem"),
|
|
202
244
|
backgroundColor: numberBgColor
|
|
203
245
|
}, blobStyle)
|
|
204
246
|
})), /*#__PURE__*/_react.default.createElement("div", {
|