Skip to content

Commit

Permalink
🐛fix buttery load twice trigger undefined bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mantoufan committed May 11, 2023
1 parent cb19599 commit 61b1fd2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Pure CSS animation for sakura, rain, snow, firefly and butterfly effects, high p
#### Node.js
```javascript
npm i yzhanweather
import YZhanWeather from 'yzhanweather'
```
#### Browser
```html
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "yzhanweather",
"version": "1.0.3",
"version": "1.0.4",
"description": "Pure CSS animation for sakura, rain, snow, firefly and butterfly effects, high performance without affecting SEO. 纯 CSS 动画实现樱花、雨、雪、萤火虫和蝴蝶飞舞背景效果,高性能且不影响 SEO",
"main": "docs/yzhanweather.min.js",
"files": [
Expand Down
3 changes: 1 addition & 2 deletions src/yzhanweather.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,9 @@ export default class {
let {num, html, containerStyle, style, styles, keyframe = {}, keyframes} = CONF[type]
this.createKeyfarme(keyframe)
const keyframeNames = this.createKeyfarmes(keyframes)
if (typeof style === 'string') style = { '': style }
if (typeof style === 'string') style = { '': style }
this.createStyles([style['']], n => '.' + (this.container.className = n) + ' div', keyframeNames)
this.createStyles([containerStyle], _ => '.' + this.container.className, keyframeNames)
delete style['']
this.createRule(style, n => '.' + this.container.className + ' div' + (n[0] === ':' ? '' : ' ') + n)
this.replaceStyles(styles, config)
const classNames = this.createStyles(styles, n => ' .' + this.container.className + ' .' + n, keyframeNames)
Expand Down

0 comments on commit 61b1fd2

Please sign in to comment.