-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
294 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) // 拖拽矩形可以看到画布在生长,自动贴合内容 |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters