@kuankuan/assist-2026 0.1.15 → 0.1.17
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/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/random.d.ts +3 -0
- package/dist/utils/random.js +9 -0
- package/package.json +1 -1
- package/src/{utils.ts → utils/copyText.ts} +1 -1
- package/src/utils/index.ts +2 -0
- package/src/utils/random.ts +9 -0
- package/styles/motion.scss +4 -2
- package/styles/theme.scss +13 -4
- /package/dist/{utils.d.ts → utils/copyText.d.ts} +0 -0
- /package/dist/{utils.js → utils/copyText.js} +0 -0
package/package.json
CHANGED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export function randomFloat(min: number, max: number) {
|
|
2
|
+
return Math.random() * (max - min) + min;
|
|
3
|
+
}
|
|
4
|
+
export function randomInt(min: number, max: number) {
|
|
5
|
+
return Math.floor(randomFloat(min, max));
|
|
6
|
+
}
|
|
7
|
+
export function randomChoice<T>(arr: T[]): T {
|
|
8
|
+
return arr[randomInt(0, arr.length)]!;
|
|
9
|
+
}
|
package/styles/motion.scss
CHANGED
package/styles/theme.scss
CHANGED
|
@@ -22,16 +22,25 @@ $defaultTheme: (
|
|
|
22
22
|
);
|
|
23
23
|
|
|
24
24
|
$curTheme: 'light';
|
|
25
|
+
$printTheme: 'light';
|
|
25
26
|
@mixin use($anythingElse: '', $themeConfig: $defaultTheme) {
|
|
26
|
-
@
|
|
27
|
-
|
|
27
|
+
@media screen {
|
|
28
|
+
@each $key, $value in $themeConfig {
|
|
29
|
+
$curTheme: $key !global;
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
@include select($key, $anythingElse) {
|
|
32
|
+
@content;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
@media print {
|
|
37
|
+
$curTheme: $printTheme !global;
|
|
38
|
+
@include select($printTheme, $anythingElse) {
|
|
30
39
|
@content;
|
|
31
40
|
}
|
|
32
41
|
}
|
|
33
42
|
}
|
|
34
|
-
@function selecter($theme){
|
|
43
|
+
@function selecter($theme) {
|
|
35
44
|
@return "[data-theme='#{$theme}']";
|
|
36
45
|
}
|
|
37
46
|
@mixin select($theme, $anythingElse: '') {
|
|
File without changes
|
|
File without changes
|