Skip to content

Commit

Permalink
v1.3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
leaferjs committed Jan 9, 2025
1 parent dd70fa1 commit c863a03
Show file tree
Hide file tree
Showing 8 changed files with 294 additions and 7 deletions.
13 changes: 13 additions & 0 deletions src/basic/app/grow.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Leafer, Rect } from 'leafer-ui'

const leafer = new Leafer({
view: window,
grow: true, // 自动生长 [!code hl:3]
// growWidth: true, // 宽度是否生长, 默认同 grow
// growHeight: true // 高度是否生长, 默认同 grow
fill: 'black'
})

const rect = Rect.one({ fill: '#32cd79', draggable: true }, 100, 100, 200, 200)

leafer.add(rect) // 拖拽矩形可以看到画布在生长,自动贴合内容
245 changes: 245 additions & 0 deletions src/contest/bloom/wish.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/performance/million.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Million Rects | Leafer UI</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<script src="https://unpkg.com/leafer-ui@1.2.2/dist/web.min.js"></script>
<script src="https://unpkg.com/leafer-ui@1.3.2/dist/web.min.js"></script>
</head>

<body></body>
Expand Down
15 changes: 15 additions & 0 deletions src/property/animation/delete.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Leafer, Text } from 'leafer-ui'
import '@leafer-in/animate'

const leafer = new Leafer({ view: window })

const text = new Text({
fill: 'rgb(50,205,121)',
text: 'Welcome to LeaferJS',
animation: { // [!code hl:4]
style: { text: '' },
duration: 2,
}
})

leafer.add(text)
14 changes: 14 additions & 0 deletions src/property/animation/writer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Leafer, Text } from 'leafer-ui'
import '@leafer-in/animate'

const leafer = new Leafer({ view: window })

const text = new Text({
fill: 'rgb(50,205,121)',
animation: { // [!code hl:4]
style: { text: 'Welcome to LeaferJS' },
duration: 2,
}
})

leafer.add(text)
8 changes: 4 additions & 4 deletions src/property/custom/addAttr-datatype.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import { Leafer, Text, dataType } from 'leafer-ui'

const leafer = new Leafer({ view: window })

Text.addAttr('version', '1.2.2', dataType) // [!code hl]
Text.addAttr('version', '1.3.2', dataType) // [!code hl]

// default version

const text = new Text({ text: 'Welcome to LeaferJS' })

leafer.add(text)

console.log((text as any).version) // 1.2.2
console.log((text as any).version) // 1.3.2

// set version

const text2 = new Text({ version: '1.2.2' } as any)
const text2 = new Text({ version: '1.3.2' } as any)

console.log((text2 as any).version) // 1.2.2
console.log((text2 as any).version) // 1.3.2
2 changes: 1 addition & 1 deletion src/start/create.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<title>Demo | Leafer UI</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<script src="https://unpkg.com/leafer-ui@1.2.2/dist/web.min.js"></script>
<script src="https://unpkg.com/leafer-ui@1.3.2/dist/web.min.js"></script>
</head>
<body></body>
<script>
Expand Down
2 changes: 1 addition & 1 deletion src/worker/worker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// 你也可以使用npm包模式,编译成js文件供worker调用
importScripts(
'https://unpkg.com/@leafer-ui/worker@1.2.2/dist/worker.min.js'
'https://unpkg.com/@leafer-ui/worker@1.3.2/dist/worker.min.js'
)

const { Leafer, Rect } = LeaferUI
Expand Down

0 comments on commit c863a03

Please sign in to comment.