Skip to content

Commit

Permalink
feat: publish v2.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mincong committed Mar 22, 2024
1 parent d6957c7 commit 0e7f2a6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
7 changes: 7 additions & 0 deletions README.CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ TagCloud(container, texts, options);

鼠标移除容器区域时是否保持继续滚动。默认为是 `true`,减速至初始滚动速度,然后继续随鼠标滚动。

##### options.reverseDirection

类型: `Boolean`\
默认值: `false`

当鼠标控制方向时,是否要逆转方向。

##### options.containerClass

类型: `String`\
Expand Down
11 changes: 9 additions & 2 deletions dist/TagCloud.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*!
* TagCloud.js v2.4.0
* Copyright (c) 2016-2023 @ Cong Min
* TagCloud.js v2.5.0
* Copyright (c) 2016-2024 @ Cong Min
* MIT License - https://github.com/mcc108/TagCloud
*/
(function (global, factory) {
Expand Down Expand Up @@ -298,6 +298,12 @@

var a = -(Math.min(Math.max(-self.mouseY, -self.size), self.size) / self.radius) * self.maxSpeed;
var b = Math.min(Math.max(-self.mouseX, -self.size), self.size) / self.radius * self.maxSpeed;

// inverse direction if enabled
if (self.config.reverseDirection) {
a = -a;
b = -b;
}
if (Math.abs(a) <= 0.01 && Math.abs(b) <= 0.01) return; // pause

// calculate offset
Expand Down Expand Up @@ -424,6 +430,7 @@
// rolling init direction, unit clockwise `deg`, optional: `0`(top) , `90`(left), `135`(right-bottom)(default)...
keep: true,
// whether to keep rolling after mouse out area, optional: `false`, `true`(default)(decelerate to rolling init speed, and keep rolling with mouse)
reverseDirection: false,
useContainerInlineStyles: true,
useItemInlineStyles: true,
containerClass: 'tagcloud',
Expand Down
6 changes: 3 additions & 3 deletions dist/TagCloud.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "TagCloud",
"version": "2.4.0",
"version": "2.5.0",
"description": "3D TagCloud",
"main": "dist/TagCloud.js",
"types": "dist/TagCloud.d.ts",
Expand Down

0 comments on commit 0e7f2a6

Please sign in to comment.