@appartmint/mint 1.2.4 → 1.2.5

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.
Files changed (37) hide show
  1. package/README.md +3 -3
  2. package/dist/css/mint.css +4 -0
  3. package/dist/css/mint.css.map +1 -1
  4. package/dist/css/mint.min.css +1 -1
  5. package/dist/css/mint.min.css.map +1 -1
  6. package/dist/js/imports/components/header.d.ts +124 -124
  7. package/dist/js/imports/components/index.d.ts +4 -4
  8. package/dist/js/imports/enums/index.d.ts +4 -4
  9. package/dist/js/imports/enums/side.d.ts +9 -9
  10. package/dist/js/imports/index.d.ts +7 -7
  11. package/dist/js/imports/models/color.d.ts +31 -31
  12. package/dist/js/imports/models/file.d.ts +20 -20
  13. package/dist/js/imports/models/index.d.ts +9 -9
  14. package/dist/js/imports/models/item.d.ts +70 -70
  15. package/dist/js/imports/models/minify.d.ts +11 -11
  16. package/dist/js/imports/models/page.d.ts +17 -17
  17. package/dist/js/imports/models/recaptcha.d.ts +8 -8
  18. package/dist/js/imports/util/display.d.ts +24 -24
  19. package/dist/js/imports/util/event.d.ts +40 -40
  20. package/dist/js/imports/util/icon.d.ts +28 -28
  21. package/dist/js/imports/util/index.d.ts +14 -14
  22. package/dist/js/imports/util/list.d.ts +22 -22
  23. package/dist/js/imports/util/math.d.ts +13 -13
  24. package/dist/js/imports/util/object.d.ts +77 -77
  25. package/dist/js/imports/util/scroll.d.ts +22 -22
  26. package/dist/js/imports/util/selectors.d.ts +121 -121
  27. package/dist/js/imports/util/settings.d.ts +38 -38
  28. package/dist/js/imports/util/text.d.ts +39 -39
  29. package/dist/js/imports/util/window.d.ts +11 -11
  30. package/dist/js/index.d.ts +9 -9
  31. package/dist/js/index.js +351 -351
  32. package/dist/js/index.js.map +1 -1
  33. package/dist/js/index.min.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/scss/imports/global/_icons.scss +6 -6
  36. package/src/scss/imports/global/_texture.scss +11 -1
  37. package/src/ts/imports/models/color.ts +96 -96
