mirror of
https://git.ddmt.top/ddmt/ddmt-tool.git
synced 2026-03-23 05:17:06 +00:00
0.0.1-beta.2
This commit is contained in:
59
README.md
59
README.md
@@ -1,5 +1,3 @@
|
||||
Here’s a suggestion for your npm package description in English:
|
||||
|
||||
```markdown
|
||||
# ddmt-tool
|
||||
|
||||
@@ -12,12 +10,63 @@ npm install ddmt-tool
|
||||
```
|
||||
|
||||
## Usage Example
|
||||
|
||||
General usage.
|
||||
```javascript
|
||||
import { Name } from 'ddmt-tool';
|
||||
|
||||
Name();
|
||||
```
|
||||
Refers specifically to the usage of animateStart.
|
||||
|
||||
```javascript
|
||||
import { animateStart } from 'ddmt-tool';
|
||||
|
||||
/**
|
||||
* animateStart
|
||||
* @param {HTMLElement} HTMLElement Animation needs to be played in HTMLElement
|
||||
* @param {string} classname The corresponding CSS for the animation
|
||||
* @param {boolean} forceExecute Whether to force execute the animation or not
|
||||
* @returns {void}
|
||||
*/
|
||||
animateStart(event, className, forceExecute=false);
|
||||
```
|
||||
Here's an example of how to use CSS
|
||||
```css
|
||||
.box-item {
|
||||
position: absolute;
|
||||
background-color: rgb(255, 223, 181);
|
||||
border-radius: 10px;
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
margin: 2px;
|
||||
text-align: center;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
.box-item.animate {
|
||||
animation-name: boxbing;
|
||||
animation-duration: 0.7s;
|
||||
animation-iteration-count: 1;
|
||||
/* 设置动画只播放一次 */
|
||||
animation-fill-mode: forwards;
|
||||
/* 保持动画结束时的状态 */
|
||||
}
|
||||
|
||||
@keyframes boxbing {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Features
|
||||
|
||||
@@ -26,6 +75,4 @@ Name();
|
||||
- Custom utilities
|
||||
|
||||
For more features and usage instructions, please refer to the documentation.
|
||||
```
|
||||
|
||||
This should give users a clear understanding of your package's purpose and how to use it.
|
||||
```
|
||||
Reference in New Issue
Block a user