grevlingui 0.1.43 → 0.1.45
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,10 +153,20 @@ 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 =>
|
|
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
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (min === value && newVal < 0) return;
|
|
168
|
+
setVerticalDistanceSwiped(touchStartPosition - gety(e));
|
|
169
|
+
};
|
|
160
170
|
const swipeDistance = 30;
|
|
161
171
|
const onTouchEnd = () => {
|
|
162
172
|
if (noFlick || editing) return;
|
|
@@ -167,14 +177,11 @@ const NumberSelect = _ref => {
|
|
|
167
177
|
// do haptix?
|
|
168
178
|
};
|
|
169
179
|
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
180
|
let top = 0,
|
|
174
181
|
bottom = 0;
|
|
175
182
|
if (offset !== 0) {
|
|
176
183
|
const absValue = Math.abs(offset);
|
|
177
|
-
const distance = size /
|
|
184
|
+
const distance = size / 5 * absValue;
|
|
178
185
|
const boop = "-".concat(distance, "rem");
|
|
179
186
|
if (offset > 0) {
|
|
180
187
|
top = boop;
|
|
@@ -186,19 +193,49 @@ const NumberSelect = _ref => {
|
|
|
186
193
|
top,
|
|
187
194
|
bottom
|
|
188
195
|
};
|
|
196
|
+
|
|
197
|
+
// const florp = Math.max(0, Math.abs(offset) - 0.3) * 1.5;
|
|
198
|
+
const florp = Math.max(0, Math.abs(offset) - 0.5) * 1.5;
|
|
189
199
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
190
200
|
onTouchStart: onTouchStart,
|
|
191
201
|
onTouchMove: onTouchMove,
|
|
192
202
|
onTouchEnd: onTouchEnd,
|
|
193
203
|
className: "numberSelect ".concat(editing ? 'numberSelect_editing' : '', " ").concat(doneClosing ? 'numberSelect_doneClosing' : '')
|
|
194
204
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
205
|
+
className: "plusMinus plus",
|
|
206
|
+
style: {
|
|
207
|
+
top: "-".concat(size / 5, "rem"),
|
|
208
|
+
opacity: offset > 0 ? florp : 0,
|
|
209
|
+
height: "".concat(size / 3, "rem")
|
|
210
|
+
}
|
|
211
|
+
}, /*#__PURE__*/_react.default.createElement("svg", {
|
|
212
|
+
height: "".concat(size / 4, "rem"),
|
|
213
|
+
viewBox: "0 0 271 153",
|
|
214
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
215
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
216
|
+
d: "M136.68 19.1619L17.4993 133.606H47.2944L136.68 64.9149L226.065 133.606H255.86L136.68 19.1619Z",
|
|
217
|
+
fill: color
|
|
218
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
219
|
+
className: "plusMinus minus",
|
|
220
|
+
style: {
|
|
221
|
+
bottom: "-".concat(size / 5, "rem"),
|
|
222
|
+
opacity: offset < 0 ? florp : 0,
|
|
223
|
+
height: "".concat(size / 3, "rem")
|
|
224
|
+
}
|
|
225
|
+
}, /*#__PURE__*/_react.default.createElement("svg", {
|
|
226
|
+
height: "".concat(size / 4, "rem"),
|
|
227
|
+
viewBox: "0 0 271 153",
|
|
228
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
229
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
230
|
+
d: "M136.68 133.606L17.4993 19.1621H47.2944L136.68 87.8532L226.065 19.1621H255.86L136.68 133.606Z",
|
|
231
|
+
fill: color
|
|
232
|
+
}))), /*#__PURE__*/_react.default.createElement("div", {
|
|
195
233
|
className: "swipeBlobContainer"
|
|
196
234
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
197
235
|
className: "swipeBlob",
|
|
198
236
|
style: _objectSpread({
|
|
199
|
-
left: "".concat(
|
|
200
|
-
right: "".concat(
|
|
201
|
-
borderRadius: blobRadius,
|
|
237
|
+
left: "".concat(size * 0.02, "rem"),
|
|
238
|
+
right: "".concat(size * 0.02, "rem"),
|
|
202
239
|
backgroundColor: numberBgColor
|
|
203
240
|
}, blobStyle)
|
|
204
241
|
})), /*#__PURE__*/_react.default.createElement("div", {
|