Skip to content

Commit

Permalink
refactor(zitie): 加深打印字帖时的颜色
Browse files Browse the repository at this point in the history
  • Loading branch information
FuckDoctors committed Sep 2, 2024
1 parent 222a60e commit d6961db
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
25 changes: 24 additions & 1 deletion docs/.vuepress/theme/components/hanzi/Zitie.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ import { onMounted, ref } from 'vue'
import cnchar from 'cnchar'
import { PRINT_STROKE_WIDTH, WRITING_WIDTH } from './constants'
import {
BORDER_COLOR,
LINE_COLOR,
OUTLINE_COLOR,
PRINT_STROKE_WIDTH,
STROKE_COLOR,
WRITING_WIDTH,
} from './constants'
const props = defineProps({
zi: String,
Expand Down Expand Up @@ -36,11 +43,15 @@ onMounted(() => {
style: {
length: PRINT_STROKE_WIDTH,
showOutline: false,
outlineColor: OUTLINE_COLOR,
strokeColor: STROKE_COLOR,
},
line: {
lineCross: false,
lineStraight: false,
borderWidth: 0,
lineColor: LINE_COLOR,
borderColor: BORDER_COLOR,
},
})
Expand All @@ -51,9 +62,13 @@ onMounted(() => {
length: WRITING_WIDTH,
showCharacter: true,
showOutline: true,
outlineColor: OUTLINE_COLOR,
strokeColor: STROKE_COLOR,
},
line: {
lineCross: false,
lineColor: LINE_COLOR,
borderColor: BORDER_COLOR,
},
onComplete: () => cloneElement(heiRef.value, props.hei),
})
Expand All @@ -66,9 +81,13 @@ onMounted(() => {
length: WRITING_WIDTH,
showCharacter: false,
showOutline: true,
outlineColor: OUTLINE_COLOR,
strokeColor: STROKE_COLOR,
},
line: {
lineCross: false,
lineColor: LINE_COLOR,
borderColor: BORDER_COLOR,
},
onComplete: () => cloneElement(huiRef.value, props.hui),
})
Expand All @@ -81,9 +100,13 @@ onMounted(() => {
length: WRITING_WIDTH,
showCharacter: false,
showOutline: false,
outlineColor: OUTLINE_COLOR,
strokeColor: STROKE_COLOR,
},
line: {
lineCross: false,
lineColor: LINE_COLOR,
borderColor: BORDER_COLOR,
},
onComplete: () => cloneElement(kongRef.value, props.kong),
})
Expand Down
10 changes: 10 additions & 0 deletions docs/.vuepress/theme/components/hanzi/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,13 @@ export const TIAN_KONG = 5

/** 拼音格 宽/高 */
export const PINYIN_GE_RATIO = 1.57

/** 灰色字颜色 */
export const OUTLINE_COLOR = '#bbb'
/** 笔画的颜色 */
export const STROKE_COLOR = '#555'

/** 田字格 内线颜色 */
export const LINE_COLOR = '#bbb'
/** 田字格 外线颜色 */
export const BORDER_COLOR = '#bbb'
2 changes: 1 addition & 1 deletion docs/posts/edu/xiaoxue-yuwen-1-xia.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ head:
:::info
为了发音迅速,优先使用浏览器自带的特性实现,推荐使用最新的 Edge 浏览器。

点击打印可作为练字帖使用。
点击打印可作为练字帖使用,打印时建议缩放 70%
:::

## 1.春夏秋冬
Expand Down
2 changes: 1 addition & 1 deletion docs/posts/edu/xiaoxue-yuwen-2-shang.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ head:
:::info
为了发音迅速,优先使用浏览器自带的特性实现,推荐使用最新的 Edge 浏览器。

点击打印可作为练字帖使用。
点击打印可作为练字帖使用,打印时建议缩放 70%
:::

## 1.小蝌蚪找妈妈
Expand Down

0 comments on commit d6961db

Please sign in to comment.