@@ -1,96 +1,96 @@
1
- /**
2
- * Color
3
- */
4
- export class mintColor {
5
- protected static hexBase: number = 16;
6
- protected static hexMax: string = 'FF';
7
- public r: number;
8
- public g: number;
9
- public b: number;
10
- public a: number;
11
-
12
- constructor (args: {[key: string]: number | string}) {
13
- this.r = typeof args.r === 'number' ? Math.max(Math.min(args.r, mintColor.hexBase ** 2 - 1), 0) : 0;
14
- this.g = typeof args.g === 'number' ? Math.max(Math.min(args.g, mintColor.hexBase ** 2 - 1), 0) : 0;
15
- this.b = typeof args.b === 'number' ? Math.max(Math.min(args.b, mintColor.hexBase ** 2 - 1), 0) : 0;
16
- this.a = typeof args.a === 'number' ? Math.max(Math.min(args.a, 1), 0) : 1;
17
- if (typeof args.color === 'string') {
18
- this.stringConstructor(args.color);
19
- }
20
- }
21
-
22
- /**
23
- * Constructor from a string argument
24
- */
25
- protected stringConstructor (str: string) : void {
26
- if (str.startsWith('#')) {
27
- this.hexConstructor(str);
28
- } else {
29
- if (~str.indexOf('linear-gradient')) {
30
- str = str.substring(str.indexOf('linear-gradient'), str.length);
31
- }
32
- this.rgbConstructor(str);
33
- }
34
- }
35
-
36
- /**
37
- * Constructor from a hex argument
38
- */
39
- protected hexConstructor (hex: string) : void {
40
- switch (hex.length) {
41
- case 1:
42
- case 5:
43
- case 6:
44
- return;
45
- case 2:
46
- hex = '#' + hex[1] + hex[1] + hex[1] + hex[1] + hex[1] + hex[1] + mintColor.hexMax;
47
- break;
48
- case 3:
49
- hex = '#' + hex[1] + hex[1] + hex[1] + hex[2] + hex[2] + hex[2] + mintColor.hexMax;
50
- break;
51
- case 4:
52
- hex = '#' + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3] + mintColor.hexMax;
53
- break;
54
- case 7:
55
- hex += mintColor.hexMax;
56
- break;
57
- case 8:
58
- hex += hex[hex.length - 1];
59
- break;
60
- default:
61
- hex = hex.substring(0, 9);
62
- }
63
-
64
- this.r = parseInt(hex.substring(1, 3), mintColor.hexBase);
65
- this.g = parseInt(hex.substring(3, 5), mintColor.hexBase);
66
- this.b = parseInt(hex.substring(5, 7), mintColor.hexBase);
67
- this.a = parseInt(hex.substring(7, 9), mintColor.hexBase) / mintColor.hexBase ** 2;
68
- }
69
-
70
- /**
71
- * Constructor from an rgba argument
72
- */
73
- protected rgbConstructor (rgb: string) : void {
74
- let match: RegExpMatchArray | null = rgb.match(/rgba?\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)?(?:, ?(\d(?:\.\d*)?)\))?/);
75
- if (match) {
76
- this.r = parseInt(match[1]);
77
- this.g = parseInt(match[2]);
78
- this.b = parseInt(match[3]);
79
- this.a = parseFloat(match[4]);
80
- }
81
- }
82
-
83
- /**
84
- * Returns the perceived brightness of the color
85
- */
86
- getBrightness () : number {
87
- if (this.a === 0) {
88
- return 262;
89
- }
90
- if (!isNaN(this.r) && !isNaN(this.g) && !isNaN(this.b)) {
91
- return Math.round((this.r * 299 + this.g * 587 + this.b * 144) / 1000);
92
- }
93
- return -1;
94
- }
95
- }
96
- export default mintColor;
1
+ /**
2
+ * Color
3
+ */
4
+ export class mintColor {
5
+ protected static hexBase: number = 16;
6
+ protected static hexMax: string = 'FF';
7
+ public r: number;
8
+ public g: number;
9
+ public b: number;
10
+ public a: number;
11
+
12
+ constructor (args: {[key: string]: number | string}) {
13
+ this.r = typeof args.r === 'number' ? Math.max(Math.min(args.r, mintColor.hexBase ** 2 - 1), 0) : 0;
14
+ this.g = typeof args.g === 'number' ? Math.max(Math.min(args.g, mintColor.hexBase ** 2 - 1), 0) : 0;
15
+ this.b = typeof args.b === 'number' ? Math.max(Math.min(args.b, mintColor.hexBase ** 2 - 1), 0) : 0;
16
+ this.a = typeof args.a === 'number' ? Math.max(Math.min(args.a, 1), 0) : 1;
17
+ if (typeof args.color === 'string') {
18
+ this.stringConstructor(args.color);
19
+ }
20
+ }
21
+
22
+ /**
23
+ * Constructor from a string argument
24
+ */
25
+ protected stringConstructor (str: string) : void {
26
+ if (str.startsWith('#')) {
27
+ this.hexConstructor(str);
28
+ } else {
29
+ if (~str.indexOf('linear-gradient')) {
30
+ str = str.substring(str.indexOf('linear-gradient'), str.length);
31
+ }
32
+ this.rgbConstructor(str);
33
+ }
34
+ }
35
+
36
+ /**
37
+ * Constructor from a hex argument
38
+ */
39
+ protected hexConstructor (hex: string) : void {
40
+ switch (hex.length) {
41
+ case 1:
42
+ case 5:
43
+ case 6:
44
+ return;
45
+ case 2:
46
+ hex = '#' + hex[1] + hex[1] + hex[1] + hex[1] + hex[1] + hex[1] + mintColor.hexMax;
47
+ break;
48
+ case 3:
49
+ hex = '#' + hex[1] + hex[1] + hex[1] + hex[2] + hex[2] + hex[2] + mintColor.hexMax;
50
+ break;
51
+ case 4:
52
+ hex = '#' + hex[1] + hex[1] + hex[2] + hex[2] + hex[3] + hex[3] + mintColor.hexMax;
53
+ break;
54
+ case 7:
55
+ hex += mintColor.hexMax;
56
+ break;
57
+ case 8:
58
+ hex += hex[hex.length - 1];
59
+ break;
60
+ default:
61
+ hex = hex.substring(0, 9);
62
+ }
63
+
64
+ this.r = parseInt(hex.substring(1, 3), mintColor.hexBase);
65
+ this.g = parseInt(hex.substring(3, 5), mintColor.hexBase);
66
+ this.b = parseInt(hex.substring(5, 7), mintColor.hexBase);
67
+ this.a = parseInt(hex.substring(7, 9), mintColor.hexBase) / mintColor.hexBase ** 2;
68
+ }
69
+
70
+ /**
71
+ * Constructor from an rgba argument
72
+ */
73
+ protected rgbConstructor (rgb: string) : void {
74
+ let match: RegExpMatchArray | null = rgb.match(/rgba?\((\d{1,3}), ?(\d{1,3}), ?(\d{1,3})\)?(?:, ?(\d(?:\.\d*)?)\))?/);
75
+ if (match) {
76
+ this.r = parseInt(match[1]);
77
+ this.g = parseInt(match[2]);
78
+ this.b = parseInt(match[3]);
79
+ this.a = parseFloat(match[4]);
80
+ }
81
+ }
82
+
83
+ /**
84
+ * Returns the perceived brightness of the color
85
+ */
86
+ getBrightness () : number {
87
+ if (this.a === 0) {
88
+ return 262;
89
+ }
90
+ if (!isNaN(this.r) && !isNaN(this.g) && !isNaN(this.b)) {
91
+ return Math.round((this.r * 299 + this.g * 587 + this.b * 144) / 1000);
92
+ }
93
+ return -1;
94
+ }
95
+ }
96
+ export default mintColor;