forked from sleepy-zone/fabritor-web
-
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
1 parent
a4c1628
commit 0ac00c4
Showing
7 changed files
with
144 additions
and
20 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
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,65 @@ | ||
import { Flex, Card, Typography } from 'antd'; | ||
|
||
const { Title } = Typography; | ||
|
||
const PRESET_FONT_LIST = [ | ||
{ | ||
label: <div style={{ fontSize: 30, fontWeight: 'bold' }}>添加标题</div>, | ||
key: 'title', | ||
config: { | ||
fontFamily: 'Times New Roman', | ||
fontWeight: 'bold', | ||
fontSize: 100, | ||
text: '添加标题', | ||
top: 100 | ||
} | ||
}, | ||
{ | ||
label: <div style={{ fontSize: 24, fontFamily: 'AlibabaPuHuiTi' }}>添加副标题</div>, | ||
key: 'sub-title', | ||
config: { | ||
fontFamily: 'AlibabaPuHuiTi', | ||
fontWeight: 'bold', | ||
fontSize: 75, | ||
text: '添加副标题', | ||
top: 200 | ||
} | ||
}, | ||
{ | ||
label: <div style={{ fontSize: 16, fontFamily: 'AlibabaPuHuiTi' }}>添加一段正文</div>, | ||
key: 'content', | ||
config: { | ||
fontFamily: 'AlibabaPuHuiTi', | ||
fontSize: 50, | ||
text: '添加一段正文' | ||
} | ||
} | ||
] | ||
|
||
export default function PresetFontPanel (props) { | ||
const { addTextBox } = props; | ||
|
||
const handleClick = (item) => { | ||
addTextBox?.(item.config); | ||
} | ||
|
||
return ( | ||
<Flex vertical gap={8} style={{ marginTop: 16 }}> | ||
<Title level={4}>默认文字样式</Title> | ||
{ | ||
PRESET_FONT_LIST.map(item => ( | ||
<Card | ||
key={item.key} | ||
hoverable | ||
onClick={() => { handleClick(item) }} | ||
bodyStyle={{ | ||
padding: '12px 30px' | ||
}} | ||
> | ||
{item.label} | ||
</Card> | ||
)) | ||
} | ||
</Flex> | ||
); | ||
} |
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,13 @@ | ||
import { ColorPicker } from 'antd'; | ||
|
||
export default function AlignSetter (props) { | ||
const { value, onChange, ...rest } = props; | ||
|
||
const handleChange = (v) => { | ||
onChange && onChange(v.toHexString()) | ||
} | ||
|
||
return ( | ||
<ColorPicker value={value} onChange={handleChange} format="hex" showText {...rest} /> | ||
) | ||
} |
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