1.0.8
This commit is contained in:
parent
45d1530f15
commit
14a24bb283
@ -21,3 +21,21 @@ export function animateStart(HTMLElement, className, forceExecute=false) {
|
|||||||
event.target.classList.remove(className); // 清洗动画
|
event.target.classList.remove(className); // 清洗动画
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设置CSS变量值
|
||||||
|
* @param {string} varName
|
||||||
|
* @param {string} value
|
||||||
|
*/
|
||||||
|
export function setClassVar(varName, value) {
|
||||||
|
document.documentElement.style.setProperty(varName, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取CSS变量值
|
||||||
|
* @param {string} varName
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
export function getStyleVar(varName) {
|
||||||
|
return getComputedStyle(document.documentElement).getPropertyValue(varName);
|
||||||
|
}
|
||||||
4
index.js
4
index.js
@ -1,8 +1,8 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: ddmt
|
* @Author: ddmt
|
||||||
* @version: 1.0.6
|
* @version: 1.0.8
|
||||||
* @Date: 2024-9-29 20:50:12
|
* @Date: 2024-9-29 20:50:12
|
||||||
* @LastEditTime: 2024-9-29 20:50:12
|
* @LastEditTime: 2024-11-15 20:50:12
|
||||||
* @LastEditors: ddmt
|
* @LastEditors: ddmt
|
||||||
* @Description: ddmt-index file
|
* @Description: ddmt-index file
|
||||||
* @FilePath: /index.js
|
* @FilePath: /index.js
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ddmt-tool",
|
"name": "ddmt-tool",
|
||||||
"version": "0.0.2-beta.1",
|
"version": "0.0.3",
|
||||||
"description": "A utility library that provides commonly used functions to simplify everyday development tasks. Whether it's string manipulation, array operations, or other frequent functionalities, `ddmt-tool` helps you work more efficiently.",
|
"description": "A utility library that provides commonly used functions to simplify everyday development tasks. Whether it's string manipulation, array operations, or other frequent functionalities, `ddmt-tool` helps you work more efficiently.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
|
|||||||
6
types/index.d.ts
vendored
6
types/index.d.ts
vendored
@ -1,8 +1,12 @@
|
|||||||
declare module 'ddmt-tool' {
|
declare module 'ddmt-tool' {
|
||||||
|
// Tool/animate.js
|
||||||
export function animateStart(event: HTMLElement, className: string, forceExecute?: boolean): void;
|
export function animateStart(event: HTMLElement, className: string, forceExecute?: boolean): void;
|
||||||
|
export function setClassVar(varName: string, value: string): void;
|
||||||
|
export function getClassVar(varName: string): String;
|
||||||
|
|
||||||
|
// Tool/number.js
|
||||||
export function randomNum(minNum: number): number;
|
export function randomNum(minNum: number): number;
|
||||||
export function randomNum(minNum: number, maxNum: number): number;
|
export function randomNum(minNum: number, maxNum: number): number;
|
||||||
|
|
||||||
export function nextArray(arr: any[], index: number): any[];
|
export function nextArray(arr: any[], index: number): any[];
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user