diff --git a/locale/en.json b/locale/en.json index 7442b32..632a94d 100644 --- a/locale/en.json +++ b/locale/en.json @@ -323,6 +323,10 @@ "签名", "Signature" ], + [ + "水印", + "Watermark" + ], [ "图片裁剪", "Image Cropping" @@ -2498,5 +2502,81 @@ [ "Calendar 日历", "Calendar Calendar" + ], + [ + "这是一段需要保护的内容", + "This is content that needs to be protected" + ], + [ + "水印会覆盖在内容上方,防止内容被盗用", + "Watermarks will be overlaid on the content to prevent unauthorized use" + ], + [ + "可自定义的水印内容区域", + "Customizable watermark content area" + ], + [ + "水印文本", + "Watermark Text" + ], + [ + "字体大小", + "Font Size" + ], + [ + "透明度", + "Opacity" + ], + [ + "旋转角度", + "Rotation Angle" + ], + [ + "水印宽度", + "Watermark Width" + ], + [ + "水印高度", + "Watermark Height" + ], + [ + "水平间距", + "Horizontal Spacing" + ], + [ + "垂直间距", + "Vertical Spacing" + ], + [ + "字体粗细", + "Font Weight" + ], + [ + "正常", + "Normal" + ], + [ + "加粗", + "Bold" + ], + [ + "多行文本水印", + "Multi-line Text Watermark" + ], + [ + "重要文档", + "Important Document" + ], + [ + "这是一份重要的文档内容,需要添加水印保护。", + "This is an important document that requires watermark protection." + ], + [ + "水印可以防止内容被未授权的复制和传播。", + "Watermarks can prevent unauthorized copying and distribution of content." + ], + [ + "图片保护", + "Image Protection" ] ] \ No newline at end of file diff --git a/locale/zh-cn.json b/locale/zh-cn.json index c99697e..e8d7392 100644 --- a/locale/zh-cn.json +++ b/locale/zh-cn.json @@ -723,6 +723,10 @@ "签名", "" ], + [ + "水印", + "" + ], [ "图片裁剪", "" @@ -2498,5 +2502,81 @@ [ "我的", "" + ], + [ + "这是一段需要保护的内容", + "" + ], + [ + "水印会覆盖在内容上方,防止内容被盗用", + "" + ], + [ + "可自定义的水印内容区域", + "" + ], + [ + "水印文本", + "" + ], + [ + "字体大小", + "" + ], + [ + "透明度", + "" + ], + [ + "旋转角度", + "" + ], + [ + "水印宽度", + "" + ], + [ + "水印高度", + "" + ], + [ + "水平间距", + "" + ], + [ + "垂直间距", + "" + ], + [ + "字体粗细", + "" + ], + [ + "正常", + "" + ], + [ + "加粗", + "" + ], + [ + "多行文本水印", + "" + ], + [ + "重要文档", + "" + ], + [ + "这是一份重要的文档内容,需要添加水印保护。", + "" + ], + [ + "水印可以防止内容被未授权的复制和传播。", + "" + ], + [ + "图片保护", + "" ] ] \ No newline at end of file diff --git a/pages.json b/pages.json index 461f972..456d285 100644 --- a/pages.json +++ b/pages.json @@ -448,6 +448,12 @@ "navigationBarTitleText": "Sign 签名" } }, + { + "path": "other/watermark", + "style": { + "navigationBarTitleText": "Watermark 水印" + } + }, { "path": "other/day-uts", "style": { diff --git a/pages/demo/other/watermark.uvue b/pages/demo/other/watermark.uvue new file mode 100644 index 0000000..0221ef9 --- /dev/null +++ b/pages/demo/other/watermark.uvue @@ -0,0 +1,147 @@ + + + diff --git a/pages/index/home.uvue b/pages/index/home.uvue index 7d49472..7b72ef4 100644 --- a/pages/index/home.uvue +++ b/pages/index/home.uvue @@ -421,6 +421,11 @@ const data = computed(() => { icon: "sketching", path: "/pages/demo/other/sign" }, + { + label: t("水印"), + icon: "copyright-line", + path: "/pages/demo/other/watermark" + }, { label: t("图片裁剪"), icon: "crop-line", diff --git a/uni_modules/cool-ui/components/cl-watermark/cl-watermark.uvue b/uni_modules/cool-ui/components/cl-watermark/cl-watermark.uvue new file mode 100644 index 0000000..d4d955c --- /dev/null +++ b/uni_modules/cool-ui/components/cl-watermark/cl-watermark.uvue @@ -0,0 +1,277 @@ + + + + + diff --git a/uni_modules/cool-ui/components/cl-watermark/props.ts b/uni_modules/cool-ui/components/cl-watermark/props.ts new file mode 100644 index 0000000..7c374c1 --- /dev/null +++ b/uni_modules/cool-ui/components/cl-watermark/props.ts @@ -0,0 +1,24 @@ +import type { PassThroughProps } from "../../types"; + +export type ClWatermarkPassThrough = { + className?: string; + container?: PassThroughProps; +}; + +export type ClWatermarkProps = { + className?: string; + pt?: ClWatermarkPassThrough; + text?: string; + fontSize?: number; + color?: string; + darkColor?: string; + opacity?: number; + rotate?: number; + width?: number; + height?: number; + gapX?: number; + gapY?: number; + zIndex?: number; + fontWeight?: string; + fontFamily?: string; +}; diff --git a/uni_modules/cool-ui/index.d.ts b/uni_modules/cool-ui/index.d.ts index 9b2109d..3b68176 100644 --- a/uni_modules/cool-ui/index.d.ts +++ b/uni_modules/cool-ui/index.d.ts @@ -76,6 +76,7 @@ import type { ClTreeProps, ClTreePassThrough } from "./components/cl-tree/props" import type { ClTreeItemProps, ClTreeItemPassThrough } from "./components/cl-tree-item/props"; import type { ClUploadProps, ClUploadPassThrough } from "./components/cl-upload/props"; import type { ClWaterfallProps, ClWaterfallPassThrough } from "./components/cl-waterfall/props"; +import type { ClWatermarkProps, ClWatermarkPassThrough } from "./components/cl-watermark/props"; export {}; @@ -156,5 +157,6 @@ declare module "vue" { "cl-tree-item": (typeof import('./components/cl-tree-item/cl-tree-item.uvue')['default']) & import('vue').DefineComponent; "cl-upload": (typeof import('./components/cl-upload/cl-upload.uvue')['default']) & import('vue').DefineComponent; "cl-waterfall": (typeof import('./components/cl-waterfall/cl-waterfall.uvue')['default']) & import('vue').DefineComponent; + "cl-watermark": (typeof import('./components/cl-watermark/cl-watermark.uvue')['default']) & import('vue').DefineComponent; } }