grevlingui 0.1.9 → 0.1.10
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/Dots/Dots.css +15 -2
- package/Dots/Dots.js +7 -6
- package/SunMoon.js +62 -0
- package/index.js +8 -0
- package/package.json +1 -1
package/Dots/Dots.css
CHANGED
|
@@ -7,8 +7,21 @@
|
|
|
7
7
|
width: 6rem;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
.flipped.dots {
|
|
11
|
+
transform: rotate(45deg);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.big.dots {
|
|
15
|
+
grid-template-columns: repeat(4, 2rem);
|
|
16
|
+
grid-template-rows: repeat(4, 2rem);
|
|
17
|
+
height: 8rem;
|
|
18
|
+
width: 8rem;
|
|
19
|
+
transform: rotate(135deg);
|
|
20
|
+
}
|
|
21
|
+
|
|
10
22
|
.dots .dot {
|
|
11
|
-
width:
|
|
12
|
-
height:
|
|
23
|
+
width: 26px;
|
|
24
|
+
height: 26px;
|
|
13
25
|
border-radius: 100%;
|
|
26
|
+
margin: 3px;
|
|
14
27
|
}
|
package/Dots/Dots.js
CHANGED
|
@@ -18,14 +18,15 @@ require("./Dots.css");
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
20
|
const Dots = _ref => {
|
|
21
|
-
var _grids$num;
|
|
21
|
+
var _grids$version$num;
|
|
22
22
|
|
|
23
23
|
let {
|
|
24
24
|
num,
|
|
25
|
-
color
|
|
25
|
+
color,
|
|
26
|
+
version = 0
|
|
26
27
|
} = _ref;
|
|
27
|
-
const grids = [[], [4], [0, 8], [0, 4, 8], [0, 2, 6, 8], [0, 2, 4, 6, 8], [0, 2, 3, 5, 6, 8], [0, 2, 3, 4, 5, 6, 8], [0, 1, 2, 3, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]];
|
|
28
|
-
const grid = (_grids$num = grids[num]) !== null && _grids$num !== void 0 ? _grids$num : [];
|
|
28
|
+
const grids = [[[], [4], [0, 8], [0, 4, 8], [0, 2, 6, 8], [0, 2, 4, 6, 8], [0, 2, 3, 5, 6, 8], [0, 2, 3, 4, 5, 6, 8], [0, 1, 2, 3, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]], [[], [4], [0, 8], [0, 4, 8], [0, 2, 6, 8], [0, 2, 4, 6, 8], [0, 2, 5, 6, 7, 8], [0, 2, 4, 5, 6, 7, 8], [0, 1, 2, 3, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]], [[], [8], [4, 8], [2, 6, 8], [0, 2, 6, 8], [0, 2, 4, 6, 8], [0, 2, 5, 6, 7, 8], [0, 2, 4, 5, 6, 7, 8], [0, 1, 2, 3, 5, 6, 7, 8], [0, 1, 2, 3, 4, 5, 6, 7, 8]], [[], [0], [1, 4], [0, 1, 4], [0, 1, 4, 5], [0, 1, 4, 6, 9], [0, 1, 4, 5, 6, 9], [0, 1, 4, 5, 6, 9, 10], [0, 1, 4, 5, 6, 9, 11, 14], [0, 1, 4, 5, 6, 9, 10, 11, 14], [0, 1, 4, 5, 6, 9, 10, 11, 14, 15]], [[], [0], [0, 5], [0, 1, 4], [0, 1, 4, 5], [0, 1, 4, 5, 10], [0, 1, 4, 5, 6, 9], [0, 1, 4, 5, 6, 9, 10], [0, 1, 4, 5, 6, 9, 10, 15], [0, 1, 4, 5, 6, 9, 10, 11, 14], [0, 1, 4, 5, 6, 9, 10, 11, 14, 15]]];
|
|
29
|
+
const grid = (_grids$version$num = grids[version][num]) !== null && _grids$version$num !== void 0 ? _grids$version$num : [];
|
|
29
30
|
|
|
30
31
|
const renderDot = i => grid.includes(i) ? /*#__PURE__*/_react.default.createElement("div", {
|
|
31
32
|
key: "dot-".concat(i),
|
|
@@ -38,8 +39,8 @@ const Dots = _ref => {
|
|
|
38
39
|
});
|
|
39
40
|
|
|
40
41
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
41
|
-
className: "dots"
|
|
42
|
-
}, [...Array(9).keys()].map(renderDot));
|
|
42
|
+
className: "dots".concat(version ? ' flipped' : '').concat(version > 2 ? ' big' : '')
|
|
43
|
+
}, [...Array(version > 2 ? 16 : 9).keys()].map(renderDot));
|
|
43
44
|
};
|
|
44
45
|
|
|
45
46
|
exports.Dots = Dots;
|
package/SunMoon.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.SunMoon = void 0;
|
|
7
|
+
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
|
|
12
|
+
const SunMoon = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
sun,
|
|
15
|
+
color = 'white',
|
|
16
|
+
tt = 300,
|
|
17
|
+
size = 32,
|
|
18
|
+
onClick
|
|
19
|
+
} = _ref;
|
|
20
|
+
|
|
21
|
+
const transition = keys => keys.map(key => "".concat(key, " ").concat(tt, "ms linear")).join(', ');
|
|
22
|
+
|
|
23
|
+
const path = d => /*#__PURE__*/_react.default.createElement("path", {
|
|
24
|
+
d: d,
|
|
25
|
+
fill: color,
|
|
26
|
+
style: {
|
|
27
|
+
transition: transition(['d', 'fill'])
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const circle = (cx, cy, r, fill) => /*#__PURE__*/_react.default.createElement("circle", {
|
|
32
|
+
cx: cx,
|
|
33
|
+
cy: cy,
|
|
34
|
+
r: r,
|
|
35
|
+
fill: fill,
|
|
36
|
+
style: {
|
|
37
|
+
transition: transition(['r', 'cy', 'cx', 'fill'])
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
42
|
+
width: size,
|
|
43
|
+
height: size,
|
|
44
|
+
viewBox: "0 0 120 120",
|
|
45
|
+
fill: color,
|
|
46
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
47
|
+
style: {
|
|
48
|
+
transition: "fill ".concat(tt, "ms linear")
|
|
49
|
+
},
|
|
50
|
+
onClick: onClick
|
|
51
|
+
}, /*#__PURE__*/_react.default.createElement("mask", {
|
|
52
|
+
id: "moonMask"
|
|
53
|
+
}, /*#__PURE__*/_react.default.createElement("rect", {
|
|
54
|
+
height: "10000",
|
|
55
|
+
width: "10000",
|
|
56
|
+
fill: "white"
|
|
57
|
+
}), sun ? circle("91", "43", "0", "black") : circle("73", "53", "35", "black")), /*#__PURE__*/_react.default.createElement("g", {
|
|
58
|
+
mask: "url(#moonMask)"
|
|
59
|
+
}, sun ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, path("M60 2L68 18H52L60 2Z"), path("M60 118L52 102L68 102L60 118Z"), path("M89 9.77053L87.9282 27.6269L74.0718 19.6269L89 9.77053Z"), path("M31 110.229L32.0718 92.3731L45.9282 100.373L31 110.229Z"), path("M110.229 31L100.373 45.9282L92.3731 32.0718L110.229 31Z"), path("M9.77053 89L19.6269 74.0718L27.6269 87.9282L9.77053 89Z"), path("M118 60L102 68L102 52L118 60Z"), path("M2 60L18 52L18 68L2 60Z"), path("M110.229 89L92.3731 87.9282L100.373 74.0718L110.229 89Z"), path("M9.77052 31L27.6269 32.0718L19.6269 45.9282L9.77052 31Z"), path("M89 110.229L74.0718 100.373L87.9282 92.3731L89 110.229Z"), path("M31 9.77053L45.9282 19.6269L32.0718 27.6269L31 9.77053Z"), circle("60", "60", "35", color)) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, path("M60 15L68 31H52L60 15Z"), path("M60 105L52 89L68 89L60 105Z"), path("M82.5 21.0289L81.4282 38.8853L67.5718 30.8853L82.5 21.0289Z"), path("M37.5 98.9711L38.5718 81.1147L52.4282 89.1147L37.5 98.9711Z"), path("M98.9712 37.5L89.1148 52.4282L81.1148 38.5718L98.9712 37.5Z"), path("M21.0289 82.5L30.8853 67.5718L38.8853 81.4282L21.0289 82.5Z"), path("M105 60L89 68L89 52L105 60Z"), path("M15 60L31 52L31 68L15 60Z"), path("M98.9711 82.5L81.1147 81.4282L89.1147 67.5718L98.9711 82.5Z"), path("M21.0288 37.5L38.8852 38.5718L30.8852 52.4282L21.0288 37.5Z"), path("M82.5 98.9711L67.5718 89.1147L81.4282 81.1147L82.5 98.9711Z"), path("M37.5 21.0289L52.4282 30.8853L38.5718 38.8853L37.5 21.0289Z"), circle("60", "60", "45", color))));
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
exports.SunMoon = SunMoon;
|
package/index.js
CHANGED
|
@@ -57,6 +57,12 @@ Object.defineProperty(exports, "SettingsButton", {
|
|
|
57
57
|
return _SettingsButton.SettingsButton;
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
|
+
Object.defineProperty(exports, "SunMoon", {
|
|
61
|
+
enumerable: true,
|
|
62
|
+
get: function get() {
|
|
63
|
+
return _SunMoon.SunMoon;
|
|
64
|
+
}
|
|
65
|
+
});
|
|
60
66
|
Object.defineProperty(exports, "ToggleSwitch", {
|
|
61
67
|
enumerable: true,
|
|
62
68
|
get: function get() {
|
|
@@ -94,6 +100,8 @@ var _CheckBox = require("./CheckBox");
|
|
|
94
100
|
|
|
95
101
|
var _Dots = require("./Dots/Dots");
|
|
96
102
|
|
|
103
|
+
var _SunMoon = require("./SunMoon");
|
|
104
|
+
|
|
97
105
|
var _ToggleSwitch = require("./ToggleSwitch");
|
|
98
106
|
|
|
99
107
|
var _NumberSelect = require("./NumberSelect/NumberSelect");
|