Socket
Socket
Sign inDemoInstall

cloudword

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cloudword

Cloud word generation tool


Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

自动生成云文字的工具

使用 让标题像云彩一样动起来

npm install cloudword -S

// 在 main.js 里面引用
import cloudWord from 'cloudWord'

new cloudWord({
  el: '#cloudWord',
  words: ['one', 'two', 'three'],
  colors: ['red', 'yellow', 'green'],
  onClick(elem) {
    console.log('点击的文字信息:', elem)
  }
})

配置项

名称描述类型默认值是否必填
eldom 容器String|Document-
words要渲染的标题列表Array-
colors标题所渲染出来的颜色列表Array-
touchStop是否鼠标覆盖停止Booleantrue
minSize最小字体String | Number14
maxSize最大字体String | Number26
onClick自定义点击事件Function-

api 方法

const cloudWords = new cloudWord({
  el: '#cloudWord',
  words: ['one', 'two', 'three'],
  colors: ['red', 'yellow', 'green']
})
// 添加,删除,更新
cloudWords.addWord('four');
cloudWords.removeWord(3);
cloudWords.updateWord(3, 'five');
// 刷新
cloudWords.refresh()

效果展示

git clone https://github.com/jiayunfei/cloudwords.git 下载到本地

npm install
npm run serve

打开 http://localhost:3000 就可以查看效果

Keywords

FAQs

Last updated on 07 Oct 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc