commit 838db1244699ad72d005f618e19d60eddf36f8f8
Author: jinghui <181050043@qq.com>
Date: Mon Oct 26 18:11:58 2026 +0800
快图设计封面工坊版:106套本地模板 + Strapi兼容本地接口 + 模板缩略图修复 + AI生图素材面板接入 + 悬浮AI面板
diff --git a/.browserslistrc b/.browserslistrc
new file mode 100644
index 0000000..214388f
--- /dev/null
+++ b/.browserslistrc
@@ -0,0 +1,3 @@
+> 1%
+last 2 versions
+not dead
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..7c3cca5
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,9 @@
+# path: ./.dockerignore
+
+.DS_Store
+node_modules
+dist
+.npmrc
+yarn.lock
+pnpm-lock.yaml
+package-lock.json
\ No newline at end of file
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..c24743d
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,7 @@
+[*.{js,jsx,ts,tsx,vue}]
+indent_style = space
+indent_size = 2
+end_of_line = lf
+trim_trailing_whitespace = true
+insert_final_newline = true
+max_line_length = 100
diff --git a/.env b/.env
new file mode 100644
index 0000000..eda8ce0
--- /dev/null
+++ b/.env
@@ -0,0 +1,4 @@
+APP_TITLE=快图设计-开源图片编辑器-vue-fabric-editor
+APP_BASE_PATH=/vue-fabric-editor/
+APP_APIHOST=https://github.kuaitu.cc
+APP_ADMINAPIHOST=https://github.kuaitu.cc
diff --git a/.env.development b/.env.development
new file mode 100644
index 0000000..bccaa41
--- /dev/null
+++ b/.env.development
@@ -0,0 +1,3 @@
+APP_FLAG=dev
+# APP_APIHOST=https://github.kuaitu.cc
+# APP_APIHOST=http://localhost:1337
\ No newline at end of file
diff --git a/.env.production b/.env.production
new file mode 100644
index 0000000..ba99f75
--- /dev/null
+++ b/.env.production
@@ -0,0 +1 @@
+APP_FLAG=prod
\ No newline at end of file
diff --git a/.env.staging b/.env.staging
new file mode 100644
index 0000000..a1f27fe
--- /dev/null
+++ b/.env.staging
@@ -0,0 +1 @@
+APP_FLAG=staging
\ No newline at end of file
diff --git a/.eslintrc.js b/.eslintrc.js
new file mode 100644
index 0000000..c7532ac
--- /dev/null
+++ b/.eslintrc.js
@@ -0,0 +1,51 @@
+module.exports = {
+ env: {
+ browser: true,
+ es2021: true,
+ node: true,
+ },
+ extends: [
+ 'eslint:recommended',
+ 'plugin:vue/vue3-essential',
+ 'plugin:@typescript-eslint/recommended',
+ 'plugin:prettier/recommended',
+ './.eslintrc-auto-import.json',
+ ],
+ parser: 'vue-eslint-parser',
+ parserOptions: {
+ ecmaVersion: 'latest',
+ parser: '@typescript-eslint/parser',
+ sourceType: 'module',
+ },
+ plugins: ['vue', '@typescript-eslint'],
+ rules: {
+ 'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
+ 'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
+ 'no-plusplus': 'off',
+ '@typescript-eslint/no-this-alias': 'off',
+ '@typescript-eslint/no-var-requires': 'off',
+ '@typescript-eslint/no-explicit-any': 'off',
+ 'import/no-unresolved': 'off',
+ 'vuejs-accessibility/form-control-has-label': 'off',
+ 'consistent-return': 'off', // 强制统一返回值
+ 'no-param-reassign': 'off', // 参数重新分配
+ 'no-underscore-dangle': 'off', // 使用下划线命名
+ 'comma-spacing': 'off',
+ 'vuejs-accessibility/click-events-have-key-events': 'off',
+ 'max-len': 'off',
+ 'no-unused-expressions': 'off', // 17
+ 'linebreak-style': 'off',
+ 'vue/multi-word-component-names': 'off', // 开启组件需要多单词
+ 'vue/no-setup-props-destructure': 'off',
+ 'vuejs-accessibility/anchor-has-content': 'off',
+ '@typescript-eslint/no-non-null-assertion': 'off',
+ },
+ overrides: [
+ {
+ files: ['**/__tests__/*.{j,t}s?(x)', '**/tests/unit/**/*.spec.{j,t}s?(x)'],
+ env: {
+ jest: true,
+ },
+ },
+ ],
+};
diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
new file mode 100644
index 0000000..fae5329
--- /dev/null
+++ b/.github/FUNDING.yml
@@ -0,0 +1,13 @@
+# These are supported funding model platforms
+
+github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+patreon: # Replace with a single Patreon username
+open_collective: # Replace with a single Open Collective username
+ko_fi: # Replace with a single Ko-fi username
+tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
+custom: ['https://oss.issuehunt.io/r/nihaojob/vue-fabric-editor'] # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..dd84ea7
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,38 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+1. Go to '...'
+2. Click on '....'
+3. Scroll down to '....'
+4. See error
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Desktop (please complete the following information):**
+ - OS: [e.g. iOS]
+ - Browser [e.g. chrome, safari]
+ - Version [e.g. 22]
+
+**Smartphone (please complete the following information):**
+ - Device: [e.g. iPhone6]
+ - OS: [e.g. iOS8.1]
+ - Browser [e.g. stock browser, safari]
+ - Version [e.g. 22]
+
+**Additional context**
+Add any other context about the problem here.
diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md
new file mode 100644
index 0000000..48d5f81
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/custom.md
@@ -0,0 +1,10 @@
+---
+name: Custom issue template
+about: Describe this issue template's purpose here.
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+
diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md
new file mode 100644
index 0000000..bbcbbe7
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.md
@@ -0,0 +1,20 @@
+---
+name: Feature request
+about: Suggest an idea for this project
+title: ''
+labels: ''
+assignees: ''
+
+---
+
+**Is your feature request related to a problem? Please describe.**
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+
+**Describe the solution you'd like**
+A clear and concise description of what you want to happen.
+
+**Describe alternatives you've considered**
+A clear and concise description of any alternative solutions or features you've considered.
+
+**Additional context**
+Add any other context or screenshots about the feature request here.
diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md
new file mode 100644
index 0000000..657079c
--- /dev/null
+++ b/.github/pull_request_template.md
@@ -0,0 +1,21 @@
+## 贡献者你好
+
+很高兴你能付出自己的时间参与到 vue-fabric-editor 的共建当中,相信很多人都会因为你提交的代码而受益。
+
+### 原则
+
+我们希望每次提交尽量小(较大重构除外),确保每次改动的影响范围清晰明了,能够方便项目维护者快速将代码合并到主分支。
+
+### 确保你的代码与主仓库没有冲突
+
+在 PR 前,请确保你的代码与主仓库保持同步,可以参考这篇[文章](https://zhuanlan.zhihu.com/p/467670042)。
+
+### 确保你的代码能正常打包构建
+
+在 PR 前,请在本地进行打包构建,并进行功能测试,确保功能正常,且不影响其他功能。
+
+- [ ] 代码构建正常
+
+### 告知项目维护者本次修改的功能
+
+请在下方描述你的修改内容:
diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml
new file mode 100644
index 0000000..bcc7b35
--- /dev/null
+++ b/.github/workflows/pull_request.yml
@@ -0,0 +1,19 @@
+name: NodeJS with Webpack
+
+on:
+ pull_request:
+ branches: ['main']
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Build
+ run: |
+ npm i -g pnpm
+ pnpm install
+ npm run build
diff --git a/.github/workflows/webpack.yml b/.github/workflows/webpack.yml
new file mode 100644
index 0000000..9b52a06
--- /dev/null
+++ b/.github/workflows/webpack.yml
@@ -0,0 +1,25 @@
+name: NodeJS with Webpack
+
+on:
+ push:
+ branches: ['main']
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Build
+ run: |
+ npm i -g pnpm
+ pnpm install
+ pnpm build
+
+ - name: Deploy
+ uses: peaceiris/actions-gh-pages@v3
+ with:
+ personal_token: ${{ secrets.demo }}
+ publish_dir: ./dist
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..5744d32
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,29 @@
+.DS_Store
+node_modules
+dist
+typings/auto-imports.d.ts
+
+# local env files
+.env.local
+.env.*.local
+
+# Log files
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
+
+yarn.lock
+# pnpm-lock.yaml # https://github.com/ikuaitu/vue-fabric-editor/issues/554
+package-lock.json
+typings/auto-imports.d.ts
+.eslintrc-auto-import.json
diff --git a/.husky/commit-msg b/.husky/commit-msg
new file mode 100644
index 0000000..c160a77
--- /dev/null
+++ b/.husky/commit-msg
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
+npx --no -- commitlint --edit ${1}
diff --git a/.husky/pre-commit b/.husky/pre-commit
new file mode 100644
index 0000000..0312b76
--- /dev/null
+++ b/.husky/pre-commit
@@ -0,0 +1,4 @@
+#!/usr/bin/env sh
+. "$(dirname -- "$0")/_/husky.sh"
+
+npx lint-staged
\ No newline at end of file
diff --git a/.npmrc b/.npmrc
new file mode 100644
index 0000000..859cddc
--- /dev/null
+++ b/.npmrc
@@ -0,0 +1,7 @@
+registry = https://registry.npmmirror.com # 镜像源
+canvas_binary_host_mirror = https://registry.npmmirror.com/-/binary/canvas # canvas安装慢的问题
+
+ignore-workspace-root-check = true
+shamefully-hoist = true
+strict-peer-dependencies = false
+auto-install-peers = true
\ No newline at end of file
diff --git a/.prettierignore b/.prettierignore
new file mode 100644
index 0000000..ab8aa70
--- /dev/null
+++ b/.prettierignore
@@ -0,0 +1,25 @@
+.DS_Store
+node_modules
+/dist
+
+
+# local env files
+.env.local
+.env.*.local
+
+# Log files
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+pnpm-debug.log*
+
+# Editor directories and files
+.idea
+.vscode
+*.suo
+*.ntvs*
+*.njsproj
+*.sln
+*.sw?
+
+yarn.lock
\ No newline at end of file
diff --git a/.prettierrc.js b/.prettierrc.js
new file mode 100644
index 0000000..cc9f352
--- /dev/null
+++ b/.prettierrc.js
@@ -0,0 +1,18 @@
+module.exports = {
+ printWidth: 100, // 指定代码长度,超出换行
+ tabWidth: 2, // tab 键的宽度
+ useTabs: false, // 不使用tab
+ semi: true, // 结尾加上分号
+ singleQuote: true, // 使用单引号
+ quoteProps: 'as-needed', // 要求对象字面量属性是否使用引号包裹,(‘as-needed’: 没有特殊要求,禁止使用,'consistent': 保持一致 , preserve: 不限制,想用就用)
+ jsxSingleQuote: false, // jsx 语法中使用单引号
+ trailingComma: 'es5', // 确保对象的最后一个属性后有逗号
+ bracketSpacing: true, // 大括号有空格 { name: 'rose' }
+ jsxBracketSameLine: false, // 在多行JSX元素的最后一行追加 >
+ arrowParens: 'always', // 箭头函数,单个参数添加括号
+ requirePragma: false, // 是否严格按照文件顶部的特殊注释格式化代码
+ insertPragma: false, // 是否在格式化的文件顶部插入Pragma标记,以表明该文件被prettier格式化过了
+ proseWrap: 'preserve', // 按照文件原样折行
+ htmlWhitespaceSensitivity: 'ignore', // html文件的空格敏感度,控制空格是否影响布局
+ endOfLine: 'auto', // 结尾是 \n \r \n\r auto
+};
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
new file mode 100644
index 0000000..0711c7e
--- /dev/null
+++ b/CODE_OF_CONDUCT.md
@@ -0,0 +1,128 @@
+# Contributor Covenant Code of Conduct
+
+## Our Pledge
+
+We as members, contributors, and leaders pledge to make participation in our
+community a harassment-free experience for everyone, regardless of age, body
+size, visible or invisible disability, ethnicity, sex characteristics, gender
+identity and expression, level of experience, education, socio-economic status,
+nationality, personal appearance, race, religion, or sexual identity
+and orientation.
+
+We pledge to act and interact in ways that contribute to an open, welcoming,
+diverse, inclusive, and healthy community.
+
+## Our Standards
+
+Examples of behavior that contributes to a positive environment for our
+community include:
+
+* Demonstrating empathy and kindness toward other people
+* Being respectful of differing opinions, viewpoints, and experiences
+* Giving and gracefully accepting constructive feedback
+* Accepting responsibility and apologizing to those affected by our mistakes,
+ and learning from the experience
+* Focusing on what is best not just for us as individuals, but for the
+ overall community
+
+Examples of unacceptable behavior include:
+
+* The use of sexualized language or imagery, and sexual attention or
+ advances of any kind
+* Trolling, insulting or derogatory comments, and personal or political attacks
+* Public or private harassment
+* Publishing others' private information, such as a physical or email
+ address, without their explicit permission
+* Other conduct which could reasonably be considered inappropriate in a
+ professional setting
+
+## Enforcement Responsibilities
+
+Community leaders are responsible for clarifying and enforcing our standards of
+acceptable behavior and will take appropriate and fair corrective action in
+response to any behavior that they deem inappropriate, threatening, offensive,
+or harmful.
+
+Community leaders have the right and responsibility to remove, edit, or reject
+comments, commits, code, wiki edits, issues, and other contributions that are
+not aligned to this Code of Conduct, and will communicate reasons for moderation
+decisions when appropriate.
+
+## Scope
+
+This Code of Conduct applies within all community spaces, and also applies when
+an individual is officially representing the community in public spaces.
+Examples of representing our community include using an official e-mail address,
+posting via an official social media account, or acting as an appointed
+representative at an online or offline event.
+
+## Enforcement
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported to the community leaders responsible for enforcement at
+nihaojob@163.com.
+All complaints will be reviewed and investigated promptly and fairly.
+
+All community leaders are obligated to respect the privacy and security of the
+reporter of any incident.
+
+## Enforcement Guidelines
+
+Community leaders will follow these Community Impact Guidelines in determining
+the consequences for any action they deem in violation of this Code of Conduct:
+
+### 1. Correction
+
+**Community Impact**: Use of inappropriate language or other behavior deemed
+unprofessional or unwelcome in the community.
+
+**Consequence**: A private, written warning from community leaders, providing
+clarity around the nature of the violation and an explanation of why the
+behavior was inappropriate. A public apology may be requested.
+
+### 2. Warning
+
+**Community Impact**: A violation through a single incident or series
+of actions.
+
+**Consequence**: A warning with consequences for continued behavior. No
+interaction with the people involved, including unsolicited interaction with
+those enforcing the Code of Conduct, for a specified period of time. This
+includes avoiding interactions in community spaces as well as external channels
+like social media. Violating these terms may lead to a temporary or
+permanent ban.
+
+### 3. Temporary Ban
+
+**Community Impact**: A serious violation of community standards, including
+sustained inappropriate behavior.
+
+**Consequence**: A temporary ban from any sort of interaction or public
+communication with the community for a specified period of time. No public or
+private interaction with the people involved, including unsolicited interaction
+with those enforcing the Code of Conduct, is allowed during this period.
+Violating these terms may lead to a permanent ban.
+
+### 4. Permanent Ban
+
+**Community Impact**: Demonstrating a pattern of violation of community
+standards, including sustained inappropriate behavior, harassment of an
+individual, or aggression toward or disparagement of classes of individuals.
+
+**Consequence**: A permanent ban from any sort of public interaction within
+the community.
+
+## Attribution
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage],
+version 2.0, available at
+https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
+
+Community Impact Guidelines were inspired by [Mozilla's code of conduct
+enforcement ladder](https://github.com/mozilla/diversity).
+
+[homepage]: https://www.contributor-covenant.org
+
+For answers to common questions about this code of conduct, see the FAQ at
+https://www.contributor-covenant.org/faq. Translations are available at
+https://www.contributor-covenant.org/translations.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..05ab9b7
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,21 @@
+# 贡献指南
+
+你好!我们很高兴你有兴趣为 vue-fabric-editor 做出贡献。在提交你的贡献之前,请花点时间阅读以下指南:
+
+## 快速上手
+vue-fabric-editor 依赖Node.js v16版本进行开发,要确保你本地已安装Node.js。
+
+## 第一次贡献
+
+如果你还不清楚怎么在 GitHub 上提 Pull Request ,可以阅读下面这篇文章来学习:
+
+[如何优雅地在 GitHub 上贡献代码](https://segmentfault.com/a/1190000000736629)
+
+为了能帮助你开始你的第一次尝试,我们用 [good first issues](https://github.com/nihaojob/vue-fabric-editor/labels/good%20first%20issue) 标记了一些比较容易修复的 bug 和小功能。这些 issue 可以很好地作为你的首次尝试。
+
+如果你打算开始处理一个 issue,请先检查一下 issue 下面的留言以确保没有别人正在处理这个 issue。如果当前没有人在处理的话你可以留言告知其他人你将会处理这个 issue,以免别人重复劳动。
+
+如果之前有人留言说会处理这个 issue 但是一两个星期都没有动静,那么你也可以接手处理这个 issue,当然还是需要留言告知其他人。
+
+## Pull Request
+
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..0cb6f29
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,15 @@
+FROM node:18-alpine3.18 as build
+
+WORKDIR /app
+COPY . .
+
+RUN npm install -g pnpm --registry=https://registry.npmmirror.com
+RUN pnpm config set registry https://registry.npmmirror.com
+RUN pnpm install
+
+RUN ["pnpm", "build"]
+
+FROM nginx:1.25.3
+COPY --from=0 /app/dist /usr/share/nginx/html/
+COPY nginx.conf /etc/nginx/conf.d/
+
diff --git a/Dockerfile.kuaitu b/Dockerfile.kuaitu
new file mode 100644
index 0000000..c9dabcd
--- /dev/null
+++ b/Dockerfile.kuaitu
@@ -0,0 +1,17 @@
+FROM node:18-alpine3.18 AS build
+WORKDIR /app
+RUN apk add --no-cache git python3 make g++
+COPY . .
+RUN git init -q \
+ && npm config set registry https://registry.npmmirror.com \
+ && npm install -g pnpm@8.15.9 --registry=https://registry.npmmirror.com \
+ && pnpm install --no-frozen-lockfile
+RUN pnpm build
+
+FROM node:20-alpine
+WORKDIR /app
+COPY --from=build /app/dist ./dist
+COPY server ./server
+ENV TEMPLATE_DIR=/app/data
+EXPOSE 80
+CMD ["node", "server/index.js"]
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..67448e3
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2022 秦少卫
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/README-COVER.md b/README-COVER.md
new file mode 100644
index 0000000..e5e058d
--- /dev/null
+++ b/README-COVER.md
@@ -0,0 +1,93 @@
+# 快图设计 · 封面工坊版(本地化改造)
+
+基于 [ikuaitu/vue-fabric-editor](https://github.com/ikuaitu/vue-fabric-editor)(MIT,作者 秦少卫)二次开发,
+目标:**在自己机器上离线跑一套中文封面编辑器**,模板、接口、AI 出图全部本地,不依赖上游 Strapi 云服务。
+
+镜像:`kuaitu-editor`(容器名同名),端口 `8126`,数据只读挂载。前端 5MB,构建后约 144MB。
+
+---
+
+## 一、改了什么
+
+### 1. 本地模板接口(新增 `server/index.js`,零依赖 Node)
+上游前端所有模板/素材都请求一个远程 Strapi(`/api/templs`、`/api/templ-types`、`/api/web-site`、`/api/sizes`…),
+没有后端就无法用。这里用一个单文件 Node 服务**完整实现了 Strapi 的返回结构**(`{data:[{id,attributes:{...}}], meta:{pagination}}`),
+所以**前端一行代码没改**,直接把请求指过来就能跑:
+
+| 接口 | 作用 |
+|---|---|
+| `GET /api/templ-types` | 10 个平台分类:公众号 900×383 / 小红书 / 知乎 / 头条 / B站 / 方形 / 竖版海报 / 视频封面 / 朋友圈 / 横版头图 |
+| `GET /api/templs?filters[...]&pagination[...]` | 模板列表,支持分类筛选、关键词搜索、分页 |
+| `GET /api/templs/:id` | 单模板 fabric JSON(直接塞进画布) |
+| `GET /api/sizes` | 从模板库反推尺寸清单,自带宽度高度 |
+| `GET /preview/:id.png` | 模板预览图 |
+| 其它 `/api/*` | 统一返回空集,避免编辑器对缺失接口报错 |
+
+模板数据就是普通文件(`data/index.json` + `data/tmpl/*.json` + `data/preview/*.png`),
+加模板 = 丢文件,不用重启数据库、不用跑迁移。
+
+### 2. 内置 106 套本地模板(`data/`)
+上游开源版**不带模板**(模板是商业版的卖点)。这里用 `data/gen_templates_v2.py` 程序化生成:
+10 种平台尺寸 × 每类 10 套以上版式,覆盖居中大标题、左文右图、色块分割、渐变底、杂志大字、极简留白等。
+`data/render_preview.js` 把每个 fabric JSON 渲染成 PNG 预览。改颜色/字体只需改脚本重新生成。
+
+### 3. 模板缩略图不显示的修复(`APP_PATCH` 注入 CSS)
+上游模板卡片外层 `.tmpl-img-box` 初始高度是 0,而 iView 的 `` 用 `IntersectionObserver` 懒加载,
+高度为 0 就永远不触发 → **模板列表一片空白,但控制台无报错**。
+处理:服务端在 `index.html` 的 `` 前注入一段 CSS,强制 `.tmpl-img-box{height:112px}` 并让内层图片 `object-fit:contain`。
+不改构建产物、不污染源码,重建前端也不会丢。
+
+### 4. 素材面板接入 AI 出图(`/api/material-types` + `/api/materials` + `/ai-img/*`)
+编辑器左侧「素材」面板原来也是空的(上游要付费素材库)。现在:
+- `/api/material-types` 返回一个分类「AI 生成」
+- `/api/materials` 实时去 `cover-ai`(8128)的 `/api/gallery` 拉最新 AI 图,转成 Strapi 格式
+- `/ai-img/` 反代 8128 的图片,绕开跨端口同源限制
+结果:**AI 生成或 AI 重绘的图,不用下载上传,直接在素材面板点一下就进画布。**
+安全细节:图片名走 `path.basename` 过滤,防目录穿越。
+
+### 5. 右下角悬浮「✨ AI 生图 / 修图」按钮(`APP_PATCH` 注入 HTML)
+一键弹出全屏 iframe 面板(指向 8128),Esc 关闭。不用装插件、不用改 Vue 路由,
+面板和编辑器两个独立服务,各自重启互不影响。
+
+### 6. 构建与部署(`Dockerfile.kuaitu` + `docker-compose.cover.yml`)
+- 多阶段构建:node18 里 `pnpm install && pnpm build` → node20 只带 `dist` + `server`
+- 内网镜像源 `registry.npmmirror.com`,构建不需要代理
+- `TEMPLATE_DIR=/app/data`,模板目录可外部挂载替换
+- 上游自带的 `Dockerfile`(nginx 版)保留,两者不冲突
+
+---
+
+## 二、相比原版和商业版
+
+| | 上游开源版 | 快图商业版 | 本项目 |
+|---|---|---|---|
+| 模板 | 无(空列表) | 云端模板库 | **106 套本地模板,可脚本批量生成** |
+| 后端 | 需自建 Strapi | 官方云服务 | **单文件 Node,零依赖,返回结构兼容 Strapi** |
+| 离线可用 | 否 | 否 | **是,全内网** |
+| AI 出图 | 无 | 增值付费 | **接入自建 8128(grok-imagine),图直接进素材面板** |
+| 数据归属 | — | 云端 | **模板和图片都在自己硬盘** |
+| 费用 | 免费 | 订阅 | **0 元**(只有 AI 出图消耗自己的 API) |
+
+对自媒体流水线的实际价值:封面从「打开网页→找模板→手动改字→下载→上传」变成
+「脚本批量渲染(8127 封面工坊)→ 需要精修才开 8126 → AI 缺图就在同一个面板画 → 点一下入画布」。
+
+---
+
+## 三、跑起来
+
+```bash
+docker build -f Dockerfile.kuaitu -t kuaitu-editor:1.0 .
+docker run -d --name kuaitu-editor --restart always -p 8126:80 \
+ -v $PWD/server:/app/server:ro \
+ -v /path/to/kuaitu-editor-data:/app/data:ro \
+ -e COVER_AI=http://<你的封面AI地址>:8128 \
+ kuaitu-editor:1.0
+```
+
+- `server/` 用只读挂载,改接口后 `docker restart kuaitu-editor` 即生效,不用重新构建
+- `COVER_AI` 不填则默认 `http://192.168.68.19:8128`,取不到 AI 图时素材面板返回空数组,不影响编辑器本身
+- 生成模板:`python3 data/gen_templates_v2.py`(需要 PIL)→ `node data/render_preview.js`(需要 node + canvas)
+
+## 四、许可
+
+上游 MIT(Copyright (c) 2022 秦少卫),本项目改动同样 MIT。上游 README、LICENSE 原样保留。
diff --git a/README-en.md b/README-en.md
new file mode 100644
index 0000000..8c37582
--- /dev/null
+++ b/README-en.md
@@ -0,0 +1,480 @@
+English| [中文](https://github.com/ikuaitu/vue-fabric-editor/blob/main/README.md)
+
+
+
+
+
+
+
+
+ Plugin architecture · Drag-and-drop design · Complete functions
+Based on fabric.js and Vue developed plug-in image editor, can customize fonts, materials, design templates, right-click menu, shortcut keys
+
+Preview · Document · Enterprise Edition Preview · Enterprise Edition
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## Introduction
+
+Vue-Fabric-Editor is an image editor based on fabric.js and Vue, which can customize fonts, materials, design templates, right-click menus, and shortcut keys.
+
+[GIF introduction](https://juejin.cn/post/7222141882515128375) · [Introductory video](https://www.bilibili.com/video/BV1US421A7TU/?spm_id_from=333.999.0.0)
+
+### Features
+
+1. **Plug-in architecture**: can be extended and developed through plug-ins, supporting right-click menus and shortcut keys.
+2. **Drag-and-drop design**: a graphic editor that is mainly lightweight and simple, rather than a large and comprehensive online PS-like heavy-line design tool.
+3. **Full-featured**: PSD parsing, auxiliary lines, history, gradients, custom fonts, cropping and other functions.
+
+### Existing features
+
+- Import JSON, PSD files
+- Export PNG, SVG, JSON files
+- Combine/split combinations
+- Layer functions
+- Gradient properties
+- Appearance properties/Font properties/Stroke/Shadow
+- Undo/Redo
+- Shortcuts
+- Right-click menu
+- Auxiliary lines
+- Rulers
+- Custom fonts
+- Custom template materials
+- Insert SVG, image materials
+- Horizontal and vertical alignment of multiple elements
+- Background property settings
+- Arrows/lines
+- Brush/polygon drawing
+- QR code/barcode
+- Image replacement/cropping/filters
+- Watermark
+- Internationalization
+
+## Use
+
+Please install node.js v16 and pnpm first, then execute the following command:
+
+```
+pnpm i
+pnpm dev
+```
+
+## Enterprise Edition
+
+Help enterprises quickly build online design tools, **reduce enterprise R&D investment, and avoid reinventing the wheel.**
+
+[Function Introduction](https://ws0gdejldw.feishu.cn/docx/GKmnddCgFokr4sxFeYNcoql1nAb) · [Product introduction](https://pro.kuaitu.cc/index-en.html) · [Preview](https://www.kuaitu.cc/)
+
+The open source version only contains the front-end code, while the paid version **provides complete front-end, back-end and management background, with full functionality out of the box, and provides source code authorization and supports secondary development**.
+
+- **Ready to use out of the box, full functionality**: Rich design capabilities, providing complete front-end and back-end functions, ready to use after deployment.
+- **Plug-in architecture, easy to expand**: Based on plug-in API, quickly carry out secondary development of the editor.
+- **Batch generation, fast output**: Support batch generation of images through HTTP interface and table files.
+- **Drag-and-drop design, simple and easy to use**: Suitable for ordinary users, easy to get started without training.
+- **Technical docking, document training**: Provide more support and efficiently complete technical docking.
+- **Customized development, reduced investment**: Support the rapid completion of functional customized development and reduce R&D investment.
+
+
+
+
+
+## Contribution guide
+
+The project is committed to creating an out-of-the-box web image editor application, and at the same time, it will precipitate an encapsulation layer between the web image editor application and fabric.js. It is expected that the encapsulation layer will be designed for developers and provide a simpler interface so that developers can easily develop image applications.
+
+If you are interested in this matter, we sincerely invite you to join us and grow together. You only need to know simple Git and Javascript syntax.
+
+### Related Materials
+
+This is a technical note I published on the Nuggets community about the editor, which will have more details:
+
+1. [Use fabric.js to quickly develop an image editor](https://juejin.cn/post/7155040639497797645),
+2. [Detailed implementation of fabric.js developing an image editor](https://juejin.cn/post/7199849226745430076)
+3. [What functions can fabric.js develop an image editor to achieve? ](https://juejin.cn/post/7222141882515128375)
+4. [Sharing my open source projects and open source experience](https://juejin.cn/post/7224765991896121401)
+5. [What functions can fabric.js achieve with the Canvas library?](https://juejin.cn/post/7336743827827015731)
+6. [Vue open source image editor](https://juejin.cn/post/7384258569590636595)
+7. [Sharing of personal open source project commercialization experience](https://juejin.cn/post/7400687574967271478)
+8. [Open source fabric.js image editor plug-in architecture](https://juejin.cn/post/7401071861847949339)
+
+Note: If you encounter technical problems, you are expected to use issue Discussion, it is more open and transparent, enough information will make problem solving more efficient, refer to [The wisdom of asking questions](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md#%E6%8F%90%E9%97%AE%E7%9A%84%E6%99%BA%E6%85%A7).
+
+
+
+## Administrator
+
+
+
+## Collaborators
+
+
+
+
+
+## License
+
+Licensed under the [MIT](./LICENSE) License.
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..048c86e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,531 @@
+
+
+[English](https://github.com/ikuaitu/vue-fabric-editor/blob/main/README-en.md)| 中文
+
+
+
+
+
+
+
+开源图片编辑器 · 插件化架构 · 拖拽式设计 · 功能完善
+基于 fabric.js 和 Vue 开发的插件化图片编辑器,可自定义字体、素材、设计模板、右键菜单、快捷键
+
+演示 · 文档 · 商业版演示 · 商业版介绍
+· 商品DIY设计器 · DIY产品介绍
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## 简介
+
+快图设计,vue-fabric-editor 是一款基于 fabric.js 和 Vue 开发的图片编辑器,可自定义字体、素材、设计模板、右键菜单、快捷键。
+
+[动图介绍](https://juejin.cn/post/7222141882515128375) · [介绍视频](https://www.bilibili.com/video/BV1US421A7TU/?spm_id_from=333.999.0.0)
+
+### 特点
+
+1. **插件化架构**:可通过插件的进行扩展开发,支持右键菜单和快捷键。
+2. **拖拽式设计**:以轻量、简洁为主的图形编辑器,而非大而全的在线 PS 类的重行设计工具。
+3. **功能完善**:PSD 解析、辅助线、历史记录、渐变、自定义字体、裁剪等功能。
+
+### 已有功能
+
+- 导入 JSON、PSD 文件
+- 导出 PNG、SVG、JSON 文件
+- 组合/拆分组合
+- 图层功能
+- 渐变属性
+- 外观属性/字体属性/描边/阴影
+- 撤销/重做
+- 快捷键
+- 右键菜单
+- 辅助线
+- 标尺
+- 自定义字体
+- 自定义模板素材
+- 插入 SVG、图片素材
+- 多元素水平、垂直对齐方式
+- 背景属性设置
+- 箭头/线条
+- 画笔/多边形绘制
+- 二维码/条形码
+- 图片替换/裁剪/滤镜
+- 水印
+- 国际化
+
+## 使用
+
+请先安装 node.js v18-v20,及 pnpm 8.4.0, 然后执行以下命令:
+
+```shell
+// 安装pnpm
+npm install -g pnpm@8.4.0
+
+// 中国使用淘宝代理
+// npm install -g pnpm@8.4.0 --registry=https://registry.npmmirror.com
+pnpm i
+pnpm dev
+```
+重要:必须使用pnpm 8.x,高版本pnpm会导致依赖不一致出现页面运行报错。
+
+## 开发者服务
+
+- **微信交流群**:我们组建了多个微信项目交流群,作者和项目维护者活跃在群内,定期解答问题。
+- **fabric.js 中文教程**:[https://blog.kuaitu.cc](https://blog.kuaitu.cc/)。
+- **知识星球**:长期更新开源编辑器与 fabric.js 的相关资料,沉淀最佳实践、开发经验分享、代码示例等。
+
+
+## 付费版本
+
+帮助企业快速搭建在线设计工具,**减少企业研发投入,避免重复造轮子。**
+
+[功能介绍](https://ws0gdejldw.feishu.cn/docx/GKmnddCgFokr4sxFeYNcoql1nAb) · [产品介绍](http://pro.kuaitu.cc/) · [演示](https://www.kuaitu.cc/)
+
+开源版本仅前端代码,付费版本**提供完整的前后端、管理后台,功能完整开箱即用,提供源码授权、支持二次开发**。
+
+- **开箱即用,功能完整**:设计能力丰富,提供完整前台、后台功能,部署即可使用。
+- **插件架构,扩展方便**:基于插件化 API,快速对编辑器进行二次开发。
+- **批量生成,快速出图**:支持通过 HTTP 接口、表格文件批量生成图片。
+- **拖拽式设计,简单易用**:适合普通用户操作,无需培训轻松上手。
+- **全平台适配**:PC 版本、H5 版本支持各种应用场景。
+- **技术对接,文档培训**:提供更多的支持,高效完成技术对接。
+- **定制开发,减少投入**:支持快速完成功能定制开发,减少研发投入。
+
+
+
+
+## 商品/服装DIY设计器
+
+商品DIY设计器 · DIY产品介绍
+
+
+
+## 二次元设计器
+吧唧/亚克力设计器 二次元自印小程序商城
+
+
+
+
+
+电商平台DIY
+
+
+
+## 定制开发案例
+面料印花
+
+丝巾设计试戴
+
+工艺仿真
+
+参数化盒型
+
+各类DIY设计器
+
+
+
+
+
+## 贡献指南
+
+项目致力于打造一个开箱即用的 web 图片编辑器应用,同时沉淀一个介于 web 图片编辑器应用与 fabric.js 之间的封装层,期望封装层面向开发者设计,提供更简单的接口,让开发者可以轻松的实现图片应用开发。
+
+如果你对这件事情感兴趣,真诚的邀请你加入,我们一起成长,你只要会简单的 Git 和 Javascript 语法就可以。
+
+[【提交代码送赢雷蛇游戏鼠标】](https://github.com/ikuaitu/vue-fabric-editor/issues/526)
+
+### 相关资料
+
+这是我发表在掘金社区关于编辑器的技术笔记,会有更多的细节:
+
+1. [使用 fabric.js 快速开发一个图片编辑器](https://juejin.cn/post/7155040639497797645),
+2. [fabric.js 开发图片编辑器的细节实现](https://juejin.cn/post/7199849226745430076)
+3. [fabric.js 开发图片编辑器可以实现哪些功能?多图](https://juejin.cn/post/7222141882515128375)
+4. [我的开源项目与开源经历分享](https://juejin.cn/post/7224765991896121401)
+5. [Canvas 库 fabric.js 可以实现哪些功能? 动图介绍](https://juejin.cn/post/7336743827827015731)
+6. [Vue 开源图片编辑器](https://juejin.cn/post/7384258569590636595)
+7. [个人开源项目商业化经验分享](https://juejin.cn/post/7400687574967271478)
+8. [开源 fabric.js 图片编辑器的插件化架构](https://juejin.cn/post/7401071861847949339)
+
+注:如果遇到技术问题,期望使用 issue 讨论,它更加开放与透明,足够多的信息会让解决问题变得更高效,参考[提问的智慧](https://github.com/ryanhanwu/How-To-Ask-Questions-The-Smart-Way/blob/main/README-zh_CN.md#%E6%8F%90%E9%97%AE%E7%9A%84%E6%99%BA%E6%85%A7)。
+
+
+
+## 致谢
+
+- [刘明野](https://github.com/liumingye)标尺功能作者。
+- [palxiao](https://github.com/palxiao/poster-design/tree/main/packages/color-picker)设计编辑器的渐变组件。
+
+## 友情赞助
+
+
+
+
+
+
+
+
+
+
+
+
+
+## 管理员
+
+
+
+
+
+## 贡献者
+
+
+
+
+
+
+## License
+
+Licensed under the [MIT](./LICENSE) License.
diff --git a/commitlint.config.js b/commitlint.config.js
new file mode 100644
index 0000000..84dcb12
--- /dev/null
+++ b/commitlint.config.js
@@ -0,0 +1,3 @@
+module.exports = {
+ extends: ['@commitlint/config-conventional'],
+};
diff --git a/data/gen_templates_v2.py b/data/gen_templates_v2.py
new file mode 100644
index 0000000..aa185d3
--- /dev/null
+++ b/data/gen_templates_v2.py
@@ -0,0 +1,612 @@
+#!/usr/bin/env python3
+"""快图设计模板批量生成器(fabric JSON)—— v2,版式×配色×尺寸 组合。
+
+设计要点
+- 模板 = 版式(layout) × 配色(palette) × 尺寸(category),20 种版式各自独立构图
+ (色块、分割、卡片、网格、步骤、对比、描边字、截图占位框等),避免"同版式换色"的廉价感。
+- 每个 fabric JSON 的第一个对象必须是 id='workspace' 的矩形,否则快图载入模板后
+ 遮罩关不掉(WorkspacePlugin / ResizePlugin 依赖它取画布尺寸)。
+- 预览图由 render_preview.js 从同一份 fabric JSON 渲染,保证缩略图 = 载入结果。
+"""
+import json, math, os
+
+DATA = "/vol1/1000/HD1/docker/kuaitu-editor-data"
+FONT = "Microsoft YaHei"
+BRAND = "@软件小妹"
+
+# ---------------------------------------------------------------- 配色 (bg1, bg2, text, muted, accent, dark)
+PALETTES = [
+ ("#1e3a8a", "#3b82f6", "#ffffff", "#c7d7f5", "#fbbf24", True), # 深蓝
+ ("#111827", "#374151", "#ffffff", "#cbd5e1", "#f59e0b", True), # 石墨金
+ ("#ecfdf5", "#bbf7d0", "#064e3b", "#0f766e", "#059669", False), # 薄荷
+ ("#7c2d12", "#ea580c", "#ffffff", "#ffedd5", "#fde047", True), # 珊瑚橙
+ ("#4c1d95", "#7c3aed", "#ffffff", "#ddd6fe", "#f472b6", True), # 紫罗兰
+ ("#ffffff", "#f3f4f6", "#111827", "#6b7280", "#ef4444", False), # 极简白
+ ("#fdf2f8", "#fbcfe8", "#831843", "#be185d", "#db2777", False), # 少女粉
+ ("#042f2e", "#0d9488", "#ffffff", "#99f6e4", "#22d3ee", True), # 科技青
+ ("#7f1d1d", "#b91c1c", "#ffffff", "#fecaca", "#fcd34d", True), # 报刊红
+ ("#facc15", "#fef08a", "#111827", "#78350f", "#111827", False), # 黄黑
+ ("#eff6ff", "#bfdbfe", "#1e3a8a", "#2563eb", "#1d4ed8", False), # 天空蓝
+ ("#1e1b4b", "#312e81", "#ffffff", "#c7d2fe", "#a78bfa", True), # 暗夜紫
+ ("#fffbeb", "#fef3c7", "#78350f", "#b45309", "#d97706", False), # 奶油米
+ ("#064e3b", "#047857", "#ffffff", "#a7f3d0", "#facc15", True), # 森林绿
+ ("#0f172a", "#1e293b", "#ffffff", "#94a3b8", "#38bdf8", True), # 深夜蓝
+ ("#831843", "#be185d", "#ffffff", "#fbcfe8", "#fde047", True), # 玫红
+ ("#f8fafc", "#e2e8f0", "#0f172a", "#475569", "#0ea5e9", False), # 冷灰
+ ("#312e81", "#0ea5e9", "#ffffff", "#e0f2fe", "#fde047", True), # 蓝紫
+]
+
+# ---------------------------------------------------------------- 图元
+def R(l, t, w, h, fill, rx=0, op=1.0, angle=0, stroke=None, sw=0, dash=None, fid=None):
+ o = {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top",
+ "left": round(l), "top": round(t), "width": round(w), "height": round(h),
+ "fill": fill, "opacity": op, "scaleX": 1, "scaleY": 1, "angle": angle, "stroke": stroke}
+ if rx:
+ o["rx"] = round(rx); o["ry"] = round(rx)
+ if sw:
+ o["strokeWidth"] = sw
+ if dash:
+ o["strokeDashArray"] = dash
+ if fid:
+ o["id"] = fid
+ return o
+
+def T(text, l, t, w, size, fill, weight="normal", align="left", lh=1.3, ls=0, stroke=None, sw=0):
+ o = {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top",
+ "left": round(l), "top": round(t), "width": round(w), "text": text,
+ "fontSize": round(size), "fontFamily": FONT, "fontWeight": weight, "fill": fill,
+ "textAlign": align, "lineHeight": lh, "charSpacing": ls, "opacity": 1,
+ "scaleX": 1, "scaleY": 1, "angle": 0}
+ if stroke:
+ o["stroke"] = stroke; o["strokeWidth"] = sw; o["paintFirst"] = "stroke"
+ return o
+
+def _lum(h):
+ h = (h or '#000000').lstrip('#')
+ if len(h) == 3:
+ h = ''.join(c * 2 for c in h)
+ try:
+ r, g, b = (int(h[i:i + 2], 16) / 255 for i in (0, 2, 4))
+ except ValueError:
+ return 0.5
+ f = lambda c: c / 12.92 if c <= 0.03928 else ((c + 0.055) / 1.055) ** 2.4
+ return 0.2126 * f(r) + 0.7152 * f(g) + 0.0722 * f(b)
+
+def onc(c):
+ """返回在 c 底色上可读的文字色"""
+ return "#111827" if _lum(c) > 0.55 else "#ffffff"
+
+def cw(s):
+ return sum(1.0 if ord(c) > 0x2E80 else 0.56 for c in s)
+
+def fit(text, maxw, size, maxlines=2):
+ size = float(size)
+ while size > 12:
+ if math.ceil(cw(text) / (maxw / size)) <= maxlines:
+ break
+ size -= 1
+ return int(size)
+
+def _sz(w, h):
+ u = min(w, h) / 100.0
+ ar = w / h
+ ts = round(u * (11 if ar >= 2 else 10 if ar >= 1.4 else 6.4))
+ return u, ts, round(ts * 0.44)
+
+def _lines(text, maxw, size):
+ return max(1, math.ceil(cw(text) / (maxw / size)))
+
+# ---------------------------------------------------------------- 版式
+def heroLeft(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 9)
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.5), R(0, 0, round(u * 1.8), h, acc),
+ R(w - u * 24, -u * 10, u * 42, u * 42, acc, rx=u * 21, op=0.12)]
+ y = pad
+ if d.get("tag"):
+ fs = round(u * 4.6); tw = cw(d["tag"]) * fs + u * 9
+ o += [R(pad, y, tw, fs + u * 4.4, acc, rx=(fs + u * 4.4) / 2, op=0.22),
+ T(d["tag"], pad + u * 4, y + u * 1.8, tw, fs, acc, "bold")]
+ y += fs + u * 9
+ wl = w - pad - u * 12
+ t = fit(d["title"], wl, ts, 2 if w / h > 1.2 else 3)
+ o.append(T(d["title"], pad, y, wl, t, txt, "bold", lh=1.22))
+ y += t * 1.22 * _lines(d["title"], wl, t) + u * 3
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, y, w - pad - u * 18, ss, mut))
+ if d.get("brand"):
+ o += [R(pad, h - pad - u * 4.4, u * 7, u * 1.1, acc, rx=u * 0.6),
+ T(d["brand"], pad + u * 9.5, h - pad - u * 6, u * 60, round(u * 4.4), mut)]
+ return o
+
+def heroRight(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 9)
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.45), R(w - u * 28, 0, u * 28, h, acc, op=0.92),
+ R(w - u * 32, h - u * 16, u * 22, u * 22, txt, rx=u * 11, op=0.14)]
+ wl = w - u * 40
+ y = pad
+ if d.get("tag"):
+ o.append(T(d["tag"], pad, y, wl, round(u * 4.6), acc, "bold")); y += u * 8
+ t = fit(d["title"], wl, ts, 3)
+ o.append(T(d["title"], pad, y, wl, t, txt, "bold", lh=1.22))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, h - pad - u * 13, wl, ss, mut))
+ if d.get("brand"):
+ o.append(T(d["brand"], w - u * 26, h - u * 14, u * 24, round(u * 4.2), onc(acc), "bold", "center"))
+ return o
+
+def centerStack(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 10)
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.55),
+ R(pad * 0.7, pad * 0.7, w - pad * 1.4, h - pad * 1.4, None, stroke=acc, sw=max(2, round(u * 0.5)), op=0.45)]
+ y = h * 0.2
+ if d.get("tag"):
+ fs = round(u * 4.4); tw = cw(d["tag"]) * fs + u * 10
+ o += [R((w - tw) / 2, y, tw, fs + u * 4.2, acc, rx=(fs + u * 4.2) / 2),
+ T(d["tag"], (w - tw) / 2, y + u * 1.7, tw, fs, onc(acc), "bold", "center")]
+ y += fs + u * 10
+ t = fit(d["title"], w - pad * 2.6, ts, 3)
+ o.append(T(d["title"], pad, y, w - pad * 2, t, txt, "bold", "center", lh=1.3))
+ y += t * 1.3 * _lines(d["title"], w - pad * 2, t) + u * 5
+ o.append(R(w / 2 - u * 6, y, u * 12, max(3, u * 0.9), acc, rx=u * 0.5))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, y + u * 6, w - pad * 2, ss, mut, "normal", "center"))
+ if d.get("brand"):
+ o.append(T(d["brand"], pad, h - pad * 0.9, w - pad * 2, round(u * 4.2), mut, "normal", "center"))
+ return o
+
+def posterBold(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 8)
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.4)]
+ y = pad
+ if d.get("tag"):
+ fs = round(u * 5); tw = cw(d["tag"]) * fs + u * 8
+ o += [R(pad, y, tw, fs + u * 5, txt if dark else acc),
+ T(d["tag"], pad + u * 3, y + u * 2, tw, fs, onc(txt if dark else acc), "bold")]
+ y += fs + u * 10
+ t = fit(d["title"], w - pad * 2, round(ts * 1.35), 2 if w / h > 1.2 else 3)
+ o.append(T(d["title"], pad, y, w - pad * 1.6, t, txt, "bold", lh=1.14))
+ if d.get("subtitle"):
+ sh = round(t * 0.62) + u * 9
+ bw = min(w - pad * 2, cw(d["subtitle"]) * ss + u * 10)
+ o += [R(pad, h - pad - sh, bw, sh, acc),
+ T(d["subtitle"], pad + u * 5, h - pad - sh + u * 4, bw, ss, onc(acc), "bold")]
+ o.append(R(0, h - max(5, u * 1.4), w, max(5, u * 1.4), acc))
+ if d.get("brand"):
+ o.append(T(d["brand"], w - pad - u * 40, pad, u * 40, round(u * 4.2), mut, "bold", "right"))
+ return o
+
+def listVertical(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 8)
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.5), R(0, 0, w, round(u * 1.2), acc)]
+ y = pad * 1.2
+ if d.get("tag"):
+ fs = round(u * 4.8); tw = cw(d["tag"]) * fs + u * 10
+ o += [R(pad, y, tw, fs + u * 5, acc, rx=(fs + u * 5) / 2),
+ T(d["tag"], pad + u * 4, y + u * 2, tw, fs, onc(acc), "bold")]
+ y += fs + u * 12
+ t = fit(d["title"], w - pad * 2, ts, 3)
+ o.append(T(d["title"], pad, y, w - pad * 1.8, t, txt, "bold", lh=1.28))
+ y += t * 1.28 * _lines(d["title"], w - pad * 2, t) + u * 6
+ o.append(R(pad, y, u * 12, max(4, u * 1.1), acc, rx=u * 0.6))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, y + u * 6, w - pad * 2.4, ss, mut)); y += ss + u * 12
+ for i, it in enumerate(d.get("items", [])[:5]):
+ yy = y + i * (ss + u * 9)
+ o += [R(pad, yy + u * 1.2, u * 3.6, u * 3.6, acc, rx=u * 1.8),
+ T(it, pad + u * 6.4, yy, w - pad * 2.4, round(ss * 0.95), txt, "bold")]
+ if d.get("brand"):
+ o += [R(pad, h - pad * 1.8, u * 5.4, u * 5.4, acc, rx=u * 2.7),
+ T(d["brand"], pad + u * 8, h - pad * 1.6, w - pad * 3, round(u * 4.4), mut, "bold")]
+ return o
+
+def cardStack(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 7)
+ top = round(h * 0.42)
+ o = [R(0, 0, w, h, "#ffffff"), R(0, 0, w, h, bg2, op=0.35), R(0, 0, w, top, bg1),
+ R(0, 0, w, top, bg2, op=0.45), R(w - u * 20, top - u * 12, u * 26, u * 26, acc, rx=u * 13, op=0.22)]
+ y = pad * 1.4
+ if d.get("tag"):
+ fs = round(u * 4.6); tw = cw(d["tag"]) * fs + u * 9
+ o += [R(pad, y, tw, fs + u * 4.4, acc), T(d["tag"], pad + u * 3.4, y + u * 1.8, tw, fs, onc(acc), "bold")]
+ y += fs + u * 10
+ t = fit(d["title"], w - pad * 2, ts, 3)
+ o.append(T(d["title"], pad, y, w - pad * 1.8, t, txt, "bold", lh=1.24))
+ yy = top + pad
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, yy, w - pad * 2, round(ss * 1.15), bg1, "bold"))
+ yy += ss * 1.15 * 1.6 + u * 5
+ for i, it in enumerate(d.get("items", [])[:3]):
+ o += [R(pad, yy + i * (ss + u * 8) + u * 0.8, u * 2.4, u * 2.4, acc, rx=u * 1.2),
+ T(it, pad + u * 4.6, yy + i * (ss + u * 8), w - pad * 2.4, ss, bg1)]
+ if d.get("brand"):
+ o.append(T(d["brand"], pad, h - pad * 1.8, w - pad * 3, round(u * 4.4), bg1, "bold"))
+ return o
+
+def splitHalf(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 8)
+ if h >= w:
+ half = round(h * 0.46)
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, half, bg2, op=0.7), R(0, half, w, h - half, acc, op=0.16),
+ R(0, half - u * 1.2, w, u * 1.2, acc)]
+ t = fit(d["title"], w - pad * 2, ts, 3)
+ o.append(T(d["title"], pad, pad * 1.6, w - pad * 2, t, txt, "bold", lh=1.25))
+ yy = half + pad
+ if d.get("tag"):
+ o.append(T(d["tag"], pad, yy, w - pad * 2, round(u * 4.6), acc, "bold")); yy += u * 9
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, yy, w - pad * 2, ss, mut, "bold", lh=1.5)); yy += ss * 3.2
+ for i, it in enumerate(d.get("items", [])[:2]):
+ o.append(T("● " + it, pad, yy + i * (ss + u * 7), w - pad * 2, ss, txt))
+ else:
+ half = round(w * 0.52)
+ o = [R(0, 0, w, h, bg1), R(half, 0, w - half, h, acc, op=0.92), R(0, 0, half, h, bg2, op=0.5)]
+ t = fit(d["title"], half - pad * 2, ts, 3)
+ o.append(T(d["title"], pad, h * 0.2, half - pad * 2, t, txt, "bold", lh=1.24))
+ if d.get("tag"):
+ o.append(T(d["tag"], pad, h * 0.2 - u * 9, half - pad * 2, round(u * 4.6), acc, "bold"))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], half + pad, h * 0.3, w - half - pad * 2, ss, onc(acc), "bold", lh=1.5))
+ if d.get("brand"):
+ o.append(T(d["brand"], half + pad, h - pad * 1.4, w - half - pad * 2, round(u * 4.2), onc(acc)))
+ return o
+
+def quoteMark(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 10)
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.5), T("“", pad, -u * 6, u * 30, round(u * 26), acc, "bold")]
+ t = fit(d["title"], w - pad * 2.4, ts, 3)
+ o.append(T(d["title"], pad, h * 0.26, w - pad * 2, t, txt, "bold", "center", lh=1.42))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, h * 0.62, w - pad * 2, ss, mut, "normal", "center"))
+ if d.get("brand"):
+ o += [R(w / 2 - u * 6, h - pad * 2.4, u * 12, max(3, u * 0.8), acc, rx=u * 0.4),
+ T(d["brand"], pad, h - pad * 1.6, w - pad * 2, round(u * 4.2), mut, "normal", "center")]
+ return o
+
+def numberedBig(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 8)
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.42)]
+ ns = round(min(h * 0.42, w * 0.3))
+ o += [R(pad, pad, ns * 1.5, ns * 1.5, acc, rx=u * 3, op=0.9),
+ T(d.get("number", "5"), pad + ns * 0.18, pad - ns * 0.06, ns * 1.4, ns, onc(acc), "bold", "center")]
+ tx = pad + ns * 1.5 + u * 6
+ wl = w - tx - pad
+ t = fit(d["title"], wl, ts, 3)
+ o.append(T(d["title"], tx, pad + ns * 0.24, wl, t, txt, "bold", lh=1.24))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], tx, pad + ns * 1.66, wl, ss, mut))
+ if d.get("tag"):
+ o.append(T(d["tag"], pad, h - pad * 1.6, w - pad * 2, round(u * 4.6), acc, "bold"))
+ if d.get("brand"):
+ o.append(T(d["brand"], pad, h - pad * 1.6, w - pad * 2, round(u * 4.4), mut, "bold", "right"))
+ return o
+
+def ribbonTop(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 8)
+ rh = round(min(h * 0.3, u * 16))
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.5), R(0, 0, w, rh, acc)]
+ if d.get("tag"):
+ o.append(T(d["tag"], pad, rh / 2 - u * 4.4, w - pad * 2, round(u * 6), onc(acc), "bold"))
+ y = rh + pad * 1.3
+ t = fit(d["title"], w - pad * 2, ts, 3)
+ o.append(T(d["title"], pad, y, w - pad * 1.8, t, txt, "bold", lh=1.26))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, y + t * 1.4 * _lines(d["title"], w - pad * 2, t) + u * 3,
+ w - pad * 2, ss, mut))
+ o.append(R(pad, h - pad * 1.9, w - pad * 2, max(2, u * 0.5), acc, op=0.6))
+ if d.get("brand"):
+ o.append(T(d["brand"], pad, h - pad * 1.4, w - pad * 2, round(u * 4.4), mut, "bold"))
+ return o
+
+def minimalLine(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 9)
+ o = [R(0, 0, w, h, "#ffffff"),
+ R(pad * 0.6, pad * 0.6, w - pad * 1.2, h - pad * 1.2, None, stroke="#111827", sw=max(2, round(u * 0.45))),
+ R(pad, pad * 1.2, u * 9, max(4, u * 1.2), acc)]
+ y = pad * 2.1
+ if d.get("tag"):
+ o.append(T(d["tag"], pad, y, w - pad * 2, round(u * 4.4), acc, "bold", ls=u * 0.6)); y += u * 8.4
+ t = fit(d["title"], w - pad * 2, ts, 3)
+ o.append(T(d["title"], pad, y, w - pad * 1.9, t, "#111827", "bold", lh=1.3))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, h - pad * 2.6, w - pad * 2, ss, "#6b7280"))
+ if d.get("brand"):
+ o.append(T(d["brand"], pad, h - pad * 1.5, w - pad * 2, round(u * 4.2), "#111827", "bold"))
+ return o
+
+def photoFrame(w, h, p, d):
+ """软件截图占位版式:留真实截图框 + 标题条(文章配图常用)"""
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 7)
+ fr = round(h * (0.52 if h >= w else 0.46))
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.4),
+ R(pad, pad, w - pad * 2, fr, "#ffffff", rx=u * 2, op=0.95),
+ R(pad, pad, w - pad * 2, fr, None, rx=u * 2, stroke=acc, sw=max(3, round(u * 0.6)),
+ dash=[u * 2.4, u * 1.6]),
+ T("把软件真实界面截图拖到这里", pad + u * 4, pad + fr / 2 - u * 4, w - pad * 2 - u * 8,
+ round(u * 4.6), "#94a3b8", "bold", "center")]
+ y = pad + fr + pad * 0.9
+ t = fit(d["title"], w - pad * 2, round(ts * 0.8), 2)
+ o.append(T(d["title"], pad, y, w - pad * 1.8, t, txt, "bold", lh=1.22))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, y + t * 1.35 * _lines(d["title"], w - pad * 2, t), w - pad * 2, ss, mut))
+ if d.get("tag"):
+ fs = round(u * 4.4); tw = cw(d["tag"]) * fs + u * 9
+ o += [R(pad, h - pad - fs - u * 4, tw, fs + u * 4, acc, rx=(fs + u * 4) / 2),
+ T(d["tag"], pad + u * 3.4, h - pad - fs - u * 1.6, tw, fs, onc(acc), "bold")]
+ if d.get("brand"):
+ o.append(T(d["brand"], pad, h - pad - u * 5, w - pad * 2, round(u * 4.4), mut, "bold", "right"))
+ return o
+
+def compareTwo(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 7)
+ cw2 = (w - pad * 3) / 2
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.42),
+ R(pad, pad * 2.6, cw2, h - pad * 5, "#ffffff", rx=u * 2, op=0.92),
+ R(pad * 2 + cw2, pad * 2.6, cw2, h - pad * 5, acc, rx=u * 2, op=0.92)]
+ t = fit(d["title"], w - pad * 2, round(ts * 0.8), 2)
+ o.append(T(d["title"], pad, pad * 0.9, w - pad * 2, t, txt, "bold"))
+ o += [T(d.get("left", "付费软件"), pad + u * 4, pad * 3.6, cw2 - u * 8, round(u * 4.8), "#111827", "bold"),
+ T(d.get("right", "开源替代"), pad * 2 + cw2 + u * 4, pad * 3.6, cw2 - u * 8, round(u * 4.8), onc(acc), "bold")]
+ left = list(d.get("items") or []) + ["要付费", "有广告", "强制登录", "到期续费"]
+ right = list(d.get("items2") or ["完全免费", "无广告", "免登录", "永久可用"]) + ["开源可改", "体积更小"]
+ for i, it in enumerate(left[:4]):
+ o.append(T("× " + it, pad + u * 4, pad * 4.8 + i * (ss + u * 5), cw2 - u * 8, ss, "#1f2937"))
+ for i, it in enumerate(right[:4]):
+ o.append(T("✓ " + it, pad * 2 + cw2 + u * 4, pad * 4.8 + i * (ss + u * 5), cw2 - u * 8, ss, onc(acc), "bold"))
+ return o
+
+def stepsThree(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 8)
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.45)]
+ y = pad
+ if d.get("tag"):
+ o.append(T(d["tag"], pad, y, w - pad * 2, round(u * 4.6), acc, "bold")); y += u * 8.6
+ t = fit(d["title"], w - pad * 2, ts, 2)
+ o.append(T(d["title"], pad, y, w - pad * 1.9, t, txt, "bold", lh=1.24))
+ y += t * 1.35 + u * 6
+ items = (d.get("items") or ["下载安装", "导入文件", "一键导出"])[:3]
+ step = (h - y - pad) / 3.0
+ for i, it in enumerate(items):
+ yy = y + i * step
+ o += [R(pad, yy, u * 9, u * 9, acc, rx=u * 4.5),
+ T(str(i + 1), pad, yy + u * 1.2, u * 9, round(u * 5), onc(acc), "bold", "center"),
+ T(it, pad + u * 12, yy + u * 1.4, w - pad * 2 - u * 12, round(ss * 1.05), txt, "bold"),
+ R(pad, yy + u * 10.5, w - pad * 2, max(1, u * 0.4), mut, op=0.4)]
+ return o
+
+def priceTag(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 8)
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.5),
+ R(w - u * 22, h - u * 22, u * 30, u * 30, acc, rx=u * 15, op=0.18)]
+ y = h * 0.22
+ if d.get("tag"):
+ fs = round(u * 5); tw = cw(d["tag"]) * fs + u * 10
+ o += [R(pad, y, tw, fs + u * 5, acc),
+ T(d["tag"], pad + u * 4, y + u * 2, tw, fs, onc(acc), "bold")]
+ y += fs + u * 11
+ bs = round(min(w * 0.3, h * 0.3))
+ o.append(T(d.get("big", "免费"), pad, y, w - pad * 2, bs, txt, "bold", lh=1.0))
+ y += bs * 1.15
+ t = fit(d["title"], w - pad * 2, round(ts * 0.72), 2)
+ o.append(T(d["title"], pad, y, w - pad * 1.9, t, acc, "bold", lh=1.26))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, y + t * 1.4 * _lines(d["title"], w - pad * 2, t), w - pad * 2, ss, mut))
+ if d.get("brand"):
+ o.append(T(d["brand"], pad, h - pad * 1.4, w - pad * 2, round(u * 4.4), mut, "bold"))
+ return o
+
+def sideBanner(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 6)
+ bw = round(w * 0.34)
+ o = [R(0, 0, w, h, bg1), R(0, 0, bw, h, acc), R(0, 0, bw, h, bg2, op=0.35), R(bw, 0, w - bw, h, bg2, op=0.4)]
+ bs = round(min(bw * 0.42, h * 0.32))
+ o.append(T(d.get("big", "免费"), pad * 0.6, h / 2 - bs * 0.72, bw - pad * 1.2, bs, onc(acc), "bold", "center", lh=1.0))
+ if d.get("tag"):
+ o.append(T(d["tag"], pad * 0.6, h / 2 + bs * 0.42, bw - pad * 1.2, round(u * 4.4), onc(acc), "bold", "center"))
+ x = bw + pad * 1.4; wl = w - x - pad; y = h * 0.22
+ if d.get("tag2"):
+ o.append(T(d["tag2"], x, y - u * 8, wl, round(u * 4.4), acc, "bold"))
+ t = fit(d["title"], wl, ts, 3)
+ o.append(T(d["title"], x, y, wl, t, txt, "bold", lh=1.24))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], x, y + t * 1.35 * _lines(d["title"], wl, t) + u * 2, wl, ss, mut))
+ if d.get("brand"):
+ o.append(T(d["brand"], x, h - pad - u * 5, wl, round(u * 4.2), mut, "bold"))
+ return o
+
+def gridCards(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 7)
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.4)]
+ t = fit(d["title"], w - pad * 2, ts, 2)
+ o.append(T(d["title"], pad, pad, w - pad * 1.9, t, txt, "bold", lh=1.24))
+ y = pad + t * 1.35 + u * 5
+ items = list(d.get("items") or ["免费", "开源", "无广告", "跨平台"])
+ fill = ["免费", "开源", "无广告", "跨平台", "轻量", "免安装"]
+ i = 0
+ while len(items) < 4:
+ if fill[i % len(fill)] not in items:
+ items.append(fill[i % len(fill)])
+ i += 1
+ if i > 24:
+ break
+ items = items[:4]
+ gap = u * 3
+ cwid = (w - pad * 2 - gap) / 2
+ chei = (h - y - pad - gap) / 2
+ for i, it in enumerate(items):
+ r, c = divmod(i, 2)
+ x = pad + c * (cwid + gap); yy = y + r * (chei + gap)
+ o += [R(x, yy, cwid, chei, "#ffffff", rx=u * 2, op=0.94), R(x, yy, cwid, u * 1.2, acc),
+ T(it, x + u * 3, yy + chei / 2 - u * 4, cwid - u * 6, round(ss * 1.15), "#111827", "bold")]
+ return o
+
+def outlineText(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 7)
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.45)]
+ t = fit(d["title"], w - pad * 2, round(ts * 1.1), 2)
+ o.append(T(d["title"], pad, h * 0.26, w - pad * 1.8, t, "rgba(0,0,0,0)", "bold", lh=1.2,
+ stroke=acc if dark else txt, sw=max(3, round(u * 0.9))))
+ if d.get("tag"):
+ o.append(T(d["tag"], pad, h * 0.2, w - pad * 2, round(u * 4.8), txt, "bold"))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, h * 0.62, w - pad * 2, ss, mut, "bold"))
+ if d.get("brand"):
+ o.append(T(d["brand"], pad, h - pad * 1.5, w - pad * 2, round(u * 4.2), txt, "bold", "right"))
+ return o
+
+def badgeCenter(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 8)
+ o = [R(0, 0, w, h, bg1), R(0, 0, w, h, bg2, op=0.5), R(0, 0, w, round(h * 0.12), acc, op=0.9)]
+ bs = round(u * 12)
+ o += [R(w / 2 - bs / 2, h * 0.12 - bs * 0.5, bs, bs, txt, rx=bs / 2, op=0.95),
+ T("荐", w / 2 - bs / 2, h * 0.12 - bs * 0.34, bs, round(bs * 0.55), onc(txt), "bold", "center")]
+ t = fit(d["title"], w - pad * 2, ts, 3)
+ o.append(T(d["title"], pad, h * 0.36, w - pad * 2, t, txt, "bold", "center", lh=1.3))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, h * 0.66, w - pad * 2, ss, mut, "normal", "center"))
+ if d.get("brand"):
+ o.append(T(d["brand"], pad, h - pad * 1.4, w - pad * 2, round(u * 4.2), mut, "normal", "center"))
+ return o
+
+def stripeDiag(w, h, p, d):
+ bg1, bg2, txt, mut, acc, dark = p
+ u, ts, ss = _sz(w, h); pad = round(u * 8)
+ o = [R(0, 0, w, h, bg1)]
+ for i in range(6):
+ o.append(R(-u * 10 + i * u * 22, -u * 12, u * 9, h + u * 24, acc, op=0.16, angle=18))
+ o.append(R(0, 0, w, h, bg2, op=0.28))
+ y = pad * 1.4
+ if d.get("tag"):
+ fs = round(u * 4.8); tw = cw(d["tag"]) * fs + u * 10
+ o += [R(pad, y, tw, fs + u * 5, acc), T(d["tag"], pad + u * 4, y + u * 2, tw, fs, onc(acc), "bold")]
+ y += fs + u * 11
+ t = fit(d["title"], w - pad * 2, ts, 3)
+ o.append(T(d["title"], pad, y, w - pad * 1.8, t, txt, "bold", lh=1.24))
+ if d.get("subtitle"):
+ o.append(T(d["subtitle"], pad, h - pad * 2.4, w - pad * 2, ss, mut, "bold"))
+ if d.get("brand"):
+ o.append(T(d["brand"], pad, h - pad * 1.4, w - pad * 2, round(u * 4.2), mut, "bold", "right"))
+ return o
+
+LAYOUTS = {
+ "heroLeft": ("左色块大标题", heroLeft), "heroRight": ("右侧强调块", heroRight),
+ "centerStack": ("居中留白", centerStack), "posterBold": ("大字报", posterBold),
+ "listVertical": ("清单条列", listVertical), "cardStack": ("上色块下说明", cardStack),
+ "splitHalf": ("两段分割", splitHalf), "quoteMark": ("引言卡片", quoteMark),
+ "numberedBig": ("超大数字", numberedBig), "ribbonTop": ("顶部色带", ribbonTop),
+ "minimalLine": ("极简线框", minimalLine), "photoFrame": ("截图占位", photoFrame),
+ "compareTwo": ("左右对比", compareTwo), "stepsThree": ("三步流程", stepsThree),
+ "priceTag": ("免费大字", priceTag), "sideBanner": ("左色块大数字", sideBanner),
+ "gridCards": ("四宫格", gridCards), "outlineText": ("描边大字", outlineText),
+ "badgeCenter": ("徽标居中", badgeCenter), "stripeDiag": ("斜纹渐变", stripeDiag),
+}
+
+# ---------------------------------------------------------------- 文案
+S = {
+ 20: [dict(tag="本期推荐", title="5 个免费神器,让电脑效率翻倍", subtitle="全部开源 · 无广告 · 一键安装", number="5", big="免费", items=["免费无广告", "中文界面"]),
+ dict(tag="省钱攻略", title="再也不用花钱买会员了", subtitle="这 3 个开源工具直接替代", number="3", big="0元", items=["可替代付费软件"]),
+ dict(tag="冷门神器", title="99% 的人都没用过这个软件", subtitle="装完就不想卸载", number="1", big="1", items=["体积极小"]),
+ dict(tag="办公效率", title="批量重命名 1000 个文件只要 3 秒", subtitle="Windows 自带工具就够了", number="3", big="3秒", items=["零学习成本"]),
+ dict(tag="真实体验", title="用了三年开源软件,我卸载了所有付费版", subtitle="省下的钱够买台新电脑", number="3", big="免费", items=["长期免费"])],
+ 21: [dict(tag="手机必备", title="亲测有效!这5个APP太顶了", subtitle="学生党/上班族都能用", items=["免费无广告", "界面超干净", "手机电脑都能装"], number="5", big="5"),
+ dict(tag="效率工具", title="上班摸鱼神器被我找到了", subtitle="老板站身后都发现不了", items=["一键隐藏", "占用极低", "免安装"], number="1", big="1"),
+ dict(tag="省钱日记", title="花 0 元换掉 6 个付费软件", subtitle="真香警告", items=["替代会员", "无广告", "可离线"], number="6", big="0元"),
+ dict(tag="学生党", title="写论文必装的3个免费工具", subtitle="导师都问我在哪找的", items=["自动排版", "查重友好", "免费导出"], number="3", big="3")],
+ 22: [dict(tag="知乎", title="真正好用的工具,从来不需要付费墙", subtitle="—— 一个用了三年开源软件的人", big="免费", items=["可替代", "可迁移"]),
+ dict(tag="理性讨论", title="为什么我劝你先别买会员", subtitle="这些免费方案已经够用", big="免费", items=["可替代", "可迁移"]),
+ dict(tag="技术向", title="开源软件到底靠什么活着", subtitle="看完你不会再说「免费的能好到哪去」", big="开源", items=["社区维护", "企业赞助"])],
+ 23: [dict(tag="干货", title="电脑必装的4个软件", subtitle="90%的人还不知道", number="4", big="4"),
+ dict(tag="热点", title="这个免费软件又更新了", subtitle="体积只有 8MB,功能却比收费的强", big="8MB", items=["免费"]),
+ dict(tag="实用", title="别再花冤枉钱买会员了", subtitle="这 5 个开源工具免费还好用", number="5", big="5", items=["免费"])],
+ 24: [dict(tag="B站投稿", title="10个免费软件,装机必备", subtitle="第6个我用了5年", number="10", big="10"),
+ dict(tag="软件推荐", title="我把付费软件全换成了这些", subtitle="一年省下 1200 元", big="1200元", items=["免费"]),
+ dict(tag="干货合集", title="这 3 个工具,让效率翻三倍", subtitle="全程无广,放心食用", number="3", big="3")],
+ 25: [dict(tag="工具箱", title="装机必备软件清单", subtitle="每一款都免费", items=["免费", "开源", "无广告", "跨平台"], big="免费"),
+ dict(tag="效率", title="一天省下 2 小时", subtitle="这 4 个工具帮我做到的", items=["自动化", "批处理", "快捷键", "免登录"], number="4", big="2h"),
+ dict(tag="收藏向", title="值得收藏的免费工具", subtitle="按需下载,不占空间", items=["轻量", "绿色", "免安装", "可便携"], big="免费")],
+ 26: [dict(tag="软件合集", title="12 个免费软件\n一次性打包给你", subtitle="全部官方正版 · 无捆绑", items=["办公", "影音", "下载", "系统"], number="12", big="12"),
+ dict(tag="干货长图", title="电脑变卡?先装这几个工具", subtitle="清完像新的一样", items=["清理", "加速", "启动项", "备份"], number="4", big="4"),
+ dict(tag="省钱合集", title="不花钱也能用得爽", subtitle="替代 8 款付费软件", items=["替代方案", "免费额度", "离线可用"], big="0元")],
+ 27: [dict(tag="视频封面", title="这 5 个免费软件,我用了 5 年", subtitle="全程无广,放心食用", number="5", big="5"),
+ dict(tag="实测", title="免费软件能有多强?", subtitle="实测对比付费版", big="免费", items=["实测对比"]),
+ dict(tag="合集", title="装机必装清单", subtitle="第 3 个最好用", number="3", big="3")],
+ 28: [dict(tag="朋友圈", title="今天又白嫖了 6 个软件", subtitle="省下的钱买了杯奶茶", items=["免费", "好用"], number="6", big="6"),
+ dict(tag="日常", title="我的电脑里没有付费软件", subtitle="全靠这些开源工具", items=["开源", "无广告"], big="免费")],
+ 29: [dict(tag="头图", title="软件小妹 · 每日一款免费软件", subtitle="关注不迷路", big="免费", tag2="公众号头图"),
+ dict(tag="专栏", title="开源软件推荐合集", subtitle="持续更新中", big="合集", tag2="专栏头图")],
+}
+
+CATS = [
+ (20, "公众号封面", 900, 383, ["heroLeft", "sideBanner", "posterBold", "ribbonTop", "heroRight",
+ "numberedBig", "photoFrame", "centerStack", "outlineText", "minimalLine",
+ "splitHalf", "quoteMark", "compareTwo", "stripeDiag"]),
+ (21, "小红书", 1080, 1440, ["cardStack", "listVertical", "numberedBig", "stepsThree", "photoFrame",
+ "gridCards", "quoteMark", "heroLeft", "splitHalf", "priceTag",
+ "outlineText", "centerStack", "stripeDiag", "badgeCenter"]),
+ (22, "知乎", 1200, 675, ["quoteMark", "centerStack", "compareTwo", "heroLeft", "heroRight",
+ "numberedBig", "ribbonTop", "minimalLine", "photoFrame", "sideBanner"]),
+ (23, "头条", 1280, 720, ["posterBold", "numberedBig", "heroLeft", "splitHalf", "ribbonTop",
+ "outlineText", "centerStack", "priceTag", "sideBanner", "photoFrame"]),
+ (24, "B站", 1146, 717, ["posterBold", "heroLeft", "centerStack", "numberedBig", "splitHalf",
+ "ribbonTop", "outlineText", "minimalLine", "photoFrame", "priceTag"]),
+ (25, "方形通用", 1080, 1080, ["centerStack", "gridCards", "numberedBig", "quoteMark", "cardStack",
+ "posterBold", "priceTag", "stepsThree", "minimalLine", "outlineText",
+ "heroLeft", "photoFrame"]),
+ (26, "竖版海报", 1080, 1920, ["cardStack", "posterBold", "listVertical", "centerStack", "stepsThree",
+ "numberedBig", "quoteMark", "photoFrame", "heroLeft", "splitHalf",
+ "priceTag", "outlineText"]),
+ (27, "视频封面", 1920, 1080, ["posterBold", "heroLeft", "sideBanner", "numberedBig", "splitHalf",
+ "centerStack", "ribbonTop", "photoFrame", "outlineText", "priceTag"]),
+ (28, "朋友圈", 1080, 1260, ["centerStack", "cardStack", "listVertical", "quoteMark", "numberedBig",
+ "photoFrame", "stepsThree", "minimalLine"]),
+ (29, "横版头图", 1200, 400, ["sideBanner", "heroLeft", "ribbonTop", "posterBold", "centerStack", "minimalLine"]),
+]
+
+def main():
+ os.makedirs(DATA + "/tmpl", exist_ok=True)
+ os.makedirs(DATA + "/preview", exist_ok=True)
+ for sub, ext in (("tmpl", ".json"), ("preview", ".png")):
+ for f in os.listdir(f"{DATA}/{sub}"):
+ if f.endswith(ext):
+ os.remove(f"{DATA}/{sub}/{f}")
+
+ meta, tid = [], 100
+ for cid, cname, w, h, layouts in CATS:
+ copies = S[cid]
+ for i, lk in enumerate(layouts):
+ label, fn = LAYOUTS[lk]
+ pal = PALETTES[(i * 5 + cid) % len(PALETTES)]
+ d = dict(copies[i % len(copies)]); d["brand"] = BRAND
+ objs = [R(0, 0, w, h, "rgba(255,255,255,1)", fid="workspace")] + fn(w, h, pal, d)
+ tid += 1
+ json.dump({"version": "5.3.0", "objects": objs, "background": "#ffffff"},
+ open(f"{DATA}/tmpl/{tid}.json", "w"), ensure_ascii=False)
+ meta.append({"id": tid, "type": cid, "name": f"{cname}·{label}", "slug": lk,
+ "desc": f"{w}×{h}", "w": w, "h": h})
+ json.dump(meta, open(DATA + "/index.json", "w"), ensure_ascii=False, indent=2)
+
+ from collections import Counter
+ bad = [m["id"] for m in meta if json.load(open(f"{DATA}/tmpl/{m['id']}.json"))["objects"][0].get("id") != "workspace"]
+ print("生成模板:", len(meta), "| 缺 workspace:", bad or "无")
+ print("分类分布:", dict(sorted(Counter(m["type"] for m in meta).items())))
+
+if __name__ == "__main__":
+ main()
diff --git a/data/index.json b/data/index.json
new file mode 100644
index 0000000..5c6ce52
--- /dev/null
+++ b/data/index.json
@@ -0,0 +1,956 @@
+[
+ {
+ "id": 101,
+ "type": 20,
+ "name": "公众号封面·左色块大标题",
+ "slug": "heroLeft",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 102,
+ "type": 20,
+ "name": "公众号封面·左色块大数字",
+ "slug": "sideBanner",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 103,
+ "type": 20,
+ "name": "公众号封面·大字报",
+ "slug": "posterBold",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 104,
+ "type": 20,
+ "name": "公众号封面·顶部色带",
+ "slug": "ribbonTop",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 105,
+ "type": 20,
+ "name": "公众号封面·右侧强调块",
+ "slug": "heroRight",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 106,
+ "type": 20,
+ "name": "公众号封面·超大数字",
+ "slug": "numberedBig",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 107,
+ "type": 20,
+ "name": "公众号封面·截图占位",
+ "slug": "photoFrame",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 108,
+ "type": 20,
+ "name": "公众号封面·居中留白",
+ "slug": "centerStack",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 109,
+ "type": 20,
+ "name": "公众号封面·描边大字",
+ "slug": "outlineText",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 110,
+ "type": 20,
+ "name": "公众号封面·极简线框",
+ "slug": "minimalLine",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 111,
+ "type": 20,
+ "name": "公众号封面·两段分割",
+ "slug": "splitHalf",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 112,
+ "type": 20,
+ "name": "公众号封面·引言卡片",
+ "slug": "quoteMark",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 113,
+ "type": 20,
+ "name": "公众号封面·左右对比",
+ "slug": "compareTwo",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 114,
+ "type": 20,
+ "name": "公众号封面·斜纹渐变",
+ "slug": "stripeDiag",
+ "desc": "900×383",
+ "w": 900,
+ "h": 383
+ },
+ {
+ "id": 115,
+ "type": 21,
+ "name": "小红书·上色块下说明",
+ "slug": "cardStack",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 116,
+ "type": 21,
+ "name": "小红书·清单条列",
+ "slug": "listVertical",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 117,
+ "type": 21,
+ "name": "小红书·超大数字",
+ "slug": "numberedBig",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 118,
+ "type": 21,
+ "name": "小红书·三步流程",
+ "slug": "stepsThree",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 119,
+ "type": 21,
+ "name": "小红书·截图占位",
+ "slug": "photoFrame",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 120,
+ "type": 21,
+ "name": "小红书·四宫格",
+ "slug": "gridCards",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 121,
+ "type": 21,
+ "name": "小红书·引言卡片",
+ "slug": "quoteMark",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 122,
+ "type": 21,
+ "name": "小红书·左色块大标题",
+ "slug": "heroLeft",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 123,
+ "type": 21,
+ "name": "小红书·两段分割",
+ "slug": "splitHalf",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 124,
+ "type": 21,
+ "name": "小红书·免费大字",
+ "slug": "priceTag",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 125,
+ "type": 21,
+ "name": "小红书·描边大字",
+ "slug": "outlineText",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 126,
+ "type": 21,
+ "name": "小红书·居中留白",
+ "slug": "centerStack",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 127,
+ "type": 21,
+ "name": "小红书·斜纹渐变",
+ "slug": "stripeDiag",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 128,
+ "type": 21,
+ "name": "小红书·徽标居中",
+ "slug": "badgeCenter",
+ "desc": "1080×1440",
+ "w": 1080,
+ "h": 1440
+ },
+ {
+ "id": 129,
+ "type": 22,
+ "name": "知乎·引言卡片",
+ "slug": "quoteMark",
+ "desc": "1200×675",
+ "w": 1200,
+ "h": 675
+ },
+ {
+ "id": 130,
+ "type": 22,
+ "name": "知乎·居中留白",
+ "slug": "centerStack",
+ "desc": "1200×675",
+ "w": 1200,
+ "h": 675
+ },
+ {
+ "id": 131,
+ "type": 22,
+ "name": "知乎·左右对比",
+ "slug": "compareTwo",
+ "desc": "1200×675",
+ "w": 1200,
+ "h": 675
+ },
+ {
+ "id": 132,
+ "type": 22,
+ "name": "知乎·左色块大标题",
+ "slug": "heroLeft",
+ "desc": "1200×675",
+ "w": 1200,
+ "h": 675
+ },
+ {
+ "id": 133,
+ "type": 22,
+ "name": "知乎·右侧强调块",
+ "slug": "heroRight",
+ "desc": "1200×675",
+ "w": 1200,
+ "h": 675
+ },
+ {
+ "id": 134,
+ "type": 22,
+ "name": "知乎·超大数字",
+ "slug": "numberedBig",
+ "desc": "1200×675",
+ "w": 1200,
+ "h": 675
+ },
+ {
+ "id": 135,
+ "type": 22,
+ "name": "知乎·顶部色带",
+ "slug": "ribbonTop",
+ "desc": "1200×675",
+ "w": 1200,
+ "h": 675
+ },
+ {
+ "id": 136,
+ "type": 22,
+ "name": "知乎·极简线框",
+ "slug": "minimalLine",
+ "desc": "1200×675",
+ "w": 1200,
+ "h": 675
+ },
+ {
+ "id": 137,
+ "type": 22,
+ "name": "知乎·截图占位",
+ "slug": "photoFrame",
+ "desc": "1200×675",
+ "w": 1200,
+ "h": 675
+ },
+ {
+ "id": 138,
+ "type": 22,
+ "name": "知乎·左色块大数字",
+ "slug": "sideBanner",
+ "desc": "1200×675",
+ "w": 1200,
+ "h": 675
+ },
+ {
+ "id": 139,
+ "type": 23,
+ "name": "头条·大字报",
+ "slug": "posterBold",
+ "desc": "1280×720",
+ "w": 1280,
+ "h": 720
+ },
+ {
+ "id": 140,
+ "type": 23,
+ "name": "头条·超大数字",
+ "slug": "numberedBig",
+ "desc": "1280×720",
+ "w": 1280,
+ "h": 720
+ },
+ {
+ "id": 141,
+ "type": 23,
+ "name": "头条·左色块大标题",
+ "slug": "heroLeft",
+ "desc": "1280×720",
+ "w": 1280,
+ "h": 720
+ },
+ {
+ "id": 142,
+ "type": 23,
+ "name": "头条·两段分割",
+ "slug": "splitHalf",
+ "desc": "1280×720",
+ "w": 1280,
+ "h": 720
+ },
+ {
+ "id": 143,
+ "type": 23,
+ "name": "头条·顶部色带",
+ "slug": "ribbonTop",
+ "desc": "1280×720",
+ "w": 1280,
+ "h": 720
+ },
+ {
+ "id": 144,
+ "type": 23,
+ "name": "头条·描边大字",
+ "slug": "outlineText",
+ "desc": "1280×720",
+ "w": 1280,
+ "h": 720
+ },
+ {
+ "id": 145,
+ "type": 23,
+ "name": "头条·居中留白",
+ "slug": "centerStack",
+ "desc": "1280×720",
+ "w": 1280,
+ "h": 720
+ },
+ {
+ "id": 146,
+ "type": 23,
+ "name": "头条·免费大字",
+ "slug": "priceTag",
+ "desc": "1280×720",
+ "w": 1280,
+ "h": 720
+ },
+ {
+ "id": 147,
+ "type": 23,
+ "name": "头条·左色块大数字",
+ "slug": "sideBanner",
+ "desc": "1280×720",
+ "w": 1280,
+ "h": 720
+ },
+ {
+ "id": 148,
+ "type": 23,
+ "name": "头条·截图占位",
+ "slug": "photoFrame",
+ "desc": "1280×720",
+ "w": 1280,
+ "h": 720
+ },
+ {
+ "id": 149,
+ "type": 24,
+ "name": "B站·大字报",
+ "slug": "posterBold",
+ "desc": "1146×717",
+ "w": 1146,
+ "h": 717
+ },
+ {
+ "id": 150,
+ "type": 24,
+ "name": "B站·左色块大标题",
+ "slug": "heroLeft",
+ "desc": "1146×717",
+ "w": 1146,
+ "h": 717
+ },
+ {
+ "id": 151,
+ "type": 24,
+ "name": "B站·居中留白",
+ "slug": "centerStack",
+ "desc": "1146×717",
+ "w": 1146,
+ "h": 717
+ },
+ {
+ "id": 152,
+ "type": 24,
+ "name": "B站·超大数字",
+ "slug": "numberedBig",
+ "desc": "1146×717",
+ "w": 1146,
+ "h": 717
+ },
+ {
+ "id": 153,
+ "type": 24,
+ "name": "B站·两段分割",
+ "slug": "splitHalf",
+ "desc": "1146×717",
+ "w": 1146,
+ "h": 717
+ },
+ {
+ "id": 154,
+ "type": 24,
+ "name": "B站·顶部色带",
+ "slug": "ribbonTop",
+ "desc": "1146×717",
+ "w": 1146,
+ "h": 717
+ },
+ {
+ "id": 155,
+ "type": 24,
+ "name": "B站·描边大字",
+ "slug": "outlineText",
+ "desc": "1146×717",
+ "w": 1146,
+ "h": 717
+ },
+ {
+ "id": 156,
+ "type": 24,
+ "name": "B站·极简线框",
+ "slug": "minimalLine",
+ "desc": "1146×717",
+ "w": 1146,
+ "h": 717
+ },
+ {
+ "id": 157,
+ "type": 24,
+ "name": "B站·截图占位",
+ "slug": "photoFrame",
+ "desc": "1146×717",
+ "w": 1146,
+ "h": 717
+ },
+ {
+ "id": 158,
+ "type": 24,
+ "name": "B站·免费大字",
+ "slug": "priceTag",
+ "desc": "1146×717",
+ "w": 1146,
+ "h": 717
+ },
+ {
+ "id": 159,
+ "type": 25,
+ "name": "方形通用·居中留白",
+ "slug": "centerStack",
+ "desc": "1080×1080",
+ "w": 1080,
+ "h": 1080
+ },
+ {
+ "id": 160,
+ "type": 25,
+ "name": "方形通用·四宫格",
+ "slug": "gridCards",
+ "desc": "1080×1080",
+ "w": 1080,
+ "h": 1080
+ },
+ {
+ "id": 161,
+ "type": 25,
+ "name": "方形通用·超大数字",
+ "slug": "numberedBig",
+ "desc": "1080×1080",
+ "w": 1080,
+ "h": 1080
+ },
+ {
+ "id": 162,
+ "type": 25,
+ "name": "方形通用·引言卡片",
+ "slug": "quoteMark",
+ "desc": "1080×1080",
+ "w": 1080,
+ "h": 1080
+ },
+ {
+ "id": 163,
+ "type": 25,
+ "name": "方形通用·上色块下说明",
+ "slug": "cardStack",
+ "desc": "1080×1080",
+ "w": 1080,
+ "h": 1080
+ },
+ {
+ "id": 164,
+ "type": 25,
+ "name": "方形通用·大字报",
+ "slug": "posterBold",
+ "desc": "1080×1080",
+ "w": 1080,
+ "h": 1080
+ },
+ {
+ "id": 165,
+ "type": 25,
+ "name": "方形通用·免费大字",
+ "slug": "priceTag",
+ "desc": "1080×1080",
+ "w": 1080,
+ "h": 1080
+ },
+ {
+ "id": 166,
+ "type": 25,
+ "name": "方形通用·三步流程",
+ "slug": "stepsThree",
+ "desc": "1080×1080",
+ "w": 1080,
+ "h": 1080
+ },
+ {
+ "id": 167,
+ "type": 25,
+ "name": "方形通用·极简线框",
+ "slug": "minimalLine",
+ "desc": "1080×1080",
+ "w": 1080,
+ "h": 1080
+ },
+ {
+ "id": 168,
+ "type": 25,
+ "name": "方形通用·描边大字",
+ "slug": "outlineText",
+ "desc": "1080×1080",
+ "w": 1080,
+ "h": 1080
+ },
+ {
+ "id": 169,
+ "type": 25,
+ "name": "方形通用·左色块大标题",
+ "slug": "heroLeft",
+ "desc": "1080×1080",
+ "w": 1080,
+ "h": 1080
+ },
+ {
+ "id": 170,
+ "type": 25,
+ "name": "方形通用·截图占位",
+ "slug": "photoFrame",
+ "desc": "1080×1080",
+ "w": 1080,
+ "h": 1080
+ },
+ {
+ "id": 171,
+ "type": 26,
+ "name": "竖版海报·上色块下说明",
+ "slug": "cardStack",
+ "desc": "1080×1920",
+ "w": 1080,
+ "h": 1920
+ },
+ {
+ "id": 172,
+ "type": 26,
+ "name": "竖版海报·大字报",
+ "slug": "posterBold",
+ "desc": "1080×1920",
+ "w": 1080,
+ "h": 1920
+ },
+ {
+ "id": 173,
+ "type": 26,
+ "name": "竖版海报·清单条列",
+ "slug": "listVertical",
+ "desc": "1080×1920",
+ "w": 1080,
+ "h": 1920
+ },
+ {
+ "id": 174,
+ "type": 26,
+ "name": "竖版海报·居中留白",
+ "slug": "centerStack",
+ "desc": "1080×1920",
+ "w": 1080,
+ "h": 1920
+ },
+ {
+ "id": 175,
+ "type": 26,
+ "name": "竖版海报·三步流程",
+ "slug": "stepsThree",
+ "desc": "1080×1920",
+ "w": 1080,
+ "h": 1920
+ },
+ {
+ "id": 176,
+ "type": 26,
+ "name": "竖版海报·超大数字",
+ "slug": "numberedBig",
+ "desc": "1080×1920",
+ "w": 1080,
+ "h": 1920
+ },
+ {
+ "id": 177,
+ "type": 26,
+ "name": "竖版海报·引言卡片",
+ "slug": "quoteMark",
+ "desc": "1080×1920",
+ "w": 1080,
+ "h": 1920
+ },
+ {
+ "id": 178,
+ "type": 26,
+ "name": "竖版海报·截图占位",
+ "slug": "photoFrame",
+ "desc": "1080×1920",
+ "w": 1080,
+ "h": 1920
+ },
+ {
+ "id": 179,
+ "type": 26,
+ "name": "竖版海报·左色块大标题",
+ "slug": "heroLeft",
+ "desc": "1080×1920",
+ "w": 1080,
+ "h": 1920
+ },
+ {
+ "id": 180,
+ "type": 26,
+ "name": "竖版海报·两段分割",
+ "slug": "splitHalf",
+ "desc": "1080×1920",
+ "w": 1080,
+ "h": 1920
+ },
+ {
+ "id": 181,
+ "type": 26,
+ "name": "竖版海报·免费大字",
+ "slug": "priceTag",
+ "desc": "1080×1920",
+ "w": 1080,
+ "h": 1920
+ },
+ {
+ "id": 182,
+ "type": 26,
+ "name": "竖版海报·描边大字",
+ "slug": "outlineText",
+ "desc": "1080×1920",
+ "w": 1080,
+ "h": 1920
+ },
+ {
+ "id": 183,
+ "type": 27,
+ "name": "视频封面·大字报",
+ "slug": "posterBold",
+ "desc": "1920×1080",
+ "w": 1920,
+ "h": 1080
+ },
+ {
+ "id": 184,
+ "type": 27,
+ "name": "视频封面·左色块大标题",
+ "slug": "heroLeft",
+ "desc": "1920×1080",
+ "w": 1920,
+ "h": 1080
+ },
+ {
+ "id": 185,
+ "type": 27,
+ "name": "视频封面·左色块大数字",
+ "slug": "sideBanner",
+ "desc": "1920×1080",
+ "w": 1920,
+ "h": 1080
+ },
+ {
+ "id": 186,
+ "type": 27,
+ "name": "视频封面·超大数字",
+ "slug": "numberedBig",
+ "desc": "1920×1080",
+ "w": 1920,
+ "h": 1080
+ },
+ {
+ "id": 187,
+ "type": 27,
+ "name": "视频封面·两段分割",
+ "slug": "splitHalf",
+ "desc": "1920×1080",
+ "w": 1920,
+ "h": 1080
+ },
+ {
+ "id": 188,
+ "type": 27,
+ "name": "视频封面·居中留白",
+ "slug": "centerStack",
+ "desc": "1920×1080",
+ "w": 1920,
+ "h": 1080
+ },
+ {
+ "id": 189,
+ "type": 27,
+ "name": "视频封面·顶部色带",
+ "slug": "ribbonTop",
+ "desc": "1920×1080",
+ "w": 1920,
+ "h": 1080
+ },
+ {
+ "id": 190,
+ "type": 27,
+ "name": "视频封面·截图占位",
+ "slug": "photoFrame",
+ "desc": "1920×1080",
+ "w": 1920,
+ "h": 1080
+ },
+ {
+ "id": 191,
+ "type": 27,
+ "name": "视频封面·描边大字",
+ "slug": "outlineText",
+ "desc": "1920×1080",
+ "w": 1920,
+ "h": 1080
+ },
+ {
+ "id": 192,
+ "type": 27,
+ "name": "视频封面·免费大字",
+ "slug": "priceTag",
+ "desc": "1920×1080",
+ "w": 1920,
+ "h": 1080
+ },
+ {
+ "id": 193,
+ "type": 28,
+ "name": "朋友圈·居中留白",
+ "slug": "centerStack",
+ "desc": "1080×1260",
+ "w": 1080,
+ "h": 1260
+ },
+ {
+ "id": 194,
+ "type": 28,
+ "name": "朋友圈·上色块下说明",
+ "slug": "cardStack",
+ "desc": "1080×1260",
+ "w": 1080,
+ "h": 1260
+ },
+ {
+ "id": 195,
+ "type": 28,
+ "name": "朋友圈·清单条列",
+ "slug": "listVertical",
+ "desc": "1080×1260",
+ "w": 1080,
+ "h": 1260
+ },
+ {
+ "id": 196,
+ "type": 28,
+ "name": "朋友圈·引言卡片",
+ "slug": "quoteMark",
+ "desc": "1080×1260",
+ "w": 1080,
+ "h": 1260
+ },
+ {
+ "id": 197,
+ "type": 28,
+ "name": "朋友圈·超大数字",
+ "slug": "numberedBig",
+ "desc": "1080×1260",
+ "w": 1080,
+ "h": 1260
+ },
+ {
+ "id": 198,
+ "type": 28,
+ "name": "朋友圈·截图占位",
+ "slug": "photoFrame",
+ "desc": "1080×1260",
+ "w": 1080,
+ "h": 1260
+ },
+ {
+ "id": 199,
+ "type": 28,
+ "name": "朋友圈·三步流程",
+ "slug": "stepsThree",
+ "desc": "1080×1260",
+ "w": 1080,
+ "h": 1260
+ },
+ {
+ "id": 200,
+ "type": 28,
+ "name": "朋友圈·极简线框",
+ "slug": "minimalLine",
+ "desc": "1080×1260",
+ "w": 1080,
+ "h": 1260
+ },
+ {
+ "id": 201,
+ "type": 29,
+ "name": "横版头图·左色块大数字",
+ "slug": "sideBanner",
+ "desc": "1200×400",
+ "w": 1200,
+ "h": 400
+ },
+ {
+ "id": 202,
+ "type": 29,
+ "name": "横版头图·左色块大标题",
+ "slug": "heroLeft",
+ "desc": "1200×400",
+ "w": 1200,
+ "h": 400
+ },
+ {
+ "id": 203,
+ "type": 29,
+ "name": "横版头图·顶部色带",
+ "slug": "ribbonTop",
+ "desc": "1200×400",
+ "w": 1200,
+ "h": 400
+ },
+ {
+ "id": 204,
+ "type": 29,
+ "name": "横版头图·大字报",
+ "slug": "posterBold",
+ "desc": "1200×400",
+ "w": 1200,
+ "h": 400
+ },
+ {
+ "id": 205,
+ "type": 29,
+ "name": "横版头图·居中留白",
+ "slug": "centerStack",
+ "desc": "1200×400",
+ "w": 1200,
+ "h": 400
+ },
+ {
+ "id": 206,
+ "type": 29,
+ "name": "横版头图·极简线框",
+ "slug": "minimalLine",
+ "desc": "1200×400",
+ "w": 1200,
+ "h": 400
+ }
+]
\ No newline at end of file
diff --git a/data/logo.svg b/data/logo.svg
new file mode 100644
index 0000000..85d273c
--- /dev/null
+++ b/data/logo.svg
@@ -0,0 +1,7 @@
+
+
+
+
+ 快图设计
+
\ No newline at end of file
diff --git a/data/preview/101.png b/data/preview/101.png
new file mode 100644
index 0000000..2c14cde
Binary files /dev/null and b/data/preview/101.png differ
diff --git a/data/preview/102.png b/data/preview/102.png
new file mode 100644
index 0000000..0d53161
Binary files /dev/null and b/data/preview/102.png differ
diff --git a/data/preview/103.png b/data/preview/103.png
new file mode 100644
index 0000000..6f4dfd2
Binary files /dev/null and b/data/preview/103.png differ
diff --git a/data/preview/104.png b/data/preview/104.png
new file mode 100644
index 0000000..958c4fc
Binary files /dev/null and b/data/preview/104.png differ
diff --git a/data/preview/105.png b/data/preview/105.png
new file mode 100644
index 0000000..fe0ebeb
Binary files /dev/null and b/data/preview/105.png differ
diff --git a/data/preview/106.png b/data/preview/106.png
new file mode 100644
index 0000000..bbabe58
Binary files /dev/null and b/data/preview/106.png differ
diff --git a/data/preview/107.png b/data/preview/107.png
new file mode 100644
index 0000000..d847e52
Binary files /dev/null and b/data/preview/107.png differ
diff --git a/data/preview/108.png b/data/preview/108.png
new file mode 100644
index 0000000..3930ee9
Binary files /dev/null and b/data/preview/108.png differ
diff --git a/data/preview/109.png b/data/preview/109.png
new file mode 100644
index 0000000..96ecbb2
Binary files /dev/null and b/data/preview/109.png differ
diff --git a/data/preview/110.png b/data/preview/110.png
new file mode 100644
index 0000000..208309c
Binary files /dev/null and b/data/preview/110.png differ
diff --git a/data/preview/111.png b/data/preview/111.png
new file mode 100644
index 0000000..b51f3e3
Binary files /dev/null and b/data/preview/111.png differ
diff --git a/data/preview/112.png b/data/preview/112.png
new file mode 100644
index 0000000..07dacf7
Binary files /dev/null and b/data/preview/112.png differ
diff --git a/data/preview/113.png b/data/preview/113.png
new file mode 100644
index 0000000..4bf5c32
Binary files /dev/null and b/data/preview/113.png differ
diff --git a/data/preview/114.png b/data/preview/114.png
new file mode 100644
index 0000000..fe4d5b1
Binary files /dev/null and b/data/preview/114.png differ
diff --git a/data/preview/115.png b/data/preview/115.png
new file mode 100644
index 0000000..c52031f
Binary files /dev/null and b/data/preview/115.png differ
diff --git a/data/preview/116.png b/data/preview/116.png
new file mode 100644
index 0000000..dcacb19
Binary files /dev/null and b/data/preview/116.png differ
diff --git a/data/preview/117.png b/data/preview/117.png
new file mode 100644
index 0000000..e2e56b7
Binary files /dev/null and b/data/preview/117.png differ
diff --git a/data/preview/118.png b/data/preview/118.png
new file mode 100644
index 0000000..a0b31ea
Binary files /dev/null and b/data/preview/118.png differ
diff --git a/data/preview/119.png b/data/preview/119.png
new file mode 100644
index 0000000..9eef9d9
Binary files /dev/null and b/data/preview/119.png differ
diff --git a/data/preview/120.png b/data/preview/120.png
new file mode 100644
index 0000000..b12a80b
Binary files /dev/null and b/data/preview/120.png differ
diff --git a/data/preview/121.png b/data/preview/121.png
new file mode 100644
index 0000000..8184257
Binary files /dev/null and b/data/preview/121.png differ
diff --git a/data/preview/122.png b/data/preview/122.png
new file mode 100644
index 0000000..fe6c650
Binary files /dev/null and b/data/preview/122.png differ
diff --git a/data/preview/123.png b/data/preview/123.png
new file mode 100644
index 0000000..01e2d13
Binary files /dev/null and b/data/preview/123.png differ
diff --git a/data/preview/124.png b/data/preview/124.png
new file mode 100644
index 0000000..5aeb333
Binary files /dev/null and b/data/preview/124.png differ
diff --git a/data/preview/125.png b/data/preview/125.png
new file mode 100644
index 0000000..55c7645
Binary files /dev/null and b/data/preview/125.png differ
diff --git a/data/preview/126.png b/data/preview/126.png
new file mode 100644
index 0000000..d0accea
Binary files /dev/null and b/data/preview/126.png differ
diff --git a/data/preview/127.png b/data/preview/127.png
new file mode 100644
index 0000000..a3792fe
Binary files /dev/null and b/data/preview/127.png differ
diff --git a/data/preview/128.png b/data/preview/128.png
new file mode 100644
index 0000000..bebbd53
Binary files /dev/null and b/data/preview/128.png differ
diff --git a/data/preview/129.png b/data/preview/129.png
new file mode 100644
index 0000000..206f05d
Binary files /dev/null and b/data/preview/129.png differ
diff --git a/data/preview/130.png b/data/preview/130.png
new file mode 100644
index 0000000..212f773
Binary files /dev/null and b/data/preview/130.png differ
diff --git a/data/preview/131.png b/data/preview/131.png
new file mode 100644
index 0000000..1c67954
Binary files /dev/null and b/data/preview/131.png differ
diff --git a/data/preview/132.png b/data/preview/132.png
new file mode 100644
index 0000000..3f70cea
Binary files /dev/null and b/data/preview/132.png differ
diff --git a/data/preview/133.png b/data/preview/133.png
new file mode 100644
index 0000000..d8dd328
Binary files /dev/null and b/data/preview/133.png differ
diff --git a/data/preview/134.png b/data/preview/134.png
new file mode 100644
index 0000000..a4834d7
Binary files /dev/null and b/data/preview/134.png differ
diff --git a/data/preview/135.png b/data/preview/135.png
new file mode 100644
index 0000000..ded2519
Binary files /dev/null and b/data/preview/135.png differ
diff --git a/data/preview/136.png b/data/preview/136.png
new file mode 100644
index 0000000..ab1b19d
Binary files /dev/null and b/data/preview/136.png differ
diff --git a/data/preview/137.png b/data/preview/137.png
new file mode 100644
index 0000000..c7f0848
Binary files /dev/null and b/data/preview/137.png differ
diff --git a/data/preview/138.png b/data/preview/138.png
new file mode 100644
index 0000000..92607b1
Binary files /dev/null and b/data/preview/138.png differ
diff --git a/data/preview/139.png b/data/preview/139.png
new file mode 100644
index 0000000..e899130
Binary files /dev/null and b/data/preview/139.png differ
diff --git a/data/preview/140.png b/data/preview/140.png
new file mode 100644
index 0000000..8ae13e4
Binary files /dev/null and b/data/preview/140.png differ
diff --git a/data/preview/141.png b/data/preview/141.png
new file mode 100644
index 0000000..f8fe388
Binary files /dev/null and b/data/preview/141.png differ
diff --git a/data/preview/142.png b/data/preview/142.png
new file mode 100644
index 0000000..ec5c688
Binary files /dev/null and b/data/preview/142.png differ
diff --git a/data/preview/143.png b/data/preview/143.png
new file mode 100644
index 0000000..196a1fb
Binary files /dev/null and b/data/preview/143.png differ
diff --git a/data/preview/144.png b/data/preview/144.png
new file mode 100644
index 0000000..af4d95d
Binary files /dev/null and b/data/preview/144.png differ
diff --git a/data/preview/145.png b/data/preview/145.png
new file mode 100644
index 0000000..8d16ce8
Binary files /dev/null and b/data/preview/145.png differ
diff --git a/data/preview/146.png b/data/preview/146.png
new file mode 100644
index 0000000..2012617
Binary files /dev/null and b/data/preview/146.png differ
diff --git a/data/preview/147.png b/data/preview/147.png
new file mode 100644
index 0000000..d96df88
Binary files /dev/null and b/data/preview/147.png differ
diff --git a/data/preview/148.png b/data/preview/148.png
new file mode 100644
index 0000000..0d15d06
Binary files /dev/null and b/data/preview/148.png differ
diff --git a/data/preview/149.png b/data/preview/149.png
new file mode 100644
index 0000000..e493ad2
Binary files /dev/null and b/data/preview/149.png differ
diff --git a/data/preview/150.png b/data/preview/150.png
new file mode 100644
index 0000000..9b1d89d
Binary files /dev/null and b/data/preview/150.png differ
diff --git a/data/preview/151.png b/data/preview/151.png
new file mode 100644
index 0000000..c585152
Binary files /dev/null and b/data/preview/151.png differ
diff --git a/data/preview/152.png b/data/preview/152.png
new file mode 100644
index 0000000..e12210c
Binary files /dev/null and b/data/preview/152.png differ
diff --git a/data/preview/153.png b/data/preview/153.png
new file mode 100644
index 0000000..7431ba8
Binary files /dev/null and b/data/preview/153.png differ
diff --git a/data/preview/154.png b/data/preview/154.png
new file mode 100644
index 0000000..84c40b7
Binary files /dev/null and b/data/preview/154.png differ
diff --git a/data/preview/155.png b/data/preview/155.png
new file mode 100644
index 0000000..738641e
Binary files /dev/null and b/data/preview/155.png differ
diff --git a/data/preview/156.png b/data/preview/156.png
new file mode 100644
index 0000000..142bc61
Binary files /dev/null and b/data/preview/156.png differ
diff --git a/data/preview/157.png b/data/preview/157.png
new file mode 100644
index 0000000..4baab3e
Binary files /dev/null and b/data/preview/157.png differ
diff --git a/data/preview/158.png b/data/preview/158.png
new file mode 100644
index 0000000..905513b
Binary files /dev/null and b/data/preview/158.png differ
diff --git a/data/preview/159.png b/data/preview/159.png
new file mode 100644
index 0000000..a3e1ee8
Binary files /dev/null and b/data/preview/159.png differ
diff --git a/data/preview/160.png b/data/preview/160.png
new file mode 100644
index 0000000..f3ea1bb
Binary files /dev/null and b/data/preview/160.png differ
diff --git a/data/preview/161.png b/data/preview/161.png
new file mode 100644
index 0000000..fa6358e
Binary files /dev/null and b/data/preview/161.png differ
diff --git a/data/preview/162.png b/data/preview/162.png
new file mode 100644
index 0000000..1d32e3c
Binary files /dev/null and b/data/preview/162.png differ
diff --git a/data/preview/163.png b/data/preview/163.png
new file mode 100644
index 0000000..d740d27
Binary files /dev/null and b/data/preview/163.png differ
diff --git a/data/preview/164.png b/data/preview/164.png
new file mode 100644
index 0000000..423bed3
Binary files /dev/null and b/data/preview/164.png differ
diff --git a/data/preview/165.png b/data/preview/165.png
new file mode 100644
index 0000000..22ce4ba
Binary files /dev/null and b/data/preview/165.png differ
diff --git a/data/preview/166.png b/data/preview/166.png
new file mode 100644
index 0000000..20e0156
Binary files /dev/null and b/data/preview/166.png differ
diff --git a/data/preview/167.png b/data/preview/167.png
new file mode 100644
index 0000000..7d9c626
Binary files /dev/null and b/data/preview/167.png differ
diff --git a/data/preview/168.png b/data/preview/168.png
new file mode 100644
index 0000000..d9be413
Binary files /dev/null and b/data/preview/168.png differ
diff --git a/data/preview/169.png b/data/preview/169.png
new file mode 100644
index 0000000..5859ab6
Binary files /dev/null and b/data/preview/169.png differ
diff --git a/data/preview/170.png b/data/preview/170.png
new file mode 100644
index 0000000..627aba4
Binary files /dev/null and b/data/preview/170.png differ
diff --git a/data/preview/171.png b/data/preview/171.png
new file mode 100644
index 0000000..f149f2d
Binary files /dev/null and b/data/preview/171.png differ
diff --git a/data/preview/172.png b/data/preview/172.png
new file mode 100644
index 0000000..df6e467
Binary files /dev/null and b/data/preview/172.png differ
diff --git a/data/preview/173.png b/data/preview/173.png
new file mode 100644
index 0000000..f61ba82
Binary files /dev/null and b/data/preview/173.png differ
diff --git a/data/preview/174.png b/data/preview/174.png
new file mode 100644
index 0000000..926b358
Binary files /dev/null and b/data/preview/174.png differ
diff --git a/data/preview/175.png b/data/preview/175.png
new file mode 100644
index 0000000..e337586
Binary files /dev/null and b/data/preview/175.png differ
diff --git a/data/preview/176.png b/data/preview/176.png
new file mode 100644
index 0000000..1882996
Binary files /dev/null and b/data/preview/176.png differ
diff --git a/data/preview/177.png b/data/preview/177.png
new file mode 100644
index 0000000..e1a4c9c
Binary files /dev/null and b/data/preview/177.png differ
diff --git a/data/preview/178.png b/data/preview/178.png
new file mode 100644
index 0000000..b2c6a29
Binary files /dev/null and b/data/preview/178.png differ
diff --git a/data/preview/179.png b/data/preview/179.png
new file mode 100644
index 0000000..2e3cf80
Binary files /dev/null and b/data/preview/179.png differ
diff --git a/data/preview/180.png b/data/preview/180.png
new file mode 100644
index 0000000..9fe7d14
Binary files /dev/null and b/data/preview/180.png differ
diff --git a/data/preview/181.png b/data/preview/181.png
new file mode 100644
index 0000000..e35dc9f
Binary files /dev/null and b/data/preview/181.png differ
diff --git a/data/preview/182.png b/data/preview/182.png
new file mode 100644
index 0000000..9860494
Binary files /dev/null and b/data/preview/182.png differ
diff --git a/data/preview/183.png b/data/preview/183.png
new file mode 100644
index 0000000..ab7a853
Binary files /dev/null and b/data/preview/183.png differ
diff --git a/data/preview/184.png b/data/preview/184.png
new file mode 100644
index 0000000..6349c84
Binary files /dev/null and b/data/preview/184.png differ
diff --git a/data/preview/185.png b/data/preview/185.png
new file mode 100644
index 0000000..77749c1
Binary files /dev/null and b/data/preview/185.png differ
diff --git a/data/preview/186.png b/data/preview/186.png
new file mode 100644
index 0000000..2b2d8d6
Binary files /dev/null and b/data/preview/186.png differ
diff --git a/data/preview/187.png b/data/preview/187.png
new file mode 100644
index 0000000..2da54c7
Binary files /dev/null and b/data/preview/187.png differ
diff --git a/data/preview/188.png b/data/preview/188.png
new file mode 100644
index 0000000..0314e52
Binary files /dev/null and b/data/preview/188.png differ
diff --git a/data/preview/189.png b/data/preview/189.png
new file mode 100644
index 0000000..e8df785
Binary files /dev/null and b/data/preview/189.png differ
diff --git a/data/preview/190.png b/data/preview/190.png
new file mode 100644
index 0000000..ef2d38a
Binary files /dev/null and b/data/preview/190.png differ
diff --git a/data/preview/191.png b/data/preview/191.png
new file mode 100644
index 0000000..bd583ed
Binary files /dev/null and b/data/preview/191.png differ
diff --git a/data/preview/192.png b/data/preview/192.png
new file mode 100644
index 0000000..29ab1d2
Binary files /dev/null and b/data/preview/192.png differ
diff --git a/data/preview/193.png b/data/preview/193.png
new file mode 100644
index 0000000..cd0c24f
Binary files /dev/null and b/data/preview/193.png differ
diff --git a/data/preview/194.png b/data/preview/194.png
new file mode 100644
index 0000000..528d22e
Binary files /dev/null and b/data/preview/194.png differ
diff --git a/data/preview/195.png b/data/preview/195.png
new file mode 100644
index 0000000..6eafbd9
Binary files /dev/null and b/data/preview/195.png differ
diff --git a/data/preview/196.png b/data/preview/196.png
new file mode 100644
index 0000000..c89d46b
Binary files /dev/null and b/data/preview/196.png differ
diff --git a/data/preview/197.png b/data/preview/197.png
new file mode 100644
index 0000000..bf7714e
Binary files /dev/null and b/data/preview/197.png differ
diff --git a/data/preview/198.png b/data/preview/198.png
new file mode 100644
index 0000000..9014c3a
Binary files /dev/null and b/data/preview/198.png differ
diff --git a/data/preview/199.png b/data/preview/199.png
new file mode 100644
index 0000000..ce00aa1
Binary files /dev/null and b/data/preview/199.png differ
diff --git a/data/preview/200.png b/data/preview/200.png
new file mode 100644
index 0000000..22eeaae
Binary files /dev/null and b/data/preview/200.png differ
diff --git a/data/preview/201.png b/data/preview/201.png
new file mode 100644
index 0000000..92a7dfc
Binary files /dev/null and b/data/preview/201.png differ
diff --git a/data/preview/202.png b/data/preview/202.png
new file mode 100644
index 0000000..2e03109
Binary files /dev/null and b/data/preview/202.png differ
diff --git a/data/preview/203.png b/data/preview/203.png
new file mode 100644
index 0000000..194d21c
Binary files /dev/null and b/data/preview/203.png differ
diff --git a/data/preview/204.png b/data/preview/204.png
new file mode 100644
index 0000000..6263d95
Binary files /dev/null and b/data/preview/204.png differ
diff --git a/data/preview/205.png b/data/preview/205.png
new file mode 100644
index 0000000..1495e4f
Binary files /dev/null and b/data/preview/205.png differ
diff --git a/data/preview/206.png b/data/preview/206.png
new file mode 100644
index 0000000..3984b97
Binary files /dev/null and b/data/preview/206.png differ
diff --git a/data/render_preview.js b/data/render_preview.js
new file mode 100644
index 0000000..0d73b70
--- /dev/null
+++ b/data/render_preview.js
@@ -0,0 +1,81 @@
+/* 从 fabric 模板 JSON 渲染预览图(在 cover-studio 镜像里跑,复用 satori + resvg + 中文字体)
+ * 用法:docker run --rm -v :/data -e NODE_PATH=/app/node_modules -w /app cover-studio:1.0 node /data/render_preview.js
+ * 好处:预览和模板同源,避免"缩略图与载入后不一致"。
+ */
+const fs = require('fs');
+const path = require('path');
+const _satori = require('satori');
+const satori = _satori.default || _satori;
+const _resvg = require('@resvg/resvg-js');
+const Resvg = _resvg.Resvg || _resvg.default.Resvg;
+
+const DATA = process.env.DATA || '/data';
+const FONT_DIR = process.env.FONT_DIR || '/app/fonts';
+const FONTS = [
+ { name: 'Noto Sans SC', data: fs.readFileSync(path.join(FONT_DIR, 'NotoSansSC-Regular.otf')), weight: 400, style: 'normal' },
+ { name: 'Noto Sans SC', data: fs.readFileSync(path.join(FONT_DIR, 'NotoSansSC-Bold.otf')), weight: 700, style: 'normal' },
+];
+const FAMILY = 'Noto Sans SC';
+
+const isTransparent = (c) => !c || c === 'transparent' || /rgba\([^)]*,\s*0\s*\)/.test(c);
+
+function rectNode(o) {
+ const s = {
+ position: 'absolute', left: `${o.left}px`, top: `${o.top}px`,
+ width: `${o.width}px`, height: `${o.height}px`,
+ background: isTransparent(o.fill) ? 'transparent' : o.fill,
+ opacity: o.opacity === undefined ? 1 : o.opacity,
+ display: 'flex',
+ };
+ if (o.rx) s.borderRadius = `${o.rx}px`;
+ if (o.angle) { s.transform = `rotate(${o.angle}deg)`; s.transformOrigin = 'top left'; }
+ if (o.stroke && !isTransparent(o.stroke)) {
+ const w = Math.max(1, Math.round(o.strokeWidth || 1));
+ s.border = o.strokeDashArray ? `${w}px dashed ${o.stroke}` : `${w}px solid ${o.stroke}`;
+ }
+ return { type: 'div', props: { style: s } };
+}
+
+function textNode(o) {
+ const outline = isTransparent(o.fill) && o.stroke && !isTransparent(o.stroke);
+ const s = {
+ position: 'absolute', left: `${o.left}px`, top: `${o.top}px`, width: `${o.width}px`,
+ fontFamily: FAMILY, fontSize: `${o.fontSize}px`,
+ fontWeight: o.fontWeight === 'bold' ? 700 : 400,
+ color: outline ? o.stroke : o.fill,
+ textAlign: o.textAlign || 'left',
+ lineHeight: o.lineHeight || 1.3,
+ letterSpacing: o.charSpacing ? `${o.charSpacing}px` : 0,
+ whiteSpace: 'pre-wrap', opacity: o.opacity === undefined ? 1 : o.opacity,
+ display: 'flex',
+ };
+ return { type: 'div', props: { style: s, children: String(o.text).replace(/\n/g, ' ') } };
+}
+
+async function renderOne(m) {
+ const doc = JSON.parse(fs.readFileSync(path.join(DATA, 'tmpl', `${m.id}.json`), 'utf8'));
+ const nodes = doc.objects.filter(o => o.id !== 'workspace')
+ .map(o => (o.type === 'rect' ? rectNode(o) : textNode(o)));
+ const root = {
+ type: 'div',
+ props: {
+ style: { width: `${m.w}px`, height: `${m.h}px`, display: 'flex', position: 'relative', background: '#ffffff', overflow: 'hidden' },
+ children: nodes,
+ },
+ };
+ const svg = await satori(root, { width: m.w, height: m.h, fonts: FONTS });
+ const png = new Resvg(svg, { fitTo: { mode: 'width', value: Math.min(m.w, 1100) } }).render().asPng();
+ fs.writeFileSync(path.join(DATA, 'preview', `${m.id}.png`), png);
+ return png.length;
+}
+
+(async () => {
+ const index = JSON.parse(fs.readFileSync(path.join(DATA, 'index.json'), 'utf8'));
+ let ok = 0, fail = [];
+ for (const m of index) {
+ try { await renderOne(m); ok++; }
+ catch (e) { fail.push(`${m.id}:${e.message}`); }
+ }
+ console.log(`预览图完成 ${ok}/${index.length}`);
+ if (fail.length) console.log('失败:', fail.join(' | '));
+})();
diff --git a/data/tmpl/101.json b/data/tmpl/101.json
new file mode 100644
index 0000000..00adaf0
--- /dev/null
+++ b/data/tmpl/101.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#ecfdf5", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#bbf7d0", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 7, "height": 383, "fill": "#059669", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 808, "top": -38, "width": 161, "height": 161, "fill": "#059669", "opacity": 0.12, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 80, "ry": 80}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 34, "top": 34, "width": 106, "height": 35, "fill": "#059669", "opacity": 0.22, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 17, "ry": 17}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 49, "top": 41, "width": 106, "text": "本期推荐", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#059669", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 34, "top": 86, "width": 820, "text": "5 个免费神器,让电脑效率翻倍", "fontSize": 42, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#064e3b", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 34, "top": 149, "width": 797, "text": "全部开源 · 无广告 · 一键安装", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#0f766e", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 34, "top": 332, "width": 27, "height": 4, "fill": "#059669", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 2, "ry": 2}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 70, "top": 326, "width": 230, "text": "@软件小妹", "fontSize": 17, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#0f766e", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/102.json b/data/tmpl/102.json
new file mode 100644
index 0000000..d141cf9
--- /dev/null
+++ b/data/tmpl/102.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#042f2e", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 306, "height": 383, "fill": "#22d3ee", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 306, "height": 383, "fill": "#0d9488", "opacity": 0.35, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 306, "top": 0, "width": 594, "height": 383, "fill": "#0d9488", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 14, "top": 103, "width": 278, "text": "0元", "fontSize": 123, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.0, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 14, "top": 243, "width": 278, "text": "省钱攻略", "fontSize": 17, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 338, "top": 84, "width": 539, "text": "再也不用花钱买会员了", "fontSize": 42, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 338, "top": 149, "width": 539, "text": "这 3 个开源工具直接替代", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#99f6e4", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 338, "top": 341, "width": 539, "text": "@软件小妹", "fontSize": 16, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#99f6e4", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/103.json b/data/tmpl/103.json
new file mode 100644
index 0000000..e1b564a
--- /dev/null
+++ b/data/tmpl/103.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#fffbeb", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#fef3c7", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 31, "width": 107, "height": 38, "fill": "#d97706", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 42, "top": 39, "width": 107, "text": "冷门神器", "fontSize": 19, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 88, "width": 850, "text": "99% 的人都没用过这个软件", "fontSize": 57, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#78350f", "textAlign": "left", "lineHeight": 1.14, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 283, "width": 164, "height": 69, "fill": "#d97706", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 298, "width": 164, "text": "装完就不想卸载", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 378, "width": 900, "height": 5, "fill": "#d97706", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 716, "top": 31, "width": 153, "text": "@软件小妹", "fontSize": 16, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#b45309", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/104.json b/data/tmpl/104.json
new file mode 100644
index 0000000..84a7928
--- /dev/null
+++ b/data/tmpl/104.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#312e81", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#0ea5e9", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 61, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 14, "width": 838, "text": "办公效率", "fontSize": 23, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 101, "width": 844, "text": "批量重命名 1000 个文件只要 3 秒", "fontSize": 42, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.26, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 172, "width": 838, "text": "Windows 自带工具就够了", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#e0f2fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 324, "width": 838, "height": 2, "fill": "#fde047", "opacity": 0.6, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 340, "width": 838, "text": "@软件小妹", "fontSize": 17, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#e0f2fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/105.json b/data/tmpl/105.json
new file mode 100644
index 0000000..412afac
--- /dev/null
+++ b/data/tmpl/105.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#4c1d95", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#7c3aed", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 793, "top": 0, "width": 107, "height": 383, "fill": "#f472b6", "opacity": 0.92, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 777, "top": 322, "width": 84, "height": 84, "fill": "#ffffff", "opacity": 0.14, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 42, "ry": 42}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 34, "top": 34, "width": 747, "text": "真实体验", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#f472b6", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 34, "top": 65, "width": 747, "text": "用了三年开源软件,我卸载了所有付费版", "fontSize": 42, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 34, "top": 299, "width": 747, "text": "省下的钱够买台新电脑", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ddd6fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 800, "top": 329, "width": 92, "text": "@软件小妹", "fontSize": 16, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/106.json b/data/tmpl/106.json
new file mode 100644
index 0000000..5c20d60
--- /dev/null
+++ b/data/tmpl/106.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#fef08a", "opacity": 0.42, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 31, "width": 242, "height": 242, "fill": "#111827", "opacity": 0.9, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 11, "ry": 11}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 60, "top": 21, "width": 225, "text": "5", "fontSize": 161, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 295, "top": 70, "width": 574, "text": "5 个免费神器,让电脑效率翻倍", "fontSize": 42, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 295, "top": 298, "width": 574, "text": "全部开源 · 无广告 · 一键安装", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#78350f", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 333, "width": 838, "text": "本期推荐", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 333, "width": 838, "text": "@软件小妹", "fontSize": 17, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#78350f", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/107.json b/data/tmpl/107.json
new file mode 100644
index 0000000..1c71bee
--- /dev/null
+++ b/data/tmpl/107.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#0f172a", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#1e293b", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 27, "top": 27, "width": 846, "height": 176, "fill": "#ffffff", "opacity": 0.95, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 8, "ry": 8}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 27, "top": 27, "width": 846, "height": 176, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#38bdf8", "rx": 8, "ry": 8, "strokeWidth": 3, "strokeDashArray": [9.192, 6.128]}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 42, "top": 100, "width": 815, "text": "把软件真实界面截图拖到这里", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#94a3b8", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 27, "top": 227, "width": 851, "text": "再也不用花钱买会员了", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 27, "top": 273, "width": 846, "text": "这 3 个开源工具直接替代", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#94a3b8", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 27, "top": 324, "width": 102, "height": 32, "fill": "#38bdf8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 16, "ry": 16}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 40, "top": 333, "width": 102, "text": "省钱攻略", "fontSize": 17, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 27, "top": 337, "width": 846, "text": "@软件小妹", "fontSize": 17, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#94a3b8", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/108.json b/data/tmpl/108.json
new file mode 100644
index 0000000..c19dc90
--- /dev/null
+++ b/data/tmpl/108.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#374151", "opacity": 0.55, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 27, "top": 27, "width": 847, "height": 330, "fill": null, "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#f59e0b", "strokeWidth": 2}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 397, "top": 77, "width": 106, "height": 33, "fill": "#f59e0b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 17, "ry": 17}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 397, "top": 83, "width": 106, "text": "冷门神器", "fontSize": 17, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 38, "top": 132, "width": 824, "text": "99% 的人都没用过这个软件", "fontSize": 42, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 427, "top": 206, "width": 46, "height": 3, "fill": "#f59e0b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 2, "ry": 2}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 38, "top": 229, "width": 824, "text": "装完就不想卸载", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#cbd5e1", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 38, "top": 349, "width": 824, "text": "@软件小妹", "fontSize": 16, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#cbd5e1", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/109.json b/data/tmpl/109.json
new file mode 100644
index 0000000..b188c21
--- /dev/null
+++ b/data/tmpl/109.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#fdf2f8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#fbcfe8", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 27, "top": 100, "width": 851, "text": "批量重命名 1000 个文件只要 3 秒", "fontSize": 46, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "rgba(0,0,0,0)", "textAlign": "left", "lineHeight": 1.2, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#831843", "strokeWidth": 3, "paintFirst": "stroke"}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 27, "top": 77, "width": 846, "text": "办公效率", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#831843", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 27, "top": 237, "width": 846, "text": "Windows 自带工具就够了", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#be185d", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 27, "top": 342, "width": 846, "text": "@软件小妹", "fontSize": 16, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#831843", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/110.json b/data/tmpl/110.json
new file mode 100644
index 0000000..96924bb
--- /dev/null
+++ b/data/tmpl/110.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 20, "top": 20, "width": 859, "height": 342, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#111827", "strokeWidth": 2}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 34, "top": 41, "width": 34, "height": 5, "fill": "#a78bfa", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 34, "top": 71, "width": 832, "text": "真实体验", "fontSize": 17, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#a78bfa", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 2.298, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 34, "top": 104, "width": 835, "text": "用了三年开源软件,我卸载了所有付费版", "fontSize": 42, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 34, "top": 295, "width": 832, "text": "省下的钱够买台新电脑", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#6b7280", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 34, "top": 332, "width": 832, "text": "@软件小妹", "fontSize": 16, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/111.json b/data/tmpl/111.json
new file mode 100644
index 0000000..a79ed57
--- /dev/null
+++ b/data/tmpl/111.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#f8fafc", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 468, "top": 0, "width": 432, "height": 383, "fill": "#0ea5e9", "opacity": 0.92, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 468, "height": 383, "fill": "#e2e8f0", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 77, "width": 406, "text": "5 个免费神器,让电脑效率翻倍", "fontSize": 42, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#0f172a", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 42, "width": 406, "text": "本期推荐", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#0ea5e9", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 499, "top": 115, "width": 370, "text": "全部开源 · 无广告 · 一键安装", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.5, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 499, "top": 340, "width": 370, "text": "@软件小妹", "fontSize": 16, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/112.json b/data/tmpl/112.json
new file mode 100644
index 0000000..8d5d551
--- /dev/null
+++ b/data/tmpl/112.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#7c2d12", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#ea580c", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 38, "top": -23, "width": 115, "text": "“", "fontSize": 100, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fde047", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 38, "top": 100, "width": 824, "text": "再也不用花钱买会员了", "fontSize": 42, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.42, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 38, "top": 237, "width": 824, "text": "这 3 个开源工具直接替代", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffedd5", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 427, "top": 292, "width": 46, "height": 3, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 2, "ry": 2}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 38, "top": 322, "width": 824, "text": "@软件小妹", "fontSize": 16, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffedd5", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/113.json b/data/tmpl/113.json
new file mode 100644
index 0000000..02078b1
--- /dev/null
+++ b/data/tmpl/113.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#7f1d1d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#b91c1c", "opacity": 0.42, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 27, "top": 70, "width": 410, "height": 248, "fill": "#ffffff", "opacity": 0.92, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 8, "ry": 8}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 464, "top": 70, "width": 410, "height": 248, "fill": "#fcd34d", "opacity": 0.92, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 8, "ry": 8}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 27, "top": 24, "width": 846, "text": "99% 的人都没用过这个软件", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 42, "top": 97, "width": 379, "text": "付费软件", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 479, "top": 97, "width": 379, "text": "开源替代", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 42, "top": 130, "width": 379, "text": "× 体积极小", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#1f2937", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 42, "top": 167, "width": 379, "text": "× 要付费", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#1f2937", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 42, "top": 204, "width": 379, "text": "× 有广告", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#1f2937", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 42, "top": 241, "width": 379, "text": "× 强制登录", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#1f2937", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 479, "top": 130, "width": 379, "text": "✓ 完全免费", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 479, "top": 167, "width": 379, "text": "✓ 无广告", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 479, "top": 204, "width": 379, "text": "✓ 免登录", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 479, "top": 241, "width": 379, "text": "✓ 永久可用", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/114.json b/data/tmpl/114.json
new file mode 100644
index 0000000..60209d2
--- /dev/null
+++ b/data/tmpl/114.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#064e3b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": -38, "top": -46, "width": 34, "height": 475, "fill": "#facc15", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 18, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 46, "top": -46, "width": 34, "height": 475, "fill": "#facc15", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 18, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 130, "top": -46, "width": 34, "height": 475, "fill": "#facc15", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 18, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 214, "top": -46, "width": 34, "height": 475, "fill": "#facc15", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 18, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 299, "top": -46, "width": 34, "height": 475, "fill": "#facc15", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 18, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 383, "top": -46, "width": 34, "height": 475, "fill": "#facc15", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 18, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 900, "height": 383, "fill": "#047857", "opacity": 0.28, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 43, "width": 110, "height": 37, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 46, "top": 51, "width": 110, "text": "办公效率", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 104, "width": 844, "text": "批量重命名 1000 个文件只要 3 秒", "fontSize": 42, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 309, "width": 838, "text": "Windows 自带工具就够了", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#a7f3d0", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 31, "top": 340, "width": 838, "text": "@软件小妹", "fontSize": 16, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#a7f3d0", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/115.json b/data/tmpl/115.json
new file mode 100644
index 0000000..9af84de
--- /dev/null
+++ b/data/tmpl/115.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#ea580c", "opacity": 0.35, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 605, "fill": "#7c2d12", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 605, "fill": "#ea580c", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 864, "top": 475, "width": 281, "height": 281, "fill": "#fde047", "opacity": 0.22, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 140, "ry": 140}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 106, "width": 297, "height": 98, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 113, "top": 126, "width": 297, "text": "手机必备", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 264, "width": 943, "text": "亲测有效!这5个APP太顶了", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 681, "width": 928, "text": "学生党/上班族都能用", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#7c2d12", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 799, "width": 26, "height": 26, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 13, "ry": 13}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 126, "top": 790, "width": 898, "text": "免费无广告", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#7c2d12", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 915, "width": 26, "height": 26, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 13, "ry": 13}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 126, "top": 907, "width": 898, "text": "界面超干净", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#7c2d12", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1032, "width": 26, "height": 26, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 13, "ry": 13}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 126, "top": 1023, "width": 898, "text": "手机电脑都能装", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#7c2d12", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1303, "width": 852, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#7c2d12", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/116.json b/data/tmpl/116.json
new file mode 100644
index 0000000..b4f6a28
--- /dev/null
+++ b/data/tmpl/116.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#7f1d1d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#b91c1c", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 13, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 103, "width": 316, "height": 106, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 53, "ry": 53}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 129, "top": 125, "width": 316, "text": "效率工具", "fontSize": 52, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 285, "width": 925, "text": "上班摸鱼神器被我找到了", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.28, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 438, "width": 130, "height": 12, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 6, "ry": 6}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 503, "width": 874, "text": "老板站身后都发现不了", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#fecaca", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 610, "width": 39, "height": 39, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 19, "ry": 19}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 155, "top": 598, "width": 874, "text": "一键隐藏", "fontSize": 28, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 738, "width": 39, "height": 39, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 19, "ry": 19}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 155, "top": 725, "width": 874, "text": "占用极低", "fontSize": 28, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 865, "width": 39, "height": 39, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 19, "ry": 19}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 155, "top": 852, "width": 874, "text": "免安装", "fontSize": 28, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1285, "width": 58, "height": 58, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 29, "ry": 29}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 172, "top": 1302, "width": 822, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fecaca", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/117.json b/data/tmpl/117.json
new file mode 100644
index 0000000..7a00d2b
--- /dev/null
+++ b/data/tmpl/117.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#064e3b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#047857", "opacity": 0.42, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 86, "width": 486, "height": 486, "fill": "#facc15", "opacity": 0.9, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 32, "ry": 32}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 144, "top": 67, "width": 454, "text": "6", "fontSize": 324, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 637, "top": 164, "width": 357, "text": "花 0 元换掉 6 个付费软件", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 637, "top": 624, "width": 357, "text": "真香警告", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#a7f3d0", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1302, "width": 908, "text": "省钱日记", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#facc15", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1302, "width": 908, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#a7f3d0", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/118.json b/data/tmpl/118.json
new file mode 100644
index 0000000..d48947b
--- /dev/null
+++ b/data/tmpl/118.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#1e3a8a", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#3b82f6", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 86, "width": 908, "text": "学生党", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fbbf24", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 179, "width": 917, "text": "写论文必装的3个免费工具", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 337, "width": 97, "height": 97, "fill": "#fbbf24", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 350, "width": 97, "text": "1", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 216, "top": 352, "width": 778, "text": "自动排版", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 450, "width": 908, "height": 4, "fill": "#c7d7f5", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 676, "width": 97, "height": 97, "fill": "#fbbf24", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 689, "width": 97, "text": "2", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 216, "top": 691, "width": 778, "text": "查重友好", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 789, "width": 908, "height": 4, "fill": "#c7d7f5", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1015, "width": 97, "height": 97, "fill": "#fbbf24", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1028, "width": 97, "text": "3", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 216, "top": 1030, "width": 778, "text": "免费导出", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1128, "width": 908, "height": 4, "fill": "#c7d7f5", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/119.json b/data/tmpl/119.json
new file mode 100644
index 0000000..a142f59
--- /dev/null
+++ b/data/tmpl/119.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#f3f4f6", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 928, "height": 749, "fill": "#ffffff", "opacity": 0.95, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 928, "height": 749, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#ef4444", "rx": 22, "ry": 22, "strokeWidth": 6, "strokeDashArray": [25.92, 17.28]}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 119, "top": 407, "width": 842, "text": "把软件真实界面截图拖到这里", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#94a3b8", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 893, "width": 943, "text": "亲测有效!这5个APP太顶了", "fontSize": 55, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 968, "width": 928, "text": "学生党/上班族都能用", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#6b7280", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1273, "width": 289, "height": 91, "fill": "#ef4444", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 46, "ry": 46}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 113, "top": 1299, "width": 289, "text": "手机必备", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1310, "width": 928, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#6b7280", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/120.json b/data/tmpl/120.json
new file mode 100644
index 0000000..383fd83
--- /dev/null
+++ b/data/tmpl/120.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#eff6ff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#bfdbfe", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 936, "text": "上班摸鱼神器被我找到了", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#1e3a8a", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 223, "width": 448, "height": 554, "fill": "#ffffff", "opacity": 0.94, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 223, "width": 448, "height": 13, "fill": "#1d4ed8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 457, "width": 383, "text": "一键隐藏", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 556, "top": 223, "width": 448, "height": 554, "fill": "#ffffff", "opacity": 0.94, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 556, "top": 223, "width": 448, "height": 13, "fill": "#1d4ed8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 589, "top": 457, "width": 383, "text": "占用极低", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 810, "width": 448, "height": 554, "fill": "#ffffff", "opacity": 0.94, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 810, "width": 448, "height": 13, "fill": "#1d4ed8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 1044, "width": 383, "text": "免安装", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 556, "top": 810, "width": 448, "height": 554, "fill": "#ffffff", "opacity": 0.94, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 556, "top": 810, "width": 448, "height": 13, "fill": "#1d4ed8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 589, "top": 1044, "width": 383, "text": "免费", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/121.json b/data/tmpl/121.json
new file mode 100644
index 0000000..a37b40f
--- /dev/null
+++ b/data/tmpl/121.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#831843", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#be185d", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": -65, "width": 324, "text": "“", "fontSize": 281, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fde047", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 374, "width": 864, "text": "花 0 元换掉 6 个付费软件", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.42, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 893, "width": 864, "text": "真香警告", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#fbcfe8", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 475, "top": 1181, "width": 130, "height": 9, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 4, "ry": 4}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 1267, "width": 864, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#fbcfe8", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/122.json b/data/tmpl/122.json
new file mode 100644
index 0000000..5b8085f
--- /dev/null
+++ b/data/tmpl/122.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#ecfdf5", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#bbf7d0", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 19, "height": 1440, "fill": "#059669", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 821, "top": -108, "width": 454, "height": 454, "fill": "#059669", "opacity": 0.12, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 227, "ry": 227}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 97, "width": 247, "height": 98, "fill": "#059669", "opacity": 0.22, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 140, "top": 116, "width": 247, "text": "学生党", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#059669", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 244, "width": 853, "text": "写论文必装的3个免费工具", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#064e3b", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 361, "width": 789, "text": "导师都问我在哪找的", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#0f766e", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 1295, "width": 76, "height": 12, "fill": "#059669", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 6, "ry": 6}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 200, "top": 1278, "width": 648, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#0f766e", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/123.json b/data/tmpl/123.json
new file mode 100644
index 0000000..82e8a2f
--- /dev/null
+++ b/data/tmpl/123.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#042f2e", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 662, "fill": "#0d9488", "opacity": 0.7, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 662, "width": 1080, "height": 778, "fill": "#22d3ee", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 649, "width": 1080, "height": 13, "fill": "#22d3ee", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 138, "width": 908, "text": "亲测有效!这5个APP太顶了", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.25, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 748, "width": 908, "text": "手机必备", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#22d3ee", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 845, "width": 908, "text": "学生党/上班族都能用", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#99f6e4", "textAlign": "left", "lineHeight": 1.5, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 941, "width": 908, "text": "● 免费无广告", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1047, "width": 908, "text": "● 界面超干净", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/124.json b/data/tmpl/124.json
new file mode 100644
index 0000000..f11815e
--- /dev/null
+++ b/data/tmpl/124.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#fffbeb", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#fef3c7", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 842, "top": 1202, "width": 324, "height": 324, "fill": "#d97706", "opacity": 0.18, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 162, "ry": 162}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 317, "width": 324, "height": 108, "fill": "#d97706", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 129, "top": 338, "width": 324, "text": "效率工具", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 490, "width": 908, "text": "1", "fontSize": 324, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#78350f", "textAlign": "left", "lineHeight": 1.0, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 862, "width": 917, "text": "上班摸鱼神器被我找到了", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#d97706", "textAlign": "left", "lineHeight": 1.26, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 932, "width": 908, "text": "老板站身后都发现不了", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#b45309", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1320, "width": 908, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#b45309", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/125.json b/data/tmpl/125.json
new file mode 100644
index 0000000..c8ca0e4
--- /dev/null
+++ b/data/tmpl/125.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#312e81", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#0ea5e9", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 374, "width": 943, "text": "花 0 元换掉 6 个付费软件", "fontSize": 76, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "rgba(0,0,0,0)", "textAlign": "left", "lineHeight": 1.2, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#fde047", "strokeWidth": 10, "paintFirst": "stroke"}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 288, "width": 928, "text": "省钱日记", "fontSize": 52, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 893, "width": 928, "text": "真香警告", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#e0f2fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1326, "width": 928, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/126.json b/data/tmpl/126.json
new file mode 100644
index 0000000..cc96ccc
--- /dev/null
+++ b/data/tmpl/126.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#4c1d95", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#7c3aed", "opacity": 0.55, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 929, "height": 1289, "fill": null, "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#f472b6", "strokeWidth": 5}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 414, "top": 288, "width": 252, "height": 93, "fill": "#f472b6", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 47, "ry": 47}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 414, "top": 306, "width": 252, "text": "学生党", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 444, "width": 864, "text": "写论文必装的3个免费工具", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 475, "top": 588, "width": 130, "height": 10, "fill": "#f472b6", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 5, "ry": 5}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 652, "width": 864, "text": "导师都问我在哪找的", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ddd6fe", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 1343, "width": 864, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ddd6fe", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/127.json b/data/tmpl/127.json
new file mode 100644
index 0000000..0dc7235
--- /dev/null
+++ b/data/tmpl/127.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": -108, "top": -130, "width": 97, "height": 1699, "fill": "#111827", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 18, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 130, "top": -130, "width": 97, "height": 1699, "fill": "#111827", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 18, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 367, "top": -130, "width": 97, "height": 1699, "fill": "#111827", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 18, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 605, "top": -130, "width": 97, "height": 1699, "fill": "#111827", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 18, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 842, "top": -130, "width": 97, "height": 1699, "fill": "#111827", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 18, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 1080, "top": -130, "width": 97, "height": 1699, "fill": "#111827", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 18, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#fef08a", "opacity": 0.28, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 120, "width": 316, "height": 106, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 129, "top": 142, "width": 316, "text": "手机必备", "fontSize": 52, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 291, "width": 925, "text": "亲测有效!这5个APP太顶了", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1234, "width": 908, "text": "学生党/上班族都能用", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#78350f", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1320, "width": 908, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#78350f", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/128.json b/data/tmpl/128.json
new file mode 100644
index 0000000..cdbf042
--- /dev/null
+++ b/data/tmpl/128.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#0f172a", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1440, "fill": "#1e293b", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 173, "fill": "#38bdf8", "opacity": 0.9, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 475, "top": 108, "width": 130, "height": 130, "fill": "#ffffff", "opacity": 0.95, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 65, "ry": 65}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 475, "top": 129, "width": 130, "text": "荐", "fontSize": 72, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 518, "width": 908, "text": "上班摸鱼神器被我找到了", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 950, "width": 908, "text": "老板站身后都发现不了", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#94a3b8", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1320, "width": 908, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#94a3b8", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/129.json b/data/tmpl/129.json
new file mode 100644
index 0000000..0047f57
--- /dev/null
+++ b/data/tmpl/129.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#4c1d95", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#7c3aed", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 68, "top": -40, "width": 202, "text": "“", "fontSize": 176, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#f472b6", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 68, "top": 176, "width": 1064, "text": "真正好用的工具,从来不需要付费墙", "fontSize": 68, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.42, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 68, "top": 418, "width": 1064, "text": "—— 一个用了三年开源软件的人", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ddd6fe", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 560, "top": 512, "width": 81, "height": 5, "fill": "#f472b6", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 3, "ry": 3}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 68, "top": 566, "width": 1064, "text": "@软件小妹", "fontSize": 28, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ddd6fe", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/130.json b/data/tmpl/130.json
new file mode 100644
index 0000000..3d32ad1
--- /dev/null
+++ b/data/tmpl/130.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#fef08a", "opacity": 0.55, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 48, "top": 48, "width": 1105, "height": 580, "fill": null, "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#111827", "strokeWidth": 3}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 506, "top": 135, "width": 188, "height": 58, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 29, "ry": 29}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 506, "top": 146, "width": 188, "text": "理性讨论", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 68, "top": 232, "width": 1064, "text": "为什么我劝你先别买会员", "fontSize": 68, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 560, "top": 355, "width": 81, "height": 6, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 3, "ry": 3}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 68, "top": 395, "width": 1064, "text": "这些免费方案已经够用", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#78350f", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 68, "top": 614, "width": 1064, "text": "@软件小妹", "fontSize": 28, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#78350f", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/131.json b/data/tmpl/131.json
new file mode 100644
index 0000000..d6489d4
--- /dev/null
+++ b/data/tmpl/131.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#0f172a", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#1e293b", "opacity": 0.42, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 47, "top": 122, "width": 530, "height": 440, "fill": "#ffffff", "opacity": 0.92, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 14, "ry": 14}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 624, "top": 122, "width": 530, "height": 440, "fill": "#38bdf8", "opacity": 0.92, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 14, "ry": 14}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 47, "top": 42, "width": 1106, "text": "开源软件到底靠什么活着", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 74, "top": 169, "width": 476, "text": "付费软件", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 650, "top": 169, "width": 476, "text": "开源替代", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 74, "top": 226, "width": 476, "text": "× 社区维护", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#1f2937", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 74, "top": 289, "width": 476, "text": "× 企业赞助", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#1f2937", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 74, "top": 353, "width": 476, "text": "× 要付费", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#1f2937", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 74, "top": 417, "width": 476, "text": "× 有广告", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#1f2937", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 650, "top": 226, "width": 476, "text": "✓ 完全免费", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 650, "top": 289, "width": 476, "text": "✓ 无广告", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 650, "top": 353, "width": 476, "text": "✓ 免登录", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 650, "top": 417, "width": 476, "text": "✓ 永久可用", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/132.json b/data/tmpl/132.json
new file mode 100644
index 0000000..cb6130a
--- /dev/null
+++ b/data/tmpl/132.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#374151", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 12, "height": 675, "fill": "#f59e0b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 1038, "top": -68, "width": 284, "height": 284, "fill": "#f59e0b", "opacity": 0.12, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 142, "ry": 142}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 61, "top": 61, "width": 123, "height": 61, "fill": "#f59e0b", "opacity": 0.22, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 30, "ry": 30}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 88, "top": 73, "width": 123, "text": "知乎", "fontSize": 31, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#f59e0b", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 61, "top": 153, "width": 1058, "text": "真正好用的工具,从来不需要付费墙", "fontSize": 68, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 61, "top": 339, "width": 1018, "text": "—— 一个用了三年开源软件的人", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#cbd5e1", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 61, "top": 584, "width": 47, "height": 7, "fill": "#f59e0b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 4, "ry": 4}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 125, "top": 574, "width": 405, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#cbd5e1", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/133.json b/data/tmpl/133.json
new file mode 100644
index 0000000..e692137
--- /dev/null
+++ b/data/tmpl/133.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#fdf2f8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#fbcfe8", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 1011, "top": 0, "width": 189, "height": 675, "fill": "#db2777", "opacity": 0.92, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 984, "top": 567, "width": 148, "height": 148, "fill": "#831843", "opacity": 0.14, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 74, "ry": 74}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 61, "top": 61, "width": 930, "text": "理性讨论", "fontSize": 31, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#db2777", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 61, "top": 115, "width": 930, "text": "为什么我劝你先别买会员", "fontSize": 68, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#831843", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 61, "top": 526, "width": 930, "text": "这些免费方案已经够用", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#be185d", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 1024, "top": 580, "width": 162, "text": "@软件小妹", "fontSize": 28, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/134.json b/data/tmpl/134.json
new file mode 100644
index 0000000..014dc4c
--- /dev/null
+++ b/data/tmpl/134.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#1e1b4b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#312e81", "opacity": 0.42, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 54, "top": 54, "width": 426, "height": 426, "fill": "#a78bfa", "opacity": 0.9, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 20, "ry": 20}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 105, "top": 37, "width": 398, "text": "5", "fontSize": 284, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 520, "top": 122, "width": 626, "text": "开源软件到底靠什么活着", "fontSize": 68, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 520, "top": 525, "width": 626, "text": "看完你不会再说「免费的能好到哪去」", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#c7d2fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 54, "top": 589, "width": 1092, "text": "技术向", "fontSize": 31, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#a78bfa", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 54, "top": 589, "width": 1092, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#c7d2fe", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/135.json b/data/tmpl/135.json
new file mode 100644
index 0000000..bf2a829
--- /dev/null
+++ b/data/tmpl/135.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#f8fafc", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#e2e8f0", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 108, "fill": "#0ea5e9", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 54, "top": 24, "width": 1092, "text": "知乎", "fontSize": 40, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 54, "top": 178, "width": 1103, "text": "真正好用的工具,从来不需要付费墙", "fontSize": 68, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#0f172a", "textAlign": "left", "lineHeight": 1.26, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 54, "top": 294, "width": 1092, "text": "—— 一个用了三年开源软件的人", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#475569", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 54, "top": 572, "width": 1092, "height": 3, "fill": "#0ea5e9", "opacity": 0.6, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 54, "top": 599, "width": 1092, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#475569", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/136.json b/data/tmpl/136.json
new file mode 100644
index 0000000..2afb646
--- /dev/null
+++ b/data/tmpl/136.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 37, "top": 37, "width": 1127, "height": 602, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#111827", "strokeWidth": 3}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 61, "top": 73, "width": 61, "height": 8, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 61, "top": 128, "width": 1078, "text": "理性讨论", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fde047", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 4.05, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 61, "top": 185, "width": 1084, "text": "为什么我劝你先别买会员", "fontSize": 68, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 61, "top": 516, "width": 1078, "text": "这些免费方案已经够用", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#6b7280", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 61, "top": 584, "width": 1078, "text": "@软件小妹", "fontSize": 28, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/137.json b/data/tmpl/137.json
new file mode 100644
index 0000000..a3a25bb
--- /dev/null
+++ b/data/tmpl/137.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#7f1d1d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#b91c1c", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 47, "top": 47, "width": 1106, "height": 310, "fill": "#ffffff", "opacity": 0.95, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 14, "ry": 14}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 47, "top": 47, "width": 1106, "height": 310, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#fcd34d", "rx": 14, "ry": 14, "strokeWidth": 4, "strokeDashArray": [16.2, 10.8]}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 74, "top": 175, "width": 1052, "text": "把软件真实界面截图拖到这里", "fontSize": 31, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#94a3b8", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 47, "top": 399, "width": 1115, "text": "开源软件到底靠什么活着", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 47, "top": 472, "width": 1106, "text": "看完你不会再说「免费的能好到哪去」", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#fecaca", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 47, "top": 571, "width": 151, "height": 57, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 28, "ry": 28}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 70, "top": 587, "width": 151, "text": "技术向", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 47, "top": 594, "width": 1106, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fecaca", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/138.json b/data/tmpl/138.json
new file mode 100644
index 0000000..9a58075
--- /dev/null
+++ b/data/tmpl/138.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 675, "fill": "#064e3b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 408, "height": 675, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 408, "height": 675, "fill": "#047857", "opacity": 0.35, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 408, "top": 0, "width": 792, "height": 675, "fill": "#047857", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 24, "top": 214, "width": 360, "text": "免费", "fontSize": 171, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.0, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 24, "top": 409, "width": 360, "text": "知乎", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 464, "top": 148, "width": 696, "text": "真正好用的工具,从来不需要付费墙", "fontSize": 68, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 464, "top": 346, "width": 696, "text": "—— 一个用了三年开源软件的人", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#a7f3d0", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 464, "top": 601, "width": 696, "text": "@软件小妹", "fontSize": 28, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#a7f3d0", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/139.json b/data/tmpl/139.json
new file mode 100644
index 0000000..0d2e5aa
--- /dev/null
+++ b/data/tmpl/139.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#f3f4f6", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 58, "width": 130, "height": 72, "fill": "#ef4444", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 80, "top": 72, "width": 130, "text": "干货", "fontSize": 36, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 166, "width": 1187, "text": "电脑必装的4个软件", "fontSize": 97, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.14, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 537, "width": 318, "height": 125, "fill": "#ef4444", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 94, "top": 566, "width": 318, "text": "90%的人还不知道", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 710, "width": 1280, "height": 10, "fill": "#ef4444", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 934, "top": 58, "width": 288, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#6b7280", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/140.json b/data/tmpl/140.json
new file mode 100644
index 0000000..125c58d
--- /dev/null
+++ b/data/tmpl/140.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#eff6ff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#bfdbfe", "opacity": 0.42, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 58, "width": 453, "height": 453, "fill": "#1d4ed8", "opacity": 0.9, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 112, "top": 40, "width": 423, "text": "5", "fontSize": 302, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 554, "top": 130, "width": 668, "text": "这个免费软件又更新了", "fontSize": 72, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#1e3a8a", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 554, "top": 559, "width": 668, "text": "体积只有 8MB,功能却比收费的强", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#2563eb", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 627, "width": 1164, "text": "热点", "fontSize": 33, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#1d4ed8", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 627, "width": 1164, "text": "@软件小妹", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#2563eb", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/141.json b/data/tmpl/141.json
new file mode 100644
index 0000000..956ef3b
--- /dev/null
+++ b/data/tmpl/141.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#831843", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#be185d", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 13, "height": 720, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 1107, "top": -72, "width": 302, "height": 302, "fill": "#fde047", "opacity": 0.12, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 151, "ry": 151}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 65, "top": 65, "width": 131, "height": 65, "fill": "#fde047", "opacity": 0.22, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 32, "ry": 32}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 94, "top": 78, "width": 131, "text": "实用", "fontSize": 33, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fde047", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 65, "top": 163, "width": 1129, "text": "别再花冤枉钱买会员了", "fontSize": 72, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 65, "top": 272, "width": 1085, "text": "这 5 个开源工具免费还好用", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#fbcfe8", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 65, "top": 623, "width": 50, "height": 8, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 4, "ry": 4}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 133, "top": 612, "width": 432, "text": "@软件小妹", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#fbcfe8", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/142.json b/data/tmpl/142.json
new file mode 100644
index 0000000..4aac99b
--- /dev/null
+++ b/data/tmpl/142.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#ecfdf5", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 666, "top": 0, "width": 614, "height": 720, "fill": "#059669", "opacity": 0.92, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 666, "height": 720, "fill": "#bbf7d0", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 144, "width": 550, "text": "电脑必装的4个软件", "fontSize": 72, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#064e3b", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 79, "width": 550, "text": "干货", "fontSize": 33, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#059669", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 724, "top": 216, "width": 498, "text": "90%的人还不知道", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.5, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 724, "top": 639, "width": 498, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/143.json b/data/tmpl/143.json
new file mode 100644
index 0000000..50f3eae
--- /dev/null
+++ b/data/tmpl/143.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#042f2e", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#0d9488", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 115, "fill": "#22d3ee", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 26, "width": 1164, "text": "热点", "fontSize": 43, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 190, "width": 1176, "text": "这个免费软件又更新了", "fontSize": 72, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.26, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 313, "width": 1164, "text": "体积只有 8MB,功能却比收费的强", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#99f6e4", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 610, "width": 1164, "height": 4, "fill": "#22d3ee", "opacity": 0.6, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 639, "width": 1164, "text": "@软件小妹", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#99f6e4", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/144.json b/data/tmpl/144.json
new file mode 100644
index 0000000..5f704a7
--- /dev/null
+++ b/data/tmpl/144.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#fffbeb", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#fef3c7", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 187, "width": 1190, "text": "别再花冤枉钱买会员了", "fontSize": 79, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "rgba(0,0,0,0)", "textAlign": "left", "lineHeight": 1.2, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#78350f", "strokeWidth": 6, "paintFirst": "stroke"}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 144, "width": 1180, "text": "实用", "fontSize": 35, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#78350f", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 446, "width": 1180, "text": "这 5 个开源工具免费还好用", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#b45309", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 645, "width": 1180, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#78350f", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/145.json b/data/tmpl/145.json
new file mode 100644
index 0000000..bd9fc8f
--- /dev/null
+++ b/data/tmpl/145.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#312e81", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#0ea5e9", "opacity": 0.55, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 50, "width": 1179, "height": 619, "fill": null, "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#fde047", "strokeWidth": 4}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 572, "top": 144, "width": 136, "height": 62, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 31, "ry": 31}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 572, "top": 156, "width": 136, "text": "干货", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 72, "top": 248, "width": 1136, "text": "电脑必装的4个软件", "fontSize": 72, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 597, "top": 378, "width": 86, "height": 6, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 4, "ry": 4}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 72, "top": 421, "width": 1136, "text": "90%的人还不知道", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#e0f2fe", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 72, "top": 655, "width": 1136, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#e0f2fe", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/146.json b/data/tmpl/146.json
new file mode 100644
index 0000000..285ec46
--- /dev/null
+++ b/data/tmpl/146.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#4c1d95", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#7c3aed", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 1122, "top": 562, "width": 216, "height": 216, "fill": "#f472b6", "opacity": 0.18, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 108, "ry": 108}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 158, "width": 144, "height": 72, "fill": "#f472b6", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 87, "top": 173, "width": 144, "text": "热点", "fontSize": 36, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 274, "width": 1164, "text": "8MB", "fontSize": 216, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.0, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 522, "width": 1170, "text": "这个免费软件又更新了", "fontSize": 52, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#f472b6", "textAlign": "left", "lineHeight": 1.26, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 595, "width": 1164, "text": "体积只有 8MB,功能却比收费的强", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ddd6fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 639, "width": 1164, "text": "@软件小妹", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ddd6fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/147.json b/data/tmpl/147.json
new file mode 100644
index 0000000..4f27e87
--- /dev/null
+++ b/data/tmpl/147.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 435, "height": 720, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 435, "height": 720, "fill": "#fef08a", "opacity": 0.35, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 435, "top": 0, "width": 845, "height": 720, "fill": "#fef08a", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 26, "top": 228, "width": 383, "text": "5", "fontSize": 183, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.0, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 26, "top": 437, "width": 383, "text": "实用", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 495, "top": 158, "width": 742, "text": "别再花冤枉钱买会员了", "fontSize": 72, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 495, "top": 270, "width": 742, "text": "这 5 个开源工具免费还好用", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#78350f", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 495, "top": 641, "width": 742, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#78350f", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/148.json b/data/tmpl/148.json
new file mode 100644
index 0000000..bb01d7b
--- /dev/null
+++ b/data/tmpl/148.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#0f172a", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1280, "height": 720, "fill": "#1e293b", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 50, "width": 1180, "height": 331, "fill": "#ffffff", "opacity": 0.95, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 14, "ry": 14}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 50, "width": 1180, "height": 331, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#38bdf8", "rx": 14, "ry": 14, "strokeWidth": 4, "strokeDashArray": [17.28, 11.520000000000001]}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 79, "top": 187, "width": 1122, "text": "把软件真实界面截图拖到这里", "fontSize": 33, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#94a3b8", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 426, "width": 1190, "text": "电脑必装的4个软件", "fontSize": 58, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 504, "width": 1180, "text": "90%的人还不知道", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#94a3b8", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 609, "width": 129, "height": 61, "fill": "#38bdf8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 30, "ry": 30}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 74, "top": 626, "width": 129, "text": "干货", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 634, "width": 1180, "text": "@软件小妹", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#94a3b8", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/149.json b/data/tmpl/149.json
new file mode 100644
index 0000000..9893c63
--- /dev/null
+++ b/data/tmpl/149.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#fdf2f8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#fbcfe8", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 57, "width": 186, "height": 72, "fill": "#db2777", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 79, "top": 71, "width": 186, "text": "B站投稿", "fontSize": 36, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 165, "width": 1055, "text": "10个免费软件,装机必备", "fontSize": 97, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#831843", "textAlign": "left", "lineHeight": 1.14, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 535, "width": 300, "height": 125, "fill": "#db2777", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 93, "top": 564, "width": 300, "text": "第6个我用了5年", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 707, "width": 1146, "height": 10, "fill": "#db2777", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 802, "top": 57, "width": 287, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#be185d", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/150.json b/data/tmpl/150.json
new file mode 100644
index 0000000..ab52707
--- /dev/null
+++ b/data/tmpl/150.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#1e1b4b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#312e81", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 13, "height": 717, "fill": "#a78bfa", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 974, "top": -72, "width": 301, "height": 301, "fill": "#a78bfa", "opacity": 0.12, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 151, "ry": 151}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 65, "top": 65, "width": 197, "height": 65, "fill": "#a78bfa", "opacity": 0.22, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 32, "ry": 32}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 94, "top": 78, "width": 197, "text": "软件推荐", "fontSize": 33, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#a78bfa", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 65, "top": 163, "width": 995, "text": "我把付费软件全换成了这些", "fontSize": 72, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 65, "top": 272, "width": 952, "text": "一年省下 1200 元", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#c7d2fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 65, "top": 620, "width": 50, "height": 8, "fill": "#a78bfa", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 4, "ry": 4}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 133, "top": 609, "width": 430, "text": "@软件小妹", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#c7d2fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/151.json b/data/tmpl/151.json
new file mode 100644
index 0000000..e9d3d41
--- /dev/null
+++ b/data/tmpl/151.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#f8fafc", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#e2e8f0", "opacity": 0.55, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 50, "width": 1045, "height": 616, "fill": null, "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#0ea5e9", "strokeWidth": 4}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 473, "top": 143, "width": 200, "height": 62, "fill": "#0ea5e9", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 31, "ry": 31}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 473, "top": 156, "width": 200, "text": "干货合集", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 72, "top": 247, "width": 1002, "text": "这 3 个工具,让效率翻三倍", "fontSize": 72, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#0f172a", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 530, "top": 377, "width": 86, "height": 6, "fill": "#0ea5e9", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 4, "ry": 4}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 72, "top": 420, "width": 1002, "text": "全程无广,放心食用", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#475569", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 72, "top": 652, "width": 1002, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#475569", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/152.json b/data/tmpl/152.json
new file mode 100644
index 0000000..2543df8
--- /dev/null
+++ b/data/tmpl/152.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#7c2d12", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#ea580c", "opacity": 0.42, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 57, "width": 452, "height": 452, "fill": "#fde047", "opacity": 0.9, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 111, "top": 39, "width": 421, "text": "10", "fontSize": 301, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 552, "top": 129, "width": 537, "text": "10个免费软件,装机必备", "fontSize": 72, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 552, "top": 557, "width": 537, "text": "第6个我用了5年", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffedd5", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 626, "width": 1032, "text": "B站投稿", "fontSize": 33, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fde047", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 626, "width": 1032, "text": "@软件小妹", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffedd5", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/153.json b/data/tmpl/153.json
new file mode 100644
index 0000000..76554b6
--- /dev/null
+++ b/data/tmpl/153.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#7f1d1d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 596, "top": 0, "width": 550, "height": 717, "fill": "#fcd34d", "opacity": 0.92, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 596, "height": 717, "fill": "#b91c1c", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 143, "width": 482, "text": "我把付费软件全换成了这些", "fontSize": 72, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 79, "width": 482, "text": "软件推荐", "fontSize": 33, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fcd34d", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 653, "top": 215, "width": 436, "text": "一年省下 1200 元", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.5, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 653, "top": 637, "width": 436, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/154.json b/data/tmpl/154.json
new file mode 100644
index 0000000..679acdb
--- /dev/null
+++ b/data/tmpl/154.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#064e3b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#047857", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 115, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 26, "width": 1032, "text": "干货合集", "fontSize": 43, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 189, "width": 1043, "text": "这 3 个工具,让效率翻三倍", "fontSize": 72, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.26, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 311, "width": 1032, "text": "全程无广,放心食用", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#a7f3d0", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 609, "width": 1032, "height": 4, "fill": "#facc15", "opacity": 0.6, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 637, "width": 1032, "text": "@软件小妹", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#a7f3d0", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/155.json b/data/tmpl/155.json
new file mode 100644
index 0000000..3c57770
--- /dev/null
+++ b/data/tmpl/155.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#1e3a8a", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#3b82f6", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 186, "width": 1056, "text": "10个免费软件,装机必备", "fontSize": 79, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "rgba(0,0,0,0)", "textAlign": "left", "lineHeight": 1.2, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#fbbf24", "strokeWidth": 6, "paintFirst": "stroke"}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 143, "width": 1046, "text": "B站投稿", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 445, "width": 1046, "text": "第6个我用了5年", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#c7d7f5", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 642, "width": 1046, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/156.json b/data/tmpl/156.json
new file mode 100644
index 0000000..af56bd0
--- /dev/null
+++ b/data/tmpl/156.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 39, "top": 39, "width": 1068, "height": 639, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#111827", "strokeWidth": 3}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 65, "top": 78, "width": 65, "height": 9, "fill": "#ef4444", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 65, "top": 136, "width": 1016, "text": "软件推荐", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ef4444", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 4.302, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 65, "top": 197, "width": 1022, "text": "我把付费软件全换成了这些", "fontSize": 72, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 65, "top": 548, "width": 1016, "text": "一年省下 1200 元", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#6b7280", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 65, "top": 620, "width": 1016, "text": "@软件小妹", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/157.json b/data/tmpl/157.json
new file mode 100644
index 0000000..19a0faf
--- /dev/null
+++ b/data/tmpl/157.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#eff6ff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#bfdbfe", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 50, "width": 1046, "height": 330, "fill": "#ffffff", "opacity": 0.95, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 14, "ry": 14}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 50, "width": 1046, "height": 330, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#1d4ed8", "rx": 14, "ry": 14, "strokeWidth": 4, "strokeDashArray": [17.208, 11.472000000000001]}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 79, "top": 186, "width": 989, "text": "把软件真实界面截图拖到这里", "fontSize": 33, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#94a3b8", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 425, "width": 1056, "text": "这 3 个工具,让效率翻三倍", "fontSize": 58, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#1e3a8a", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 503, "width": 1046, "text": "全程无广,放心食用", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#2563eb", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 606, "width": 193, "height": 61, "fill": "#1d4ed8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 30, "ry": 30}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 74, "top": 624, "width": 193, "text": "干货合集", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 50, "top": 631, "width": 1046, "text": "@软件小妹", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#2563eb", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/158.json b/data/tmpl/158.json
new file mode 100644
index 0000000..4df2604
--- /dev/null
+++ b/data/tmpl/158.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#831843", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1146, "height": 717, "fill": "#be185d", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 988, "top": 559, "width": 215, "height": 215, "fill": "#fde047", "opacity": 0.18, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 108, "ry": 108}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 158, "width": 200, "height": 72, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 172, "width": 200, "text": "B站投稿", "fontSize": 36, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 273, "width": 1032, "text": "10", "fontSize": 215, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.0, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 520, "width": 1038, "text": "10个免费软件,装机必备", "fontSize": 52, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fde047", "textAlign": "left", "lineHeight": 1.26, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 593, "width": 1032, "text": "第6个我用了5年", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#fbcfe8", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 57, "top": 637, "width": 1032, "text": "@软件小妹", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fbcfe8", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/159.json b/data/tmpl/159.json
new file mode 100644
index 0000000..32ded21
--- /dev/null
+++ b/data/tmpl/159.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#042f2e", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#0d9488", "opacity": 0.55, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 929, "height": 929, "fill": null, "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#22d3ee", "strokeWidth": 5}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 414, "top": 216, "width": 252, "height": 93, "fill": "#22d3ee", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 47, "ry": 47}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 414, "top": 234, "width": 252, "text": "工具箱", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 372, "width": 864, "text": "装机必备软件清单", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 475, "top": 516, "width": 130, "height": 10, "fill": "#22d3ee", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 5, "ry": 5}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 580, "width": 864, "text": "每一款都免费", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#99f6e4", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 983, "width": 864, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#99f6e4", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/160.json b/data/tmpl/160.json
new file mode 100644
index 0000000..da6afd1
--- /dev/null
+++ b/data/tmpl/160.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#fffbeb", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#fef3c7", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 936, "text": "一天省下 2 小时", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#78350f", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 223, "width": 448, "height": 374, "fill": "#ffffff", "opacity": 0.94, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 223, "width": 448, "height": 13, "fill": "#d97706", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 367, "width": 383, "text": "自动化", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 556, "top": 223, "width": 448, "height": 374, "fill": "#ffffff", "opacity": 0.94, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 556, "top": 223, "width": 448, "height": 13, "fill": "#d97706", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 589, "top": 367, "width": 383, "text": "批处理", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 630, "width": 448, "height": 374, "fill": "#ffffff", "opacity": 0.94, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 630, "width": 448, "height": 13, "fill": "#d97706", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 774, "width": 383, "text": "快捷键", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 556, "top": 630, "width": 448, "height": 374, "fill": "#ffffff", "opacity": 0.94, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 556, "top": 630, "width": 448, "height": 13, "fill": "#d97706", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 589, "top": 774, "width": 383, "text": "免登录", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/161.json b/data/tmpl/161.json
new file mode 100644
index 0000000..1ac59ba
--- /dev/null
+++ b/data/tmpl/161.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#312e81", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#0ea5e9", "opacity": 0.42, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 86, "width": 486, "height": 486, "fill": "#fde047", "opacity": 0.9, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 32, "ry": 32}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 144, "top": 67, "width": 454, "text": "5", "fontSize": 324, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 637, "top": 164, "width": 357, "text": "值得收藏的免费工具", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 637, "top": 624, "width": 357, "text": "按需下载,不占空间", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#e0f2fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 942, "width": 908, "text": "收藏向", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fde047", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 942, "width": 908, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#e0f2fe", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/162.json b/data/tmpl/162.json
new file mode 100644
index 0000000..2789cab
--- /dev/null
+++ b/data/tmpl/162.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#4c1d95", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#7c3aed", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": -65, "width": 324, "text": "“", "fontSize": 281, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#f472b6", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 281, "width": 864, "text": "装机必备软件清单", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.42, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 670, "width": 864, "text": "每一款都免费", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ddd6fe", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 475, "top": 821, "width": 130, "height": 9, "fill": "#f472b6", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 4, "ry": 4}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 907, "width": 864, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ddd6fe", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/163.json b/data/tmpl/163.json
new file mode 100644
index 0000000..2eeceb8
--- /dev/null
+++ b/data/tmpl/163.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#fef08a", "opacity": 0.35, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 454, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 454, "fill": "#fef08a", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 864, "top": 324, "width": 281, "height": 281, "fill": "#111827", "opacity": 0.22, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 140, "ry": 140}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 106, "width": 197, "height": 98, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 113, "top": 126, "width": 197, "text": "效率", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 264, "width": 943, "text": "一天省下 2 小时", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 530, "width": 928, "text": "这 4 个工具帮我做到的", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#facc15", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 648, "width": 26, "height": 26, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 13, "ry": 13}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 126, "top": 639, "width": 898, "text": "自动化", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#facc15", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 764, "width": 26, "height": 26, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 13, "ry": 13}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 126, "top": 756, "width": 898, "text": "批处理", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#facc15", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 881, "width": 26, "height": 26, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 13, "ry": 13}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 126, "top": 872, "width": 898, "text": "快捷键", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#facc15", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 943, "width": 852, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#facc15", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/164.json b/data/tmpl/164.json
new file mode 100644
index 0000000..bb30a5e
--- /dev/null
+++ b/data/tmpl/164.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#0f172a", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#1e293b", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 86, "width": 248, "height": 108, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 118, "top": 108, "width": 248, "text": "收藏向", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 248, "width": 942, "text": "值得收藏的免费工具", "fontSize": 93, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.14, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 839, "width": 378, "height": 155, "fill": "#38bdf8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 140, "top": 882, "width": 378, "text": "按需下载,不占空间", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 1065, "width": 1080, "height": 15, "fill": "#38bdf8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 562, "top": 86, "width": 432, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#94a3b8", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/165.json b/data/tmpl/165.json
new file mode 100644
index 0000000..4c93573
--- /dev/null
+++ b/data/tmpl/165.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#374151", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 842, "top": 842, "width": 324, "height": 324, "fill": "#f59e0b", "opacity": 0.18, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 162, "ry": 162}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 238, "width": 270, "height": 108, "fill": "#f59e0b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 129, "top": 259, "width": 270, "text": "工具箱", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 410, "width": 908, "text": "免费", "fontSize": 324, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.0, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 783, "width": 917, "text": "装机必备软件清单", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#f59e0b", "textAlign": "left", "lineHeight": 1.26, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 853, "width": 908, "text": "每一款都免费", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#cbd5e1", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 960, "width": 908, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#cbd5e1", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/166.json b/data/tmpl/166.json
new file mode 100644
index 0000000..f1ed6ba
--- /dev/null
+++ b/data/tmpl/166.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#fdf2f8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#fbcfe8", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 86, "width": 908, "text": "效率", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#db2777", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 179, "width": 917, "text": "一天省下 2 小时", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#831843", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 337, "width": 97, "height": 97, "fill": "#db2777", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 350, "width": 97, "text": "1", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 216, "top": 352, "width": 778, "text": "自动化", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#831843", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 450, "width": 908, "height": 4, "fill": "#be185d", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 556, "width": 97, "height": 97, "fill": "#db2777", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 569, "width": 97, "text": "2", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 216, "top": 571, "width": 778, "text": "批处理", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#831843", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 669, "width": 908, "height": 4, "fill": "#be185d", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 775, "width": 97, "height": 97, "fill": "#db2777", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 788, "width": 97, "text": "3", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 216, "top": 790, "width": 778, "text": "快捷键", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#831843", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 888, "width": 908, "height": 4, "fill": "#be185d", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/167.json b/data/tmpl/167.json
new file mode 100644
index 0000000..d98473d
--- /dev/null
+++ b/data/tmpl/167.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 58, "width": 964, "height": 964, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#111827", "strokeWidth": 5}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 116, "width": 97, "height": 13, "fill": "#a78bfa", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 204, "width": 886, "text": "收藏向", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#a78bfa", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 6.48, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 294, "width": 896, "text": "值得收藏的免费工具", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 828, "width": 886, "text": "按需下载,不占空间", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#6b7280", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 934, "width": 886, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/168.json b/data/tmpl/168.json
new file mode 100644
index 0000000..08469bb
--- /dev/null
+++ b/data/tmpl/168.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#f8fafc", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#e2e8f0", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 281, "width": 943, "text": "装机必备软件清单", "fontSize": 76, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "rgba(0,0,0,0)", "textAlign": "left", "lineHeight": 1.2, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#0f172a", "strokeWidth": 10, "paintFirst": "stroke"}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 216, "width": 928, "text": "工具箱", "fontSize": 52, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#0f172a", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 670, "width": 928, "text": "每一款都免费", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#475569", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 966, "width": 928, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#0f172a", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/169.json b/data/tmpl/169.json
new file mode 100644
index 0000000..cab3554
--- /dev/null
+++ b/data/tmpl/169.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#7c2d12", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#ea580c", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 19, "height": 1080, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 821, "top": -108, "width": 454, "height": 454, "fill": "#fde047", "opacity": 0.12, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 227, "ry": 227}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 97, "width": 197, "height": 98, "fill": "#fde047", "opacity": 0.22, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 140, "top": 116, "width": 197, "text": "效率", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fde047", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 244, "width": 853, "text": "一天省下 2 小时", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 361, "width": 789, "text": "这 4 个工具帮我做到的", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffedd5", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 935, "width": 76, "height": 12, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 6, "ry": 6}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 200, "top": 918, "width": 648, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffedd5", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/170.json b/data/tmpl/170.json
new file mode 100644
index 0000000..89a3692
--- /dev/null
+++ b/data/tmpl/170.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#7f1d1d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1080, "fill": "#b91c1c", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 928, "height": 562, "fill": "#ffffff", "opacity": 0.95, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 928, "height": 562, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#fcd34d", "rx": 22, "ry": 22, "strokeWidth": 6, "strokeDashArray": [25.92, 17.28]}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 119, "top": 314, "width": 842, "text": "把软件真实界面截图拖到这里", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#94a3b8", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 706, "width": 943, "text": "值得收藏的免费工具", "fontSize": 55, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 781, "width": 928, "text": "按需下载,不占空间", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#fecaca", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 913, "width": 241, "height": 91, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 46, "ry": 46}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 113, "top": 939, "width": 241, "text": "收藏向", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 950, "width": 928, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fecaca", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/171.json b/data/tmpl/171.json
new file mode 100644
index 0000000..1a0820f
--- /dev/null
+++ b/data/tmpl/171.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#b91c1c", "opacity": 0.35, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 806, "fill": "#7f1d1d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 806, "fill": "#b91c1c", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 864, "top": 676, "width": 281, "height": 281, "fill": "#fcd34d", "opacity": 0.22, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 140, "ry": 140}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 106, "width": 297, "height": 98, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 113, "top": 126, "width": 297, "text": "软件合集", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 264, "width": 943, "text": "12 个免费软件\n一次性打包给你", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 882, "width": 928, "text": "全部官方正版 · 无捆绑", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#7f1d1d", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1000, "width": 26, "height": 26, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 13, "ry": 13}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 126, "top": 991, "width": 898, "text": "办公", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#7f1d1d", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1116, "width": 26, "height": 26, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 13, "ry": 13}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 126, "top": 1108, "width": 898, "text": "影音", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#7f1d1d", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1233, "width": 26, "height": 26, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 13, "ry": 13}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 126, "top": 1224, "width": 898, "text": "下载", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#7f1d1d", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1783, "width": 852, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#7f1d1d", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/172.json b/data/tmpl/172.json
new file mode 100644
index 0000000..fd218c4
--- /dev/null
+++ b/data/tmpl/172.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#064e3b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#047857", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 86, "width": 302, "height": 108, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 118, "top": 108, "width": 302, "text": "干货长图", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 248, "width": 942, "text": "电脑变卡?先装这几个工具", "fontSize": 93, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.14, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1679, "width": 318, "height": 155, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 140, "top": 1722, "width": 318, "text": "清完像新的一样", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 1905, "width": 1080, "height": 15, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 562, "top": 86, "width": 432, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#a7f3d0", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/173.json b/data/tmpl/173.json
new file mode 100644
index 0000000..b5c04a1
--- /dev/null
+++ b/data/tmpl/173.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#1e3a8a", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#3b82f6", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 13, "fill": "#fbbf24", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 103, "width": 316, "height": 106, "fill": "#fbbf24", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 53, "ry": 53}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 129, "top": 125, "width": 316, "text": "省钱合集", "fontSize": 52, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 285, "width": 925, "text": "不花钱也能用得爽", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.28, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 438, "width": 130, "height": 12, "fill": "#fbbf24", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 6, "ry": 6}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 503, "width": 874, "text": "替代 8 款付费软件", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#c7d7f5", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 610, "width": 39, "height": 39, "fill": "#fbbf24", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 19, "ry": 19}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 155, "top": 598, "width": 874, "text": "替代方案", "fontSize": 28, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 738, "width": 39, "height": 39, "fill": "#fbbf24", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 19, "ry": 19}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 155, "top": 725, "width": 874, "text": "免费额度", "fontSize": 28, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 865, "width": 39, "height": 39, "fill": "#fbbf24", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 19, "ry": 19}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 155, "top": 852, "width": 874, "text": "离线可用", "fontSize": 28, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1765, "width": 58, "height": 58, "fill": "#fbbf24", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 29, "ry": 29}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 172, "top": 1782, "width": 822, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#c7d7f5", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/174.json b/data/tmpl/174.json
new file mode 100644
index 0000000..216ab4d
--- /dev/null
+++ b/data/tmpl/174.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#f3f4f6", "opacity": 0.55, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 929, "height": 1769, "fill": null, "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#ef4444", "strokeWidth": 5}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 390, "top": 384, "width": 300, "height": 93, "fill": "#ef4444", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 47, "ry": 47}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 390, "top": 402, "width": 300, "text": "软件合集", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 540, "width": 864, "text": "12 个免费软件\n一次性打包给你", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 475, "top": 773, "width": 130, "height": 10, "fill": "#ef4444", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 5, "ry": 5}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 838, "width": 864, "text": "全部官方正版 · 无捆绑", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#6b7280", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 1823, "width": 864, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#6b7280", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/175.json b/data/tmpl/175.json
new file mode 100644
index 0000000..21097b7
--- /dev/null
+++ b/data/tmpl/175.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#eff6ff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#bfdbfe", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 86, "width": 908, "text": "干货长图", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#1d4ed8", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 179, "width": 917, "text": "电脑变卡?先装这几个工具", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#1e3a8a", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 337, "width": 97, "height": 97, "fill": "#1d4ed8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 350, "width": 97, "text": "1", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 216, "top": 352, "width": 778, "text": "清理", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#1e3a8a", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 450, "width": 908, "height": 4, "fill": "#2563eb", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 836, "width": 97, "height": 97, "fill": "#1d4ed8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 849, "width": 97, "text": "2", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 216, "top": 851, "width": 778, "text": "加速", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#1e3a8a", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 949, "width": 908, "height": 4, "fill": "#2563eb", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1335, "width": 97, "height": 97, "fill": "#1d4ed8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1348, "width": 97, "text": "3", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 216, "top": 1350, "width": 778, "text": "启动项", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#1e3a8a", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1448, "width": 908, "height": 4, "fill": "#2563eb", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/176.json b/data/tmpl/176.json
new file mode 100644
index 0000000..82319df
--- /dev/null
+++ b/data/tmpl/176.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#831843", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#be185d", "opacity": 0.42, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 86, "width": 486, "height": 486, "fill": "#fde047", "opacity": 0.9, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 32, "ry": 32}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 144, "top": 67, "width": 454, "text": "5", "fontSize": 324, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 637, "top": 164, "width": 357, "text": "不花钱也能用得爽", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 637, "top": 624, "width": 357, "text": "替代 8 款付费软件", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#fbcfe8", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1782, "width": 908, "text": "省钱合集", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fde047", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1782, "width": 908, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fbcfe8", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/177.json b/data/tmpl/177.json
new file mode 100644
index 0000000..9ee93a5
--- /dev/null
+++ b/data/tmpl/177.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#ecfdf5", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#bbf7d0", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": -65, "width": 324, "text": "“", "fontSize": 281, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#059669", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 499, "width": 864, "text": "12 个免费软件\n一次性打包给你", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#064e3b", "textAlign": "center", "lineHeight": 1.42, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 1190, "width": 864, "text": "全部官方正版 · 无捆绑", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#0f766e", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 475, "top": 1661, "width": 130, "height": 9, "fill": "#059669", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 4, "ry": 4}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 1747, "width": 864, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#0f766e", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/178.json b/data/tmpl/178.json
new file mode 100644
index 0000000..ea92e25
--- /dev/null
+++ b/data/tmpl/178.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#042f2e", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#0d9488", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 928, "height": 998, "fill": "#ffffff", "opacity": 0.95, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 928, "height": 998, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#22d3ee", "rx": 22, "ry": 22, "strokeWidth": 6, "strokeDashArray": [25.92, 17.28]}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 119, "top": 532, "width": 842, "text": "把软件真实界面截图拖到这里", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#94a3b8", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1142, "width": 943, "text": "电脑变卡?先装这几个工具", "fontSize": 55, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1217, "width": 928, "text": "清完像新的一样", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#99f6e4", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1753, "width": 289, "height": 91, "fill": "#22d3ee", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 46, "ry": 46}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 113, "top": 1779, "width": 289, "text": "干货长图", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1790, "width": 928, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#99f6e4", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/179.json b/data/tmpl/179.json
new file mode 100644
index 0000000..ee34838
--- /dev/null
+++ b/data/tmpl/179.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#fffbeb", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#fef3c7", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 19, "height": 1920, "fill": "#d97706", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 821, "top": -108, "width": 454, "height": 454, "fill": "#d97706", "opacity": 0.12, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 227, "ry": 227}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 97, "width": 297, "height": 98, "fill": "#d97706", "opacity": 0.22, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 140, "top": 116, "width": 297, "text": "省钱合集", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#d97706", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 244, "width": 853, "text": "不花钱也能用得爽", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#78350f", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 361, "width": 789, "text": "替代 8 款付费软件", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#b45309", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 1775, "width": 76, "height": 12, "fill": "#d97706", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 6, "ry": 6}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 200, "top": 1758, "width": 648, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#b45309", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/180.json b/data/tmpl/180.json
new file mode 100644
index 0000000..3f56f1f
--- /dev/null
+++ b/data/tmpl/180.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#312e81", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 883, "fill": "#0ea5e9", "opacity": 0.7, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 883, "width": 1080, "height": 1037, "fill": "#fde047", "opacity": 0.16, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 870, "width": 1080, "height": 13, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 138, "width": 908, "text": "12 个免费软件\n一次性打包给你", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.25, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 969, "width": 908, "text": "软件合集", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fde047", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1066, "width": 908, "text": "全部官方正版 · 无捆绑", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#e0f2fe", "textAlign": "left", "lineHeight": 1.5, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1162, "width": 908, "text": "● 办公", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1268, "width": 908, "text": "● 影音", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/181.json b/data/tmpl/181.json
new file mode 100644
index 0000000..06644f1
--- /dev/null
+++ b/data/tmpl/181.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#4c1d95", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#7c3aed", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 842, "top": 1682, "width": 324, "height": 324, "fill": "#f472b6", "opacity": 0.18, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 162, "ry": 162}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 422, "width": 324, "height": 108, "fill": "#f472b6", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 129, "top": 444, "width": 324, "text": "干货长图", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 595, "width": 908, "text": "4", "fontSize": 324, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.0, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 968, "width": 917, "text": "电脑变卡?先装这几个工具", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#f472b6", "textAlign": "left", "lineHeight": 1.26, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1038, "width": 908, "text": "清完像新的一样", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ddd6fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1800, "width": 908, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ddd6fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/182.json b/data/tmpl/182.json
new file mode 100644
index 0000000..f66e34c
--- /dev/null
+++ b/data/tmpl/182.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1920, "fill": "#fef08a", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 499, "width": 943, "text": "不花钱也能用得爽", "fontSize": 76, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "rgba(0,0,0,0)", "textAlign": "left", "lineHeight": 1.2, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#111827", "strokeWidth": 10, "paintFirst": "stroke"}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 384, "width": 928, "text": "省钱合集", "fontSize": 52, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1190, "width": 928, "text": "替代 8 款付费软件", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#78350f", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1806, "width": 928, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/183.json b/data/tmpl/183.json
new file mode 100644
index 0000000..7161c2a
--- /dev/null
+++ b/data/tmpl/183.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#fef08a", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 86, "width": 302, "height": 108, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 118, "top": 108, "width": 302, "text": "视频封面", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 248, "width": 1782, "text": "这 5 个免费软件,我用了 5 年", "fontSize": 146, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.14, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 806, "width": 540, "height": 188, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 140, "top": 849, "width": 540, "text": "全程无广,放心食用", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 1065, "width": 1920, "height": 15, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 1402, "top": 86, "width": 432, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#78350f", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/184.json b/data/tmpl/184.json
new file mode 100644
index 0000000..9e18cfd
--- /dev/null
+++ b/data/tmpl/184.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#0f172a", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#1e293b", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 19, "height": 1080, "fill": "#38bdf8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 1661, "top": -108, "width": 454, "height": 454, "fill": "#38bdf8", "opacity": 0.12, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 227, "ry": 227}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 97, "width": 197, "height": 98, "fill": "#38bdf8", "opacity": 0.22, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 140, "top": 116, "width": 197, "text": "实测", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#38bdf8", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 244, "width": 1693, "text": "免费软件能有多强?", "fontSize": 108, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 408, "width": 1629, "text": "实测对比付费版", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#94a3b8", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 935, "width": 76, "height": 12, "fill": "#38bdf8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 6, "ry": 6}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 200, "top": 918, "width": 648, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#94a3b8", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/185.json b/data/tmpl/185.json
new file mode 100644
index 0000000..244f304
--- /dev/null
+++ b/data/tmpl/185.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 653, "height": 1080, "fill": "#f59e0b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 653, "height": 1080, "fill": "#374151", "opacity": 0.35, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 653, "top": 0, "width": 1267, "height": 1080, "fill": "#374151", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 39, "top": 343, "width": 575, "text": "3", "fontSize": 274, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.0, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 39, "top": 655, "width": 575, "text": "合集", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 744, "top": 238, "width": 1111, "text": "装机必装清单", "fontSize": 108, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 744, "top": 405, "width": 1111, "text": "第 3 个最好用", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#cbd5e1", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 744, "top": 961, "width": 1111, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#cbd5e1", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/186.json b/data/tmpl/186.json
new file mode 100644
index 0000000..f6f98a6
--- /dev/null
+++ b/data/tmpl/186.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#fdf2f8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#fbcfe8", "opacity": 0.42, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 86, "width": 681, "height": 681, "fill": "#db2777", "opacity": 0.9, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 32, "ry": 32}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 168, "top": 59, "width": 636, "text": "5", "fontSize": 454, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 832, "top": 195, "width": 1002, "text": "这 5 个免费软件,我用了 5 年", "fontSize": 108, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#831843", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 832, "top": 840, "width": 1002, "text": "全程无广,放心食用", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#be185d", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 942, "width": 1748, "text": "视频封面", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#db2777", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 942, "width": 1748, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#be185d", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/187.json b/data/tmpl/187.json
new file mode 100644
index 0000000..72eb2d1
--- /dev/null
+++ b/data/tmpl/187.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#1e1b4b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 998, "top": 0, "width": 922, "height": 1080, "fill": "#a78bfa", "opacity": 0.92, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 998, "height": 1080, "fill": "#312e81", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 216, "width": 826, "text": "免费软件能有多强?", "fontSize": 108, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 119, "width": 826, "text": "实测", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#a78bfa", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 1084, "top": 324, "width": 750, "text": "实测对比付费版", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.5, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 1084, "top": 960, "width": 750, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/188.json b/data/tmpl/188.json
new file mode 100644
index 0000000..6eca256
--- /dev/null
+++ b/data/tmpl/188.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#f8fafc", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#e2e8f0", "opacity": 0.55, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 1769, "height": 929, "fill": null, "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#0ea5e9", "strokeWidth": 5}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 858, "top": 216, "width": 204, "height": 93, "fill": "#0ea5e9", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 47, "ry": 47}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 858, "top": 234, "width": 204, "text": "合集", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 372, "width": 1704, "text": "装机必装清单", "fontSize": 108, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#0f172a", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 895, "top": 566, "width": 130, "height": 10, "fill": "#0ea5e9", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 5, "ry": 5}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 631, "width": 1704, "text": "第 3 个最好用", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#475569", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 983, "width": 1704, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#475569", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/189.json b/data/tmpl/189.json
new file mode 100644
index 0000000..c81f2e6
--- /dev/null
+++ b/data/tmpl/189.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#7c2d12", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#ea580c", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 173, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 39, "width": 1748, "text": "视频封面", "fontSize": 65, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 285, "width": 1765, "text": "这 5 个免费软件,我用了 5 年", "fontSize": 108, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.26, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 468, "width": 1748, "text": "全程无广,放心食用", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffedd5", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 917, "width": 1748, "height": 5, "fill": "#fde047", "opacity": 0.6, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 960, "width": 1748, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffedd5", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/190.json b/data/tmpl/190.json
new file mode 100644
index 0000000..8d06435
--- /dev/null
+++ b/data/tmpl/190.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#7f1d1d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#b91c1c", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 1768, "height": 497, "fill": "#ffffff", "opacity": 0.95, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 1768, "height": 497, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#fcd34d", "rx": 22, "ry": 22, "strokeWidth": 6, "strokeDashArray": [25.92, 17.28]}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 119, "top": 281, "width": 1682, "text": "把软件真实界面截图拖到这里", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#94a3b8", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 641, "width": 1783, "text": "免费软件能有多强?", "fontSize": 86, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 758, "width": 1768, "text": "实测对比付费版", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#fecaca", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 913, "width": 193, "height": 91, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 46, "ry": 46}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 113, "top": 939, "width": 193, "text": "实测", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 950, "width": 1768, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fecaca", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/191.json b/data/tmpl/191.json
new file mode 100644
index 0000000..3c41c16
--- /dev/null
+++ b/data/tmpl/191.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#064e3b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#047857", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 281, "width": 1783, "text": "装机必装清单", "fontSize": 119, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "rgba(0,0,0,0)", "textAlign": "left", "lineHeight": 1.2, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#facc15", "strokeWidth": 10, "paintFirst": "stroke"}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 216, "width": 1768, "text": "合集", "fontSize": 52, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 670, "width": 1768, "text": "第 3 个最好用", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#a7f3d0", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 966, "width": 1768, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/192.json b/data/tmpl/192.json
new file mode 100644
index 0000000..6a7bc86
--- /dev/null
+++ b/data/tmpl/192.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#1e3a8a", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1920, "height": 1080, "fill": "#3b82f6", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 1682, "top": 842, "width": 324, "height": 324, "fill": "#fbbf24", "opacity": 0.18, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 162, "ry": 162}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 238, "width": 324, "height": 108, "fill": "#fbbf24", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 129, "top": 259, "width": 324, "text": "视频封面", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 410, "width": 1748, "text": "5", "fontSize": 324, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.0, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 783, "width": 1757, "text": "这 5 个免费软件,我用了 5 年", "fontSize": 78, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fbbf24", "textAlign": "left", "lineHeight": 1.26, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 892, "width": 1748, "text": "全程无广,放心食用", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#c7d7f5", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 960, "width": 1748, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#c7d7f5", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/193.json b/data/tmpl/193.json
new file mode 100644
index 0000000..21d64e5
--- /dev/null
+++ b/data/tmpl/193.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#eff6ff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#bfdbfe", "opacity": 0.55, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 929, "height": 1109, "fill": null, "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#1d4ed8", "strokeWidth": 5}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 414, "top": 252, "width": 252, "height": 93, "fill": "#1d4ed8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 47, "ry": 47}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 414, "top": 270, "width": 252, "text": "朋友圈", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 408, "width": 864, "text": "今天又白嫖了 6 个软件", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#1e3a8a", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 475, "top": 552, "width": 130, "height": 10, "fill": "#1d4ed8", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 5, "ry": 5}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 616, "width": 864, "text": "省下的钱买了杯奶茶", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#2563eb", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 1163, "width": 864, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#2563eb", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/194.json b/data/tmpl/194.json
new file mode 100644
index 0000000..cf565dc
--- /dev/null
+++ b/data/tmpl/194.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#be185d", "opacity": 0.35, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 529, "fill": "#831843", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 529, "fill": "#be185d", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 864, "top": 399, "width": 281, "height": 281, "fill": "#fde047", "opacity": 0.22, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 140, "ry": 140}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 106, "width": 197, "height": 98, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 113, "top": 126, "width": 197, "text": "日常", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 264, "width": 943, "text": "我的电脑里没有付费软件", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 605, "width": 928, "text": "全靠这些开源工具", "fontSize": 34, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#831843", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 723, "width": 26, "height": 26, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 13, "ry": 13}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 126, "top": 714, "width": 898, "text": "开源", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#831843", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 839, "width": 26, "height": 26, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 13, "ry": 13}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 126, "top": 831, "width": 898, "text": "无广告", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#831843", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1123, "width": 852, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#831843", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/195.json b/data/tmpl/195.json
new file mode 100644
index 0000000..38d4b6e
--- /dev/null
+++ b/data/tmpl/195.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#ecfdf5", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#bbf7d0", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 13, "fill": "#059669", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 103, "width": 264, "height": 106, "fill": "#059669", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 53, "ry": 53}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 129, "top": 125, "width": 264, "text": "朋友圈", "fontSize": 52, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 285, "width": 925, "text": "今天又白嫖了 6 个软件", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#064e3b", "textAlign": "left", "lineHeight": 1.28, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 438, "width": 130, "height": 12, "fill": "#059669", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 6, "ry": 6}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 503, "width": 874, "text": "省下的钱买了杯奶茶", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#0f766e", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 610, "width": 39, "height": 39, "fill": "#059669", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 19, "ry": 19}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 155, "top": 598, "width": 874, "text": "免费", "fontSize": 28, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#064e3b", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 738, "width": 39, "height": 39, "fill": "#059669", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 19, "ry": 19}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 155, "top": 725, "width": 874, "text": "好用", "fontSize": 28, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#064e3b", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1105, "width": 58, "height": 58, "fill": "#059669", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 29, "ry": 29}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 172, "top": 1122, "width": 822, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#0f766e", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/196.json b/data/tmpl/196.json
new file mode 100644
index 0000000..20c0bb2
--- /dev/null
+++ b/data/tmpl/196.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#042f2e", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#0d9488", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": -65, "width": 324, "text": "“", "fontSize": 281, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#22d3ee", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 328, "width": 864, "text": "我的电脑里没有付费软件", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.42, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 781, "width": 864, "text": "全靠这些开源工具", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#99f6e4", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 475, "top": 1001, "width": 130, "height": 9, "fill": "#22d3ee", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 4, "ry": 4}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 108, "top": 1087, "width": 864, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#99f6e4", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/197.json b/data/tmpl/197.json
new file mode 100644
index 0000000..f64beee
--- /dev/null
+++ b/data/tmpl/197.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#fffbeb", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#fef3c7", "opacity": 0.42, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 86, "width": 486, "height": 486, "fill": "#d97706", "opacity": 0.9, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 32, "ry": 32}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 144, "top": 67, "width": 454, "text": "6", "fontSize": 324, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 637, "top": 164, "width": 357, "text": "今天又白嫖了 6 个软件", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#78350f", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 637, "top": 624, "width": 357, "text": "省下的钱买了杯奶茶", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#b45309", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1122, "width": 908, "text": "朋友圈", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#d97706", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 1122, "width": 908, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#b45309", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/198.json b/data/tmpl/198.json
new file mode 100644
index 0000000..e9b07d6
--- /dev/null
+++ b/data/tmpl/198.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#312e81", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#0ea5e9", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 928, "height": 655, "fill": "#ffffff", "opacity": 0.95, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 22, "ry": 22}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 76, "width": 928, "height": 655, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#fde047", "rx": 22, "ry": 22, "strokeWidth": 6, "strokeDashArray": [25.92, 17.28]}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 119, "top": 360, "width": 842, "text": "把软件真实界面截图拖到这里", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#94a3b8", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 799, "width": 943, "text": "我的电脑里没有付费软件", "fontSize": 55, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 874, "width": 928, "text": "全靠这些开源工具", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#e0f2fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1093, "width": 193, "height": 91, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 46, "ry": 46}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 113, "top": 1119, "width": 193, "text": "日常", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 76, "top": 1130, "width": 928, "text": "@软件小妹", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#e0f2fe", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/199.json b/data/tmpl/199.json
new file mode 100644
index 0000000..5e9eb32
--- /dev/null
+++ b/data/tmpl/199.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#4c1d95", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#7c3aed", "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 86, "width": 908, "text": "朋友圈", "fontSize": 50, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#f472b6", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 179, "width": 917, "text": "今天又白嫖了 6 个软件", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 337, "width": 97, "height": 97, "fill": "#f472b6", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 350, "width": 97, "text": "1", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 216, "top": 352, "width": 778, "text": "免费", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 450, "width": 908, "height": 4, "fill": "#ddd6fe", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 616, "width": 97, "height": 97, "fill": "#f472b6", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 49, "ry": 49}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 629, "width": 97, "text": "2", "fontSize": 54, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 216, "top": 631, "width": 778, "text": "好用", "fontSize": 32, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 86, "top": 729, "width": 908, "height": 4, "fill": "#ddd6fe", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/200.json b/data/tmpl/200.json
new file mode 100644
index 0000000..00f1ddc
--- /dev/null
+++ b/data/tmpl/200.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1080, "height": 1260, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 58, "top": 58, "width": 964, "height": 1144, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#111827", "strokeWidth": 5}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 116, "width": 97, "height": 13, "fill": "#111827", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 204, "width": 886, "text": "日常", "fontSize": 48, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 6.48, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 294, "width": 896, "text": "我的电脑里没有付费软件", "fontSize": 69, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 1008, "width": 886, "text": "全靠这些开源工具", "fontSize": 30, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#6b7280", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 97, "top": 1114, "width": 886, "text": "@软件小妹", "fontSize": 45, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/201.json b/data/tmpl/201.json
new file mode 100644
index 0000000..a6e6828
--- /dev/null
+++ b/data/tmpl/201.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "#1e1b4b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 408, "height": 400, "fill": "#a78bfa", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 408, "height": 400, "fill": "#312e81", "opacity": 0.35, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 408, "top": 0, "width": 792, "height": 400, "fill": "#312e81", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 14, "top": 108, "width": 379, "text": "免费", "fontSize": 128, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.0, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 14, "top": 254, "width": 379, "text": "头图", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 442, "top": 56, "width": 734, "text": "公众号头图", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#a78bfa", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 442, "top": 88, "width": 734, "text": "软件小妹 · 每日一款免费软件", "fontSize": 44, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.24, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 442, "top": 155, "width": 734, "text": "关注不迷路", "fontSize": 19, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#c7d2fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 442, "top": 356, "width": 734, "text": "@软件小妹", "fontSize": 17, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#c7d2fe", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/202.json b/data/tmpl/202.json
new file mode 100644
index 0000000..91fbef3
--- /dev/null
+++ b/data/tmpl/202.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "#f8fafc", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "#e2e8f0", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 7, "height": 400, "fill": "#0ea5e9", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 1104, "top": -40, "width": 168, "height": 168, "fill": "#0ea5e9", "opacity": 0.12, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 84, "ry": 84}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 36, "top": 36, "width": 72, "height": 36, "fill": "#0ea5e9", "opacity": 0.22, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 18, "ry": 18}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 52, "top": 43, "width": 72, "text": "专栏", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#0ea5e9", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 36, "top": 90, "width": 1116, "text": "开源软件推荐合集", "fontSize": 44, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#0f172a", "textAlign": "left", "lineHeight": 1.22, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 36, "top": 156, "width": 1092, "text": "持续更新中", "fontSize": 19, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#475569", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 36, "top": 346, "width": 28, "height": 4, "fill": "#0ea5e9", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 2, "ry": 2}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 74, "top": 340, "width": 240, "text": "@软件小妹", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#475569", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/203.json b/data/tmpl/203.json
new file mode 100644
index 0000000..d3fa1a3
--- /dev/null
+++ b/data/tmpl/203.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "#7c2d12", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "#ea580c", "opacity": 0.5, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 64, "fill": "#fde047", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 32, "top": 14, "width": 1136, "text": "头图", "fontSize": 24, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 32, "top": 106, "width": 1142, "text": "软件小妹 · 每日一款免费软件", "fontSize": 44, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.26, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 32, "top": 179, "width": 1136, "text": "关注不迷路", "fontSize": 19, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#ffedd5", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 32, "top": 339, "width": 1136, "height": 2, "fill": "#fde047", "opacity": 0.6, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 32, "top": 355, "width": 1136, "text": "@软件小妹", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffedd5", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/204.json b/data/tmpl/204.json
new file mode 100644
index 0000000..65dc422
--- /dev/null
+++ b/data/tmpl/204.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "#7f1d1d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "#b91c1c", "opacity": 0.4, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 32, "top": 32, "width": 72, "height": 40, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 44, "top": 40, "width": 72, "text": "专栏", "fontSize": 20, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 32, "top": 92, "width": 1149, "text": "开源软件推荐合集", "fontSize": 59, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "left", "lineHeight": 1.14, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 32, "top": 295, "width": 135, "height": 73, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 52, "top": 311, "width": 135, "text": "持续更新中", "fontSize": 19, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 394, "width": 1200, "height": 6, "fill": "#fcd34d", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 1008, "top": 32, "width": 160, "text": "@软件小妹", "fontSize": 17, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fecaca", "textAlign": "right", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/205.json b/data/tmpl/205.json
new file mode 100644
index 0000000..f15c99a
--- /dev/null
+++ b/data/tmpl/205.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "#064e3b", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "#047857", "opacity": 0.55, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 28, "top": 28, "width": 1144, "height": 344, "fill": null, "opacity": 0.45, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#facc15", "strokeWidth": 2}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 562, "top": 80, "width": 76, "height": 35, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 17, "ry": 17}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 562, "top": 87, "width": 76, "text": "头图", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 40, "top": 138, "width": 1120, "text": "软件小妹 · 每日一款免费软件", "fontSize": 44, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#ffffff", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 576, "top": 215, "width": 48, "height": 4, "fill": "#facc15", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "rx": 2, "ry": 2}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 40, "top": 239, "width": 1120, "text": "关注不迷路", "fontSize": 19, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#a7f3d0", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 40, "top": 364, "width": 1120, "text": "@软件小妹", "fontSize": 17, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#a7f3d0", "textAlign": "center", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/data/tmpl/206.json b/data/tmpl/206.json
new file mode 100644
index 0000000..0e8bcb6
--- /dev/null
+++ b/data/tmpl/206.json
@@ -0,0 +1 @@
+{"version": "5.3.0", "objects": [{"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "rgba(255,255,255,1)", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null, "id": "workspace"}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 0, "top": 0, "width": 1200, "height": 400, "fill": "#ffffff", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 22, "top": 22, "width": 1157, "height": 357, "fill": null, "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": "#111827", "strokeWidth": 2}, {"type": "rect", "version": "5.3.0", "originX": "left", "originY": "top", "left": 36, "top": 43, "width": 36, "height": 5, "fill": "#fbbf24", "opacity": 1.0, "scaleX": 1, "scaleY": 1, "angle": 0, "stroke": null}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 36, "top": 76, "width": 1128, "text": "专栏", "fontSize": 18, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#fbbf24", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 2.4, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 36, "top": 109, "width": 1132, "text": "开源软件推荐合集", "fontSize": 44, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 36, "top": 306, "width": 1128, "text": "持续更新中", "fontSize": 19, "fontFamily": "Microsoft YaHei", "fontWeight": "normal", "fill": "#6b7280", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}, {"type": "textbox", "version": "5.3.0", "originX": "left", "originY": "top", "left": 36, "top": 346, "width": 1128, "text": "@软件小妹", "fontSize": 17, "fontFamily": "Microsoft YaHei", "fontWeight": "bold", "fill": "#111827", "textAlign": "left", "lineHeight": 1.3, "charSpacing": 0, "opacity": 1, "scaleX": 1, "scaleY": 1, "angle": 0}], "background": "#ffffff"}
\ No newline at end of file
diff --git a/docker-compose.cover.yml b/docker-compose.cover.yml
new file mode 100644
index 0000000..35e23f6
--- /dev/null
+++ b/docker-compose.cover.yml
@@ -0,0 +1,19 @@
+# 快图设计 · 封面工坊版
+# 用法:docker compose -f docker-compose.cover.yml up -d --build
+services:
+ kuaitu:
+ container_name: kuaitu-editor
+ build:
+ context: .
+ dockerfile: Dockerfile.kuaitu
+ image: kuaitu-editor:1.0
+ restart: always
+ ports:
+ - '8126:80'
+ environment:
+ TEMPLATE_DIR: /app/data
+ # 封面 AI 助手地址(AI 出图的图会出现在「素材 → AI 生成」里)
+ COVER_AI: ${COVER_AI:-http://192.168.68.19:8128}
+ volumes:
+ - ./server:/app/server:ro
+ - ./data:/app/data:ro
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644
index 0000000..c5a8ada
--- /dev/null
+++ b/docker-compose.yml
@@ -0,0 +1,7 @@
+version: '3'
+services:
+ kuaitu:
+ container_name: kuaitu
+ build: ./
+ ports:
+ - '8888:80'
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..b2b54e0
--- /dev/null
+++ b/index.html
@@ -0,0 +1,55 @@
+
+
+
+
+
+
+
+
+
+
+
+ <%- APP_TITLE %>
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/nginx.conf b/nginx.conf
new file mode 100644
index 0000000..9cb67bd
--- /dev/null
+++ b/nginx.conf
@@ -0,0 +1,15 @@
+server {
+ listen 80;
+ server_name localhost;
+
+ location / {
+ root /usr/share/nginx/html;
+ index index.html;
+ try_files $uri $uri/ /index.html;
+ }
+
+ error_page 500 502 503 504 /50x.html;
+ location = /50x.html {
+ root /usr/share/nginx/html;
+ }
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..8c80ca2
--- /dev/null
+++ b/package.json
@@ -0,0 +1,88 @@
+{
+ "name": "view-ui-project-ts",
+ "private": true,
+ "version": "1.0.0",
+ "description": "a template project for vue3, ViewUIPlus, TypeScript and Vite.",
+ "scripts": {
+ "preinstall": "npx only-allow pnpm",
+ "serve": "pnpm dev",
+ "dev": "vite serve",
+ "dev:staging": "vite serve --mode=staging",
+ "dev:prod": "vite serve --mode=production",
+ "build": "vite build",
+ "build:sdk": "pnpm -C packages/core build",
+ "build:staging": "vite build --mode=staging",
+ "preview": "pnpm build && vite preview",
+ "preview:staging": "pnpm build:staging && vite preview --mode=staging",
+ "prepare": "husky install",
+ "test": "pnpm -C packages/core test"
+ },
+ "dependencies": {
+ "@kuaitu/core": "workspace:^",
+ "@vueuse/core": "^10.1.0",
+ "axios": "^1.3.4",
+ "color-gradient-picker-vue3": "^3.1.0",
+ "dayjs": "^1.11.11",
+ "events": "^3.3.0",
+ "fabric": "5.3.0",
+ "fontfaceobserver": "^2.1.0",
+ "lodash-es": "^4.17.21",
+ "number-precision": "^1.6.0",
+ "qs": "^6.12.1",
+ "uuid": "^8.3.2",
+ "view-ui-plus": "1.3.7",
+ "vite-svg-loader": "^5.1.0",
+ "vue": "^3.2.25",
+ "vue-cropper": "^1.1.4",
+ "vue-i18n": "9.0.0",
+ "vue-masonry": "^0.16.0",
+ "vue-router": "^4.0.16",
+ "vue3-lazyload": "^0.3.6"
+ },
+ "workspaces": [
+ "packages/*"
+ ],
+ "devDependencies": {
+ "@commitlint/cli": "^17.4.2",
+ "@commitlint/config-conventional": "^17.4.2",
+ "@types/events": "^3.0.0",
+ "@types/fabric": "^5.3.0",
+ "@types/fontfaceobserver": "^2.1.3",
+ "@types/lodash-es": "^4.17.7",
+ "@types/node": "^18.15.13",
+ "@types/uuid": "^9.0.1",
+ "@typescript-eslint/eslint-plugin": "^5.54.1",
+ "@typescript-eslint/parser": "^5.54.1",
+ "@vitejs/plugin-vue": "^4.1.0",
+ "@vitejs/plugin-vue-jsx": "^3.0.1",
+ "autoprefixer": "^10.4.16",
+ "eslint": "^7.32.0",
+ "eslint-config-prettier": "^8.6.0",
+ "eslint-plugin-prettier": "^4.2.1",
+ "eslint-plugin-vue": "^9.9.0",
+ "husky": "^8.0.0",
+ "less": "^4.1.3",
+ "less-loader": "^11.1.0",
+ "lint-staged": "^13.1.1",
+ "prettier": "2.8.4",
+ "typescript": "5.1.6",
+ "unplugin-auto-import": "^0.16.0",
+ "vite": "^4.2.1",
+ "vite-plugin-compression": "^0.5.1",
+ "vite-plugin-eslint": "^1.8.1",
+ "vite-plugin-html": "^3.2.0",
+ "vite-plugin-vue-setup-extend-plus": "^0.1.0",
+ "vue-tsc": "^0.34.7"
+ },
+ "lint-staged": {
+ "*.{ts,tsx,js,vue}": [
+ "eslint --fix",
+ "prettier --write"
+ ]
+ },
+ "pnpm": {
+ "overrides": {
+ "@jridgewell/gen-mapping": "0.3.5"
+ }
+ }
+}
diff --git a/packages/core/ContextMenu.js b/packages/core/ContextMenu.js
new file mode 100644
index 0000000..bed7d15
--- /dev/null
+++ b/packages/core/ContextMenu.js
@@ -0,0 +1,263 @@
+/* eslint-disable no-prototype-builtins */
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-05-25 22:33:23
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-03-17 19:00:29
+ * @Description: 右键菜单
+ */
+/* Author: @UnrealSec */
+import './styles/contextMenu.css';
+
+class ContextMenu {
+ constructor(container, items) {
+ this.container = container;
+ this.dom = null;
+ this.shown = false;
+ this.root = true;
+ this.parent = null;
+ this.submenus = [];
+ this.items = items;
+
+ this._onclick = (e) => {
+ if (
+ this.dom &&
+ e.target != this.dom &&
+ e.target.parentElement != this.dom &&
+ !e.target.classList.contains('item') &&
+ !e.target.parentElement.classList.contains('item')
+ ) {
+ this.hideAll();
+ }
+ };
+
+ this._oncontextmenu = (e) => {
+ e.preventDefault();
+ if (
+ e.target != this.dom &&
+ e.target.parentElement != this.dom &&
+ !e.target.classList.contains('item') &&
+ !e.target.parentElement.classList.contains('item')
+ ) {
+ this.hideAll();
+ this.show(e.clientX, e.clientY);
+ }
+ };
+
+ this._oncontextmenu_keydown = (e) => {
+ if (e.keyCode != 93) return;
+ e.preventDefault();
+
+ this.hideAll();
+ this.show(e.clientX, e.clientY);
+ };
+
+ this._onblur = () => {
+ this.hideAll();
+ };
+ }
+
+ getMenuDom() {
+ const menu = document.createElement('div');
+ menu.classList.add('context');
+
+ for (const item of this.items) {
+ menu.appendChild(this.itemToDomEl(item));
+ }
+
+ return menu;
+ }
+
+ itemToDomEl(data) {
+ const item = document.createElement('div');
+
+ if (data === null) {
+ item.classList = 'separator';
+ return item;
+ }
+
+ if (
+ data.hasOwnProperty('color') &&
+ /^#([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(data.color.toString())
+ ) {
+ item.style.cssText = `color: ${data.color}`;
+ }
+
+ item.classList.add('item');
+
+ const label = document.createElement('span');
+ label.classList = 'label';
+ label.innerText = data.hasOwnProperty('text') ? data['text'].toString() : '';
+ item.appendChild(label);
+
+ if (data.hasOwnProperty('disabled') && data['disabled']) {
+ item.classList.add('disabled');
+ } else {
+ item.classList.add('enabled');
+ }
+
+ const hotkey = document.createElement('span');
+ hotkey.classList = 'hotkey';
+ hotkey.innerText = data.hasOwnProperty('hotkey') ? data['hotkey'].toString() : '';
+ item.appendChild(hotkey);
+
+ if (
+ data.hasOwnProperty('subitems') &&
+ Array.isArray(data['subitems']) &&
+ data['subitems'].length > 0
+ ) {
+ const menu = new ContextMenu(this.container, data['subitems']);
+ menu.root = false;
+ menu.parent = this;
+
+ const openSubItems = () => {
+ if (data.hasOwnProperty('disabled') && data['disabled'] == true) return;
+
+ this.hideSubMenus();
+
+ const x = this.dom.offsetLeft + this.dom.clientWidth + item.offsetLeft;
+ const y = this.dom.offsetTop + item.offsetTop;
+
+ if (!menu.shown) {
+ menu.show(x, y);
+ } else {
+ menu.hide();
+ }
+ };
+
+ this.submenus.push(menu);
+
+ item.classList.add('has-subitems');
+ item.addEventListener('click', openSubItems);
+ item.addEventListener('mousemove', openSubItems);
+ } else if (data.hasOwnProperty('submenu') && data['submenu'] instanceof ContextMenu) {
+ const menu = data['submenu'];
+ menu.root = false;
+ menu.parent = this;
+
+ const openSubItems = () => {
+ if (data.hasOwnProperty('disabled') && data['disabled'] == true) return;
+
+ this.hideSubMenus();
+
+ const x = this.dom.offsetLeft + this.dom.clientWidth + item.offsetLeft;
+ const y = this.dom.offsetTop + item.offsetTop;
+
+ if (!menu.shown) {
+ menu.show(x, y);
+ } else {
+ menu.hide();
+ }
+ };
+
+ this.submenus.push(menu);
+
+ item.classList.add('has-subitems');
+ item.addEventListener('click', openSubItems);
+ item.addEventListener('mousemove', openSubItems);
+ } else {
+ item.addEventListener('click', () => {
+ this.hideSubMenus();
+
+ if (item.classList.contains('disabled')) return;
+
+ if (data.hasOwnProperty('onclick') && typeof data['onclick'] === 'function') {
+ const event = {
+ handled: false,
+ item: item,
+ label: label,
+ hotkey: hotkey,
+ items: this.items,
+ data: data,
+ };
+
+ data['onclick'](event);
+
+ if (!event.handled) {
+ this.hide();
+ }
+ } else {
+ this.hide();
+ }
+ });
+
+ item.addEventListener('mousemove', () => {
+ this.hideSubMenus();
+ });
+ }
+
+ return item;
+ }
+
+ hideAll() {
+ if (this.root && !this.parent) {
+ if (this.shown) {
+ this.hideSubMenus();
+
+ this.shown = false;
+ this.container.removeChild(this.dom);
+
+ if (this.parent && this.parent.shown) {
+ this.parent.hide();
+ }
+ }
+
+ return;
+ }
+
+ this.parent.hide();
+ }
+
+ hide() {
+ if (this.dom && this.shown) {
+ this.shown = false;
+ this.hideSubMenus();
+ this.container.removeChild(this.dom);
+
+ if (this.parent && this.parent.shown) {
+ this.parent.hide();
+ }
+ }
+ }
+
+ hideSubMenus() {
+ for (const menu of this.submenus) {
+ if (menu.shown) {
+ menu.shown = false;
+ menu.container.removeChild(menu.dom);
+ }
+ menu.hideSubMenus();
+ }
+ }
+
+ show(x, y) {
+ this.dom = this.getMenuDom();
+
+ this.dom.style.left = `${x}px`;
+ this.dom.style.top = `${y}px`;
+
+ this.shown = true;
+ this.container.appendChild(this.dom);
+ }
+
+ install() {
+ this.container.addEventListener('contextmenu', this._oncontextmenu);
+ this.container.addEventListener('keydown', this._oncontextmenu_keydown);
+ this.container.addEventListener('click', this._onclick);
+ window.addEventListener('blur', this._onblur);
+ }
+
+ setData(data) {
+ this.items = data;
+ }
+
+ uninstall() {
+ this.dom = null;
+ // this.container.removeEventListener('contextmenu', this._oncontextmenu);
+ this.container.removeEventListener('keydown', this._oncontextmenu_keydown);
+ this.container.removeEventListener('click', this._onclick);
+ window.removeEventListener('blur', this._onblur);
+ }
+}
+
+export default ContextMenu;
diff --git a/packages/core/Editor.ts b/packages/core/Editor.ts
new file mode 100644
index 0000000..20a80e7
--- /dev/null
+++ b/packages/core/Editor.ts
@@ -0,0 +1,197 @@
+import EventEmitter from 'events';
+import hotkeys from 'hotkeys-js';
+import ContextMenu from './ContextMenu.js';
+import ServersPlugin from './ServersPlugin';
+import { AsyncSeriesHook } from 'tapable';
+import type {
+ IPluginMenu,
+ IPluginClass,
+ IPluginOption,
+ IEditorHooksType,
+ IPluginTempl,
+} from '@kuaitu/core';
+
+import Utils from './utils/utils';
+
+class Editor extends EventEmitter {
+ private canvas: fabric.Canvas | null = null;
+ contextMenu: ContextMenu | null = null;
+ [key: string]: any;
+ private pluginMap: {
+ [propName: string]: IPluginTempl;
+ } = {};
+ // 自定义事件
+ private customEvents: string[] = [];
+ // 自定义API
+ private customApis: string[] = [];
+ // 生命周期函数名
+ private hooks: IEditorHooksType[] = [
+ 'hookImportBefore',
+ 'hookImportAfter',
+ 'hookSaveBefore',
+ 'hookSaveAfter',
+ 'hookTransform',
+ ];
+ public hooksEntity: {
+ [propName: string]: AsyncSeriesHook;
+ } = {};
+
+ init(canvas: fabric.Canvas) {
+ this.canvas = canvas;
+ this._initContextMenu();
+ this._bindContextMenu();
+ this._initActionHooks();
+ this._initServersPlugin();
+
+ this.Utils = Utils;
+ }
+
+ get fabricCanvas() {
+ return this.canvas;
+ }
+
+ // 引入组件
+ use(plugin: IPluginTempl, options?: IPluginOption) {
+ if (this._checkPlugin(plugin) && this.canvas) {
+ this._saveCustomAttr(plugin);
+ const pluginRunTime = new (plugin as IPluginClass)(this.canvas, this, options || {});
+ // 添加插件名称
+ pluginRunTime.pluginName = plugin.pluginName;
+ this.pluginMap[plugin.pluginName] = pluginRunTime;
+ this._bindingHooks(pluginRunTime);
+ this._bindingHotkeys(pluginRunTime);
+ this._bindingApis(pluginRunTime);
+ }
+ return this;
+ }
+
+ destory() {
+ this.canvas = null;
+ this.contextMenu = null;
+ this.pluginMap = {};
+ this.customEvents = [];
+ this.customApis = [];
+ this.hooksEntity = {};
+ }
+ // 获取插件
+ getPlugin(name: string) {
+ if (this.pluginMap[name]) {
+ return this.pluginMap[name];
+ }
+ }
+
+ // 检查组件
+ private _checkPlugin(plugin: IPluginTempl) {
+ const { pluginName, events = [], apis = [] } = plugin;
+ //名称检查
+ if (this.pluginMap[pluginName]) {
+ throw new Error(pluginName + '插件重复初始化');
+ }
+ events.forEach((eventName: string) => {
+ if (this.customEvents.find((info) => info === eventName)) {
+ throw new Error(pluginName + '插件中' + eventName + '重复');
+ }
+ });
+
+ apis.forEach((apiName: string) => {
+ if (this.customApis.find((info) => info === apiName)) {
+ throw new Error(pluginName + '插件中' + apiName + '重复');
+ }
+ });
+ return true;
+ }
+
+ // 绑定hooks方法
+ private _bindingHooks(plugin: IPluginTempl) {
+ this.hooks.forEach((hookName) => {
+ const hook = plugin[hookName];
+ if (hook) {
+ this.hooksEntity[hookName].tapPromise(plugin.pluginName + hookName, function () {
+ // console.log(hookName, ...arguments);
+ // eslint-disable-next-line prefer-rest-params
+ const result = hook.apply(plugin, [...arguments]);
+ // hook 兼容非 Promise 返回值
+ return (result as any) instanceof Promise ? result : Promise.resolve(result);
+ });
+ }
+ });
+ }
+
+ // 绑定快捷键
+ private _bindingHotkeys(plugin: IPluginTempl) {
+ plugin?.hotkeys?.forEach((keyName: string) => {
+ // 支持 keyup
+ hotkeys(keyName, { keyup: true }, (e) => {
+ plugin.hotkeyEvent && plugin.hotkeyEvent(keyName, e);
+ });
+ });
+ }
+
+ // 保存组件自定义事件与API
+ private _saveCustomAttr(plugin: IPluginTempl) {
+ const { events = [], apis = [] } = plugin;
+ this.customApis = this.customApis.concat(apis);
+ this.customEvents = this.customEvents.concat(events);
+ }
+ // 代理API事件
+ private _bindingApis(pluginRunTime: IPluginTempl) {
+ const { apis = [] } = (pluginRunTime.constructor as any) || {};
+ apis.forEach((apiName: string) => {
+ this[apiName] = function () {
+ // eslint-disable-next-line prefer-rest-params
+ return pluginRunTime[apiName].apply(pluginRunTime, [...arguments]);
+ };
+ });
+ }
+
+ // 右键菜单
+ private _bindContextMenu() {
+ this.canvas &&
+ this.canvas.on('mouse:down', (opt) => {
+ if (opt.button === 3) {
+ let menu: IPluginMenu[] = [];
+ Object.keys(this.pluginMap).forEach((pluginName) => {
+ const pluginRunTime = this.pluginMap[pluginName];
+ const pluginMenu = pluginRunTime.contextMenu && pluginRunTime.contextMenu();
+ if (pluginMenu) {
+ menu = menu.concat(pluginMenu);
+ }
+ });
+ this._renderMenu(opt, menu);
+ }
+ });
+ }
+
+ // 渲染右键菜单
+ private _renderMenu(opt: { e: MouseEvent }, menu: IPluginMenu[]) {
+ if (menu.length !== 0 && this.contextMenu) {
+ this.contextMenu.hideAll();
+ this.contextMenu.setData(menu);
+ this.contextMenu.show(opt.e.clientX, opt.e.clientY);
+ }
+ }
+
+ // 生命周期事件
+ _initActionHooks() {
+ this.hooks.forEach((hookName) => {
+ this.hooksEntity[hookName] = new AsyncSeriesHook(['data']);
+ });
+ }
+
+ _initContextMenu() {
+ this.contextMenu = new ContextMenu(this.canvas!.wrapperEl, []);
+ this.contextMenu.install();
+ }
+
+ _initServersPlugin() {
+ this.use(ServersPlugin);
+ }
+
+ // 解决 listener 为 undefined 的时候卸载错误
+ off(eventName: string, listener: any): this {
+ // noinspection TypeScriptValidateTypes
+ return listener ? super.off(eventName, listener) : this;
+ }
+}
+
+export default Editor;
diff --git a/packages/core/Instance.ts b/packages/core/Instance.ts
new file mode 100644
index 0000000..f837076
--- /dev/null
+++ b/packages/core/Instance.ts
@@ -0,0 +1,82 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2024-04-10 15:38:47
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-07-22 11:56:28
+ * @Description: 类型文件
+ */
+import Editor from './Editor';
+import DringPlugin from './plugin/DringPlugin';
+import AlignGuidLinePlugin from './plugin/AlignGuidLinePlugin';
+import ControlsPlugin from './plugin/ControlsPlugin';
+import ControlsRotatePlugin from './plugin/ControlsRotatePlugin';
+import CenterAlignPlugin from './plugin/CenterAlignPlugin';
+import LayerPlugin from './plugin/LayerPlugin';
+import CopyPlugin from './plugin/CopyPlugin';
+import MoveHotKeyPlugin from './plugin/MoveHotKeyPlugin';
+import DeleteHotKeyPlugin from './plugin/DeleteHotKeyPlugin';
+import GroupPlugin from './plugin/GroupPlugin';
+import DrawLinePlugin from './plugin/DrawLinePlugin';
+import GroupTextEditorPlugin from './plugin/GroupTextEditorPlugin';
+import GroupAlignPlugin from './plugin/GroupAlignPlugin';
+import WorkspacePlugin from './plugin/WorkspacePlugin';
+import MaskPlugin from './plugin/MaskPlugin';
+import HistoryPlugin from './plugin/HistoryPlugin';
+import FlipPlugin from './plugin/FlipPlugin';
+import RulerPlugin from './plugin/RulerPlugin';
+import MaterialPlugin from './plugin/MaterialPlugin';
+import WaterMarkPlugin from './plugin/WaterMarkPlugin';
+import FontPlugin from './plugin/FontPlugin';
+import PolygonModifyPlugin from './plugin/PolygonModifyPlugin';
+import DrawPolygonPlugin from './plugin/DrawPolygonPlugin';
+import FreeDrawPlugin from './plugin/FreeDrawPlugin';
+import PathTextPlugin from './plugin/PathTextPlugin';
+import PsdPlugin from './plugin/PsdPlugin';
+import SimpleClipImagePlugin from './plugin/SimpleClipImagePlugin';
+import BarCodePlugin from './plugin/BarCodePlugin';
+import QrCodePlugin from './plugin/QrCodePlugin';
+import ImageStroke from './plugin/ImageStroke';
+import ResizePlugin from './plugin/ResizePlugin';
+import LockPlugin from './plugin/LockPlugin';
+import AddBaseTypePlugin from './plugin/AddBaseTypePlugin';
+
+const AllEditor = {
+ Editor,
+ DringPlugin,
+ AlignGuidLinePlugin,
+ ControlsPlugin,
+ ControlsRotatePlugin,
+ CenterAlignPlugin,
+ LayerPlugin,
+ CopyPlugin,
+ MoveHotKeyPlugin,
+ DeleteHotKeyPlugin,
+ GroupPlugin,
+ DrawLinePlugin,
+ GroupTextEditorPlugin,
+ GroupAlignPlugin,
+ WorkspacePlugin,
+ MaskPlugin,
+ HistoryPlugin,
+ FlipPlugin,
+ RulerPlugin,
+ MaterialPlugin,
+ WaterMarkPlugin,
+ FontPlugin,
+ PolygonModifyPlugin,
+ DrawPolygonPlugin,
+ FreeDrawPlugin,
+ PathTextPlugin,
+ PsdPlugin,
+ SimpleClipImagePlugin,
+ BarCodePlugin,
+ QrCodePlugin,
+ ImageStroke,
+ ResizePlugin,
+ LockPlugin,
+ AddBaseTypePlugin,
+};
+
+declare type KuaituEditor = typeof AllEditor;
+
+export default KuaituEditor;
diff --git a/packages/core/ServersPlugin.ts b/packages/core/ServersPlugin.ts
new file mode 100644
index 0000000..030e6c8
--- /dev/null
+++ b/packages/core/ServersPlugin.ts
@@ -0,0 +1,355 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-20 12:52:09
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-07-25 17:40:14
+ * @Description: 内部插件
+ */
+import { v4 as uuid } from 'uuid';
+import { selectFiles, clipboardText, downFile } from './utils/utils';
+import { fabric } from 'fabric';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+import { SelectEvent, SelectMode } from './eventType';
+
+type IPlugin = Pick<
+ ServersPlugin,
+ | 'insert'
+ | 'loadJSON'
+ | 'getJson'
+ | 'dragAddItem'
+ | 'clipboard'
+ | 'clipboardBase64'
+ | 'saveJson'
+ | 'saveSvg'
+ | 'saveImg'
+ | 'clear'
+ | 'preview'
+ | 'getSelectMode'
+ | 'getExtensionKey'
+>;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+function transformText(objects: any) {
+ if (!objects) return;
+ objects.forEach((item: any) => {
+ if (item.objects) {
+ transformText(item.objects);
+ } else {
+ item.type === 'text' && (item.type = 'textbox');
+ }
+ });
+}
+
+class ServersPlugin implements IPluginTempl {
+ public selectedMode: SelectMode;
+ static pluginName = 'ServersPlugin';
+ static apis = [
+ 'insert',
+ 'loadJSON',
+ 'getJson',
+ 'dragAddItem',
+ 'clipboard',
+ 'clipboardBase64',
+ 'saveJson',
+ 'saveSvg',
+ 'saveImg',
+ 'clear',
+ 'preview',
+ 'getSelectMode',
+ 'getExtensionKey',
+ ];
+ static events = [SelectMode.ONE, SelectMode.MULTI, SelectEvent.CANCEL];
+ // public hotkeys: string[] = ['left', 'right', 'down', 'up'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.selectedMode = SelectMode.EMPTY;
+ this._initSelectEvent();
+ }
+
+ private _initSelectEvent() {
+ this.canvas.on('selection:created', () => this._emitSelectEvent());
+ this.canvas.on('selection:updated', () => this._emitSelectEvent());
+ this.canvas.on('selection:cleared', () => this._emitSelectEvent());
+ }
+
+ private _emitSelectEvent() {
+ if (!this.canvas) {
+ throw TypeError('还未初始化');
+ }
+
+ const actives = this.canvas
+ .getActiveObjects()
+ .filter((item) => !(item instanceof fabric.GuideLine)); // 过滤掉辅助线
+ if (actives && actives.length === 1) {
+ this.selectedMode = SelectMode.ONE;
+ this.editor.emit(SelectEvent.ONE, actives);
+ } else if (actives && actives.length > 1) {
+ this.selectedMode = SelectMode.MULTI;
+ this.editor.emit(SelectEvent.MULTI, actives);
+ } else {
+ this.editor.emit(SelectEvent.CANCEL);
+ }
+ }
+
+ getSelectMode() {
+ return String(this.selectedMode);
+ }
+
+ insert(callback?: () => void) {
+ selectFiles({ accept: '.json' }).then((files) => {
+ if (files && files.length > 0) {
+ const file = files[0];
+ const reader = new FileReader();
+ reader.readAsText(file, 'UTF-8');
+ reader.onload = () => {
+ this.loadJSON(reader.result as string, callback);
+ };
+ }
+ });
+ }
+
+ // 设置path属性
+ renderITextPath(textPaths: Record<'id' | 'path', any>[]) {
+ textPaths.forEach((item) => {
+ const object = this.canvas.getObjects().find((o) => o.id === item.id);
+ if (object) {
+ fabric.Path.fromObject(item.path, (e) => {
+ object.set('path', e);
+ });
+ }
+ });
+ }
+
+ async loadJSON(jsonFile: string | object, callback?: () => void) {
+ // 确保元素存在id
+ const temp = typeof jsonFile === 'string' ? JSON.parse(jsonFile) : jsonFile;
+ const textPaths: Record<'id' | 'path', any>[] = [];
+ temp.objects.forEach((item: any) => {
+ !item.id && (item.id = uuid());
+ // 收集所有路径文本元素i-text,并设置path为null
+ if (item.type === 'i-text' && item.path) {
+ textPaths.push({ id: item.id, path: item.path });
+ item.path = null;
+ }
+ });
+
+ // hookTransform遍历
+ const tempTransform = await this._transform(temp);
+
+ jsonFile = JSON.stringify(tempTransform);
+ // 加载前钩子
+ this.editor.hooksEntity.hookImportBefore.callAsync(jsonFile, () => {
+ this.canvas.loadFromJSON(jsonFile, () => {
+ // 把i-text对应的path加上
+ this.renderITextPath(textPaths);
+ this.canvas.renderAll();
+ // 加载后钩子
+ this.editor.hooksEntity.hookImportAfter.callAsync(jsonFile, () => {
+ // 修复导入带水印的json无法清除问题 #359
+ this.editor?.updateDrawStatus &&
+ typeof this.editor.updateDrawStatus === 'function' &&
+ this.editor.updateDrawStatus(!!temp['overlayImage']);
+ this.canvas.renderAll();
+ callback && callback();
+ this.editor.emit('loadJson');
+ });
+ });
+ });
+ }
+
+ async _transform(json: any) {
+ await this.promiseCallAsync(json);
+ if (json.objects) {
+ const all = json.objects.map((item: any) => {
+ return this._transform(item);
+ });
+ await Promise.all(all);
+ }
+ return json;
+ }
+
+ promiseCallAsync(item: any) {
+ return new Promise((resolve) => {
+ this.editor.hooksEntity.hookTransform.callAsync(item, () => {
+ resolve(item);
+ });
+ });
+ }
+
+ getJson() {
+ const keys = this.getExtensionKey();
+ return this.canvas.toJSON(keys);
+ }
+
+ getExtensionKey() {
+ return [
+ 'id',
+ 'gradientAngle',
+ 'selectable',
+ 'hasControls',
+ 'linkData',
+ 'editable',
+ 'extensionType',
+ 'extension',
+ 'verticalAlign',
+ 'roundValue',
+ ];
+ }
+
+ /**
+ * @description: 拖拽添加到画布
+ * @param {Event} event
+ * @param {Object} item
+ */
+ dragAddItem(item: fabric.Object, event?: DragEvent) {
+ if (event) {
+ const { left, top } = this.canvas.getSelectionElement().getBoundingClientRect();
+ if (event.x < left || event.y < top || item.width === undefined) return;
+
+ const point = {
+ x: event.x - left,
+ y: event.y - top,
+ };
+ const pointerVpt = this.canvas.restorePointerVpt(point);
+ item.left = pointerVpt.x - item.width / 2;
+ item.top = pointerVpt.y;
+ }
+ const { width } = this._getSaveOption();
+ width && item.scaleToWidth(width / 2);
+ this.canvas.add(item);
+ this.canvas.setActiveObject(item);
+
+ !event && this.editor.position('center');
+ this.canvas.requestRenderAll();
+ }
+
+ clipboard() {
+ const jsonStr = this.getJson();
+ return clipboardText(JSON.stringify(jsonStr, null, '\t'));
+ }
+
+ async clipboardBase64() {
+ const dataUrl = await this.preview();
+ return clipboardText(dataUrl);
+ }
+
+ async saveJson() {
+ const dataUrl = this.getJson();
+ // 把文本text转为textgroup,让导入可以编辑
+ await transformText(dataUrl.objects);
+ const fileStr = `data:text/json;charset=utf-8,${encodeURIComponent(
+ JSON.stringify(dataUrl, null, '\t')
+ )}`;
+ downFile(fileStr, 'json');
+ }
+
+ saveSvg() {
+ this.editor.hooksEntity.hookSaveBefore.callAsync('', () => {
+ const { fontOption, svgOption } = this._getSaveSvgOption();
+ fabric.fontPaths = {
+ ...fontOption,
+ };
+ const dataUrl = this.canvas.toSVG(svgOption);
+ const fileStr = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(dataUrl)}`;
+ this.editor.hooksEntity.hookSaveAfter.callAsync(fileStr, () => {
+ downFile(fileStr, 'svg');
+ });
+ });
+ }
+
+ saveImg() {
+ this.editor.hooksEntity.hookSaveBefore.callAsync('', () => {
+ const option = this._getSaveOption();
+ this.canvas.setViewportTransform([1, 0, 0, 1, 0, 0]);
+ const dataUrl = this.canvas.toDataURL(option);
+ this.editor.hooksEntity.hookSaveAfter.callAsync(dataUrl, () => {
+ downFile(dataUrl, 'png');
+ });
+ });
+ }
+
+ preview() {
+ return new Promise((resolve) => {
+ this.editor.hooksEntity.hookSaveBefore.callAsync('', () => {
+ const option = this._getSaveOption();
+ this.canvas.setViewportTransform([1, 0, 0, 1, 0, 0]);
+ this.canvas.renderAll();
+ const dataUrl = this.canvas.toDataURL(option);
+ this.editor.hooksEntity.hookSaveAfter.callAsync(dataUrl, () => {
+ resolve(dataUrl);
+ });
+ });
+ });
+ }
+
+ _getSaveSvgOption() {
+ const workspace = this.canvas.getObjects().find((item) => item.id === 'workspace');
+ let fontFamilyArry = this.canvas
+ .getObjects()
+ .filter((item) => item.type == 'textbox')
+ .map((item) => item.fontFamily);
+ fontFamilyArry = Array.from(new Set(fontFamilyArry));
+
+ const fontList = this.editor.getPlugin('FontPlugin').cacheList;
+
+ const fontEntry = {};
+ for (const font of fontFamilyArry) {
+ const item = fontList.find((item) => item.name === font);
+ fontEntry[font] = item.file;
+ }
+
+ console.log('_getSaveSvgOption', fontEntry);
+ const { left, top, width, height } = workspace as fabric.Object;
+ return {
+ fontOption: fontEntry,
+ svgOption: {
+ width,
+ height,
+ viewBox: {
+ x: left,
+ y: top,
+ width,
+ height,
+ },
+ },
+ };
+ }
+
+ _getSaveOption() {
+ const workspace = this.canvas
+ .getObjects()
+ .find((item: fabric.Object) => item.id === 'workspace');
+ console.log('getObjects', this.canvas.getObjects());
+ const { left, top, width, height } = workspace as fabric.Object;
+ const option = {
+ name: 'New Image',
+ format: 'png',
+ quality: 1,
+ width,
+ height,
+ left,
+ top,
+ };
+ return option;
+ }
+
+ clear() {
+ this.canvas.getObjects().forEach((obj) => {
+ if (obj.id !== 'workspace') {
+ this.canvas.remove(obj);
+ }
+ });
+ this.editor?.setWorkspaseBg('#fff');
+ this.canvas.discardActiveObject();
+ this.canvas.renderAll();
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default ServersPlugin;
diff --git a/packages/core/__tests__/editor/basic.spec.ts b/packages/core/__tests__/editor/basic.spec.ts
new file mode 100644
index 0000000..e3bc5d5
--- /dev/null
+++ b/packages/core/__tests__/editor/basic.spec.ts
@@ -0,0 +1,12 @@
+import { beforeEach, expect, test } from 'vitest';
+import { createEditor } from '../utils/setup.ts';
+
+const { cleanUp } = createEditor();
+
+beforeEach(() => {
+ return cleanUp;
+});
+
+test('basic', () => {
+ expect(window.editor).toBeDefined();
+});
diff --git a/packages/core/__tests__/env.d.ts b/packages/core/__tests__/env.d.ts
new file mode 100644
index 0000000..44cf89a
--- /dev/null
+++ b/packages/core/__tests__/env.d.ts
@@ -0,0 +1,7 @@
+import Editor from '../Editor';
+
+declare global {
+ interface Window {
+ editor: Editor;
+ }
+}
diff --git a/packages/core/__tests__/plugin/DringPlugin.spec.ts b/packages/core/__tests__/plugin/DringPlugin.spec.ts
new file mode 100644
index 0000000..2d4611d
--- /dev/null
+++ b/packages/core/__tests__/plugin/DringPlugin.spec.ts
@@ -0,0 +1,52 @@
+import { beforeEach, expect, test } from 'vitest';
+import { initPlugin } from '../utils/setup.ts';
+import { DringPlugin } from '../../plugin/DringPlugin.ts';
+import { wait, mouseDown, drag } from '../utils/common.ts';
+import { describe } from 'node:test';
+
+describe('canvas:drag', async () => {
+ const { pluginInstance, cleanUp } = initPlugin(DringPlugin);
+
+ beforeEach(() => {
+ return () => {
+ cleanUp();
+ (pluginInstance as DringPlugin).destroy();
+ };
+ });
+ test('dragMode is true', async () => {
+ const instance = pluginInstance as DringPlugin;
+ instance.dragMode = true;
+ const testCanvas = instance.canvas as ExtCanvas;
+ testCanvas.lastPosX = 0;
+ testCanvas.lastPosY = 0;
+ mouseDown(testCanvas, { x: 50, y: 50 });
+ await wait();
+ expect([testCanvas.lastPosX, testCanvas.lastPosY]).toEqual([50, 50]);
+ expect(testCanvas.isDragging).toEqual(true);
+ expect(testCanvas.selection).toEqual(false);
+ });
+
+ test('dragMode is false', async () => {
+ const instance = pluginInstance as DringPlugin;
+ instance.dragMode = false;
+ const testCanvas = instance.canvas as ExtCanvas;
+ testCanvas.lastPosX = 0;
+ testCanvas.lastPosY = 0;
+ mouseDown(testCanvas, { x: 50, y: 50 });
+ await wait();
+ expect([testCanvas.lastPosX, testCanvas.lastPosY]).toEqual([0, 0]);
+ });
+
+ test('canvas drag', async () => {
+ const instance = pluginInstance as DringPlugin;
+ instance.dragMode = false;
+ const testCanvas = pluginInstance.canvas as ExtCanvas;
+ testCanvas.lastPosX = 0;
+ testCanvas.lastPosY = 0;
+ drag(testCanvas, { x: 50, y: 50 }, { x: 100, y: 100 });
+ await wait();
+ expect([testCanvas.lastPosX, testCanvas.lastPosY]).toEqual([100, 100]);
+ expect(testCanvas.isDragging).toEqual(false);
+ expect(testCanvas.selection).toEqual(true);
+ });
+});
diff --git a/packages/core/__tests__/utils/common.ts b/packages/core/__tests__/utils/common.ts
new file mode 100644
index 0000000..87eb0ab
--- /dev/null
+++ b/packages/core/__tests__/utils/common.ts
@@ -0,0 +1,63 @@
+export function wait(time = 0) {
+ return new Promise((resolve) => {
+ requestAnimationFrame(() => {
+ setTimeout(resolve, time);
+ });
+ });
+}
+
+/**
+ * simulate mouseDown event
+ * @param target
+ * @param position position relative to the target
+ */
+export function mouseDown(target: ExtCanvas, position: { x: number; y: number }) {
+ const clientX = target.lastPosX + position.x;
+ const clientY = target.lastPosY + position.y;
+ target.fire('mouse:down', { e: { clientX: clientX, clientY: clientY } });
+}
+
+/**
+ * simulate mouseMove event
+ * @param target
+ * @param position
+ */
+
+export function mouseMove(target: ExtCanvas, position: { x: number; y: number }) {
+ const clientX = position.x;
+ const clientY = position.y;
+ target.fire('mouse:move', { e: { clientX: clientX, clientY: clientY } });
+}
+
+/**
+ * simulate mouseUp event
+ * @param target
+ */
+
+export function mouseUp(target: ExtCanvas) {
+ target.fire('mouse:up');
+}
+
+export function drag(
+ target: ExtCanvas,
+ start: { x: number; y: number },
+ end: { x: number; y: number },
+ step = 5
+) {
+ mouseDown(target, start);
+ mouseMove(target, start);
+ if (step !== 0) {
+ const xStep = (end.x - start.x) / step;
+ const yStep = (end.y - start.y) / step;
+
+ for (const [i] of Array.from({ length: step }).entries()) {
+ mouseMove(target, {
+ x: xStep * (i + 1),
+ y: yStep * (i + 1),
+ });
+ }
+ }
+
+ mouseMove(target, end);
+ mouseUp(target);
+}
diff --git a/packages/core/__tests__/utils/setup.ts b/packages/core/__tests__/utils/setup.ts
new file mode 100644
index 0000000..b933b5d
--- /dev/null
+++ b/packages/core/__tests__/utils/setup.ts
@@ -0,0 +1,36 @@
+import Editor from '../../Editor.ts';
+import { fabric } from 'fabric';
+
+export function createEditor() {
+ const editor = new Editor();
+ const canvasElement = document.createElement('canvas');
+ canvasElement.id = 'canvas';
+ const canvas = new fabric.Canvas('canvas', {
+ fireRightClick: true,
+ stopContextMenu: true,
+ controlsAboveOverlay: true,
+ imageSmoothingEnabled: false,
+ preserveObjectStacking: true,
+ });
+ editor.init(canvas);
+ window.editor = editor;
+
+ return {
+ cleanUp: editor.destory(),
+ };
+}
+
+export function initPlugin(plugin: any) {
+ const editor = new Editor();
+ const canvasElement = document.createElement('canvas');
+ canvasElement.id = 'canvas';
+ const canvas = new fabric.Canvas('canvas', {});
+ const pluginInstance = new plugin(canvas, editor);
+
+ return {
+ pluginInstance,
+ cleanUp: () => {
+ editor.destory();
+ },
+ };
+}
diff --git a/packages/core/assets/edgecontrol.svg b/packages/core/assets/edgecontrol.svg
new file mode 100644
index 0000000..8fe63b6
--- /dev/null
+++ b/packages/core/assets/edgecontrol.svg
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/core/assets/lock.svg b/packages/core/assets/lock.svg
new file mode 100644
index 0000000..a42429a
--- /dev/null
+++ b/packages/core/assets/lock.svg
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/core/assets/middlecontrol.svg b/packages/core/assets/middlecontrol.svg
new file mode 100644
index 0000000..53fb5b5
--- /dev/null
+++ b/packages/core/assets/middlecontrol.svg
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/core/assets/middlecontrolhoz.svg b/packages/core/assets/middlecontrolhoz.svg
new file mode 100644
index 0000000..ba05d9a
--- /dev/null
+++ b/packages/core/assets/middlecontrolhoz.svg
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/core/assets/rotateicon.svg b/packages/core/assets/rotateicon.svg
new file mode 100644
index 0000000..7b1d4db
--- /dev/null
+++ b/packages/core/assets/rotateicon.svg
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/core/eventType.ts b/packages/core/eventType.ts
new file mode 100644
index 0000000..2b28cb9
--- /dev/null
+++ b/packages/core/eventType.ts
@@ -0,0 +1,22 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2024-04-10 14:00:05
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-04-10 14:01:39
+ * @Description: 事件类型
+ */
+// 选择模式
+export enum SelectMode {
+ EMPTY = '',
+ ONE = 'one',
+ MULTI = 'multiple',
+}
+
+// 选择事件(用于广播)
+export enum SelectEvent {
+ ONE = 'selectOne',
+ MULTI = 'selectMultiple',
+ CANCEL = 'selectCancel',
+}
+
+export default { SelectMode, SelectEvent };
diff --git a/packages/core/index.ts b/packages/core/index.ts
new file mode 100644
index 0000000..c0ef129
--- /dev/null
+++ b/packages/core/index.ts
@@ -0,0 +1,51 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-02-03 23:29:34
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-07-06 12:36:22
+ * @Description: 核心入口文件
+ */
+import Editor from './Editor';
+export { default as DringPlugin } from './plugin/DringPlugin';
+export { default as AlignGuidLinePlugin } from './plugin/AlignGuidLinePlugin';
+export { default as ControlsPlugin } from './plugin/ControlsPlugin';
+export { default as ControlsRotatePlugin } from './plugin/ControlsRotatePlugin';
+export { default as CenterAlignPlugin } from './plugin/CenterAlignPlugin';
+export { default as LayerPlugin } from './plugin/LayerPlugin';
+export { default as CopyPlugin } from './plugin/CopyPlugin';
+export { default as MoveHotKeyPlugin } from './plugin/MoveHotKeyPlugin';
+export { default as DeleteHotKeyPlugin } from './plugin/DeleteHotKeyPlugin';
+export { default as GroupPlugin } from './plugin/GroupPlugin';
+export { default as DrawLinePlugin } from './plugin/DrawLinePlugin';
+export { default as GroupTextEditorPlugin } from './plugin/GroupTextEditorPlugin';
+export { default as GroupAlignPlugin } from './plugin/GroupAlignPlugin';
+export { default as WorkspacePlugin } from './plugin/WorkspacePlugin';
+export { default as MaskPlugin } from './plugin/MaskPlugin';
+export { default as HistoryPlugin } from './plugin/HistoryPlugin';
+export { default as FlipPlugin } from './plugin/FlipPlugin';
+export { default as RulerPlugin } from './plugin/RulerPlugin';
+export { default as MaterialPlugin } from './plugin/MaterialPlugin';
+export { default as WaterMarkPlugin } from './plugin/WaterMarkPlugin';
+export { default as FontPlugin } from './plugin/FontPlugin';
+export { default as PolygonModifyPlugin } from './plugin/PolygonModifyPlugin';
+export { default as DrawPolygonPlugin } from './plugin/DrawPolygonPlugin';
+export { default as FreeDrawPlugin } from './plugin/FreeDrawPlugin';
+export { default as PathTextPlugin } from './plugin/PathTextPlugin';
+export { default as PsdPlugin } from './plugin/PsdPlugin';
+export { default as SimpleClipImagePlugin } from './plugin/SimpleClipImagePlugin';
+export { default as BarCodePlugin } from './plugin/BarCodePlugin';
+export { default as QrCodePlugin } from './plugin/QrCodePlugin';
+export { default as ImageStroke } from './plugin/ImageStroke';
+export { default as ResizePlugin } from './plugin/ResizePlugin';
+export { default as LockPlugin } from './plugin/LockPlugin';
+export { default as AddBaseTypePlugin } from './plugin/AddBaseTypePlugin';
+import EventType from './eventType';
+import Utils from './utils/utils';
+import CustomRect from './objects/CustomRect';
+import CustomTextbox from './objects/CustomTextbox';
+// import { extend } from 'dayjs';
+
+export { EventType, Utils, CustomRect, CustomTextbox };
+export default Editor;
+
+export * from './interface/Editor';
diff --git a/packages/core/interface/Editor.ts b/packages/core/interface/Editor.ts
new file mode 100644
index 0000000..da9afaf
--- /dev/null
+++ b/packages/core/interface/Editor.ts
@@ -0,0 +1,48 @@
+import type Editor from '@kuaitu/core';
+
+// IEditor类型包含插件实例,Editor不包含插件实例
+// eslint-disable-next-line @typescript-eslint/no-empty-interface
+export interface IEditor extends Editor {}
+
+// 生命周期事件类型
+export type IEditorHooksType =
+ | 'hookImportBefore'
+ | 'hookImportAfter'
+ | 'hookSaveBefore'
+ | 'hookSaveAfter'
+ | 'hookTransform';
+
+// 插件实例
+export declare class IPluginTempl {
+ constructor(canvas: fabric.Canvas, editor: IEditor, options?: IPluginOption);
+ static pluginName: string;
+ static events: string[];
+ static apis: string[];
+ hotkeyEvent?: (name: string, e: KeyboardEvent) => void;
+ hookImportBefore?: (...args: unknown[]) => Promise;
+ hookImportAfter?: (...args: unknown[]) => Promise;
+ hookSaveBefore?: (...args: unknown[]) => Promise;
+ hookSaveAfter?: (...args: unknown[]) => Promise;
+ hookTransform?: (...args: unknown[]) => Promise;
+ [propName: string]: any;
+ canvas?: fabric.Canvas;
+ editor?: IEditor;
+}
+
+export declare interface IPluginOption {
+ [propName: string]: unknown | undefined;
+}
+
+declare class IPluginClass2 extends IPluginTempl {
+ constructor();
+}
+// 插件class
+export declare interface IPluginClass {
+ new (canvas: fabric.Canvas, editor: Editor, options?: IPluginOption): IPluginClass2;
+}
+
+export declare interface IPluginMenu {
+ text: string;
+ command?: () => void;
+ child?: IPluginMenu[];
+}
diff --git a/packages/core/objects/Arrow.js b/packages/core/objects/Arrow.js
new file mode 100644
index 0000000..b5a1613
--- /dev/null
+++ b/packages/core/objects/Arrow.js
@@ -0,0 +1,51 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-01-07 01:15:50
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2023-02-08 00:08:40
+ * @Description: 箭头元素
+ */
+import { fabric } from 'fabric';
+
+fabric.Arrow = fabric.util.createClass(fabric.Line, {
+ type: 'arrow',
+ superType: 'drawing',
+ initialize(points, options) {
+ if (!points) {
+ const { x1, x2, y1, y2 } = options;
+ points = [x1, y1, x2, y2];
+ }
+ options = options || {};
+ this.callSuper('initialize', points, options);
+ },
+ _render(ctx) {
+ this.callSuper('_render', ctx);
+ ctx.save();
+ // 乘或除对应的scaleX(Y),抵消元素放缩造成的影响,使箭头不会变形
+ ctx.scale(1 / this.scaleX, 1 / this.scaleY);
+ const xDiff = (this.x2 - this.x1) * this.scaleX;
+ const yDiff = (this.y2 - this.y1) * this.scaleY;
+ const angle = Math.atan2(yDiff, xDiff);
+ ctx.translate(((this.x2 - this.x1) / 2) * this.scaleX, ((this.y2 - this.y1) / 2) * this.scaleY);
+ ctx.rotate(angle);
+ ctx.beginPath();
+ // Move 5px in front of line to start the arrow so it does not have the square line end showing in front (0,0)
+ ctx.moveTo(0, 0);
+ ctx.lineTo(-10, 5);
+ ctx.lineTo(-10, -5);
+ ctx.closePath();
+ ctx.lineWidth = this.lineWidth;
+ ctx.strokeStyle = this.stroke;
+ ctx.fillStyle = this.fill;
+ ctx.stroke();
+ ctx.fill();
+ ctx.restore();
+ },
+});
+
+fabric.Arrow.fromObject = (options, callback) => {
+ const { x1, x2, y1, y2 } = options;
+ return callback(new fabric.Arrow([x1, y1, x2, y2], options));
+};
+
+export default fabric.Arrow;
diff --git a/packages/core/objects/CustomRect.js b/packages/core/objects/CustomRect.js
new file mode 100644
index 0000000..71303ff
--- /dev/null
+++ b/packages/core/objects/CustomRect.js
@@ -0,0 +1,28 @@
+/*
+ * @Author: wuchenguang1998
+ * @Date: 2024-07-28 22:00:00
+ * @LastEditors: wuchenguang1998
+ * @LastEditTime: 2024-07-28 23:00:00
+ * @Description: 矩形元素,圆角属性适配元素放缩影响
+ */
+import { fabric } from 'fabric';
+
+fabric.Rect = fabric.util.createClass(fabric.Rect, {
+ type: 'rect',
+ initialize: function (options) {
+ options || (options = {});
+ this.callSuper('initialize', options);
+ },
+ _render(ctx) {
+ const roundValue = this.roundValue || 0;
+ this.rx = (1 / this.scaleX) * roundValue;
+ this.ry = (1 / this.scaleY) * roundValue;
+ this.callSuper('_render', ctx);
+ },
+});
+
+fabric.Rect.fromObject = function (object, callback) {
+ return fabric.Object._fromObject('Rect', object, callback);
+};
+
+export default fabric.Rect;
diff --git a/packages/core/objects/CustomTextbox.js b/packages/core/objects/CustomTextbox.js
new file mode 100644
index 0000000..4b765f3
--- /dev/null
+++ b/packages/core/objects/CustomTextbox.js
@@ -0,0 +1,118 @@
+/*
+ * 文本框,修改两端对齐逻辑
+ */
+import { fabric } from 'fabric';
+
+fabric.Textbox = fabric.util.createClass(fabric.Textbox, {
+ type: 'textbox',
+
+ _renderChars: function (method, ctx, line, left, top, lineIndex) {
+ // set proper line offset
+ var lineHeight = this.getHeightOfLine(lineIndex),
+ isJustify = this.textAlign.indexOf('justify') !== -1,
+ actualStyle,
+ nextStyle,
+ charsToRender = '',
+ charBox,
+ boxWidth = 0,
+ timeToRender,
+ path = this.path,
+ shortCut = !isJustify && this.charSpacing === 0 && this.isEmptyStyles(lineIndex) && !path,
+ isLtr = this.direction === 'ltr',
+ sign = this.direction === 'ltr' ? 1 : -1,
+ drawingLeft,
+ currentDirection = ctx.canvas.getAttribute('dir');
+ ctx.save();
+ if (currentDirection !== this.direction) {
+ ctx.canvas.setAttribute('dir', isLtr ? 'ltr' : 'rtl');
+ ctx.direction = isLtr ? 'ltr' : 'rtl';
+ ctx.textAlign = isLtr ? 'left' : 'right';
+ }
+ top -= (lineHeight * this._fontSizeFraction) / this.lineHeight;
+ if (shortCut) {
+ // render all the line in one pass without checking
+ // drawingLeft = isLtr ? left : left - this.getLineWidth(lineIndex);
+ this._renderChar(method, ctx, lineIndex, 0, line.join(''), left, top, lineHeight);
+ ctx.restore();
+ return;
+ }
+ for (var i = 0, len = line.length - 1; i <= len; i++) {
+ timeToRender = i === len || this.charSpacing || path;
+ charsToRender += line[i];
+ charBox = this.__charBounds[lineIndex][i];
+ if (boxWidth === 0) {
+ left += sign * (charBox.kernedWidth - charBox.width);
+ boxWidth += charBox.width;
+ } else {
+ boxWidth += charBox.kernedWidth;
+ }
+ if (isJustify && !timeToRender) {
+ if (this._reSpaceAndTab.test(line[i])) {
+ timeToRender = true;
+ }
+ }
+ if (!timeToRender) {
+ // if we have charSpacing, we render char by char
+ actualStyle = actualStyle || this.getCompleteStyleDeclaration(lineIndex, i);
+ nextStyle = this.getCompleteStyleDeclaration(lineIndex, i + 1);
+ timeToRender = fabric.util.hasStyleChanged(actualStyle, nextStyle, false);
+ }
+ // if (timeToRender) {
+ if (path) {
+ ctx.save();
+ ctx.translate(charBox.renderLeft, charBox.renderTop);
+ ctx.rotate(charBox.angle);
+ this._renderChar(method, ctx, lineIndex, i, charsToRender, -boxWidth / 2, 0, lineHeight);
+ ctx.restore();
+ } else {
+ drawingLeft = left;
+ this._renderChar(method, ctx, lineIndex, i, charsToRender, drawingLeft, top, lineHeight);
+ }
+ charsToRender = '';
+ actualStyle = nextStyle;
+ left += sign * boxWidth;
+ boxWidth = 0;
+ // }
+ }
+ ctx.restore();
+ },
+ enlargeSpaces: function () {
+ var diffSpace, currentLineWidth, numberOfSpaces, accumulatedSpace, line, charBound, spaces;
+ for (var i = 0, len = this._textLines.length; i < len; i++) {
+ if (this.textAlign !== 'justify' && (i === len - 1 || this.isEndOfWrapping(i))) {
+ continue;
+ }
+ accumulatedSpace = 0;
+ line = this._textLines[i];
+ currentLineWidth = this.getLineWidth(i);
+ if (
+ currentLineWidth < this.width &&
+ (spaces = this.textLines[i].split('')) &&
+ spaces.length > 1
+ ) {
+ numberOfSpaces = spaces.length;
+ diffSpace = (this.width - currentLineWidth) / (numberOfSpaces - 1);
+ for (var j = 0, jlen = line.length; j <= jlen; j++) {
+ charBound = this.__charBounds[i][j];
+ // if (this._reSpaceAndTab.test(line[j])) {
+ charBound.left += accumulatedSpace;
+ if (j < jlen - 1) {
+ charBound.width += diffSpace;
+ charBound.kernedWidth += diffSpace;
+ accumulatedSpace += diffSpace;
+ }
+ // } else {
+ // charBound.left += accumulatedSpace;
+ // }
+ }
+ }
+ }
+ },
+});
+
+fabric.Textbox.fromObject = function (options, callback) {
+ const { text } = options;
+ return callback(new fabric.Textbox(text, options));
+};
+
+export default fabric.Rect;
diff --git a/packages/core/objects/ThinTailArrow.js b/packages/core/objects/ThinTailArrow.js
new file mode 100644
index 0000000..fb41da1
--- /dev/null
+++ b/packages/core/objects/ThinTailArrow.js
@@ -0,0 +1,57 @@
+/*
+ * @Author: wuchenguang1998
+ * @Date: 2024-05-10 10:46:10
+ * @LastEditors: wuchenguang1998
+ * @LastEditTime: 2024-05-10 22:08:51
+ * @Description: 细尾箭头,支持控制条拖拽不变形
+ */
+import { fabric } from 'fabric';
+
+fabric.ThinTailArrow = fabric.util.createClass(fabric.Line, {
+ type: 'thinTailArrow',
+ superType: 'drawing',
+ initialize(points, options) {
+ if (!points) {
+ const { x1, x2, y1, y2 } = options;
+ points = [x1, y1, x2, y2];
+ }
+ options = options || {};
+ this.callSuper('initialize', points, options);
+ },
+ _render(ctx) {
+ ctx.save();
+ // 乘或除对应的scaleX(Y),抵消元素放缩造成的影响,使箭头不会变形
+ ctx.scale(1 / this.scaleX, 1 / this.scaleY);
+ const xDiff = (this.x2 - this.x1) * this.scaleX;
+ const yDiff = (this.y2 - this.y1) * this.scaleY;
+ ctx.translate(-xDiff / 2, -yDiff / 2);
+ // 箭头方位角
+ const angle = Math.atan2(yDiff, xDiff);
+ ctx.rotate(angle);
+ // 箭头总长(最小长度是20)
+ let length = Math.hypot(xDiff, yDiff);
+ length = length < 20 ? 20 : length;
+ // 绘制箭头
+ ctx.beginPath();
+ ctx.moveTo(0, 0);
+ ctx.lineTo(length - 18, -5);
+ ctx.lineTo(length - 20, -12);
+ ctx.lineTo(length, 0);
+ ctx.lineTo(length - 20, 12);
+ ctx.lineTo(length - 18, 5);
+ ctx.lineTo(0, 0);
+ ctx.lineWidth = this.strokeWidth;
+ ctx.strokeStyle = this.stroke;
+ ctx.fillStyle = this.fill;
+ ctx.stroke();
+ ctx.fill();
+ ctx.restore();
+ },
+});
+
+fabric.ThinTailArrow.fromObject = (options, callback) => {
+ const { x1, x2, y1, y2 } = options;
+ return callback(new fabric.ThinTailArrow([x1, y1, x2, y2], options));
+};
+
+export default fabric.ThinTailArrow;
diff --git a/packages/core/package.json b/packages/core/package.json
new file mode 100644
index 0000000..87bfb00
--- /dev/null
+++ b/packages/core/package.json
@@ -0,0 +1,31 @@
+{
+ "name": "@kuaitu/core",
+ "version": "1.0.0",
+ "description": "",
+ "main": "index.ts",
+ "scripts": {
+ "build": "vite build",
+ "test": "vitest"
+ },
+ "dependencies": {
+ "@webtoon/psd": "^0.4.0",
+ "events": "^3.3.0",
+ "fabric-history": "^1.6.0",
+ "fontfaceobserver": "^2.1.0",
+ "hotkeys-js": "^3.8.8",
+ "jsbarcode": "^3.11.6",
+ "qr-code-styling": "1.6.0-rc.1",
+ "qs": "^6.12.1",
+ "tapable": "^2.2.1",
+ "uuid": "^8.3.2"
+ },
+ "keywords": [],
+ "author": "",
+ "license": "ISC",
+ "devDependencies": {
+ "@types/jsdom": "^21.1.6",
+ "@types/qs": "^6.9.15",
+ "jsdom": "^24.0.0",
+ "vitest": "^1.6.0"
+ }
+}
diff --git a/packages/core/plugin.ts b/packages/core/plugin.ts
new file mode 100644
index 0000000..b52c73f
--- /dev/null
+++ b/packages/core/plugin.ts
@@ -0,0 +1,84 @@
+import Editor from './Editor';
+type IEditor = Editor;
+
+class FontPlugin {
+ public canvas: fabric.Canvas;
+ public editor: IEditor;
+ // 插件名称
+ static pluginName = 'FontPlugin';
+ // 挂载API名称
+ static apis = ['downFontByJSON'];
+ // 发布事件
+ static events = ['textEvent1', 'textEvent2'];
+ // 快捷键 keyCode hotkeys-js
+ public hotkeys: string[] = ['backspace', 'space'];
+ // 私有属性
+ repoSrc: string;
+
+ constructor(canvas: fabric.Canvas, editor: IEditor, config: { repoSrc: string }) {
+ // 初始化
+ this.canvas = canvas;
+ this.editor = editor;
+ // 可插入外部配置
+ this.repoSrc = config.repoSrc;
+ }
+
+ // 钩子函数 hookImportAfter/hookSaveBefore/hookSaveAfter Promise
+ hookImportBefore(json: string) {
+ return this.downFontByJSON(json);
+ }
+
+ // 挂载API方法
+ downFontByJSON() {
+ //
+ }
+
+ // 私有方法 + 发布事件
+ _createFontCSS() {
+ const params = [];
+ this.editor.emit('textEvent1', params);
+ }
+
+ // 右键菜单
+ contextMenu() {
+ const selectedMode = this.editor.getSelectMode();
+ if (selectedMode === SelectMode.ONE) {
+ return [
+ null, // 分割线
+ {
+ text: '翻转',
+ hotkey: '❯',
+ subitems: [
+ {
+ text: t('flip.x'),
+ hotkey: '|',
+ onclick: () => this.flip('X'),
+ },
+ {
+ text: t('flip.y'),
+ hotkey: '-',
+ onclick: () => this.flip('Y'),
+ },
+ ],
+ },
+ ];
+ }
+ }
+
+ // 快捷键
+ hotkeyEvent(eventName: string, { type }: KeyboardEvent) {
+ // eventName:hotkeys中的属性 backspace、space
+ // type:keyUp keyDown
+ // code:hotkeys-js Code
+ if (eventName === 'backspace' && type === 'keydown') {
+ this.del();
+ }
+ }
+
+ // 注销
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default FontPlugin;
diff --git a/packages/core/plugin/AddBaseTypePlugin.ts b/packages/core/plugin/AddBaseTypePlugin.ts
new file mode 100644
index 0000000..3f61b1b
--- /dev/null
+++ b/packages/core/plugin/AddBaseTypePlugin.ts
@@ -0,0 +1,110 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2024-07-06 12:34:00
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-07-06 17:11:03
+ * @Description: 基础元素类型添加
+ */
+
+import { fabric } from 'fabric';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+import { v4 as uuid } from 'uuid';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+export default class AddBaseTypePlugin implements IPluginTempl {
+ static pluginName = 'AddBaseTypePlugin';
+ static apis = ['addBaseType', 'createImgByElement'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.editor = editor;
+ this.canvas = canvas;
+ }
+
+ addBaseType(
+ item: fabric.Object,
+ optons?: {
+ event: DragEvent;
+ scale: boolean;
+ center: boolean;
+ }
+ ) {
+ const { event = false, scale = false, center = true } = optons || {};
+ item.set({
+ id: uuid(),
+ });
+ scale && this._toScale(item);
+ event && this._toEvent(item, event);
+ this.canvas.add(item);
+ if (!event && center) {
+ this._toCenter(item);
+ }
+ this.canvas.setActiveObject(item);
+ this.canvas.renderAll();
+ this.editor.saveState();
+ }
+
+ _toEvent(item: fabric.Object, event: DragEvent) {
+ const { left, top } = this.canvas.getSelectionElement().getBoundingClientRect();
+ if (event.x < left || event.y < top || item.width === undefined) return;
+ const point = {
+ x: event.x - left,
+ y: event.y - top,
+ };
+ const pointerVpt = this.canvas.restorePointerVpt(point);
+ item.set({
+ left: pointerVpt.x,
+ top: pointerVpt.y,
+ });
+ }
+
+ _toCenter(item: fabric.Object) {
+ this.canvas.setActiveObject(item);
+ this.editor.position('center');
+ }
+
+ _toScale(item: fabric.Object) {
+ const { width } = this.editor.getWorkspase();
+ if (width === undefined) return;
+ item.scaleToWidth(width / 2);
+ }
+
+ createImgByElement(target: HTMLImageElement) {
+ return new Promise((resolve) => {
+ const imgType = this.getImageExtension(target.src);
+ if (imgType === 'svg') {
+ fabric.loadSVGFromURL(target.src, (objects) => {
+ const item = fabric.util.groupSVGElements(objects, {
+ shadow: '',
+ fontFamily: 'arial',
+ name: 'svg元素',
+ });
+ resolve(item);
+ });
+ } else {
+ fabric.Image.fromURL(
+ target.src,
+ (imgEl) => {
+ resolve(imgEl);
+ },
+ { crossOrigin: 'anonymous' }
+ );
+ }
+ });
+ }
+
+ getImageExtension(imageUrl: string) {
+ const pathParts = imageUrl.split('/');
+ const filename = pathParts[pathParts.length - 1];
+ const fileParts = filename.split('.');
+ return fileParts[fileParts.length - 1];
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
diff --git a/packages/core/plugin/AlignGuidLinePlugin.ts b/packages/core/plugin/AlignGuidLinePlugin.ts
new file mode 100644
index 0000000..ff6a24a
--- /dev/null
+++ b/packages/core/plugin/AlignGuidLinePlugin.ts
@@ -0,0 +1,812 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-05-21 08:55:25
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-04-10 17:32:48
+ * @Description: 辅助线功能
+ */
+import { fabric } from 'fabric';
+import { IEditor, IPluginTempl } from '@kuaitu/core';
+
+declare interface VerticalLine {
+ x: number;
+ y1: number;
+ y2: number;
+}
+
+declare interface HorizontalLine {
+ x1: number;
+ x2: number;
+ y: number;
+}
+
+class AlignGuidLinePlugin implements IPluginTempl {
+ defautOption = {
+ color: 'rgba(255,95,95,1)',
+ width: 1,
+ };
+ static pluginName = 'AlignGuidLinePlugin';
+ dragMode = false;
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.dragMode = false;
+ this.init();
+ }
+ init() {
+ const { canvas } = this;
+ const ctx = canvas.getSelectionContext();
+ const aligningLineOffset = 5;
+ const aligningLineMargin = 4;
+ const This = this;
+ let viewportTransform: number[] | undefined;
+ let zoom = 1;
+ let activeWidth = 0;
+ let activeHeight = 0;
+ let activeLeft = 0;
+ let activeTop = 0;
+
+ function drawVerticalLine(coords: VerticalLine) {
+ drawLine(
+ coords.x + 0.5,
+ coords.y1 > coords.y2 ? coords.y2 : coords.y1,
+ coords.x + 0.5,
+ coords.y2 > coords.y1 ? coords.y2 : coords.y1
+ );
+ }
+
+ function drawHorizontalLine(coords: HorizontalLine) {
+ drawLine(
+ coords.x1 > coords.x2 ? coords.x2 : coords.x1,
+ coords.y + 0.5,
+ coords.x2 > coords.x1 ? coords.x2 : coords.x1,
+ coords.y + 0.5
+ );
+ }
+
+ function drawLine(x1: number, y1: number, x2: number, y2: number) {
+ if (viewportTransform == null) return;
+
+ ctx.moveTo(x1 * zoom + viewportTransform[4], y1 * zoom + viewportTransform[5]);
+ ctx.lineTo(x2 * zoom + viewportTransform[4], y2 * zoom + viewportTransform[5]);
+ }
+
+ function isInRange(value1: number, value2: number) {
+ value1 = Math.round(value1);
+ value2 = Math.round(value2);
+ for (let i = value1 - aligningLineMargin, len = value1 + aligningLineMargin; i <= len; i++) {
+ if (i === value2) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ let verticalLines: VerticalLine[] = [];
+ let horizontalLines: HorizontalLine[] = [];
+
+ canvas.on('mouse:down', (e) => {
+ viewportTransform = canvas.viewportTransform;
+ zoom = canvas.getZoom();
+ try {
+ if (e) {
+ activeLeft = e.target.left;
+ activeTop = e.target.top;
+ activeWidth = e.target.getScaledWidth();
+ activeHeight = e.target.getScaledHeight();
+ }
+ } catch (e) {}
+ });
+
+ canvas.on('object:moving', (e) => {
+
+
+ if (viewportTransform === undefined || e.target === undefined) return;
+
+ const activeObject = e.target;
+ const canvasObjects = canvas.getObjects();
+ const activeObjectCenter = activeObject.getCenterPoint();
+ const activeObjectLeft = activeObjectCenter.x;
+ const activeObjectTop = activeObjectCenter.y;
+ const activeObjectBoundingRect = activeObject.getBoundingRect();
+ const activeObjectHeight = activeObject.getScaledHeight();
+ const activeObjectWidth = activeObject.getScaledWidth();
+ let horizontalInTheRange = false;
+ let verticalInTheRange = false;
+ const transform = canvas._currentTransform;
+
+ //到达位置
+ let reachLeft = false; //左
+ let reachTop = false; //上
+
+ //距离
+ let _elReachLeft = 0; //左距离
+ let _elReachTop = 0; //上距离
+
+ activeObject.set('hasControls', false);
+
+ if (!transform) return;
+
+ for (let i = canvasObjects.length; i--; ) {
+ // eslint-disable-next-line no-continue
+ if (canvasObjects[i] === activeObject) continue;
+
+ // 排除辅助线
+ if (
+ activeObject instanceof fabric.GuideLine &&
+ canvasObjects[i] instanceof fabric.GuideLine
+ ) {
+ continue;
+ }
+
+ const objectCenter = canvasObjects[i].getCenterPoint();
+ const objectLeft = objectCenter.x;
+ const objectTop = objectCenter.y;
+ const objectBoundingRect = canvasObjects[i].getBoundingRect();
+ const objectHeight = objectBoundingRect.height / viewportTransform[3];
+ const objectWidth = objectBoundingRect.width / viewportTransform[0];
+
+ // snap by the horizontal center line
+ //水平中心线
+ if (isInRange(objectLeft, activeObjectLeft)) {
+ verticalInTheRange = true;
+ verticalLines = [];
+ verticalLines.push({
+ x: objectLeft,
+ y1:
+ objectTop < activeObjectTop
+ ? objectTop - objectHeight / 2 - aligningLineOffset
+ : objectTop + objectHeight / 2 + aligningLineOffset,
+ y2:
+ activeObjectTop > objectTop
+ ? activeObjectTop + activeObjectHeight / 2 + aligningLineOffset
+ : activeObjectTop - activeObjectHeight / 2 - aligningLineOffset,
+ });
+ activeObject.setPositionByOrigin(
+ new fabric.Point(objectLeft, activeObjectTop),
+ 'center',
+ 'center'
+ );
+ }
+
+ // snap by the vertical center line
+ //垂直中心线
+ if (isInRange(objectTop, activeObjectTop)) {
+ horizontalInTheRange = true;
+ horizontalLines = [];
+ horizontalLines.push({
+ y: objectTop,
+ x1:
+ objectLeft < activeObjectLeft
+ ? objectLeft - objectWidth / 2 - aligningLineOffset
+ : objectLeft + objectWidth / 2 + aligningLineOffset,
+ x2:
+ activeObjectLeft > objectLeft
+ ? activeObjectLeft + activeObjectWidth / 2 + aligningLineOffset
+ : activeObjectLeft - activeObjectWidth / 2 - aligningLineOffset,
+ });
+ activeObject.setPositionByOrigin(
+ new fabric.Point(activeObjectLeft, objectTop),
+ 'center',
+ 'center'
+ );
+ }
+ // snap by the left edge
+ //左边线
+ if (isInRange(objectLeft - objectWidth / 2, activeObjectLeft - activeObjectWidth / 2)) {
+ verticalInTheRange = true;
+ verticalLines = [];
+ reachLeft = true;
+ verticalLines.push({
+ x: objectLeft - objectWidth / 2,
+ y1:
+ objectTop < activeObjectTop
+ ? objectTop - objectHeight / 2 - aligningLineOffset
+ : objectTop + objectHeight / 2 + aligningLineOffset,
+ y2:
+ activeObjectTop > objectTop
+ ? activeObjectTop + activeObjectHeight / 2 + aligningLineOffset
+ : activeObjectTop - activeObjectHeight / 2 - aligningLineOffset,
+ });
+ _elReachLeft = objectLeft - objectWidth / 2 + activeObjectWidth / 2;
+ let x = objectLeft - objectWidth / 2 + activeObjectWidth / 2;
+ let y = reachTop ? _elReachTop : activeObjectTop;
+
+ activeObject.setPositionByOrigin(new fabric.Point(x, y), 'center', 'center');
+ }
+
+ // snap by the right edge
+ //右边线
+ if (isInRange(objectLeft + objectWidth / 2, activeObjectLeft + activeObjectWidth / 2)) {
+ reachLeft = true;
+ verticalInTheRange = true;
+ verticalLines = [];
+ verticalLines.push({
+ x: objectLeft + objectWidth / 2,
+ y1:
+ objectTop < activeObjectTop
+ ? objectTop - objectHeight / 2 - aligningLineOffset
+ : objectTop + objectHeight / 2 + aligningLineOffset,
+ y2:
+ activeObjectTop > objectTop
+ ? activeObjectTop + activeObjectHeight / 2 + aligningLineOffset
+ : activeObjectTop - activeObjectHeight / 2 - aligningLineOffset,
+ });
+ _elReachLeft = objectLeft + objectWidth / 2 - activeObjectWidth / 2;
+ let x = objectLeft + objectWidth / 2 - activeObjectWidth / 2;
+ let y = reachTop ? _elReachTop : activeObjectTop;
+ activeObject.setPositionByOrigin(new fabric.Point(x, y), 'center', 'center');
+ }
+
+ // snap by the top edge
+ //上边线
+ if (isInRange(objectTop - objectHeight / 2, activeObjectTop - activeObjectHeight / 2)) {
+ reachTop = true;
+ horizontalInTheRange = true;
+ horizontalLines = [];
+ horizontalLines.push({
+ y: objectTop - objectHeight / 2,
+ x1:
+ objectLeft < activeObjectLeft
+ ? objectLeft - objectWidth / 2 - aligningLineOffset
+ : objectLeft + objectWidth / 2 + aligningLineOffset,
+ x2:
+ activeObjectLeft > objectLeft
+ ? activeObjectLeft + activeObjectWidth / 2 + aligningLineOffset
+ : activeObjectLeft - activeObjectWidth / 2 - aligningLineOffset,
+ });
+ _elReachTop = objectTop - objectHeight / 2 + activeObjectHeight / 2;
+ let x = reachLeft ? _elReachLeft : activeObjectLeft;
+ let y = objectTop - objectHeight / 2 + activeObjectHeight / 2;
+ activeObject.setPositionByOrigin(new fabric.Point(x, y), 'center', 'center');
+ }
+
+ // snap by the bottom edge
+ //底边线
+ if (isInRange(objectTop + objectHeight / 2, activeObjectTop + activeObjectHeight / 2)) {
+ reachTop = true;
+
+ horizontalInTheRange = true;
+ horizontalLines = [];
+ horizontalLines.push({
+ y: objectTop + objectHeight / 2,
+ x1:
+ objectLeft < activeObjectLeft
+ ? objectLeft - objectWidth / 2 - aligningLineOffset
+ : objectLeft + objectWidth / 2 + aligningLineOffset,
+ x2:
+ activeObjectLeft > objectLeft
+ ? activeObjectLeft + activeObjectWidth / 2 + aligningLineOffset
+ : activeObjectLeft - activeObjectWidth / 2 - aligningLineOffset,
+ });
+ _elReachTop = objectTop + objectHeight / 2 - activeObjectHeight / 2;
+ let x = reachLeft ? _elReachLeft : activeObjectLeft;
+ let y = objectTop + objectHeight / 2 - activeObjectHeight / 2;
+ activeObject.setPositionByOrigin(new fabric.Point(x, y), 'center', 'center');
+ }
+
+ //左边线和右边线
+ if (isInRange(objectLeft - objectWidth / 2, activeObjectLeft + activeObjectWidth / 2)) {
+ reachLeft = true;
+ verticalInTheRange = true;
+ verticalInTheRange = [];
+ verticalLines.push({
+ x: objectLeft - objectWidth / 2,
+ y1:
+ objectTop < activeObjectTop
+ ? objectTop - objectHeight / 2 - aligningLineOffset
+ : objectTop + objectHeight / 2 + aligningLineOffset,
+ y2:
+ activeObjectTop > objectTop
+ ? activeObjectTop + activeObjectHeight / 2 + aligningLineOffset
+ : activeObjectTop - activeObjectHeight / 2 - aligningLineOffset,
+ });
+
+ _elReachLeft = objectLeft - objectWidth / 2 - activeObjectWidth / 2;
+ let x = objectLeft - objectWidth / 2 - activeObjectWidth / 2;
+ let y = activeObjectTop;
+
+ activeObject.setPositionByOrigin(new fabric.Point(x, y), 'center', 'center');
+ }
+ //右边线和左边线
+ if (isInRange(objectLeft + objectWidth / 2, activeObjectLeft - activeObjectWidth / 2)) {
+ reachLeft = true;
+ verticalInTheRange = true;
+ verticalInTheRange = [];
+ verticalLines.push({
+ x: objectLeft + objectWidth / 2,
+ y1:
+ objectTop < activeObjectTop
+ ? objectTop - objectHeight / 2 - aligningLineOffset
+ : objectTop + objectHeight / 2 + aligningLineOffset,
+ y2:
+ activeObjectTop > objectTop
+ ? activeObjectTop + activeObjectHeight / 2 + aligningLineOffset
+ : activeObjectTop - activeObjectHeight / 2 - aligningLineOffset,
+ });
+ _elReachLeft = objectLeft + objectWidth / 2 + activeObjectWidth / 2;
+
+ let x = objectLeft + objectWidth / 2 + activeObjectWidth / 2;
+ let y = activeObjectTop;
+
+ activeObject.setPositionByOrigin(new fabric.Point(x, y), 'center', 'center');
+ }
+ //上边线和下边线
+ if (isInRange(objectTop - objectHeight / 2, activeObjectTop + activeObjectHeight / 2)) {
+ reachTop = true;
+ horizontalInTheRange = true;
+ horizontalLines = [];
+ horizontalLines.push({
+ y: objectTop - objectHeight / 2,
+ x1:
+ objectLeft < activeObjectLeft
+ ? objectLeft - objectWidth / 2 - aligningLineOffset
+ : objectLeft + objectWidth / 2 + aligningLineOffset,
+ x2:
+ activeObjectLeft > objectLeft
+ ? activeObjectLeft + activeObjectWidth / 2 + aligningLineOffset
+ : activeObjectLeft - activeObjectWidth / 2 - aligningLineOffset,
+ });
+ _elReachTop = objectTop - objectHeight / 2 - activeObjectHeight / 2;
+
+ let x = reachLeft ? _elReachLeft : activeObjectLeft;
+ let y = objectTop - objectHeight / 2 - activeObjectHeight / 2;
+ activeObject.setPositionByOrigin(new fabric.Point(x, y), 'center', 'center');
+ }
+ //下边线和上变线
+ if (isInRange(objectTop + objectHeight / 2, activeObjectTop - activeObjectHeight / 2)) {
+ reachTop = true;
+ horizontalInTheRange = true;
+ horizontalLines = [];
+ horizontalLines.push({
+ y: objectTop + objectHeight / 2,
+ x1:
+ objectLeft < activeObjectLeft
+ ? objectLeft - objectWidth / 2 - aligningLineOffset
+ : objectLeft + objectWidth / 2 + aligningLineOffset,
+ x2:
+ activeObjectLeft > objectLeft
+ ? activeObjectLeft + activeObjectWidth / 2 + aligningLineOffset
+ : activeObjectLeft - activeObjectWidth / 2 - aligningLineOffset,
+ });
+ _elReachTop = objectTop + objectHeight / 2 + activeObjectHeight / 2;
+ let x = reachLeft ? _elReachLeft : activeObjectLeft;
+ let y = objectTop + objectHeight / 2 + activeObjectHeight / 2;
+ activeObject.setPositionByOrigin(new fabric.Point(x, y), 'center', 'center');
+ }
+ }
+
+ if (!horizontalInTheRange) {
+ horizontalLines.length = 0;
+ }
+
+ if (!verticalInTheRange) {
+ verticalLines.length = 0;
+ }
+ });
+
+ canvas.on('before:render', () => {
+ // fix 保存图片时报错
+ if (canvas.contextTop === null) {
+ return;
+ }
+ try {
+ canvas.clearContext(canvas.contextTop);
+ } catch (error) {
+ console.log(error);
+ }
+ });
+
+
+ canvas.on('object:scaling', (e) => {
+
+
+ if (viewportTransform === undefined || e.target === undefined) return;
+
+ const activeObject = e.target;
+ const canvasObjects = canvas.getObjects();
+ const activeObjectCenter = activeObject.getCenterPoint();
+ const activeObjectLeft = activeObjectCenter.x;
+ const activeObjectTop = activeObjectCenter.y;
+ const activeObjectBoundingRect = activeObject.getBoundingRect();
+ const activeObjectHeight = activeObject.getScaledHeight();
+ const activeObjectWidth = activeObject.getScaledWidth();
+ let horizontalInTheRange = false;
+ let verticalInTheRange = false;
+ const transform = canvas._currentTransform;
+
+ activeObject.set('hasControls', false);
+ if (!transform) return;
+
+ for (let i = canvasObjects.length; i--; ) {
+ // eslint-disable-next-line no-continue
+ if (canvasObjects[i] === activeObject) continue;
+
+ // 排除辅助线
+ if (
+ activeObject instanceof fabric.GuideLine &&
+ canvasObjects[i] instanceof fabric.GuideLine
+ ) {
+ continue;
+ }
+
+ const objectCenter = canvasObjects[i].getCenterPoint();
+ const objectLeft = objectCenter.x;
+ const objectTop = objectCenter.y;
+ const objectBoundingRect = canvasObjects[i].getBoundingRect();
+ const objectHeight = objectBoundingRect.height / viewportTransform[3];
+ const objectWidth = objectBoundingRect.width / viewportTransform[0];
+
+ // snap by the horizontal center line
+ //水平中心线
+ if (isInRange(objectLeft, activeObjectLeft)) {
+ verticalInTheRange = true;
+ verticalLines = [];
+ verticalLines.push({
+ x: objectLeft,
+ y1:
+ objectTop < activeObjectTop
+ ? objectTop - objectHeight / 2 - aligningLineOffset
+ : objectTop + objectHeight / 2 + aligningLineOffset,
+ y2:
+ activeObjectTop > objectTop
+ ? activeObjectTop + activeObjectHeight / 2 + aligningLineOffset
+ : activeObjectTop - activeObjectHeight / 2 - aligningLineOffset,
+ });
+ }
+
+ // snap by the left edge
+ //左边线
+ if (isInRange(objectLeft - objectWidth / 2, activeObjectLeft - activeObjectWidth / 2)) {
+ verticalInTheRange = true;
+ verticalLines = [];
+ verticalLines.push({
+ x: objectLeft - objectWidth / 2,
+ y1:
+ objectTop < activeObjectTop
+ ? objectTop - objectHeight / 2 - aligningLineOffset
+ : objectTop + objectHeight / 2 + aligningLineOffset,
+ y2:
+ activeObjectTop > objectTop
+ ? activeObjectTop + activeObjectHeight / 2 + aligningLineOffset
+ : activeObjectTop - activeObjectHeight / 2 - aligningLineOffset,
+ });
+
+ let leftRight = new Map([
+ ['bl', 1],
+ ['ml', 1],
+ ['tl', 1],
+ ]);
+ if (leftRight.get(e.transform.corner)) {
+ activeObject.setPositionByOrigin(
+ new fabric.Point(
+ objectLeft - objectWidth / 2 + activeObjectWidth / 2,
+ activeObjectTop
+ ),
+ 'center',
+ 'center'
+ );
+
+ activeObject.set(
+ 'scaleX',
+ ((activeLeft - (objectLeft - objectWidth / 2) + activeWidth) * activeObject.scaleX) /
+ activeObject.getScaledWidth()
+ );
+ break;
+ }
+ }
+
+ // snap by the right edge
+ //右边线
+ if (isInRange(objectLeft + objectWidth / 2, activeObjectLeft + activeObjectWidth / 2)) {
+ verticalInTheRange = true;
+ verticalLines = [];
+ verticalLines.push({
+ x: objectLeft + objectWidth / 2,
+ y1:
+ objectTop < activeObjectTop
+ ? objectTop - objectHeight / 2 - aligningLineOffset
+ : objectTop + objectHeight / 2 + aligningLineOffset,
+ y2:
+ activeObjectTop > objectTop
+ ? activeObjectTop + activeObjectHeight / 2 + aligningLineOffset
+ : activeObjectTop - activeObjectHeight / 2 - aligningLineOffset,
+ });
+
+ let Right = new Map([
+ ['mr', 1],
+ ['tr', 1],
+ ['br', 1],
+ ]);
+
+ if (Right.get(e.transform.corner)) {
+ activeObject.set(
+ 'scaleX',
+ ((objectLeft + objectWidth / 2 - (activeLeft + activeWidth) + activeWidth) *
+ activeObject.scaleX) /
+ activeObject.getScaledWidth()
+ );
+ break;
+ }
+ }
+
+ // snap by the vertical center line
+ //垂直中心线
+ if (isInRange(objectTop, activeObjectTop)) {
+ horizontalInTheRange = true;
+ horizontalLines = [];
+ horizontalLines.push({
+ y: objectTop,
+ x1:
+ objectLeft < activeObjectLeft
+ ? objectLeft - objectWidth / 2 - aligningLineOffset
+ : objectLeft + objectWidth / 2 + aligningLineOffset,
+ x2:
+ activeObjectLeft > objectLeft
+ ? activeObjectLeft + activeObjectWidth / 2 + aligningLineOffset
+ : activeObjectLeft - activeObjectWidth / 2 - aligningLineOffset,
+ });
+ }
+
+ // snap by the top edge
+ if (isInRange(objectTop - objectHeight / 2, activeObjectTop - activeObjectHeight / 2)) {
+ horizontalInTheRange = true;
+ horizontalLines = [];
+ horizontalLines.push({
+ y: objectTop - objectHeight / 2,
+ x1:
+ objectLeft < activeObjectLeft
+ ? objectLeft - objectWidth / 2 - aligningLineOffset
+ : objectLeft + objectWidth / 2 + aligningLineOffset,
+ x2:
+ activeObjectLeft > objectLeft
+ ? activeObjectLeft + activeObjectWidth / 2 + aligningLineOffset
+ : activeObjectLeft - activeObjectWidth / 2 - aligningLineOffset,
+ });
+
+ let bottomRight = new Map([
+ ['tr', 1],
+ ['tl', 1],
+ ['mt', 1],
+ ]);
+
+ if (bottomRight.get(e.transform.corner)) {
+ activeObject.setPositionByOrigin(
+ new fabric.Point(
+ activeObjectLeft,
+ objectTop - objectHeight / 2 + activeObjectHeight / 2
+ ),
+ 'center',
+ 'center'
+ );
+
+ activeObject.set(
+ 'scaleY',
+ ((activeTop + activeHeight - (objectTop - objectHeight / 2)) * activeObject.scaleY) /
+ activeObject.getScaledHeight()
+ );
+ break;
+ }
+ }
+
+ // snap by the bottom edge
+ if (isInRange(objectTop + objectHeight / 2, activeObjectTop + activeObjectHeight / 2)) {
+ horizontalInTheRange = true;
+ horizontalLines = [];
+ horizontalLines.push({
+ y: objectTop + objectHeight / 2,
+ x1:
+ objectLeft < activeObjectLeft
+ ? objectLeft - objectWidth / 2 - aligningLineOffset
+ : objectLeft + objectWidth / 2 + aligningLineOffset,
+ x2:
+ activeObjectLeft > objectLeft
+ ? activeObjectLeft + activeObjectWidth / 2 + aligningLineOffset
+ : activeObjectLeft - activeObjectWidth / 2 - aligningLineOffset,
+ });
+
+ let bottom = new Map([
+ ['mb', 1],
+ ['bl', 1],
+ ['br', 1],
+ ]);
+ if (bottom.get(e.transform.corner)) {
+ activeObject.set(
+ 'scaleY',
+ ((objectTop + objectHeight / 2 - (activeTop + activeHeight) + activeHeight) *
+ activeObject.scaleY) /
+ activeObject.getScaledHeight()
+ );
+ break;
+ }
+ }
+
+ //左边线和右边线
+ if (isInRange(objectLeft - objectWidth / 2, activeObjectLeft + activeObjectWidth / 2)) {
+ verticalInTheRange = true;
+ verticalLines = [];
+ verticalLines.push({
+ x: objectLeft - objectWidth / 2,
+ y1:
+ objectTop < activeObjectTop
+ ? objectTop - objectHeight / 2 - aligningLineOffset
+ : objectTop + objectHeight / 2 + aligningLineOffset,
+ y2:
+ activeObjectTop > objectTop
+ ? activeObjectTop + activeObjectHeight / 2 + aligningLineOffset
+ : activeObjectTop - activeObjectHeight / 2 - aligningLineOffset,
+ });
+
+ let right = new Map([
+ ['mr', 1],
+ ['tr', 1],
+ ['br', 1],
+ ]);
+ if (right.get(e.transform.corner)) {
+ activeObject.set(
+ 'scaleX',
+ ((objectLeft - objectWidth / 2 - activeObject.left) * activeObject.scaleX) /
+ activeObject.getScaledWidth()
+ );
+ break;
+ }
+ }
+ //右边线和左边线
+ if (isInRange(objectLeft + objectWidth / 2, activeObjectLeft - activeObjectWidth / 2)) {
+ verticalInTheRange = true;
+ verticalLines = [];
+ verticalLines.push({
+ x: objectLeft + objectWidth / 2,
+ y1:
+ objectTop < activeObjectTop
+ ? objectTop - objectHeight / 2 - aligningLineOffset
+ : objectTop + objectHeight / 2 + aligningLineOffset,
+ y2:
+ activeObjectTop > objectTop
+ ? activeObjectTop + activeObjectHeight / 2 + aligningLineOffset
+ : activeObjectTop - activeObjectHeight / 2 - aligningLineOffset,
+ });
+
+ let leftRight = new Map([
+ ['bl', 1],
+ ['ml', 1],
+ ['tl', 1],
+ ]);
+ if (leftRight.get(e.transform.corner)) {
+ activeObject.setPositionByOrigin(
+ new fabric.Point(
+ objectLeft + objectWidth / 2 + activeObjectWidth / 2,
+ activeObjectTop
+ ),
+ 'center',
+ 'center'
+ );
+
+ activeObject.set(
+ 'scaleX',
+ ((activeLeft + activeWidth - (objectLeft + objectWidth / 2)) * activeObject.scaleX) /
+ activeObject.getScaledWidth()
+ );
+ break;
+ }
+ }
+ //上边线和下边线
+ if (isInRange(objectTop - objectHeight / 2, activeObjectTop + activeObjectHeight / 2)) {
+ horizontalInTheRange = true;
+ horizontalLines = [];
+ horizontalLines.push({
+ y: objectTop - objectHeight / 2,
+ x1:
+ objectLeft < activeObjectLeft
+ ? objectLeft - objectWidth / 2 - aligningLineOffset
+ : objectLeft + objectWidth / 2 + aligningLineOffset,
+ x2:
+ activeObjectLeft > objectLeft
+ ? activeObjectLeft + activeObjectWidth / 2 + aligningLineOffset
+ : activeObjectLeft - activeObjectWidth / 2 - aligningLineOffset,
+ });
+
+ let bottom = new Map([
+ ['mb', 1],
+ ['bl', 1],
+ ['br', 1],
+ ]);
+ if (bottom.get(e.transform.corner)) {
+ activeObject.set(
+ 'scaleY',
+ ((objectTop - objectHeight / 2 - activeObject.top) * activeObject.scaleY) /
+ activeObject.getScaledHeight()
+ );
+ break;
+ }
+ }
+ //下边线和上变线
+ if (isInRange(objectTop + objectHeight / 2, activeObjectTop - activeObjectHeight / 2)) {
+ horizontalInTheRange = true;
+ horizontalLines = [];
+ horizontalLines.push({
+ y: objectTop + objectHeight / 2,
+ x1:
+ objectLeft < activeObjectLeft
+ ? objectLeft - objectWidth / 2 - aligningLineOffset
+ : objectLeft + objectWidth / 2 + aligningLineOffset,
+ x2:
+ activeObjectLeft > objectLeft
+ ? activeObjectLeft + activeObjectWidth / 2 + aligningLineOffset
+ : activeObjectLeft - activeObjectWidth / 2 - aligningLineOffset,
+ });
+
+ let bottomRight = new Map([
+ ['tr', 1],
+ ['tl', 1],
+ ['mt', 1],
+ ]);
+
+ if (bottomRight.get(e.transform.corner)) {
+ activeObject.setPositionByOrigin(
+ new fabric.Point(
+ activeObjectLeft,
+ objectTop + objectHeight / 2 + activeObjectHeight / 2
+ ),
+ 'center',
+ 'center'
+ );
+
+ activeObject.set(
+ 'scaleY',
+ ((activeTop + activeHeight - (objectTop + objectHeight / 2)) * activeObject.scaleY) /
+ activeObject.getScaledHeight()
+ );
+
+ break;
+ }
+ }
+ }
+
+ if (!horizontalInTheRange) {
+ horizontalLines.length = 0;
+ }
+
+ if (!verticalInTheRange) {
+ verticalLines.length = 0;
+ }
+ });
+ canvas.on('after:render', () => {
+ ctx.save();
+ ctx.beginPath();
+ ctx.lineWidth = This.defautOption.width;
+ ctx.strokeStyle = This.defautOption.color;
+
+ for (let i = verticalLines.length; i--; ) {
+ if (verticalLines[i]) {
+ drawVerticalLine(verticalLines[i]);
+ }
+ }
+ for (let j = horizontalLines.length; j--; ) {
+ if (horizontalLines[j]) {
+ drawHorizontalLine(horizontalLines[j]);
+ }
+ }
+ ctx.stroke();
+ ctx.restore();
+
+ // noinspection NestedAssignmentJS
+ verticalLines.length = 0;
+ horizontalLines.length = 0;
+ });
+
+ canvas.on('mouse:up', (e) => {
+ const activeObject = e.target;
+ if (activeObject && activeObject.selectable && !activeObject.lockRotation) {
+ activeObject.set('hasControls', true);
+ }
+ verticalLines.length = 0;
+ horizontalLines.length = 0;
+ canvas.renderAll();
+ });
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default AlignGuidLinePlugin;
diff --git a/packages/core/plugin/BarCodePlugin.ts b/packages/core/plugin/BarCodePlugin.ts
new file mode 100644
index 0000000..766b5e6
--- /dev/null
+++ b/packages/core/plugin/BarCodePlugin.ts
@@ -0,0 +1,121 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2024-06-06 14:12:24
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-06-07 21:24:56
+ * @Description: 条形码生成工具
+ */
+
+import { fabric } from 'fabric';
+import JsBarcode from 'jsbarcode';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+// 条形码生成参数
+// https://github.com/lindell/JsBarcode/wiki/Options
+
+enum CodeType {
+ CODE128 = 'CODE128',
+ EAN8 = 'EAN8',
+ EAN13 = 'EAN13',
+ ITF14 = 'ITF14',
+ codabar = 'codabar',
+ pharmacode = 'pharmacode',
+}
+
+class BarCodePlugin implements IPluginTempl {
+ static pluginName = 'BarCodePlugin';
+ static apis = ['addBarcode', 'setBarcode', 'getBarcodeTypes'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+
+ async hookTransform(object: any) {
+ if (object.extensionType === 'barcode') {
+ const url = await this._getBase64Str(object.extension);
+ object.src = url;
+ }
+ }
+ _getBase64Str(option: any) {
+ const canvas = document.createElement('canvas');
+ JsBarcode(canvas, option.value, {
+ ...option,
+ });
+ const url = canvas.toDataURL('image/png', 1);
+ return url;
+ }
+
+ _defaultBarcodeOption() {
+ return {
+ value: '123456',
+ format: CodeType.CODE128,
+ text: 'hi kuaitu',
+ textAlign: 'left',
+ textPosition: 'bottom',
+ fontSize: 12,
+ background: '#fff',
+ lineColor: '#000',
+ displayValue: false,
+ };
+ }
+
+ addBarcode() {
+ const option = this._defaultBarcodeOption();
+ const url = this._getBase64Str(JSON.parse(JSON.stringify(option)));
+ fabric.Image.fromURL(
+ url,
+ (imgEl) => {
+ imgEl.set({
+ extensionType: 'barcode',
+ extension: option,
+ });
+ imgEl.scaleToWidth(this.editor.getWorkspase().getScaledWidth() / 2);
+ this.canvas.add(imgEl);
+ this.canvas.setActiveObject(imgEl);
+ this.editor.position('center');
+ this.canvas.renderAll();
+ this.editor.saveState();
+ },
+ { crossOrigin: 'anonymous' }
+ );
+ }
+
+ setBarcode(option: any) {
+ try {
+ const url = this._getBase64Str(option);
+ const activeObject = this.canvas.getActiveObjects()[0];
+ fabric.Image.fromURL(
+ url,
+ (imgEl) => {
+ imgEl.set({
+ left: activeObject.left,
+ top: activeObject.top,
+ extensionType: 'barcode',
+ extension: { ...option },
+ });
+ imgEl.scaleToWidth(activeObject.getScaledWidth());
+ this.editor.del();
+ this.canvas.add(imgEl);
+ this.canvas.setActiveObject(imgEl);
+ },
+ { crossOrigin: 'anonymous' }
+ );
+ } catch (error) {
+ console.log(error);
+ }
+ }
+
+ getBarcodeTypes() {
+ return Object.values(CodeType);
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default BarCodePlugin;
diff --git a/packages/core/plugin/CenterAlignPlugin.ts b/packages/core/plugin/CenterAlignPlugin.ts
new file mode 100644
index 0000000..9139648
--- /dev/null
+++ b/packages/core/plugin/CenterAlignPlugin.ts
@@ -0,0 +1,74 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-15 22:49:42
+ * @LastEditors: bigFace2019 599069310@qq.com
+ * @LastEditTime: 2024-11-03 20:39:43
+ * @Description: 居中对齐插件
+ */
+
+import { fabric } from 'fabric';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+class CenterAlignPlugin implements IPluginTempl {
+ static pluginName = 'CenterAlignPlugin';
+ static apis = ['centerH', 'center', 'position', 'centerV'];
+ // public hotkeys: string[] = ['space'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+
+ center(workspace: fabric.Rect, object: fabric.Object) {
+ const center = workspace.getCenterPoint();
+ return this.canvas._centerObject(object, center);
+ }
+
+ centerV(workspace: fabric.Rect, object: fabric.Object) {
+ return this.canvas._centerObject(
+ object,
+ new fabric.Point(object.getCenterPoint().x, workspace.getCenterPoint().y)
+ );
+ }
+
+ centerH(workspace: fabric.Rect, object: fabric.Object) {
+ return this.canvas._centerObject(
+ object,
+ new fabric.Point(workspace.getCenterPoint().x, object.getCenterPoint().y)
+ );
+ }
+
+ position(name: 'centerH' | 'center' | 'centerV') {
+ const anignType = ['centerH', 'center', 'centerV'];
+ const activeObject = this.canvas.getActiveObject();
+ if (anignType.includes(name) && activeObject) {
+ const defaultWorkspace = this.canvas.getObjects().find((item) => item.id === 'workspace');
+ if (defaultWorkspace) {
+ this[name](defaultWorkspace, activeObject);
+ }
+ this.canvas.renderAll();
+ }
+ }
+
+ contextMenu() {
+ const activeObject = this.canvas.getActiveObject();
+ if (activeObject) {
+ return [
+ {
+ text: '水平垂直居中',
+ hotkey: '',
+ disabled: false,
+ onclick: () => this.position('center'),
+ },
+ ];
+ }
+ }
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default CenterAlignPlugin;
diff --git a/packages/core/plugin/ControlsPlugin.ts b/packages/core/plugin/ControlsPlugin.ts
new file mode 100644
index 0000000..bce5979
--- /dev/null
+++ b/packages/core/plugin/ControlsPlugin.ts
@@ -0,0 +1,255 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-13 23:00:43
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-07-16 14:59:25
+ * @Description: 控制条插件
+ */
+import { fabric } from 'fabric';
+import verticalImg from '../assets/middlecontrol.svg?url';
+// import verticalImg from './middlecontrol.svg';
+import horizontalImg from '../assets/middlecontrolhoz.svg?url';
+import edgeImg from '../assets/edgecontrol.svg?url';
+import rotateImg from '../assets/rotateicon.svg?url';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+/**
+ * 实际场景: 在进行某个对象缩放的时候,由于fabricjs默认精度使用的是toFixed(2)。
+ * 此处为了缩放的精度更准确一些,因此将NUM_FRACTION_DIGITS默认值改为4,即toFixed(4).
+ */
+fabric.Object.NUM_FRACTION_DIGITS = 4;
+
+function drawImg(
+ ctx: CanvasRenderingContext2D,
+ left: number,
+ top: number,
+ img: HTMLImageElement,
+ wSize: number,
+ hSize: number,
+ angle: number | undefined
+) {
+ if (angle === undefined) return;
+ ctx.save();
+ ctx.translate(left, top);
+ ctx.rotate(fabric.util.degreesToRadians(angle));
+ ctx.drawImage(img, -wSize / 2, -hSize / 2, wSize, hSize);
+ ctx.restore();
+}
+
+// 中间横杠
+function intervalControl() {
+ const verticalImgIcon = document.createElement('img');
+ verticalImgIcon.src = verticalImg;
+
+ const horizontalImgIcon = document.createElement('img');
+ horizontalImgIcon.src = horizontalImg;
+
+ function renderIcon(
+ ctx: CanvasRenderingContext2D,
+ left: number,
+ top: number,
+ styleOverride: any,
+ fabricObject: fabric.Object
+ ) {
+ drawImg(ctx, left, top, verticalImgIcon, 20, 25, fabricObject.angle);
+ }
+
+ function renderIconHoz(
+ ctx: CanvasRenderingContext2D,
+ left: number,
+ top: number,
+ styleOverride: any,
+ fabricObject: fabric.Object
+ ) {
+ drawImg(ctx, left, top, horizontalImgIcon, 25, 20, fabricObject.angle);
+ }
+ // 中间横杠
+ fabric.Object.prototype.controls.ml = new fabric.Control({
+ x: -0.5,
+ y: 0,
+ offsetX: -1,
+ cursorStyleHandler: fabric.controlsUtils.scaleSkewCursorStyleHandler,
+ actionHandler: fabric.controlsUtils.scalingXOrSkewingY,
+ getActionName: fabric.controlsUtils.scaleOrSkewActionName,
+ render: renderIcon,
+ });
+
+ fabric.Object.prototype.controls.mr = new fabric.Control({
+ x: 0.5,
+ y: 0,
+ offsetX: 1,
+ cursorStyleHandler: fabric.controlsUtils.scaleSkewCursorStyleHandler,
+ actionHandler: fabric.controlsUtils.scalingXOrSkewingY,
+ getActionName: fabric.controlsUtils.scaleOrSkewActionName,
+ render: renderIcon,
+ });
+
+ fabric.Object.prototype.controls.mb = new fabric.Control({
+ x: 0,
+ y: 0.5,
+ offsetY: 1,
+ cursorStyleHandler: fabric.controlsUtils.scaleSkewCursorStyleHandler,
+ actionHandler: fabric.controlsUtils.scalingYOrSkewingX,
+ getActionName: fabric.controlsUtils.scaleOrSkewActionName,
+ render: renderIconHoz,
+ });
+
+ fabric.Object.prototype.controls.mt = new fabric.Control({
+ x: 0,
+ y: -0.5,
+ offsetY: -1,
+ cursorStyleHandler: fabric.controlsUtils.scaleSkewCursorStyleHandler,
+ actionHandler: fabric.controlsUtils.scalingYOrSkewingX,
+ getActionName: fabric.controlsUtils.scaleOrSkewActionName,
+ render: renderIconHoz,
+ });
+}
+
+// 顶点
+function peakControl() {
+ const img = document.createElement('img');
+ img.src = edgeImg;
+
+ function renderIconEdge(
+ ctx: CanvasRenderingContext2D,
+ left: number,
+ top: number,
+ styleOverride: any,
+ fabricObject: fabric.Object
+ ) {
+ drawImg(ctx, left, top, img, 25, 25, fabricObject.angle);
+ }
+ // 四角图标
+ fabric.Object.prototype.controls.tl = new fabric.Control({
+ x: -0.5,
+ y: -0.5,
+ cursorStyleHandler: fabric.controlsUtils.scaleCursorStyleHandler,
+ actionHandler: fabric.controlsUtils.scalingEqually,
+ render: renderIconEdge,
+ });
+ fabric.Object.prototype.controls.bl = new fabric.Control({
+ x: -0.5,
+ y: 0.5,
+ cursorStyleHandler: fabric.controlsUtils.scaleCursorStyleHandler,
+ actionHandler: fabric.controlsUtils.scalingEqually,
+ render: renderIconEdge,
+ });
+ fabric.Object.prototype.controls.tr = new fabric.Control({
+ x: 0.5,
+ y: -0.5,
+ cursorStyleHandler: fabric.controlsUtils.scaleCursorStyleHandler,
+ actionHandler: fabric.controlsUtils.scalingEqually,
+ render: renderIconEdge,
+ });
+ fabric.Object.prototype.controls.br = new fabric.Control({
+ x: 0.5,
+ y: 0.5,
+ cursorStyleHandler: fabric.controlsUtils.scaleCursorStyleHandler,
+ actionHandler: fabric.controlsUtils.scalingEqually,
+ render: renderIconEdge,
+ });
+}
+
+// 删除
+/*function deleteControl(canvas: fabric.Canvas) {
+ const deleteIcon =
+ "data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3E%3Csvg version='1.1' id='Ebene_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' width='595.275px' height='595.275px' viewBox='200 215 230 470' xml:space='preserve'%3E%3Ccircle style='fill:%23F44336;' cx='299.76' cy='439.067' r='218.516'/%3E%3Cg%3E%3Crect x='267.162' y='307.978' transform='matrix(0.7071 -0.7071 0.7071 0.7071 -222.6202 340.6915)' style='fill:white;' width='65.545' height='262.18'/%3E%3Crect x='266.988' y='308.153' transform='matrix(0.7071 0.7071 -0.7071 0.7071 398.3889 -83.3116)' style='fill:white;' width='65.544' height='262.179'/%3E%3C/g%3E%3C/svg%3E";
+ const delImg = document.createElement('img');
+ delImg.src = deleteIcon;
+
+ function renderDelIcon(
+ ctx: CanvasRenderingContext2D,
+ left: number,
+ top: number,
+ styleOverride: any,
+ fabricObject: fabric.Object
+ ) {
+ drawImg(ctx, left, top, delImg, 24, 24, fabricObject.angle);
+ }
+
+ // 删除选中元素
+ function deleteObject(mouseEvent: MouseEvent, target: fabric.Transform) {
+ if (target.action === 'rotate') return true;
+ const activeObject = canvas.getActiveObjects();
+ if (activeObject) {
+ activeObject.map((item) => canvas.remove(item));
+ canvas.requestRenderAll();
+ canvas.discardActiveObject();
+ }
+ return true;
+ }
+
+ // 删除图标
+ fabric.Object.prototype.controls.deleteControl = new fabric.Control({
+ x: 0.5,
+ y: -0.5,
+ offsetY: -16,
+ offsetX: 16,
+ cursorStyle: 'pointer',
+ mouseUpHandler: deleteObject,
+ render: renderDelIcon,
+ // cornerSize: 24,
+ });
+}*/
+
+// 旋转
+function rotationControl() {
+ const img = document.createElement('img');
+ img.src = rotateImg;
+ function renderIconRotate(
+ ctx: CanvasRenderingContext2D,
+ left: number,
+ top: number,
+ styleOverride: any,
+ fabricObject: fabric.Object
+ ) {
+ drawImg(ctx, left, top, img, 40, 40, fabricObject.angle);
+ }
+ // 旋转图标
+ fabric.Object.prototype.controls.mtr = new fabric.Control({
+ x: 0,
+ y: 0.5,
+ cursorStyleHandler: fabric.controlsUtils.rotationStyleHandler,
+ actionHandler: fabric.controlsUtils.rotationWithSnapping,
+ offsetY: 30,
+ // withConnecton: false,
+ actionName: 'rotate',
+ render: renderIconRotate,
+ });
+}
+
+class ControlsPlugin implements IPluginTempl {
+ static pluginName = 'ControlsPlugin';
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.init();
+ }
+ init() {
+ // 删除图标
+ // deleteControl(this.canvas);
+ // 顶点图标
+ peakControl();
+ // 中间横杠图标
+ intervalControl();
+ // 旋转图标
+ rotationControl();
+
+ // 选中样式
+ fabric.Object.prototype.set({
+ transparentCorners: false,
+ borderColor: '#51B9F9',
+ cornerColor: '#FFF',
+ borderScaleFactor: 2.5,
+ cornerStyle: 'circle',
+ cornerStrokeColor: '#0E98FC',
+ borderOpacityWhenMoving: 1,
+ });
+ // textbox保持一致
+ // fabric.Textbox.prototype.controls = fabric.Object.prototype.controls;
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default ControlsPlugin;
diff --git a/packages/core/plugin/ControlsRotatePlugin.ts b/packages/core/plugin/ControlsRotatePlugin.ts
new file mode 100644
index 0000000..09150d1
--- /dev/null
+++ b/packages/core/plugin/ControlsRotatePlugin.ts
@@ -0,0 +1,108 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-13 23:07:04
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-04-10 17:32:56
+ * @Description: 控制条插件
+ */
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+// 定义旋转光标样式,根据转动角度设定光标旋转
+function rotateIcon(angle: number) {
+ return `url("data:image/svg+xml,%3Csvg height='18' width='18' viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg' style='color: black;'%3E%3Cg fill='none' transform='rotate(${angle} 16 16)'%3E%3Cpath d='M22.4484 0L32 9.57891L22.4484 19.1478V13.1032C17.6121 13.8563 13.7935 17.6618 13.0479 22.4914H19.2141L9.60201 32.01L0 22.4813H6.54912C7.36524 14.1073 14.0453 7.44023 22.4484 6.61688V0Z' fill='white'/%3E%3Cpath d='M24.0605 3.89587L29.7229 9.57896L24.0605 15.252V11.3562C17.0479 11.4365 11.3753 17.0895 11.3048 24.0879H15.3048L9.60201 29.7308L3.90932 24.0879H8.0806C8.14106 15.3223 15.2645 8.22345 24.0605 8.14313V3.89587Z' fill='black'/%3E%3C/g%3E%3C/svg%3E ") 12 12,crosshair`;
+}
+
+class ControlsRotatePlugin implements IPluginTempl {
+ static pluginName = 'ControlsRotatePlugin';
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.init();
+ }
+ init() {
+ const { canvas } = this;
+ // 添加旋转控制响应区域
+ fabric.Object.prototype.controls.mtr = new fabric.Control({
+ x: -0.5,
+ y: -0.5,
+ offsetY: -10,
+ offsetX: -10,
+ rotate: 20,
+ actionName: 'rotate',
+ actionHandler: fabric.controlsUtils.rotationWithSnapping,
+ render: () => '',
+ });
+ // ↖左上
+ fabric.Object.prototype.controls.mtr2 = new fabric.Control({
+ x: 0.5,
+ y: -0.5,
+ offsetY: -10,
+ offsetX: 10,
+ rotate: 20,
+ actionName: 'rotate',
+ actionHandler: fabric.controlsUtils.rotationWithSnapping,
+ render: () => '',
+ }); // ↗右上
+ fabric.Object.prototype.controls.mtr3 = new fabric.Control({
+ x: 0.5,
+ y: 0.5,
+ offsetY: 10,
+ offsetX: 10,
+ rotate: 20,
+ actionName: 'rotate',
+ actionHandler: fabric.controlsUtils.rotationWithSnapping,
+ render: () => '',
+ }); // ↘右下
+ fabric.Object.prototype.controls.mtr4 = new fabric.Control({
+ x: -0.5,
+ y: 0.5,
+ offsetY: 10,
+ offsetX: -10,
+ rotate: 20,
+ actionName: 'rotate',
+ actionHandler: fabric.controlsUtils.rotationWithSnapping,
+ render: () => '',
+ }); // ↙左下
+
+ // 渲染时,执行
+ canvas.on('after:render', () => {
+ const activeObj = canvas.getActiveObject();
+ const angle = activeObj?.angle?.toFixed(2);
+ if (angle !== undefined) {
+ fabric.Object.prototype.controls.mtr.cursorStyle = rotateIcon(Number(angle));
+ fabric.Object.prototype.controls.mtr2.cursorStyle = rotateIcon(Number(angle) + 90);
+ fabric.Object.prototype.controls.mtr3.cursorStyle = rotateIcon(Number(angle) + 180);
+ fabric.Object.prototype.controls.mtr4.cursorStyle = rotateIcon(Number(angle) + 270);
+ }
+ });
+
+ // 旋转时,实时更新旋转控制图标
+ canvas.on('object:rotating', (event) => {
+ const body = canvas.lowerCanvasEl.nextSibling as HTMLElement;
+ const angle = canvas.getActiveObject()?.angle?.toFixed(2);
+ if (angle === undefined) return;
+ switch (event.transform?.corner) {
+ case 'mtr':
+ body.style.cursor = rotateIcon(Number(angle));
+ break;
+ case 'mtr2':
+ body.style.cursor = rotateIcon(Number(angle) + 90);
+ break;
+ case 'mtr3':
+ body.style.cursor = rotateIcon(Number(angle) + 180);
+ break;
+ case 'mtr4':
+ body.style.cursor = rotateIcon(Number(angle) + 270);
+ break;
+ default:
+ break;
+ } // 设置四角旋转光标
+ });
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default ControlsRotatePlugin;
+
+import { fabric } from 'fabric';
diff --git a/packages/core/plugin/CopyPlugin.ts b/packages/core/plugin/CopyPlugin.ts
new file mode 100644
index 0000000..723da2b
--- /dev/null
+++ b/packages/core/plugin/CopyPlugin.ts
@@ -0,0 +1,227 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-20 12:38:37
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-06-07 11:25:05
+ * @Description: 复制插件
+ */
+
+import { fabric } from 'fabric';
+import { v4 as uuid } from 'uuid';
+import { getImgStr } from '../utils/utils';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+class CopyPlugin implements IPluginTempl {
+ static pluginName = 'CopyPlugin';
+ static apis = ['clone'];
+ hotkeys: string[] = ['ctrl+v', 'ctrl+c'];
+ private cache: null | fabric.ActiveSelection | fabric.Object = null;
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.initPaste();
+ }
+
+ // 多选对象复制
+ _copyActiveSelection(activeObject: fabric.Object) {
+ // 间距设置
+ const grid = 10;
+ const canvas = this.canvas;
+ const keys = this.editor.getExtensionKey();
+ activeObject?.clone((cloned: fabric.Object) => {
+ // 再次进行克隆,处理选择多个对象的情况
+ cloned.clone((clonedObj: fabric.ActiveSelection) => {
+ canvas.discardActiveObject();
+ if (clonedObj.left === undefined || clonedObj.top === undefined) return;
+ // 将克隆的画布重新赋值
+ clonedObj.canvas = canvas;
+ // 设置位置信息
+ clonedObj.set({
+ left: clonedObj.left + grid,
+ top: clonedObj.top + grid,
+ evented: true,
+ id: uuid(),
+ });
+ clonedObj.forEachObject((obj: fabric.Object) => {
+ obj.id = uuid();
+ canvas.add(obj);
+ });
+ // 解决不可选择问题
+ clonedObj.setCoords();
+ canvas.setActiveObject(clonedObj);
+ canvas.requestRenderAll();
+ });
+ }, keys);
+ }
+
+ // 单个对象复制
+ _copyObject(activeObject: fabric.Object) {
+ // 间距设置
+ const grid = 10;
+ const canvas = this.canvas;
+ const keys = this.editor.getExtensionKey();
+ activeObject?.clone((cloned: fabric.Object) => {
+ if (cloned.left === undefined || cloned.top === undefined) return;
+ canvas.discardActiveObject();
+ // 设置位置信息
+ cloned.set({
+ left: cloned.left + grid,
+ top: cloned.top + grid,
+ evented: true,
+ id: uuid(),
+ });
+ canvas.add(cloned);
+ canvas.setActiveObject(cloned);
+ canvas.requestRenderAll();
+ }, keys);
+ }
+
+ // 复制元素
+ clone(paramsActiveObeject?: fabric.ActiveSelection | fabric.Object) {
+ const activeObject = paramsActiveObeject || this.canvas.getActiveObject();
+ if (!activeObject) return;
+ if (activeObject?.type === 'activeSelection') {
+ this._copyActiveSelection(activeObject);
+ } else {
+ this._copyObject(activeObject);
+ }
+ }
+
+ // 快捷键扩展回调
+ hotkeyEvent(eventName: string, e: KeyboardEvent) {
+ if (eventName === 'ctrl+c' && e.type === 'keydown') {
+ const activeObject = this.canvas.getActiveObject();
+ this.cache = activeObject;
+ // 清空剪切板
+ navigator.clipboard.writeText('');
+ }
+ if (eventName === 'ctrl+v' && e.type === 'keydown') {
+ // 确保clone元素操作的执行晚于pasteListener
+ setTimeout(() => {
+ if (this.cache) {
+ this.clone(this.cache);
+ }
+ }, 0);
+ }
+ }
+
+ contextMenu() {
+ const activeObject = this.canvas.getActiveObject();
+ if (activeObject) {
+ return [{ text: '复制', hotkey: 'Ctrl+V', disabled: false, onclick: () => this.clone() }];
+ }
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ window.removeEventListener('paste', (e) => this.pasteListener(e));
+ }
+
+ initPaste() {
+ window.addEventListener('paste', (e) => this.pasteListener(e));
+ }
+
+ async pasteListener(event: any) {
+ const canvas = this.canvas;
+ if (document.activeElement === document.body) {
+ event.preventDefault(); // 阻止默认粘贴行为
+ } else {
+ return;
+ }
+
+ const items = (event.clipboardData || event.originalEvent.clipboardData).items;
+ const fileAccept = '.pdf,.psd,.cdr,.ai,.svg,.jpg,.jpeg,.png,.webp,.json';
+ for (const item of items) {
+ if (item.kind === 'file') {
+ const file = item.getAsFile();
+ const curFileSuffix: string | undefined = file.name.split('.').pop();
+ if (!fileAccept.split(',').includes(`.${curFileSuffix}`)) return;
+ if (curFileSuffix === 'svg') {
+ const svgFile = await getImgStr(file);
+ if (!svgFile) throw new Error('file is undefined');
+ fabric.loadSVGFromURL(svgFile as string, (objects, options) => {
+ const item = fabric.util.groupSVGElements(objects, {
+ ...options,
+ name: 'defaultSVG',
+ id: uuid(),
+ });
+ canvas.add(item).centerObject(item).renderAll();
+ });
+ }
+ // if (curFileSuffix === 'json') {
+ // const dataText = await getImageText(file);
+ // const template = JSON.parse(dataText);
+ // addTemplate(template);
+ // }
+ if (item.type.indexOf('image/') === 0) {
+ // 这是一个图片文件
+ const imageUrl = URL.createObjectURL(file);
+ const imgEl = document.createElement('img');
+ imgEl.src = imageUrl;
+ // 插入页面
+ document.body.appendChild(imgEl);
+ imgEl.onload = () => {
+ // 创建图片对象
+ const imgInstance = new fabric.Image(imgEl, {
+ id: uuid(),
+ name: '图片1',
+ left: 100,
+ top: 100,
+ });
+ // 设置缩放
+ canvas.add(imgInstance);
+ canvas.setActiveObject(imgInstance);
+ canvas.renderAll();
+ // 删除页面中的图片元素
+ imgEl.remove();
+ };
+ }
+ } else if (item.kind === 'string' && item.type.indexOf('text/plain') === 0) {
+ // 文本数据
+ item.getAsString((text: any) => {
+ // 插入到文本框
+ const activeObject = canvas.getActiveObject() as fabric.Textbox;
+ // 如果是激活的文字把复制的内容插入到对应光标位置
+ if (
+ activeObject &&
+ (activeObject.type === 'textbox' || activeObject.type === 'i-text') &&
+ activeObject.text
+ ) {
+ const cursorPosition = activeObject.selectionStart;
+ const textBeforeCursorPosition = activeObject.text.substring(0, cursorPosition);
+ const textAfterCursorPosition = activeObject.text.substring(cursorPosition as number);
+
+ // 更新文本对象的文本
+ activeObject.set('text', textBeforeCursorPosition + text + textAfterCursorPosition);
+
+ // 重新设置光标的位置
+ activeObject.selectionStart = cursorPosition + text.length;
+ activeObject.selectionEnd = cursorPosition + text.length;
+
+ // 重新渲染画布展示更新后的文本
+ activeObject.dirty = true;
+ canvas.renderAll();
+ } else {
+ const fabricText = new fabric.IText(text, {
+ left: 100,
+ top: 100,
+ fontSize: 80,
+ id: uuid(),
+ });
+ canvas.add(fabricText);
+ canvas.setActiveObject(fabricText);
+ }
+ });
+ }
+ }
+ // 复制浏览器外的元素时,清空暂存的画布内粘贴元素
+ if (items.length) this.cache = null;
+ }
+}
+
+export default CopyPlugin;
diff --git a/packages/core/plugin/DeleteHotKeyPlugin.ts b/packages/core/plugin/DeleteHotKeyPlugin.ts
new file mode 100644
index 0000000..e935190
--- /dev/null
+++ b/packages/core/plugin/DeleteHotKeyPlugin.ts
@@ -0,0 +1,57 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-20 12:57:35
+ * @LastEditors: bigFace2019 599069310@qq.com
+ * @LastEditTime: 2024-11-03 20:38:33
+ * @Description: 删除快捷键
+ */
+
+import { fabric } from 'fabric';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+class DeleteHotKeyPlugin implements IPluginTempl {
+ static pluginName = 'DeleteHotKeyPlugin';
+ static apis = ['del'];
+ hotkeys: string[] = ['backspace'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+
+ // 快捷键扩展回调
+ hotkeyEvent(eventName: string, e: KeyboardEvent) {
+ if (e.type === 'keydown' && eventName === 'backspace') {
+ this.del();
+ }
+ }
+
+ del() {
+ const { canvas } = this;
+ const activeObject = canvas.getActiveObjects();
+ if (activeObject) {
+ activeObject.map((item) => canvas.remove(item));
+ canvas.requestRenderAll();
+ canvas.discardActiveObject();
+ }
+ }
+
+ contextMenu() {
+ const activeObject = this.canvas.getActiveObject();
+ if (activeObject) {
+ return [
+ null,
+ { text: '删除', hotkey: 'Backspace', disabled: false, onclick: () => this.del() },
+ ];
+ }
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default DeleteHotKeyPlugin;
diff --git a/packages/core/plugin/DrawLinePlugin.ts b/packages/core/plugin/DrawLinePlugin.ts
new file mode 100644
index 0000000..715b141
--- /dev/null
+++ b/packages/core/plugin/DrawLinePlugin.ts
@@ -0,0 +1,159 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-21 22:09:36
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-04-10 17:33:05
+ * @Description: file content
+ */
+
+import { v4 as uuid } from 'uuid';
+import { fabric } from 'fabric';
+import Arrow from '../objects/Arrow';
+import ThinTailArrow from '../objects/ThinTailArrow';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+class DrawLinePlugin implements IPluginTempl {
+ static pluginName = 'DrawLinePlugin';
+ static apis = ['setLineType', 'setMode'];
+ isDrawingLineMode: boolean;
+ lineType: string;
+ lineToDraw: any;
+ pointer: any;
+ pointerPoints: any;
+ isDrawingLine: boolean;
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.isDrawingLine = false;
+ this.isDrawingLineMode = false;
+ this.lineType = '';
+ this.lineToDraw = null;
+ this.pointer = null;
+ this.pointerPoints = null;
+ this.init();
+ }
+
+ init() {
+ const { canvas } = this;
+ canvas.on('mouse:down', (o) => {
+ if (!this.isDrawingLineMode) return;
+ canvas.discardActiveObject();
+ canvas.getObjects().forEach((obj) => {
+ obj.selectable = false;
+ obj.hasControls = false;
+ });
+ canvas.requestRenderAll();
+ this.isDrawingLine = true;
+ this.pointer = canvas.getPointer(o.e);
+ this.pointerPoints = [this.pointer.x, this.pointer.y, this.pointer.x, this.pointer.y];
+ let NodeHandler;
+ let opts: any = {
+ strokeWidth: 2,
+ stroke: '#000000',
+ id: uuid(),
+ };
+ switch (this.lineType) {
+ case 'line':
+ NodeHandler = fabric.Line;
+ break;
+ case 'arrow':
+ NodeHandler = Arrow;
+ break;
+ case 'thinTailArrow':
+ NodeHandler = ThinTailArrow;
+ opts = {
+ strokeWidth: 2,
+ stroke: '#ff0000',
+ fill: '#ff0000',
+ id: uuid(),
+ };
+ break;
+ default:
+ break;
+ }
+ if (!NodeHandler) throw new Error('Draw failed: invalid lineType.');
+
+ this.lineToDraw = new NodeHandler(this.pointerPoints, opts);
+
+ this.lineToDraw.selectable = false;
+ this.lineToDraw.evented = false;
+ this.lineToDraw.strokeUniform = true;
+ canvas.add(this.lineToDraw);
+ });
+
+ canvas.on('mouse:move', (o) => {
+ if (!this.isDrawingLine || !['line', 'arrow', 'thinTailArrow'].includes(this.lineType))
+ return;
+ canvas.discardActiveObject();
+ const activeObject = canvas.getActiveObject();
+ if (activeObject) return;
+ this.pointer = canvas.getPointer(o.e);
+
+ if (o.e.shiftKey) {
+ // calc angle
+ const startX = this.pointerPoints[0];
+ const startY = this.pointerPoints[1];
+ const x2 = this.pointer.x - startX;
+ const y2 = this.pointer.y - startY;
+ const r = Math.sqrt(x2 * x2 + y2 * y2);
+ let angle = (Math.atan2(y2, x2) / Math.PI) * 180;
+ angle = ~~(((angle + 7.5) % 360) / 15) * 15;
+
+ const cosx = r * Math.cos((angle * Math.PI) / 180);
+ const sinx = r * Math.sin((angle * Math.PI) / 180);
+
+ this.lineToDraw.set({
+ x2: cosx + startX,
+ y2: sinx + startY,
+ });
+ } else {
+ this.lineToDraw.set({
+ x2: this.pointer.x,
+ y2: this.pointer.y,
+ });
+ }
+
+ canvas.renderAll();
+ });
+
+ canvas.on('mouse:up', () => {
+ if (!this.isDrawingLine) return;
+ this.lineToDraw.setCoords();
+ this.isDrawingLine = false;
+ canvas.discardActiveObject();
+ canvas.renderAll();
+ this.editor.saveState();
+ });
+ }
+
+ setLineType(params: any) {
+ this.lineType = params;
+ }
+
+ setMode(params: any) {
+ this.isDrawingLineMode = params;
+ if (!this.isDrawingLineMode) {
+ this.endRest();
+ }
+ }
+
+ endRest() {
+ this.canvas.getObjects().forEach((obj) => {
+ if (obj.id !== 'workspace') {
+ obj.selectable = true;
+ obj.hasControls = true;
+ }
+ });
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default DrawLinePlugin;
diff --git a/packages/core/plugin/DrawPolygonPlugin.ts b/packages/core/plugin/DrawPolygonPlugin.ts
new file mode 100644
index 0000000..76eec2b
--- /dev/null
+++ b/packages/core/plugin/DrawPolygonPlugin.ts
@@ -0,0 +1,191 @@
+import { fabric } from 'fabric';
+import { v4 as uuid } from 'uuid';
+import { shiftAngle } from '../utils/utils';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+type LineCoords = [fabric.Point, fabric.Point];
+type OffListener = (ev: fabric.IEvent) => void;
+type OnEnd = (...args: any[]) => void;
+class DrawPolygonPlugin implements IPluginTempl {
+ isDrawingPolygon = false;
+ points: fabric.Point[] = [];
+ lines: fabric.Line[] = [];
+ anchors: fabric.Circle[] = [];
+ tempPoint: fabric.Point | undefined;
+ tempLine: fabric.Line | undefined;
+ lastPoint: fabric.Point | undefined;
+ onEnd?: OnEnd;
+ // 最后一点和第一点的距离为<=delta即闭合
+ delta = 5;
+ static pluginName = 'DrawPolygonPlugin';
+ static apis = ['beginDrawPolygon', 'endDrawPolygon', 'discardPolygon'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+
+ _isUsingHistory() {
+ return this.canvas.offHistory && typeof this.canvas.offHistory === 'function';
+ }
+ _bindEvent() {
+ window.addEventListener('keydown', this._escListener);
+ this.canvas.on('mouse:down', this._downHandler);
+ this.canvas.on('mouse:move', this._moveHandler);
+ }
+ _escListener = (evt: KeyboardEvent) => {
+ if (evt.key === 'Escape' || evt['keyCode'] === 27) {
+ this._confirmBuildPolygon();
+ }
+ };
+ _downHandler = (ev: fabric.IEvent): void => {
+ if (!this.isDrawingPolygon) return;
+ const absPointer = ev.absolutePointer!;
+ const confirmPoint = new fabric.Point(absPointer.x, absPointer.y);
+ const anchor = this._mackAnchor(absPointer);
+ this.anchors.push(anchor);
+ if (this.tempLine == null) {
+ const tempPoint = new fabric.Point(absPointer.x, absPointer.y);
+ this.tempLine = this._makeLine([tempPoint, tempPoint]);
+ this.canvas.add(this.tempLine);
+ } else {
+ ev.e.shiftKey && confirmPoint.setXY(this.tempLine.x2!, this.tempLine.y2!);
+ anchor.set({ left: confirmPoint.x, top: confirmPoint.y });
+ this.tempLine.set({
+ x1: confirmPoint.x,
+ y1: confirmPoint.y,
+ x2: confirmPoint.x,
+ y2: confirmPoint.y,
+ });
+ }
+ if (this.lastPoint) {
+ const line = this._makeLine([this.lastPoint, confirmPoint]);
+ this.lines.push(line);
+ this.canvas.add(line);
+ if (this.points[0].distanceFrom(confirmPoint) / this.canvas.getZoom() <= this.delta) {
+ this._confirmBuildPolygon();
+ return;
+ }
+ }
+ this.canvas.add(anchor);
+ this.lastPoint = confirmPoint;
+ this.points.push(confirmPoint);
+ this._ensureAnchorsForward();
+ };
+ _moveHandler = (ev: fabric.IEvent): void => {
+ if (!this.isDrawingPolygon || !this.tempLine) return;
+ const absPoint = ev.absolutePointer!;
+ if (ev.e.shiftKey && this.lastPoint) {
+ const point = shiftAngle(this.lastPoint, absPoint);
+ this.tempLine.set({
+ x2: point.x,
+ y2: point.y,
+ });
+ } else {
+ this.tempLine.set({
+ x2: absPoint.x,
+ y2: absPoint.y,
+ });
+ }
+ this.canvas.renderAll();
+ };
+ _ensureAnchorsForward() {
+ this.anchors.forEach((item) => {
+ item.bringForward();
+ });
+ }
+ _unbindEvent() {
+ window.removeEventListener('keydown', this._escListener);
+ this.canvas.off('mouse:down', this._downHandler as OffListener);
+ this.canvas.off('mouse:move', this._moveHandler as OffListener);
+ }
+ _createPolygon(points: fabric.Point[]) {
+ return new fabric.Polygon(points, {
+ fill: '#ccccccff',
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
+ // @ts-ignore
+ id: uuid(),
+ });
+ }
+ _makeLine(coors: LineCoords) {
+ const [p1, p2] = coors;
+ return new fabric.Line([p1.x, p1.y, p2.x, p2.y], {
+ fill: '#000',
+ stroke: '#000',
+ strokeWidth: 1,
+ selectable: false,
+ evented: false,
+ });
+ }
+ _mackAnchor(position: fabric.Point) {
+ return new fabric.Circle({
+ radius: 5,
+ left: position.x,
+ top: position.y,
+ fill: 'rgb(178, 53, 84)',
+ scaleX: 1 / this.canvas.getZoom(),
+ scaleY: 1 / this.canvas.getZoom(),
+ strokeWidth: 1 / this.canvas.getZoom(),
+ originX: 'center',
+ originY: 'center',
+ evented: false,
+ selectable: false,
+ });
+ }
+ _confirmBuildPolygon() {
+ const points = this.points;
+ this.discardPolygon();
+ if (this._isUsingHistory()) {
+ this.canvas.historyProcessing = false;
+ }
+ if (points.length >= 3) {
+ const poly = this._createPolygon(points);
+ this.canvas.add(poly);
+ }
+ }
+ _prepare() {
+ this.canvas.discardActiveObject();
+ this.canvas.getObjects().forEach((obj) => {
+ obj.selectable = false;
+ obj.hasControls = false;
+ });
+ }
+ beginDrawPolygon(onEnd?: OnEnd) {
+ this._prepare();
+ this.onEnd = onEnd;
+ if (this._isUsingHistory()) {
+ this.canvas.historyProcessing = true;
+ }
+ this.canvas.requestRenderAll();
+ this.isDrawingPolygon = true;
+ this._bindEvent();
+ }
+ endDrawPolygon() {
+ this.canvas.discardActiveObject();
+ this.isDrawingPolygon = false;
+ this.lastPoint = undefined;
+ this.tempPoint = undefined;
+ this._unbindEvent();
+ this.onEnd && this.onEnd();
+ this.onEnd = undefined;
+ }
+ discardPolygon() {
+ this.lines.forEach((item) => {
+ this.canvas.remove(item);
+ });
+ this.anchors.forEach((item) => {
+ this.canvas.remove(item);
+ });
+ this.tempLine && this.canvas.remove(this.tempLine);
+ this.tempLine = undefined;
+ this.anchors = [];
+ this.lines = [];
+ this.points = [];
+ this.endDrawPolygon();
+ }
+}
+
+export default DrawPolygonPlugin;
diff --git a/packages/core/plugin/DringPlugin.ts b/packages/core/plugin/DringPlugin.ts
new file mode 100644
index 0000000..78e8c17
--- /dev/null
+++ b/packages/core/plugin/DringPlugin.ts
@@ -0,0 +1,130 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-05-19 08:31:34
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-04-10 17:33:11
+ * @Description: 拖拽插件
+ */
+
+import { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+export class DringPlugin implements IPluginTempl {
+ defautOption = {};
+ static pluginName = 'DringPlugin';
+ static events = ['startDring', 'endDring'];
+ static apis = ['startDring', 'endDring'];
+ hotkeys: string[] = ['space'];
+ dragMode = false;
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.dragMode = false;
+ this.init();
+ }
+ init() {
+ this._initDring();
+ }
+
+ startDring() {
+ this.dragMode = true;
+ this.canvas.setCursor('grab');
+ this.editor.emit('startDring');
+ this.canvas.renderAll();
+ }
+ endDring() {
+ this.dragMode = false;
+ this.canvas.setCursor('default');
+ this.canvas.isDragging = false;
+ this.editor.emit('endDring');
+ this.canvas.renderAll();
+ }
+
+ // 拖拽模式;
+ _initDring() {
+ const This = this;
+ this.canvas.on('mouse:down', function (this: ExtCanvas, opt) {
+ const evt = opt.e;
+ // evt.button === 1 为鼠标中键的判断
+ if (evt.altKey || This.dragMode || evt.button === 1) {
+ This.canvas.setCursor('grabbing');
+ This.canvas.discardActiveObject();
+ This._setDring();
+ this.selection = false;
+ this.isDragging = true;
+ this.lastPosX = evt.clientX;
+ this.lastPosY = evt.clientY;
+ this.requestRenderAll();
+ }
+ });
+
+ this.canvas.on('mouse:move', function (this: ExtCanvas, opt) {
+ This.dragMode && This.canvas.setCursor('grab');
+ if (this.isDragging) {
+ This.canvas.discardActiveObject();
+ This.canvas.setCursor('grabbing');
+ const { e } = opt;
+ if (!this.viewportTransform) return;
+ const vpt = this.viewportTransform;
+ vpt[4] += e.clientX - this.lastPosX;
+ vpt[5] += e.clientY - this.lastPosY;
+ this.lastPosX = e.clientX;
+ this.lastPosY = e.clientY;
+ this.requestRenderAll();
+ }
+ });
+
+ this.canvas.on('mouse:up', function (this: ExtCanvas) {
+ if (!this.viewportTransform) return;
+ this.setViewportTransform(this.viewportTransform);
+ this.isDragging = false;
+ this.selection = true;
+ this.getObjects().forEach((obj) => {
+ if (obj.id !== 'workspace' && obj.hasControls) {
+ obj.selectable = true;
+ }
+ });
+ This.dragMode && This.canvas.setCursor('grab');
+ this.requestRenderAll();
+ });
+ }
+
+ _setDring() {
+ this.canvas.selection = false;
+ this.canvas.getObjects().forEach((obj) => {
+ obj.selectable = false;
+ });
+ this.canvas.requestRenderAll();
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+
+ // 快捷键扩展回调
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
+ hotkeyEvent(eventName: string, e: KeyboardEvent) {
+ if (e.code === 'Space' && e.type === 'keydown') {
+ if (!this.dragMode) {
+ this.startDring();
+ }
+ }
+ if (e.code === 'Space' && e.type === 'keyup') {
+ this.endDring();
+ }
+ }
+}
+
+declare global {
+ export type ExtCanvas = fabric.Canvas & {
+ isDragging: boolean;
+ lastPosX: number;
+ lastPosY: number;
+ };
+}
+
+export default DringPlugin;
diff --git a/packages/core/plugin/FlipPlugin.ts b/packages/core/plugin/FlipPlugin.ts
new file mode 100644
index 0000000..2c6d441
--- /dev/null
+++ b/packages/core/plugin/FlipPlugin.ts
@@ -0,0 +1,55 @@
+import { fabric } from 'fabric';
+import { SelectMode } from '../eventType';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+import i18n from "@/language";
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+// import event from '@/utils/event/notifier';
+
+export default class FlipPlugin implements IPluginTempl {
+ static pluginName = 'FlipPlugin';
+ static apis = ['flip'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+
+ flip(type: 'X' | 'Y') {
+ const activeObject = this.canvas.getActiveObject();
+ if (activeObject) {
+ activeObject.set(`flip${type}`, !activeObject[`flip${type}`]).setCoords();
+ this.canvas.requestRenderAll();
+ }
+ }
+
+ contextMenu() {
+ const selectedMode = this.editor.getSelectMode();
+ if (selectedMode === SelectMode.ONE) {
+ return [
+ {
+ text: '翻转',
+ hotkey: '❯',
+ subitems: [
+ {
+ text: i18n.global.t('flip.x'),
+ hotkey: '|',
+ onclick: () => this.flip('X'),
+ },
+ {
+ text: i18n.global.t('flip.y'),
+ hotkey: '-',
+ onclick: () => this.flip('Y'),
+ },
+ ],
+ },
+ ];
+ }
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
diff --git a/packages/core/plugin/FontPlugin.ts b/packages/core/plugin/FontPlugin.ts
new file mode 100644
index 0000000..6ddfedd
--- /dev/null
+++ b/packages/core/plugin/FontPlugin.ts
@@ -0,0 +1,148 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2024-04-21 23:51:01
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-06-07 21:53:36
+ * @Description: 自定义字体
+ */
+
+// const repoSrc = 'http://localhost:1337';
+import { fabric } from 'fabric';
+import FontFaceObserver from 'fontfaceobserver';
+import axios from 'axios';
+import { downFile } from '../utils/utils';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+interface Font {
+ type: string;
+ fontFamily: string;
+}
+
+interface FontSource {
+ name: string;
+ type: string;
+ file: string;
+ img: string;
+}
+
+class FontPlugin implements IPluginTempl {
+ private tempPromise: Promise | null;
+ static pluginName = 'FontPlugin';
+ static apis = ['getFontList', 'loadFont', 'getFontJson', 'downFontByJSON'];
+ repoSrc: string;
+ cacheList: FontSource[];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor, config: { repoSrc: string }) {
+ this.repoSrc = config.repoSrc;
+ this.cacheList = [];
+ this.tempPromise = null;
+ }
+
+ hookImportBefore(json: string) {
+ return this.downFontByJSON(json);
+ }
+ getFontList() {
+ // 返回暂存字体
+ if (this.cacheList.length) {
+ return Promise.resolve(this.cacheList);
+ }
+ if (this.tempPromise) return this.tempPromise;
+ this.tempPromise = axios
+ .get(`${this.repoSrc}/api/fonts?populate=*&pagination[pageSize]=100`)
+ .then((res) => {
+ const list = res.data.data.map((item: any) => {
+ return {
+ name: item.attributes.name,
+ type: item.attributes.type,
+ file: this.repoSrc + item.attributes.file.data.attributes.url,
+ img: this.repoSrc + item.attributes.img.data.attributes.url,
+ };
+ });
+ this.cacheList = list;
+ this.createFontCSS(list);
+ return list;
+ });
+ return this.tempPromise;
+ }
+
+ downFontByJSON(str: string) {
+ const object = JSON.parse(str);
+ let fontFamilies: string[] = [];
+ const skipFonts = ['arial'];
+ if (object.objects) {
+ fontFamilies = JSON.parse(str)
+ .objects.filter((item: Font) => {
+ const hasFontFile = this.cacheList.find((font) => font.name === item.fontFamily);
+ return item.type.includes('text') && !skipFonts.includes(item.fontFamily) && hasFontFile;
+ })
+ .map((item: Font) => item.fontFamily);
+ } else {
+ fontFamilies = skipFonts.includes(object.fontFamily) ? [] : [object.fontFamily];
+ }
+
+ const fontFamiliesAll = fontFamilies.map((fontName) => {
+ const font = new FontFaceObserver(fontName);
+ return font.load(null, 150000);
+ });
+ return Promise.all(fontFamiliesAll);
+ }
+
+ // 获取字体数据 新增字体样式使用
+ getFontJson() {
+ const activeObject = this.canvas.getActiveObject();
+ if (activeObject) {
+ const json = activeObject.toJSON(['id', 'gradientAngle', 'selectable', 'hasControls']);
+ const fileStr = `data:text/json;charset=utf-8,${encodeURIComponent(
+ JSON.stringify(json, null, '\t')
+ )}`;
+ const dataUrl = activeObject.toDataURL({});
+ downFile(fileStr, 'font.json');
+ downFile(dataUrl, 'font.png');
+ }
+ }
+
+ loadFont(fontName: string) {
+ const font = new FontFaceObserver(fontName);
+ return font.load(null, 150000).then(() => {
+ const activeObject = this.canvas.getActiveObjects()[0];
+ if (activeObject) {
+ activeObject.set('fontFamily', fontName);
+ this.canvas.renderAll();
+ }
+ });
+ }
+
+ createFontCSS(arr: any[]) {
+ let code = '';
+ arr.forEach((item) => {
+ code =
+ code +
+ `
+ @font-face {
+ font-family: ${item.name};
+ src: url('${item.file}');
+ }
+ `;
+ });
+ const style = document.createElement('style');
+ try {
+ style.appendChild(document.createTextNode(code));
+ } catch (error) {
+ // style.styleSheet.cssText = code;
+ }
+ const head = document.getElementsByTagName('head')[0];
+ head.appendChild(style);
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default FontPlugin;
diff --git a/packages/core/plugin/FreeDrawPlugin.ts b/packages/core/plugin/FreeDrawPlugin.ts
new file mode 100644
index 0000000..a598135
--- /dev/null
+++ b/packages/core/plugin/FreeDrawPlugin.ts
@@ -0,0 +1,46 @@
+import { fabric } from 'fabric';
+import { v4 as uuid } from 'uuid';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+type DrawOptions = {
+ width: number;
+};
+
+export default class FreeDrawPlugin implements IPluginTempl {
+ static pluginName = 'FreeDrawPlugin';
+ static apis = ['startDraw', 'endDraw'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+
+ _bindEvent() {
+ this.canvas.on('path:created', this._createdHandler);
+ }
+
+ _unbindEvent() {
+ this.canvas.off('path:created', this._createdHandler);
+ }
+
+ _createdHandler = (opt: any) => {
+ opt.path.set('id', uuid());
+ };
+
+ startDraw(options: DrawOptions) {
+ this.canvas.isDrawingMode = true;
+ this.canvas.freeDrawingBrush = new fabric.PencilBrush(this.canvas);
+ this.canvas.freeDrawingBrush.width = options.width;
+ this._bindEvent();
+ }
+ endDraw() {
+ if (this.canvas.isDrawingMode) {
+ this.canvas.isDrawingMode = false;
+ this._unbindEvent();
+ return;
+ }
+ }
+}
diff --git a/packages/core/plugin/GroupAlignPlugin.ts b/packages/core/plugin/GroupAlignPlugin.ts
new file mode 100644
index 0000000..7a6c347
--- /dev/null
+++ b/packages/core/plugin/GroupAlignPlugin.ts
@@ -0,0 +1,337 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-22 16:19:46
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-07-22 10:21:05
+ * @Description: 组对齐插件
+ */
+
+import { fabric } from 'fabric';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick<
+ GroupAlignPlugin,
+ 'left' | 'right' | 'xcenter' | 'ycenter' | 'top' | 'bottom' | 'xequation' | 'yequation'
+>;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+class GroupAlignPlugin implements IPluginTempl {
+ static pluginName = 'GroupAlignPlugin';
+ static apis = ['left', 'right', 'xcenter', 'ycenter', 'top', 'bottom', 'xequation', 'yequation'];
+ // public hotkeys: string[] = ['space'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+
+ left() {
+ const { canvas } = this;
+
+ const activeObject = canvas.getActiveObject();
+ const selectObjects = canvas.getActiveObjects();
+ if (activeObject) {
+ const { left = 0 } = activeObject;
+ canvas.discardActiveObject();
+ selectObjects.forEach((item) => {
+ const bounding = item.getBoundingRect(true);
+ item.set({
+ left: left - bounding.left + Number(item.left),
+ });
+ item.setCoords();
+ });
+ const activeSelection = new fabric.ActiveSelection(selectObjects, {
+ canvas: canvas,
+ });
+ canvas.setActiveObject(activeSelection);
+ canvas.requestRenderAll();
+ }
+ }
+
+ right() {
+ const { canvas } = this;
+
+ const activeObject = canvas.getActiveObject();
+ const selectObjects = canvas.getActiveObjects();
+ if (activeObject) {
+ const { left = 0, width = 0 } = activeObject;
+ canvas.discardActiveObject();
+ selectObjects.forEach((item) => {
+ const bounding = item.getBoundingRect(true);
+ item.set({
+ left: left + width - (bounding.left + bounding.width) + Number(item.left),
+ });
+ });
+ const activeSelection = new fabric.ActiveSelection(selectObjects, {
+ canvas: canvas,
+ });
+ canvas.setActiveObject(activeSelection);
+ canvas.requestRenderAll();
+ }
+ }
+
+ xcenter() {
+ const { canvas } = this;
+
+ const activeObject = canvas.getActiveObject();
+ const selectObjects = canvas.getActiveObjects();
+ if (activeObject) {
+ const { left = 0, width = 0 } = activeObject;
+ canvas.discardActiveObject();
+ selectObjects.forEach((item) => {
+ const bounding = item.getBoundingRect(true);
+ item.set({
+ left: left + width / 2 - (bounding.left + bounding.width / 2) + Number(item.left),
+ });
+ });
+ const activeSelection = new fabric.ActiveSelection(selectObjects, {
+ canvas: canvas,
+ });
+ canvas.setActiveObject(activeSelection);
+ canvas.requestRenderAll();
+ }
+ }
+
+ ycenter() {
+ const { canvas } = this;
+
+ const activeObject = canvas.getActiveObject();
+ const selectObjects = canvas.getActiveObjects();
+ if (activeObject) {
+ const { top = 0, height = 0 } = activeObject;
+ canvas.discardActiveObject();
+ selectObjects.forEach((item) => {
+ const bounding = item.getBoundingRect(true);
+ item.set({
+ top: top + height / 2 - (bounding.top + bounding.height / 2) + Number(item.top),
+ });
+ });
+ const activeSelection = new fabric.ActiveSelection(selectObjects, {
+ canvas: canvas,
+ });
+ canvas.setActiveObject(activeSelection);
+ canvas.requestRenderAll();
+ }
+ }
+
+ top() {
+ const { canvas } = this;
+
+ const activeObject = canvas.getActiveObject();
+ const selectObjects = canvas.getActiveObjects();
+ if (activeObject) {
+ const { top = 0 } = activeObject;
+ canvas.discardActiveObject();
+ selectObjects.forEach((item) => {
+ const bounding = item.getBoundingRect(true);
+ item.set({
+ top: top - bounding.top + Number(item.top),
+ });
+ });
+ const activeSelection = new fabric.ActiveSelection(selectObjects, {
+ canvas: canvas,
+ });
+ canvas.setActiveObject(activeSelection);
+ canvas.requestRenderAll();
+ }
+ }
+
+ bottom() {
+ const { canvas } = this;
+
+ const activeObject = canvas.getActiveObject();
+ const selectObjects = canvas.getActiveObjects();
+ if (activeObject) {
+ const { top = 0, height = 0 } = activeObject;
+ canvas.discardActiveObject();
+ selectObjects.forEach((item) => {
+ const bounding = item.getBoundingRect(true);
+ item.set({
+ top: top + height - (bounding.top + bounding.height) + Number(item.top),
+ });
+ });
+ const activeSelection = new fabric.ActiveSelection(selectObjects, {
+ canvas: canvas,
+ });
+ canvas.setActiveObject(activeSelection);
+ canvas.requestRenderAll();
+ }
+ }
+
+ xequation() {
+ const { canvas } = this;
+ const activeObject = canvas.getActiveObject() as fabric.ActiveSelection;
+ // width属性不准确,需要坐标换算
+ function getItemWidth(item: fabric.Object) {
+ let x1 = Infinity,
+ x2 = -Infinity;
+ for (const key in item.aCoords) {
+ if (item.aCoords[key].x < x1) {
+ x1 = item.aCoords[key].x;
+ }
+ if (item.aCoords[key].x > x2) {
+ x2 = item.aCoords[key].x;
+ }
+ }
+ return x2 - x1;
+ }
+
+ // 获取所有元素高度
+ function getAllItemHeight() {
+ let count = 0;
+ if (activeObject) {
+ activeObject.forEachObject((item: fabric.Object) => {
+ count += getItemWidth(item);
+ });
+ }
+
+ return count;
+ }
+ // 获取平均间距
+ function spacWidth() {
+ const count = getAllItemHeight();
+ if (activeObject) {
+ const allSpac = Number(activeObject.width) - count;
+ return allSpac / (activeObject._objects.length - 1);
+ }
+ }
+
+ // 获取当前元素之前所有元素的高度
+ function getItemLeft(i: number) {
+ if (i === 0) return 0;
+ let width = 0;
+ if (activeObject) {
+ for (let index = 0; index < i; index++) {
+ width += getItemWidth(activeObject._objects[index]);
+ }
+ }
+
+ return width;
+ }
+ if (activeObject && activeObject.type === 'activeSelection') {
+ const activeSelection = activeObject;
+ // 排序
+ activeSelection._objects.sort((a, b) => a.left - b.left);
+
+ // 平均间距计算
+ const itemSpac = spacWidth() as number;
+ // 组原点高度
+ const yHeight = Number(activeObject.width) / 2;
+
+ activeObject.forEachObject((item: fabric.Object, i: number) => {
+ // 获取当前元素之前所有元素的高度
+ const preHeight = getItemLeft(i);
+ // 顶部距离 间距 * 索引 + 之前元素高度 - 原点高度
+ const top = itemSpac * i + preHeight - yHeight;
+ item.set('left', top);
+ });
+ }
+
+ const objecs = canvas.getActiveObjects();
+ canvas.discardActiveObject();
+ objecs.forEach((item: fabric.Object) => {
+ let x = Infinity;
+ for (const key in item.aCoords) {
+ if (item.aCoords[key].x < x) {
+ x = item.aCoords[key].x;
+ }
+ }
+ item.set('left', 2 * item.left - x);
+ });
+
+ const sel = new fabric.ActiveSelection(objecs, {
+ canvas: canvas,
+ });
+ canvas.setActiveObject(sel);
+ canvas.requestRenderAll();
+ }
+
+ yequation() {
+ const { canvas } = this;
+ const activeObject = (canvas.getActiveObject() as fabric.ActiveSelection) || {
+ top: 0,
+ height: 0,
+ };
+ // width属性不准确,需要坐标换算
+ function getItemHeight(item: fabric.Object) {
+ let y1 = Infinity,
+ y2 = -Infinity;
+ for (const key in item.aCoords) {
+ if (item.aCoords[key].y < y1) {
+ y1 = item.aCoords[key].y;
+ }
+ if (item.aCoords[key].y > y2) {
+ y2 = item.aCoords[key].y;
+ }
+ }
+ return y2 - y1;
+ }
+ // 获取所有元素高度
+ function getAllItemHeight() {
+ let count = 0;
+ activeObject.forEachObject((item: fabric.Object) => {
+ count += getItemHeight(item);
+ });
+ return count;
+ }
+ // 获取平均间距
+ function spacHeight() {
+ const count = getAllItemHeight();
+ const allSpac = activeObject.height - count;
+ return allSpac / (activeObject._objects.length - 1);
+ }
+
+ // 获取当前元素之前所有元素的高度
+ function getItemTop(i: number) {
+ if (i === 0) return 0;
+ let height = 0;
+ for (let index = 0; index < i; index++) {
+ height += getItemHeight(activeObject._objects[index]);
+ }
+ return height;
+ }
+
+ if (activeObject && activeObject.type === 'activeSelection') {
+ const activeSelection = activeObject;
+ // 排序
+ activeSelection._objects.sort((a, b) => a.top - b.top);
+
+ // 平均间距计算
+ const itemSpac = spacHeight();
+ // 组原点高度
+ const yHeight = Number(activeObject.height) / 2;
+
+ activeObject.forEachObject((item: fabric.Object, i: number) => {
+ // 获取当前元素之前所有元素的高度
+ const preHeight = getItemTop(i);
+ // 顶部距离 间距 * 索引 + 之前元素高度 - 原点高度
+ const top = itemSpac * i + preHeight - yHeight;
+ item.set('top', top);
+ });
+ }
+
+ const objecs = canvas.getActiveObjects();
+ canvas.discardActiveObject();
+ objecs.forEach((item) => {
+ let y = Infinity;
+ for (const key in item.aCoords) {
+ if (item.aCoords[key].y < y) {
+ y = item.aCoords[key].y;
+ }
+ }
+ item.set('top', 2 * item.top - y);
+ });
+
+ const sel = new fabric.ActiveSelection(objecs, {
+ canvas: canvas,
+ });
+ canvas.setActiveObject(sel);
+ canvas.requestRenderAll();
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default GroupAlignPlugin;
diff --git a/packages/core/plugin/GroupPlugin.ts b/packages/core/plugin/GroupPlugin.ts
new file mode 100644
index 0000000..c435a53
--- /dev/null
+++ b/packages/core/plugin/GroupPlugin.ts
@@ -0,0 +1,74 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-20 13:21:10
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-04-10 23:26:13
+ * @Description: 组合拆分组合插件
+ */
+
+import { fabric } from 'fabric';
+import { isGroup, isActiveSelection } from '../utils/utils';
+import { v4 as uuid } from 'uuid';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+class GroupPlugin implements IPluginTempl {
+ static pluginName = 'GroupPlugin';
+ static apis = ['unGroup', 'group'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+
+ // 拆分组
+ unGroup() {
+ const activeObject = this.canvas.getActiveObject() as fabric.Group;
+ if (!activeObject) return;
+ // 先获取当前选中的对象,然后打散
+ const activeObjectList = activeObject.getObjects();
+ activeObject.toActiveSelection();
+ for (const item of activeObjectList) {
+ item.set('id', uuid());
+ }
+ this.canvas.discardActiveObject().renderAll();
+ }
+
+ group() {
+ // 组合元素
+ const activeObj = this.canvas.getActiveObject() as fabric.ActiveSelection;
+ if (!activeObj) return;
+ const activegroup = activeObj.toGroup();
+ const objectsInGroup = activegroup.getObjects();
+ activegroup.clone((newgroup: fabric.Group) => {
+ newgroup.set('id', uuid());
+ this.canvas.remove(activegroup);
+ objectsInGroup.forEach((object) => {
+ this.canvas.remove(object);
+ });
+ this.canvas.add(newgroup);
+ this.canvas.setActiveObject(newgroup);
+ });
+ }
+
+ contextMenu() {
+ const activeObject = this.canvas.getActiveObject();
+
+ if (isActiveSelection(activeObject)) {
+ return [{ text: '组合', hotkey: 'Ctrl+V', disabled: false, onclick: () => this.group() }];
+ }
+
+ if (isGroup(activeObject)) {
+ return [
+ { text: '拆分组合', hotkey: 'Ctrl+V', disabled: false, onclick: () => this.unGroup() },
+ ];
+ }
+ }
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default GroupPlugin;
diff --git a/packages/core/plugin/GroupTextEditorPlugin.ts b/packages/core/plugin/GroupTextEditorPlugin.ts
new file mode 100644
index 0000000..19768b0
--- /dev/null
+++ b/packages/core/plugin/GroupTextEditorPlugin.ts
@@ -0,0 +1,189 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-22 16:11:40
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-07-25 16:49:18
+ * @Description: 组内文字编辑
+ */
+
+import { fabric } from 'fabric';
+import { isGroup } from '../utils/utils';
+import { v4 as uuid } from 'uuid';
+import { pick } from 'lodash-es';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+class GroupTextEditorPlugin implements IPluginTempl {
+ static pluginName = 'GroupTextEditorPlugin';
+ isDown = false;
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this._init();
+ }
+
+ // 组内文本输入
+ _init() {
+ this.canvas.on('mouse:down', (opt) => {
+ this.isDown = true;
+ // 重置选中controls
+ if (
+ opt.target &&
+ !opt.target.lockMovementX &&
+ !opt.target.lockMovementY &&
+ !opt.target.lockRotation &&
+ !opt.target.lockScalingX &&
+ !opt.target.lockScalingY
+ ) {
+ opt.target.hasControls = true;
+ }
+ });
+
+ this.canvas.on('mouse:up', () => {
+ this.isDown = false;
+ });
+
+ this.canvas.on('mouse:dblclick', (opt) => {
+ if (isGroup(opt.target)) {
+ const selectedObject = this._getGroupObj(opt) as fabric.IText;
+ if (!selectedObject) return;
+ selectedObject.selectable = true;
+ // 由于组内的元素,双击以后会导致controls偏移,因此隐藏他
+ if (selectedObject.hasControls) {
+ selectedObject.hasControls = false;
+ }
+ if (this.isText(selectedObject)) {
+ this._bedingTextEditingEvent(selectedObject, opt.target);
+ return;
+ }
+ this.canvas.setActiveObject(selectedObject);
+ this.canvas.renderAll();
+ }
+ });
+ }
+
+ // 获取点击区域内的组内文字元素
+ _getGroupTextObj(opt: fabric.IEvent) {
+ const pointer = this.canvas.getPointer(opt.e, true);
+ if (!isGroup(opt.target)) return false;
+ const clickObj = this.canvas._searchPossibleTargets(opt.target._objects, pointer);
+ if (clickObj && this.isText(clickObj)) {
+ return clickObj;
+ }
+ return false;
+ }
+
+ _getGroupObj(opt: fabric.IEvent) {
+ const pointer = this.canvas.getPointer(opt.e, true);
+ if (!isGroup(opt.target)) return false;
+ const clickObj = this.canvas._searchPossibleTargets(opt.target._objects, pointer);
+ return clickObj;
+ }
+
+ // 通过组合重新组装来编辑文字,可能会耗性能。
+ _bedingTextEditingEvent(textObject: fabric.IText, groupObj: fabric.Group) {
+ const textObjectJSON = textObject.toObject();
+
+ const groupMatrix: number[] = groupObj.calcTransformMatrix();
+
+ const a: number = groupMatrix[0];
+ const b: number = groupMatrix[1];
+ const c: number = groupMatrix[2];
+ const d: number = groupMatrix[3];
+ const e: number = groupMatrix[4];
+ const f: number = groupMatrix[5];
+
+ const newX = a * (textObject.left ?? 0) + c * (textObject.top ?? 0) + e;
+ const newY = b * (textObject.left ?? 0) + d * (textObject.top ?? 0) + f;
+
+ const tempText = new (textObject.constructor as typeof fabric.IText)(textObject.text ?? '', {
+ ...textObjectJSON,
+ scaleX: textObjectJSON.scaleX * a,
+ scaleY: textObjectJSON.scaleY * a,
+ textAlign: textObject.textAlign,
+ left: newX,
+ top: newY,
+ styles: textObject.styles,
+ groupCopyed: textObject.group,
+ });
+ tempText.id = uuid();
+ textObject.visible = false;
+ groupObj.addWithUpdate();
+ tempText.visible = true;
+ tempText.selectable = true;
+ tempText.hasControls = false;
+ tempText.editable = true;
+ this.canvas.add(tempText);
+ this.canvas.setActiveObject(tempText);
+ tempText.enterEditing();
+ tempText.selectAll();
+
+ tempText.on('editing:exited', () => {
+ const attrs = tempText.toObject();
+
+ // 进入编辑模式时触发
+ textObject.set({
+ ...pick(attrs, [
+ 'fill',
+ 'fontSize',
+ 'fontStyle',
+ 'fontFamily',
+ 'lineHeight',
+ 'backgroundColor',
+ ]),
+ text: tempText.text,
+ visible: true,
+ });
+ groupObj.addWithUpdate();
+ tempText.visible = false;
+ this.canvas.remove(tempText);
+ this.canvas.setActiveObject(groupObj);
+ });
+ }
+
+ // 绑定编辑取消事件
+ _bedingEditingEvent(textObject: fabric.IText, opt: fabric.IEvent) {
+ if (!opt.target) return;
+ const left = opt.target.left;
+ const top = opt.target.top;
+ const ids = this._unGroup() || [];
+
+ const resetGroup = () => {
+ const groupArr = this.canvas.getObjects().filter((item) => item.id && ids.includes(item.id));
+ // 删除元素
+ groupArr.forEach((item) => this.canvas.remove(item));
+
+ // 生成新组
+ const group = new fabric.Group([...groupArr]);
+ group.set('left', left);
+ group.set('top', top);
+ group.set('id', uuid());
+ textObject.off('editing:exited', resetGroup);
+ this.canvas.add(group);
+ this.canvas.discardActiveObject().renderAll();
+ };
+ // 绑定取消事件
+ textObject.on('editing:exited', resetGroup);
+ }
+
+ // 拆分组合并返回ID
+ _unGroup() {
+ const ids: string[] = [];
+ const activeObj = this.canvas.getActiveObject() as fabric.Group;
+ if (!activeObj) return;
+ activeObj.getObjects().forEach((item) => {
+ const id = uuid();
+ ids.push(id);
+ item.set('id', id);
+ });
+ activeObj.toActiveSelection();
+ return ids;
+ }
+
+ isText(obj: fabric.Object) {
+ return obj.type && ['i-text', 'text', 'textbox'].includes(obj.type);
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default GroupTextEditorPlugin;
diff --git a/packages/core/plugin/HistoryPlugin.ts b/packages/core/plugin/HistoryPlugin.ts
new file mode 100644
index 0000000..b21e6be
--- /dev/null
+++ b/packages/core/plugin/HistoryPlugin.ts
@@ -0,0 +1,178 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-20 13:06:31
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2025-01-06 17:22:47
+ * @Description: 历史记录插件
+ */
+import { fabric } from 'fabric';
+import Editor from '../Editor';
+
+type IEditor = Editor;
+type callback = () => void;
+
+class HistoryPlugin implements IPluginTempl {
+ static pluginName = 'HistoryPlugin';
+ static apis = ['undo', 'redo', 'historyUpdate', 'clearAndSaveState', 'saveState'];
+ static events = [];
+
+ // 历史记录相关属性
+ private stack: string[] = [];
+ private currentIndex = 0;
+ private maxLength = 100;
+ private isProcessing = false;
+ private isLoading = false;
+
+ hotkeys: string[] = ['ctrl+z', 'ctrl+shift+z', '⌘+z', '⌘+shift+z'];
+
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this._init();
+ }
+
+ private _init() {
+ // 监听对象变更事件
+ const events = {
+ 'object:removed': () => this.saveState(),
+ 'object:modified': () => this.saveState(),
+ 'object:skewing': () => this.saveState(),
+ };
+
+ // 绑定事件
+ Object.entries(events).forEach(([event, handler]) => {
+ this.canvas.on(event, handler);
+ });
+
+ // 初始化状态
+ this.saveState();
+
+ // 更新历史记录状态
+ this.canvas.on('history:append', () => {
+ this.historyUpdate();
+ });
+
+ // 页面离开提示
+ window.addEventListener('beforeunload', (e) => {
+ const { undoCount } = this.getState();
+ if (undoCount > 0) {
+ (e || window.event).returnValue = '确认离开';
+ }
+ });
+ }
+
+ // 获取当前状态
+ private getCurrentState() {
+ return this.editor.getJson();
+ }
+
+ // 保存状态
+ private saveState() {
+ if (this.isProcessing) return;
+
+ // 清除当前索引后的记录
+ this.stack.splice(this.currentIndex);
+ this.stack.push(this.getCurrentState());
+
+ // 维护最大长度
+ if (this.stack.length > this.maxLength) {
+ this.stack.shift();
+ } else {
+ this.currentIndex++;
+ }
+ this.historyUpdate();
+ }
+
+ // 加载状态
+ private _loadState(state: string, eventName: string, callback?: callback) {
+ this.isLoading = true;
+ this.isProcessing = true;
+
+ // 处理 workspace 的特殊情况
+ const parsedState = JSON.parse(state);
+ const workspace = parsedState.objects?.find((item: any) => item.id === 'workspace');
+ if (workspace) {
+ workspace.evented = false;
+ }
+
+ this.canvas.loadFromJSON(state, () => {
+ this.canvas.renderAll();
+ this.canvas.fire(eventName);
+ this.isProcessing = false;
+ this.isLoading = false;
+ callback?.();
+ });
+ }
+
+ // 获取历史记录状态
+ private getState() {
+ return {
+ undoCount: this.currentIndex - 1,
+ redoCount: this.stack.length - this.currentIndex,
+ };
+ }
+
+ // 清空历史记录
+ private clear() {
+ this.stack = [];
+ this.currentIndex = 0;
+ this.saveState();
+ }
+
+ // 公开方法
+ historyUpdate() {
+ const { undoCount, redoCount } = this.getState();
+ this.editor.emit('historyUpdate', undoCount, redoCount);
+ }
+
+ hookImportAfter() {
+ this.clear();
+ this.historyUpdate();
+ return Promise.resolve();
+ }
+
+ undo() {
+ if (this.isLoading || this.currentIndex <= 1) return;
+
+ this.currentIndex--;
+ const state = this.stack[this.currentIndex - 1];
+ if (state) {
+ this._loadState(JSON.stringify(state), 'history:undo');
+ this.historyUpdate();
+ }
+ }
+
+ redo() {
+ if (this.isLoading || this.currentIndex >= this.stack.length) return;
+
+ const state = this.stack[this.currentIndex];
+ if (state) {
+ this._loadState(JSON.stringify(state), 'history:redo');
+ this.currentIndex++;
+ this.historyUpdate();
+ }
+ }
+
+ hotkeyEvent(eventName: string, e: KeyboardEvent) {
+ if (e.type === 'keydown') {
+ switch (eventName) {
+ case 'ctrl+z':
+ case '⌘+z':
+ this.undo();
+ break;
+ case 'ctrl+shift+z':
+ case '⌘+shift+z':
+ this.redo();
+ break;
+ }
+ }
+ }
+
+ clearAndSaveState() {
+ const currentState = this.getCurrentState();
+ this.stack = [currentState]; // 只保留当前状态作为第一条记录
+ this.currentIndex = 1;
+ this.historyUpdate();
+ }
+}
+
+export default HistoryPlugin;
diff --git a/packages/core/plugin/ImageStroke.ts b/packages/core/plugin/ImageStroke.ts
new file mode 100644
index 0000000..33131cd
--- /dev/null
+++ b/packages/core/plugin/ImageStroke.ts
@@ -0,0 +1,126 @@
+/*
+ * @Author: June 1601745371@qq.com
+ * @Date: 2024-06-19 10:30:25
+ * @LastEditors: June 1601745371@qq.com
+ * @LastEditTime: 2024-06-19 11:48:12
+ * @FilePath: \vue-fabric-editor\packages\core\plugin\ImageStroke.ts
+ * @Description: 图像描边
+ */
+import { fabric } from 'fabric';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+/*type IStrokeOps = {
+ enabled: boolean;
+ width: number;
+ color: string;
+ type: 'destination-out' | 'source-over' | 'source-in';
+};*/
+interface IExtendImage {
+ [x: string]: any;
+ originWidth?: number;
+ originHeight?: number;
+ originSrc?: string;
+}
+class ImageStrokePlugin implements IPluginTempl {
+ static pluginName = 'ImageStroke';
+ static apis = ['imageStrokeDraw'];
+ // public options: Required;
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ // this.options = Object.assign(
+ // {
+ // enabled: false,
+ // width: 5,
+ // color: '#000',
+ // type: 'source-over',
+ // },
+ // _options
+ // );
+ }
+
+ private addImage(src: string): Promise {
+ return new Promise((resolve, reject) => {
+ const img = new Image();
+ img.crossOrigin = 'anonymous';
+ img.onload = () => resolve(img);
+ img.onerror = () => reject();
+ img.src = src;
+ });
+ }
+
+ // imageStrokeEnable() {
+ // this.options.enabled = true;
+ // }
+
+ // imageStrokeDisable() {
+ // this.options.enabled = false;
+ // }
+
+ // imageStrokeSet(key: 'enabled' | 'width' | 'color' | 'type', val: any) {
+ // this.options[key] = val;
+ // }
+
+ async imageStrokeDraw(stroke: string, strokeWidth: number, type = 'source-over') {
+ const activeObject = this.canvas.getActiveObject() as (fabric.Image & IExtendImage) | undefined;
+ if (!activeObject) return;
+ const w = activeObject.originWidth || 0,
+ h = activeObject.originHeight || 0,
+ src = activeObject?.originSrc || activeObject.getSrc();
+ let canvas: HTMLCanvasElement | null = document.createElement('canvas');
+ const ctx = canvas!.getContext('2d');
+ if (!ctx) return;
+ // 描边等于0 说明关闭了开关或者不需要描边 直接从原图绘制
+ if (strokeWidth === 0) {
+ const { scaleX, scaleY, width, height } = activeObject;
+ activeObject.setSrc(src, () => {
+ activeObject.set('scaleX', (width! * scaleX!) / (activeObject.width || 1));
+ activeObject.set('scaleY', (height! * scaleY!) / (activeObject.height || 1));
+ activeObject.canvas?.renderAll();
+ });
+ return;
+ }
+ ctx.save();
+ ctx.clearRect(0, 0, canvas!.width, canvas!.height);
+ ctx.restore();
+ canvas!.width = w + strokeWidth * 2;
+ canvas!.height = h + strokeWidth * 2;
+ const dArr = [-1, -1, 0, -1, 1, -1, -1, 0, 1, 0, -1, 1, 0, 1, 1, 1];
+ const img = await this.addImage(src);
+ if (!img) return;
+ for (let i = 0; i < dArr.length; i += 2) {
+ ctx.drawImage(
+ img,
+ strokeWidth + dArr[i] * strokeWidth,
+ strokeWidth + dArr[i + 1] * strokeWidth,
+ w,
+ h
+ );
+ }
+ ctx.globalCompositeOperation = 'source-in';
+ ctx.fillStyle = stroke;
+ ctx.fillRect(0, 0, w + strokeWidth * 2, h + strokeWidth * 2);
+ ctx.globalCompositeOperation = type as any;
+ ctx.drawImage(img, strokeWidth, strokeWidth, w, h);
+ const res = canvas?.toDataURL();
+ canvas = null;
+ if (!res) return;
+ const { scaleX, scaleY, width, height } = activeObject;
+ activeObject.setSrc(res, () => {
+ activeObject.set('scaleX', (width! * scaleX!) / (activeObject.width || 1));
+ activeObject.set('scaleY', (height! * scaleY!) / (activeObject.height || 1));
+ activeObject.canvas?.renderAll();
+ });
+ }
+
+ destroy() {
+ // this.editor.off('sizeChange', this.drawWaterMark);
+ }
+}
+
+export default ImageStrokePlugin;
diff --git a/packages/core/plugin/LayerPlugin.ts b/packages/core/plugin/LayerPlugin.ts
new file mode 100644
index 0000000..6cb5de0
--- /dev/null
+++ b/packages/core/plugin/LayerPlugin.ts
@@ -0,0 +1,113 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-15 23:23:18
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-07-06 23:53:42
+ * @Description: 图层调整插件
+ */
+
+import { fabric } from 'fabric';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+class LayerPlugin implements IPluginTempl {
+ static pluginName = 'LayerPlugin';
+ static apis = ['up', 'down', 'toFront', 'toBack'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+
+ _getWorkspace() {
+ return this.canvas.getObjects().find((item) => item.id === 'workspace');
+ }
+
+ _workspaceSendToBack() {
+ const workspace = this._getWorkspace();
+ workspace && workspace.sendToBack();
+ }
+
+ up() {
+ const actives = this.canvas.getActiveObjects();
+ if (actives && actives.length === 1) {
+ const activeObject = this.canvas.getActiveObjects()[0];
+ activeObject && activeObject.bringForward();
+ this.canvas.renderAll();
+ this._workspaceSendToBack();
+ }
+ }
+
+ down() {
+ const actives = this.canvas.getActiveObjects();
+ if (actives && actives.length === 1) {
+ const activeObject = this.canvas.getActiveObjects()[0];
+ activeObject && activeObject.sendBackwards();
+ this.canvas.renderAll();
+ this._workspaceSendToBack();
+ }
+ }
+
+ toFront() {
+ const actives = this.canvas.getActiveObjects();
+ if (actives && actives.length === 1) {
+ const activeObject = this.canvas.getActiveObjects()[0];
+ activeObject && activeObject.bringToFront();
+ this.canvas.renderAll();
+ this._workspaceSendToBack();
+ }
+ }
+
+ toBack() {
+ const actives = this.canvas.getActiveObjects();
+ if (actives && actives.length === 1) {
+ const activeObject = this.canvas.getActiveObjects()[0];
+ activeObject && activeObject.sendToBack();
+ this.canvas.renderAll();
+ this._workspaceSendToBack();
+ }
+ }
+
+ contextMenu() {
+ const activeObject = this.canvas.getActiveObject();
+ if (activeObject) {
+ return [
+ {
+ text: '图层管理',
+ hotkey: '❯',
+ subitems: [
+ {
+ text: '上一个',
+ hotkey: '',
+ onclick: () => this.up(),
+ },
+ {
+ text: '下一个',
+ hotkey: '',
+ onclick: () => this.down(),
+ },
+ {
+ text: '置顶',
+ hotkey: '',
+ onclick: () => this.toFront(),
+ },
+ {
+ text: '置底',
+ hotkey: '',
+ onclick: () => this.toBack(),
+ },
+ ],
+ },
+ ];
+ // return [{ text: '复制', hotkey: 'Ctrl+V', disabled: false, onclick: () => this.clone() }];
+ }
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default LayerPlugin;
diff --git a/packages/core/plugin/LockPlugin.ts b/packages/core/plugin/LockPlugin.ts
new file mode 100644
index 0000000..c184480
--- /dev/null
+++ b/packages/core/plugin/LockPlugin.ts
@@ -0,0 +1,225 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2024-07-04 14:27:05
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-07-22 10:11:29
+ * @Description: 锁定文件
+ */
+import { fabric } from 'fabric';
+import { SelectEvent, SelectMode } from '../eventType';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+import lockImg from '../assets/lock.svg?url';
+// import lockImg from '../assets/rotateicon.svg?url';
+// import unlockImg from '../assets/unlock.svg?url'
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+enum ItypeKey {
+ lockMovementX = 'lockMovementX',
+ lockMovementY = 'lockMovementY',
+ lockRotation = 'lockRotation',
+ lockScalingX = 'lockScalingX',
+ lockScalingY = 'lockScalingY',
+}
+
+enum IControlKey {
+ bl = 'bl',
+ br = 'br',
+ mb = 'mb',
+ ml = 'ml',
+ mr = 'mr',
+ mt = 'mt',
+ tl = 'tl',
+ tr = 'tr',
+ mtr = 'mtr',
+ lock = 'lock',
+}
+
+export default class LockPlugin implements IPluginTempl {
+ static pluginName = 'LockPlugin';
+ static apis = ['lock', 'unLock'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.init();
+ }
+
+ init() {
+ const imgEl = document.createElement('img');
+ imgEl.src = lockImg;
+ const that = this;
+ function renderIcon(
+ ctx: CanvasRenderingContext2D,
+ left: number,
+ top: number,
+ styleOverride: any,
+ fabricObject: fabric.Object
+ ) {
+ const iconWith = 25;
+ ctx.save();
+ ctx.translate(left, top);
+ const angle = fabricObject.angle as number;
+ ctx.rotate(fabric.util.degreesToRadians(angle));
+ ctx.drawImage(imgEl, -iconWith / 2, -iconWith / 2, iconWith, iconWith);
+ ctx.restore();
+ }
+
+ function unLockObject(eventData: any, transform: any): boolean {
+ that.unLock();
+ return true;
+ }
+
+ fabric.Object.prototype.controls.lock = new fabric.Control({
+ x: 0.5,
+ y: 0.5,
+ offsetY: 0,
+ cursorStyle: 'pointer',
+ mouseUpHandler: unLockObject,
+ render: renderIcon,
+ });
+
+ fabric.Textbox.prototype.controls.lock = new fabric.Control({
+ x: 0.5,
+ y: 0.5,
+ offsetY: 0,
+ cursorStyle: 'pointer',
+ mouseUpHandler: unLockObject,
+ render: renderIcon,
+ });
+ this.canvas.on('selection:created', () => this.renderCornerByActiveObj());
+ this.canvas.on('selection:updated', () => this.renderCornerByActiveObj());
+
+ // 鼠标框选不能多选锁定元素
+ (fabric.Canvas.prototype as any)._groupSelectedObjects = function (e: any) {
+ const group = this._collectObjects(e);
+ let aGroup;
+
+ for (let i = group.length - 1; i >= 0; i--) {
+ if (group[i].lockMovementX) {
+ group.splice(i, 1);
+ }
+ }
+
+ // do not create group for 1 element only
+ if (group.length === 1) {
+ this.setActiveObject(group[0], e);
+ } else if (group.length > 1) {
+ aGroup = new fabric.ActiveSelection(group.reverse(), {
+ canvas: this,
+ });
+ this.setActiveObject(aGroup, e);
+ }
+ };
+
+ // shift+左键点选不能多选锁定元素
+ (fabric.Canvas.prototype as any)._handleGrouping = function (e: any, target: fabric.Object) {
+ const activeObject = this._activeObject;
+ // avoid multi select when shift click on a corner
+ if (activeObject.__corner) {
+ return;
+ }
+
+ if (target.lockMovementX) return;
+ if (activeObject.lockMovementX) return;
+
+ if (target === activeObject) {
+ // if it's a group, find target again, using activeGroup objects
+ target = this.findTarget(e, true);
+ // if even object is not found or we are on activeObjectCorner, bail out
+ if (!target || !target.selectable) {
+ return;
+ }
+ if (target.lockMovementX) return;
+ }
+ if (activeObject && activeObject.type === 'activeSelection') {
+ this._updateActiveSelection(target, e);
+ } else {
+ this._createActiveSelection(target, e);
+ }
+ };
+ }
+
+ controlCornersVisible(obj: fabric.Object) {
+ const isLocked = obj.lockMovementX;
+ Object.values(IControlKey).forEach((key: IControlKey) => {
+ if (key === IControlKey.lock) {
+ obj.setControlVisible(key, isLocked);
+ } else {
+ obj.setControlVisible(key, !isLocked);
+ }
+ });
+ }
+
+ renderCornerByActiveObj() {
+ const actives = this.canvas
+ .getActiveObjects()
+ .filter((item) => !(item instanceof fabric.GuideLine));
+ if (actives && actives.length === 1) {
+ const active = actives[0];
+ this.controlCornersVisible(active);
+ } else if (actives && actives.length > 1) {
+ const active = this.canvas.getActiveObject();
+ if (active) {
+ this.controlCornersVisible(active);
+ }
+ }
+ }
+
+ hookImportAfter() {
+ this.canvas.forEachObject((obj: fabric.Object) => {
+ if (obj.hasControls === false && obj.selectable === false) {
+ this.canvas.setActiveObject(obj);
+ this.lock();
+ }
+ });
+ return Promise.resolve();
+ }
+
+ lock() {
+ const activeObject = this.canvas.getActiveObject() as fabric.Object;
+ if (activeObject) {
+ // 修改默认属性
+ Object.values(ItypeKey).forEach((key: ItypeKey) => {
+ activeObject[key] = true;
+ });
+ this.controlCornersVisible(activeObject);
+ this.canvas.renderAll();
+ this.editor.emit(SelectEvent.ONE, [activeObject]);
+ }
+ }
+
+ unLock() {
+ const activeObject = this.canvas.getActiveObject() as fabric.Object;
+ if (activeObject) {
+ activeObject.hasControls = true;
+ activeObject.selectable = true;
+ activeObject.evented = true;
+ // 修改默认属性
+ Object.values(ItypeKey).forEach((key: ItypeKey) => {
+ activeObject[key] = false;
+ });
+ this.controlCornersVisible(activeObject);
+ this.canvas.renderAll();
+ this.editor.emit(SelectEvent.ONE, [activeObject]);
+ }
+ }
+
+ contextMenu() {
+ const selectedMode = this.editor.getSelectMode();
+ const activeObject = this.canvas.getActiveObject();
+ if (selectedMode === SelectMode.ONE && activeObject) {
+ if (activeObject.selectable) {
+ return [{ text: '锁定', hotkey: '', onclick: () => this.lock() }];
+ } else {
+ return [{ text: '解锁', hotkey: '', onclick: () => this.unLock() }];
+ }
+ }
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
diff --git a/packages/core/plugin/MaskPlugin.ts b/packages/core/plugin/MaskPlugin.ts
new file mode 100644
index 0000000..817a785
--- /dev/null
+++ b/packages/core/plugin/MaskPlugin.ts
@@ -0,0 +1,141 @@
+/*
+ * @Author: MOmo
+ * @Date: 2024-07-12 15:10:02
+ * @LastEditors: MOmo
+ * @LastEditTime: 2024-07-12 15:15:45
+ * @Description: 画布蒙层插件
+ */
+
+import { fabric } from 'fabric';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+class MaskPlugin implements IPluginTempl {
+ static pluginName = 'MaskPlugin';
+ static apis = ['setCoverMask', 'workspaceMaskToggle', 'getworkspaceMaskStatus'];
+ coverMask: null | fabric.Rect = null;
+ workspace: null | fabric.Rect = null;
+ workspaceEl!: HTMLElement;
+ hackFlag = false;
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.init();
+ }
+
+ private init() {
+ const workspaceEl = document.querySelector('#workspace') as HTMLElement;
+ if (!workspaceEl) {
+ throw new Error('element #workspace is missing, plz check!');
+ }
+ this.workspaceEl = workspaceEl;
+ }
+
+ /**
+ * @desc 蒙版开关
+ * @param val Boolean false
+ */
+ workspaceMaskToggle() {
+ const workspaceMask = this.getWorkspaceMask();
+ if (!workspaceMask) {
+ this.initMask();
+ } else {
+ // 如果有 则删除
+ workspaceMask && this.canvas.remove(workspaceMask);
+ this.workspace?.clone((cloned: fabric.Rect) => {
+ this.canvas.clipPath = cloned;
+ this.coverMask = null;
+ this.canvas.requestRenderAll();
+ });
+ this.editor.off('loadJson', this.initMask);
+ }
+ }
+ /**
+ * @desc 获取蒙版开关
+ */
+ getworkspaceMaskStatus() {
+ return this.coverMask !== null;
+ }
+
+ /**
+ * @desc 获取蒙版
+ * @returns Object
+ */
+ getWorkspaceMask() {
+ return this.canvas.getObjects().find((item) => item.id === 'coverMask') as fabric.Rect;
+ }
+
+ // 返回workspace对象
+ getWorkspase() {
+ return this.canvas.getObjects().find((item) => item.id === 'workspace') as fabric.Rect;
+ }
+
+ setCoverMask(hack = false) {
+ if (!this.coverMask || !this.workspace) {
+ return;
+ }
+ const center = this.canvas.getCenter();
+ const zoom = this.canvas.getZoom();
+ let zoomToPointNumber = zoom;
+ if (hack) {
+ // 比较hack的方法,判断为fabric内部的数据更新问题
+ zoomToPointNumber += 0.0000001 * (this.hackFlag ? 1 : -1);
+ this.hackFlag = !this.hackFlag;
+ }
+
+ this.canvas.zoomToPoint(new fabric.Point(center.left, center.top), zoomToPointNumber);
+ if (zoom) {
+ const { workspaceEl } = this;
+ const width = workspaceEl.offsetWidth;
+ const height = workspaceEl.offsetHeight;
+ const cWidth = width / zoom;
+ const cHeight = height / zoom;
+ this.coverMask.width = cWidth;
+ this.coverMask.height = cHeight;
+ this.coverMask.left = (this.workspace.left || 0) + (this.workspace.width! - cWidth) / 2;
+ this.coverMask.top = (this.workspace.top || 0) + (this.workspace.height! - cHeight) / 2;
+ this.workspace.clone((clone: fabric.Rect) => {
+ clone.left = -clone.width! / 2;
+ clone.top = -clone.height! / 2;
+ clone.inverted = true;
+ this.coverMask!.clipPath = clone;
+ this.canvas.requestRenderAll();
+ });
+ }
+ }
+
+ initMask(needBindLoadJSON = true) {
+ this.workspace = this.getWorkspase();
+ if (!this.workspace) {
+ throw new Error('MaskPlugin must be used after WorkspacePlugin!');
+ }
+ const coverMask = new fabric.Rect({
+ fill: 'rgba(0,0,0,0.5)',
+ id: 'coverMask',
+ strokeWidth: 0,
+ });
+ coverMask.set('selectable', false);
+ coverMask.set('hasControls', false);
+ coverMask.set('evented', false);
+ coverMask.hoverCursor = 'default';
+ this.canvas.on('object:added', () => {
+ coverMask.bringToFront();
+ });
+ this.canvas.clipPath = undefined;
+ this.canvas.add(coverMask);
+ this.coverMask = coverMask;
+ this.setCoverMask();
+ // 适配模板和psd的loadjson,在加载完成后再入mask
+ needBindLoadJSON && this.editor.on('loadJson', () => this.initMask(false));
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default MaskPlugin;
diff --git a/packages/core/plugin/MaterialPlugin.ts b/packages/core/plugin/MaterialPlugin.ts
new file mode 100644
index 0000000..f8e0cd9
--- /dev/null
+++ b/packages/core/plugin/MaterialPlugin.ts
@@ -0,0 +1,207 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-08-04 21:13:16
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-05-11 14:20:26
+ * @Description: 素材插件
+ */
+
+import { fabric } from 'fabric';
+import axios from 'axios';
+import qs from 'qs';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick<
+ MaterialPlugin,
+ 'getTemplTypeList' | 'getTemplList' | 'getMaterialTypeList' | 'getMaterialList' | 'getSizeList'
+>;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+class MaterialPlugin implements IPluginTempl {
+ static pluginName = 'MaterialPlugin';
+ static apis = [
+ 'getTemplTypeList',
+ 'getTemplList',
+ 'getMaterialTypeList',
+ 'getMaterialList',
+ 'getSizeList',
+ ];
+ apiMapUrl: { [propName: string]: string };
+ repoSrc: string;
+ constructor(public canvas: fabric.Canvas, public editor: IEditor, config: { repoSrc: string }) {
+ this.repoSrc = config.repoSrc;
+ this.apiMapUrl = {
+ template: config.repoSrc + '/template/type.json',
+ svg: config.repoSrc + '/svg/type.json',
+ };
+ }
+ // 获取模板分类
+ getTemplTypeList() {
+ return axios.get(`${this.repoSrc}/api/templ-types?pagination[pageSize]=100`).then((res) => {
+ const list = res.data.data.map((item: any) => {
+ return {
+ value: item.id,
+ label: item.attributes.name,
+ };
+ });
+ return list;
+ });
+ }
+ // 分页获取模板列表
+ getTemplList(templType = '', index = 1, searchKeyword = '') {
+ const query = {
+ fields: '*',
+ populate: {
+ img: '*',
+ },
+ filters: {},
+ pagination: {
+ page: index,
+ pageSize: 10,
+ },
+ };
+
+ const queryParams = this._getQueryParams(query, [
+ {
+ key: 'templ_type',
+ value: templType,
+ type: '$eq',
+ },
+ {
+ key: 'name',
+ value: searchKeyword,
+ type: '$contains',
+ },
+ ]);
+
+ return axios.get(`${this.repoSrc}/api/templs?${queryParams}`).then((res: any) => {
+ const list = res.data.data.map((item: any) => {
+ return {
+ name: item.attributes.name,
+ desc: item.attributes.desc,
+ src: this._getMaterialPreviewUrl(item.attributes.img),
+ json: item.attributes.json,
+ };
+ });
+ return { list, pagination: res?.data?.meta?.pagination };
+ });
+ }
+
+ /**
+ * @description: 获取素材分类
+ * @return {Promise}
+ */
+ getMaterialTypeList() {
+ return axios.get(`${this.repoSrc}/api/material-types?pagination[pageSize]=100`).then((res) => {
+ const list = res.data.data.map((item: any) => {
+ return {
+ value: item.id,
+ label: item.attributes.name,
+ };
+ });
+ return list;
+ });
+ }
+
+ /**
+ * @description: 获取素材列表
+ * @returns Promise
+ */
+ getMaterialList(materialType = '', index = 1, searchKeyword = '') {
+ const query = {
+ populate: {
+ img: '*',
+ },
+ // fields: ['materialType'],
+ filters: {},
+ pagination: {
+ page: index,
+ pageSize: 50,
+ },
+ };
+
+ const queryParams = this._getQueryParams(query, [
+ {
+ key: 'material_type',
+ value: materialType,
+ type: '$eq',
+ },
+ {
+ key: 'name',
+ value: searchKeyword,
+ type: '$contains',
+ },
+ ]);
+
+ return axios.get(`${this.repoSrc}/api/materials?${queryParams}`).then((res: any) => {
+ const list = res.data.data.map((item: any) => {
+ return {
+ name: item.attributes.name,
+ desc: item.attributes.desc,
+ src: this._getMaterialInfoUrl(item.attributes.img),
+ previewSrc: this._getMaterialPreviewUrl(item.attributes.img),
+ };
+ });
+ return { list, pagination: res?.data?.meta?.pagination };
+ });
+ }
+
+ getSizeList() {
+ return axios.get(`${this.repoSrc}/api/sizes?pagination[pageSize]=100`).then((res) => {
+ const list = res.data.data.map((item: any) => {
+ return {
+ value: item.id,
+ name: item.attributes.name,
+ width: Number(item.attributes.width),
+ height: Number(item.attributes.height),
+ unit: item.attributes.unit,
+ };
+ });
+ return list;
+ });
+ }
+ getFontList() {
+ return axios.get(`${this.repoSrc}/api/fonts?pagination[pageSize]=100`).then((res) => {
+ const list = res.data.data.map((item: any) => {
+ return {
+ value: item.id,
+ label: item.attributes.name,
+ };
+ });
+ return list;
+ });
+ }
+
+ _getMaterialInfoUrl(info: any) {
+ const imgUrl = info?.data?.attributes?.url || '';
+ return this.repoSrc + imgUrl;
+ }
+
+ _getMaterialPreviewUrl(info: any) {
+ const imgUrl = info?.data?.attributes?.formats?.small?.url || info?.data?.attributes?.url || '';
+ return this.repoSrc + imgUrl;
+ }
+
+ // 拼接查询条件参数
+ _getQueryParams(option: any, filters: any) {
+ filters.forEach((item: any) => {
+ const { key, value, type } = item;
+ if (value) {
+ option.filters[key] = { [type]: value };
+ }
+ });
+ return qs.stringify(option);
+ }
+
+ async getMaterialInfo(typeId: string) {
+ const url = this.apiMapUrl[typeId];
+ const res = await axios.get(url, { params: { typeId } });
+ return res.data.data;
+ }
+}
+
+export default MaterialPlugin;
diff --git a/packages/core/plugin/MiddleMousePlugin.ts b/packages/core/plugin/MiddleMousePlugin.ts
new file mode 100644
index 0000000..67b8a15
--- /dev/null
+++ b/packages/core/plugin/MiddleMousePlugin.ts
@@ -0,0 +1,49 @@
+/*
+ * @Author: George
+ * @Date: 2024-10-29 11:11:11
+ * @LastEditors: George
+ * @LastEditTime: 2024-10-29 11:11:11
+ * @Description: 鼠标中键点击事件插件
+ */
+
+import { fabric } from 'fabric';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+class MiddleMousePlugin implements IPluginTempl {
+ static pluginName = 'MiddleMousePlugin';
+ workspaceEl!: HTMLElement;
+
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.init();
+ }
+
+ private init() {
+ const workspaceEl = document.querySelector('#workspace') as HTMLElement;
+ if (!workspaceEl) {
+ throw new Error('element #workspace is missing, plz check!');
+ }
+ this.workspaceEl = workspaceEl;
+ this.initListener();
+ }
+
+ private handleMouseUp = (e: MouseEvent) => e.button === 1 && this.canvas.fire('mouse:up', { e });
+
+ private handleMouseDown = (e: MouseEvent) =>
+ e.button === 1 && this.canvas.fire('mouse:down', { e });
+
+ /**
+ * @desc 初始化鼠标中键监听事件
+ */
+ private initListener() {
+ this.workspaceEl.addEventListener('mouseup', this.handleMouseUp);
+ this.workspaceEl.addEventListener('mousedown', this.handleMouseDown);
+ }
+
+ destroy() {
+ this.workspaceEl.removeEventListener('mouseup', this.handleMouseUp);
+ this.workspaceEl.removeEventListener('mousedown', this.handleMouseDown);
+ console.log('pluginDestroy');
+ }
+}
+
+export default MiddleMousePlugin;
diff --git a/packages/core/plugin/MoveHotKeyPlugin.ts b/packages/core/plugin/MoveHotKeyPlugin.ts
new file mode 100644
index 0000000..c248c92
--- /dev/null
+++ b/packages/core/plugin/MoveHotKeyPlugin.ts
@@ -0,0 +1,51 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-20 12:52:09
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-04-10 17:32:31
+ * @Description: 移动快捷键
+ */
+
+import { fabric } from 'fabric';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+class MoveHotKeyPlugin implements IPluginTempl {
+ static pluginName = 'MoveHotKeyPlugin';
+ hotkeys: string[] = ['left', 'right', 'down', 'up'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+
+ // 快捷键扩展回调
+ hotkeyEvent(eventName: string, e: KeyboardEvent) {
+ if (e.type === 'keydown') {
+ const { canvas } = this;
+ const activeObject = canvas.getActiveObject();
+ if (!activeObject) return;
+ switch (eventName) {
+ case 'left':
+ if (activeObject.left === undefined) return;
+ activeObject.set('left', activeObject.left - 1);
+ break;
+ case 'right':
+ if (activeObject.left === undefined) return;
+ activeObject.set('left', activeObject.left + 1);
+ break;
+ case 'down':
+ if (activeObject.top === undefined) return;
+ activeObject.set('top', activeObject.top + 1);
+ break;
+ case 'up':
+ if (activeObject.top === undefined) return;
+ activeObject.set('top', activeObject.top - 1);
+ break;
+ default:
+ }
+ canvas.renderAll();
+ }
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default MoveHotKeyPlugin;
diff --git a/packages/core/plugin/PathTextPlugin.ts b/packages/core/plugin/PathTextPlugin.ts
new file mode 100644
index 0000000..4668578
--- /dev/null
+++ b/packages/core/plugin/PathTextPlugin.ts
@@ -0,0 +1,84 @@
+import { fabric } from 'fabric';
+import { v4 as uuid } from 'uuid';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+type DrawOptions = {
+ decimate: number;
+ width: number;
+ defaultText: string;
+ color: string;
+ lineColor: string;
+ defaultFontSize: number;
+};
+
+export default class PathTextPlugin implements IPluginTempl {
+ static pluginName = 'PathTextPlugin';
+ static apis = ['startTextPathDraw', 'endTextPathDraw'];
+ private options?: DrawOptions;
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+
+ _beforeHandler = (opt: any) => {
+ if (this.options == null) return;
+ const path = opt.path as any;
+ const getPathSegmentsInfo = (fabric.util as any).getPathSegmentsInfo;
+ path.segmentsInfo = getPathSegmentsInfo(path.path);
+ path.set({ stroke: this.options.lineColor });
+ const text = this.options.defaultText;
+ const fontSize = this.options.defaultFontSize;
+ const textObject = new fabric.IText(text, {
+ shadow: '',
+ fontFamily: 'arial',
+ fontSize: fontSize,
+ top: path.top,
+ left: path.left,
+ fill: this.options.color,
+ path: path,
+ id: uuid(),
+ // 路径文字元素禁止在画布上直接编辑
+ editable: false,
+ });
+ this.canvas.add(textObject);
+ };
+ _createdHandler = (opt: any) => {
+ this.canvas.remove(opt.path);
+ };
+ _bindEvent() {
+ this.canvas.on('before:path:created', this._beforeHandler);
+ this.canvas.on('path:created', this._createdHandler);
+ }
+ _unbindEvent() {
+ this.canvas.off('before:path:created', this._beforeHandler);
+ this.canvas.off('path:created', this._createdHandler);
+ }
+ startTextPathDraw(options: Partial = {}) {
+ const defaultOptions = {
+ decimate: 8,
+ width: 2,
+ defaultText: '诸事顺遂 万事大吉',
+ color: '#000000',
+ lineColor: '#000000',
+ defaultFontSize: 20,
+ };
+ this.options = {
+ ...defaultOptions,
+ ...options,
+ };
+ this.canvas.isDrawingMode = true;
+ const brush = (this.canvas.freeDrawingBrush = new fabric.PencilBrush(this.canvas));
+ brush.decimate = this.options.decimate;
+ brush.width = this.options.width;
+ brush.color = this.options.color;
+ this._bindEvent();
+ }
+ endTextPathDraw() {
+ this.canvas.isDrawingMode = false;
+ this._unbindEvent();
+ }
+}
diff --git a/packages/core/plugin/PolygonModifyPlugin.ts b/packages/core/plugin/PolygonModifyPlugin.ts
new file mode 100644
index 0000000..ad78f70
--- /dev/null
+++ b/packages/core/plugin/PolygonModifyPlugin.ts
@@ -0,0 +1,180 @@
+import { fabric } from 'fabric';
+import { drawImg } from '../utils/utils';
+import edgeImg from '../assets/edgecontrol.svg?url';
+import { noop } from 'lodash-es';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+export type Options = {
+ fill: string;
+ style: fabric.IObjectOptions['cornerStyle'];
+};
+
+interface PointIndexPolygon extends fabric.Polygon {
+ pointIndex: number;
+ __corner: string;
+ _setPositionDimensions: (...args: any[]) => any;
+}
+
+interface PointIndexControl extends fabric.Control {
+ pointIndex: number;
+}
+
+const actionHandler: fabric.Control['actionHandler'] = function (
+ eventData: MouseEvent,
+ transform: fabric.Transform,
+ x: number,
+ y: number
+) {
+ const polygon = transform.target as PointIndexPolygon,
+ currentControl = polygon.controls[polygon.__corner] as PointIndexControl,
+ mouseLocalPosition = polygon.toLocalPoint(new fabric.Point(x, y), 'center', 'center'),
+ polygonBaseSize = getObjectSizeWithStroke(polygon),
+ size = polygon._getTransformedDimensions(0, 0);
+ if (polygon.points == null) return false;
+ polygon.points[currentControl.pointIndex] = new fabric.Point(
+ (mouseLocalPosition.x * polygonBaseSize.x) / size.x + polygon.pathOffset.x,
+ (mouseLocalPosition.y * polygonBaseSize.y) / size.y + polygon.pathOffset.y
+ );
+ return true;
+};
+const anchorWrapper = function (anchorIndex: number, fn: fabric.Control['actionHandler']) {
+ return function (eventData: MouseEvent, transform: fabric.Transform, x: number, y: number) {
+ const fabricObject = transform.target as PointIndexPolygon;
+ if (fabricObject.points == null) return false;
+ const absolutePoint = fabric.util.transformPoint(
+ new fabric.Point(
+ fabricObject.points[anchorIndex].x - fabricObject.pathOffset.x,
+ fabricObject.points[anchorIndex].y - fabricObject.pathOffset.y
+ ),
+ fabricObject.calcTransformMatrix()
+ ),
+ actionPerformed = fn(eventData, transform, x, y),
+ // newDim = fabricObject._setPositionDimensions({}),
+ polygonBaseSize = getObjectSizeWithStroke(fabricObject),
+ newX = (fabricObject.points[anchorIndex].x - fabricObject.pathOffset.x) / polygonBaseSize.x,
+ newY = (fabricObject.points[anchorIndex].y - fabricObject.pathOffset.y) / polygonBaseSize.y;
+ const originX = (newX + 0.5) as any;
+ const originY = (newY + 0.5) as any;
+ fabricObject.setPositionByOrigin(absolutePoint, originX, originY);
+ return actionPerformed;
+ };
+};
+const getObjectSizeWithStroke = function (object: fabric.Object) {
+ const stroke = new fabric.Point(
+ object.strokeUniform ? 1 / object.scaleX! : 1,
+ object.strokeUniform ? 1 / object.scaleY! : 1
+ ).multiply(object.strokeWidth!);
+ return new fabric.Point(object.width! + stroke.x, object.height! + stroke.y);
+};
+const polygonPositionHandler = function (
+ this: PointIndexControl,
+ dim: any,
+ finalMatrix: any,
+ fabricObject: any
+) {
+ const x = fabricObject.points[this.pointIndex].x - fabricObject.pathOffset.x,
+ y = fabricObject.points[this.pointIndex].y - fabricObject.pathOffset.y;
+ // 求出在世界坐标系的位置
+ return fabric.util.transformPoint(
+ new fabric.Point(x, y), // 物体坐标系下的位置
+ fabric.util.multiplyTransformMatrices(
+ fabricObject.canvas.viewportTransform,
+ fabricObject.calcTransformMatrix()
+ )
+ );
+};
+function renderIconEdge(
+ ctx: CanvasRenderingContext2D,
+ left: number,
+ top: number,
+ styleOverride: any,
+ fabricObject: fabric.Object,
+ img: HTMLImageElement
+) {
+ drawImg(ctx, left, top, img, 25, 25, fabric.util.degreesToRadians(fabricObject.angle || 0));
+}
+
+class PolygonModifyPlugin implements IPluginTempl {
+ public isEdit: boolean;
+ private img: HTMLImageElement;
+ static pluginName = 'PolygonModifyPlugin';
+ static events = [];
+ static apis = ['toggleEdit', 'activeEdit', 'inActiveEdit'];
+
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.isEdit = false;
+ const img = document.createElement('img');
+ img.src = edgeImg;
+ this.img = img;
+ this.init();
+ }
+ init() {
+ console.info('[PolygonModifyPlugin]: init');
+ }
+ _onDeselected: () => any = noop;
+ _ensureEvent(poly: fabric.Object) {
+ poly.off('deselected', this._onDeselected);
+ }
+ toggleEdit() {
+ this.isEdit ? this.inActiveEdit() : this.activeEdit();
+ }
+ activeEdit() {
+ this.isEdit = true;
+ const poly = this.canvas.getActiveObject() as fabric.Polygon;
+ if (poly && poly.type === 'polygon') {
+ this._ensureEvent(poly);
+ if (poly.points == null) return;
+ const lastControl = poly.points.length - 1;
+ const This = this;
+ poly.controls = poly.points.reduce>(function (
+ acc,
+ point,
+ index
+ ) {
+ acc['p' + index] = new fabric.Control({
+ positionHandler: polygonPositionHandler,
+ actionHandler: anchorWrapper(index > 0 ? index - 1 : lastControl, actionHandler),
+ actionName: 'modifyPolygon',
+ render: (...args) => renderIconEdge(...args, This.img),
+ });
+ Object.defineProperty(acc['p' + index], 'pointIndex', { value: index });
+ return acc;
+ },
+ {});
+ poly.set({
+ objectCaching: false,
+ });
+ poly.hasBorders = !this.isEdit;
+ this.canvas.requestRenderAll();
+ this._onDeselected = () => this.inActiveEdit(poly);
+ poly.on('deselected', this._onDeselected);
+ }
+ }
+ inActiveEdit(poly?: fabric.Polygon) {
+ this.isEdit = false;
+ poly = poly || (this.canvas.getActiveObject() as fabric.Polygon);
+ if (poly && poly.type === 'polygon') {
+ poly.cornerColor = 'blue';
+ poly.cornerStyle = 'rect';
+ poly.controls = fabric.Object.prototype.controls;
+ poly.hasBorders = !this.isEdit;
+ poly.set({
+ objectCaching: true,
+ });
+ if (this._onDeselected) {
+ poly.off('deselected', this._onDeselected);
+ this._onDeselected = noop;
+ }
+ }
+ this.canvas.requestRenderAll();
+ }
+}
+
+export default PolygonModifyPlugin;
diff --git a/packages/core/plugin/PsdPlugin.ts b/packages/core/plugin/PsdPlugin.ts
new file mode 100644
index 0000000..64eb949
--- /dev/null
+++ b/packages/core/plugin/PsdPlugin.ts
@@ -0,0 +1,55 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2024-05-27 16:09:29
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-06-08 18:31:24
+ * @Description: PSD插件
+ */
+import { fabric } from 'fabric';
+import { selectFiles } from '../utils/utils';
+import psdToJson from '../utils/psd';
+import Psd from '@webtoon/psd';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+class PsdPlugin implements IPluginTempl {
+ static pluginName = 'PsdPlugin';
+ static apis = ['insertPSD'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+
+ insertPSD(callback?: () => void) {
+ return new Promise((resolve, reject) => {
+ selectFiles({ accept: '.psd' })
+ .then((files) => {
+ if (files && files.length > 0) {
+ const file = files[0];
+ const reader = new FileReader();
+ reader.readAsText(file, 'UTF-8');
+ reader.onload = async () => {
+ const result = await file.arrayBuffer();
+ // 解析PSD文件
+ const psdFile = Psd.parse(result as ArrayBuffer);
+ console.log(psdFile, '11111');
+ const json = await psdToJson(psdFile);
+ // 加载json
+ this.loadJSON(json, callback);
+ resolve('');
+ };
+ }
+ })
+ .catch(reject);
+ });
+ }
+
+ loadJSON(json: string, callback?: () => void) {
+ this.editor.loadJSON(json, callback);
+ }
+}
+
+export default PsdPlugin;
diff --git a/packages/core/plugin/QrCodePlugin.ts b/packages/core/plugin/QrCodePlugin.ts
new file mode 100644
index 0000000..4bfe436
--- /dev/null
+++ b/packages/core/plugin/QrCodePlugin.ts
@@ -0,0 +1,181 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2024-06-06 19:58:26
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-07-22 10:26:59
+ * @Description: 二维码生成工具
+ */
+
+import { fabric } from 'fabric';
+import QRCodeStyling from 'qr-code-styling';
+import { blobToBase64 } from '../utils/utils';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+// 二维码生成参数
+
+enum DotsType {
+ rounded = 'rounded',
+ dots = 'dots',
+ classy = 'classy',
+ classy_rounded = 'classy-rounded',
+ square = 'square',
+ extra_rounded = 'extra-rounded',
+}
+
+enum CornersType {
+ dot = 'dot',
+ square = 'square',
+ extra_rounded = 'extra-rounded',
+}
+
+enum cornersDotType {
+ dot = 'dot',
+ square = 'square',
+}
+
+enum errorCorrectionLevelType {
+ L = 'L',
+ M = 'M',
+ Q = 'Q',
+ H = 'H',
+}
+
+class QrCodePlugin implements IPluginTempl {
+ static pluginName = 'QrCodePlugin';
+ static apis = ['addQrCode', 'setQrCode', 'getQrCodeTypes'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+
+ async hookTransform(object: any) {
+ if (object.extensionType === 'qrcode') {
+ const paramsOption = this._paramsToOption(object.extension);
+ const url = await this._getBase64Str(paramsOption);
+ object.src = url;
+ }
+ }
+
+ async _getBase64Str(options: any): Promise {
+ const qrCode = new QRCodeStyling(options);
+ const blob = await qrCode.getRawData('png');
+ if (!blob) return '';
+ const base64Str = (await blobToBase64(blob)) as string;
+ return base64Str || '';
+ }
+
+ _defaultBarcodeOption() {
+ return {
+ data: 'https://kuaitu.cc',
+ width: 300,
+ margin: 10,
+ errorCorrectionLevel: 'M',
+ dotsColor: '#000000',
+ dotsType: 'rounded',
+ cornersSquareColor: '#000000',
+ cornersSquareType: 'square',
+ cornersDotColor: '#000000',
+ cornersDotType: 'square',
+ background: '#ffffff',
+ };
+ }
+
+ _paramsToOption(option: any) {
+ return {
+ width: option.width,
+ height: option.width,
+ type: 'canvas',
+ data: option.data,
+ margin: option.margin,
+ qrOptions: {
+ errorCorrectionLevel: option.errorCorrectionLevel,
+ },
+ // 点
+ dotsOptions: {
+ color: option.dotsColor,
+ type: option.dotsType,
+ },
+ // 三个角
+ cornersSquareOptions: {
+ color: option.cornersSquareColor,
+ type: option.cornersSquareType,
+ },
+ // 圆点选项
+ cornersDotOptions: {
+ color: option.cornersDotColor,
+ type: option.cornersDotType,
+ },
+ // 背景
+ backgroundOptions: {
+ color: option.background,
+ },
+ };
+ }
+
+ async addQrCode() {
+ const option = this._defaultBarcodeOption();
+ const paramsOption = this._paramsToOption(option);
+ const url = await this._getBase64Str(paramsOption);
+ fabric.Image.fromURL(
+ url,
+ (imgEl) => {
+ imgEl.set({
+ extensionType: 'qrcode',
+ extension: option,
+ });
+ imgEl.scaleToWidth(this.editor.getWorkspase().getScaledWidth() / 2);
+ this.canvas.add(imgEl);
+ this.canvas.setActiveObject(imgEl);
+ this.editor.position('center');
+ this.canvas.renderAll();
+ this.editor.saveState();
+ },
+ { crossOrigin: 'anonymous' }
+ );
+ }
+
+ async setQrCode(option: any) {
+ try {
+ const paramsOption = this._paramsToOption(option);
+ const url = await this._getBase64Str(paramsOption);
+ const activeObject = this.canvas.getActiveObjects()[0];
+ fabric.Image.fromURL(
+ url,
+ (imgEl) => {
+ imgEl.set({
+ left: activeObject.left,
+ top: activeObject.top,
+ extensionType: 'qrcode',
+ extension: { ...option },
+ });
+ imgEl.scaleToWidth(activeObject.getScaledWidth());
+ this.editor.del();
+ this.canvas.add(imgEl);
+ this.canvas.setActiveObject(imgEl);
+ },
+ { crossOrigin: 'anonymous' }
+ );
+ } catch (error) {
+ console.log(error);
+ }
+ }
+
+ getQrCodeTypes() {
+ return {
+ DotsType: Object.values(DotsType),
+ CornersType: Object.values(CornersType),
+ cornersDotType: Object.values(cornersDotType),
+ errorCorrectionLevelType: Object.values(errorCorrectionLevelType),
+ };
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default QrCodePlugin;
diff --git a/packages/core/plugin/ResizePlugin.ts b/packages/core/plugin/ResizePlugin.ts
new file mode 100644
index 0000000..55050d3
--- /dev/null
+++ b/packages/core/plugin/ResizePlugin.ts
@@ -0,0 +1,238 @@
+/*
+ * @Author: wuchenguang1998
+ * @Date: 2024-06-17 21:00:00
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-06-30 20:01:36
+ * @Description: 画布resize拖拽插件
+ */
+
+import { fabric } from 'fabric';
+import { throttle } from 'lodash-es';
+import '../styles/resizePlugin.css';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPosition = 'left' | 'right' | 'top' | 'bottom';
+
+class ResizePlugin implements IPluginTempl {
+ static pluginName = 'ResizePlugin';
+ static events = [];
+ static apis = [];
+ workspaceEl!: HTMLElement;
+ // 最小画布尺寸
+ minSize = { width: 1, height: 1 };
+ // 控制条
+ barOpts = {
+ bWidth: 30, // 宽
+ bHeight: 6, // 高
+ bPadding: 10, // 离画布边缘的距离
+ };
+ hasCreatedBar = false;
+ isDragging = false;
+ dragEl: HTMLElement | null = null;
+ startPoints = { x: 0, y: 0 };
+ barOffset = { x: 0, y: 0 };
+ wsOffset: Record<'left' | 'top' | 'width' | 'height', number> = {
+ left: 0,
+ top: 0,
+ width: 0,
+ height: 0,
+ };
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this._init();
+ this._initResizeObserve();
+ this._addListeners();
+ }
+
+ _init() {
+ const workspaceEl = document.querySelector('#workspace') as HTMLElement;
+ if (!workspaceEl) {
+ throw new Error('element #workspace is missing, plz check!');
+ }
+ this.workspaceEl = workspaceEl;
+ }
+
+ // 初始化监听器
+ _initResizeObserve() {
+ const resizeObserver = new ResizeObserver(
+ throttle(() => {
+ this.renderBars();
+ }, 50)
+ );
+ resizeObserver.observe(this.workspaceEl);
+ }
+
+ // 渲染控制条具体位置
+ renderBars() {
+ const viewportTransform = this.canvas.viewportTransform;
+ const [scaleX, , , scaleY, offsetX, offsetY] = viewportTransform || [];
+ const workspace = this.getWorkspase() as Required;
+ const wsWidth = workspace.width * scaleX;
+ const wsHeight = workspace.height * scaleY;
+ const wsLeft = workspace.left * scaleX;
+ const wsTop = workspace.top * scaleY;
+ const { bWidth, bHeight, bPadding } = this.barOpts;
+ if (!viewportTransform) return;
+ // 左控制条
+ const leftBar = this._getBarFromType('left');
+ leftBar.style.left = `${offsetX + wsLeft - bHeight - bPadding}px`;
+ leftBar.style.top = `${offsetY + wsTop + wsHeight / 2 - bWidth / 2}px`;
+ // 右控制条
+ const rightBar = this._getBarFromType('right');
+ rightBar.style.left = `${offsetX + wsLeft + wsWidth + bPadding}px`;
+ rightBar.style.top = `${offsetY + wsTop + wsHeight / 2 - bWidth / 2}px`;
+ // 上控制条
+ const topBar = this._getBarFromType('top');
+ topBar.style.left = `${offsetX + wsLeft + wsWidth / 2 - bWidth / 2}px`;
+ topBar.style.top = `${offsetY + wsTop - bHeight - bPadding}px`;
+ // 下控制条
+ const bottomBar = this._getBarFromType('bottom');
+ bottomBar.style.left = `${offsetX + wsLeft + wsWidth / 2 - bWidth / 2}px`;
+ bottomBar.style.top = `${offsetY + wsTop + wsHeight + bPadding}px`;
+ // 监听
+ if (!this.hasCreatedBar) {
+ this.hasCreatedBar = true;
+ this._watchDrag();
+ }
+ }
+
+ // 获取或创建控制条
+ _getBarFromType(type: IPosition) {
+ let bar = document.querySelector(`#resize-${type}-bar`) as HTMLElement;
+ if (bar) return bar;
+ bar = document.createElement('div');
+ bar.id = `resize-${type}-bar`;
+ bar.className = 'resize-bar';
+ if (['left', 'right'].includes(type)) {
+ bar.classList.add('horizontal');
+ } else {
+ bar.classList.add('vertical');
+ }
+ this.workspaceEl.appendChild(bar);
+ return bar;
+ }
+
+ // 监听拖拽相关事件
+ _watchDrag() {
+ const barList = Array.from(document.getElementsByClassName('resize-bar')) as HTMLElement[];
+ barList.forEach((bar) => {
+ bar.addEventListener('mousedown', (e: MouseEvent) => {
+ this.isDragging = true;
+ this.dragEl = bar;
+ this.dragEl.classList.add('active');
+ this.startPoints = {
+ x: e.clientX,
+ y: e.clientY,
+ };
+ this.barOffset = {
+ x: bar.offsetLeft,
+ y: bar.offsetTop,
+ };
+ const workspace = this.getWorkspase() as Required;
+ const { width, height, left, top } = workspace;
+ this.wsOffset = { width, height, left, top };
+ });
+ });
+ document.addEventListener('mousemove', this.eventHandler.onDragging);
+ document.addEventListener('mouseup', () => {
+ if (this.isDragging && this.dragEl) {
+ this.isDragging = false;
+ this.dragEl.classList.remove('active');
+ this.dragEl = null;
+ this.canvas.defaultCursor = 'default';
+ }
+ });
+ }
+
+ // 拖拽更新控制条及画布
+ onDragging(e: MouseEvent) {
+ if (this.isDragging && this.dragEl) {
+ const workspace = this.getWorkspase() as Required;
+ const viewportTransform = this.canvas.viewportTransform;
+ const [scaleX, , , scaleY] = viewportTransform || [];
+ const deltaX = e.clientX - this.startPoints.x;
+ const deltaY = e.clientY - this.startPoints.y;
+ const deltaViewX = deltaX / scaleX;
+ const deltaViewY = deltaY / scaleY;
+ const type = this.dragEl.id.split('-')[1];
+ let tempLength = 0;
+ switch (type) {
+ case 'left':
+ tempLength = Math.round(this.wsOffset.width - deltaViewX * 2);
+ if (tempLength >= this.minSize.width) {
+ this.dragEl.style.left = `${this.barOffset.x + deltaX}px`;
+ workspace.set('left', this.wsOffset.left + deltaViewX * 2);
+ workspace.set('width', tempLength);
+ } else {
+ workspace.set('left', this.wsOffset.left + this.wsOffset.width - this.minSize.width);
+ workspace.set('width', this.minSize.width);
+ }
+ break;
+ case 'right':
+ tempLength = Math.round(this.wsOffset.width + deltaViewX * 2);
+ if (tempLength >= this.minSize.width) {
+ this.dragEl.style.left = `${this.barOffset.x + deltaX}px`;
+ workspace.set('width', tempLength);
+ } else {
+ workspace.set('width', this.minSize.width);
+ }
+ break;
+ case 'top':
+ tempLength = Math.round(this.wsOffset.height - deltaViewY * 2);
+ if (tempLength >= this.minSize.height) {
+ this.dragEl.style.top = `${this.barOffset.y + deltaY}px`;
+ workspace.set('top', this.wsOffset.top + deltaViewY * 2);
+ workspace.set('height', tempLength);
+ } else {
+ workspace.set('top', this.wsOffset.top + this.wsOffset.height - this.minSize.height);
+ workspace.set('height', this.minSize.height);
+ }
+ break;
+ case 'bottom':
+ tempLength = Math.round(this.wsOffset.height + deltaViewY * 2);
+ if (tempLength >= this.minSize.height) {
+ this.dragEl.style.top = `${this.barOffset.y + deltaY}px`;
+ workspace.set('height', tempLength);
+ } else {
+ workspace.set('height', this.minSize.height);
+ }
+ break;
+ default:
+ break;
+ }
+
+ this.editor.setCenterFromObject(workspace);
+ workspace.clone((cloned: fabric.Rect) => {
+ this.canvas.clipPath = cloned;
+ this.canvas.requestRenderAll();
+ });
+ if (['left', 'right'].includes(type)) {
+ this.canvas.defaultCursor = 'ew-resize';
+ } else {
+ this.canvas.defaultCursor = 'ns-resize';
+ }
+ this.editor.emit('sizeChange', workspace.width, workspace.height);
+ }
+ }
+
+ // 事件句柄缓存
+ private eventHandler: Record void> = {
+ render: throttle(this.renderBars.bind(this), 50),
+ onDragging: throttle(this.onDragging.bind(this), 30),
+ };
+
+ // 监听画布渲染
+ _addListeners() {
+ this.canvas.on('after:render', this.eventHandler.render);
+ }
+
+ // 返回workspace对象
+ getWorkspase() {
+ return this.canvas.getObjects().find((item) => item.id === 'workspace') as fabric.Rect;
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default ResizePlugin;
diff --git a/packages/core/plugin/RulerPlugin.ts b/packages/core/plugin/RulerPlugin.ts
new file mode 100644
index 0000000..230c0c6
--- /dev/null
+++ b/packages/core/plugin/RulerPlugin.ts
@@ -0,0 +1,72 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-07-04 23:45:49
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-04-10 17:33:54
+ * @Description: 标尺插件
+ */
+
+import { fabric } from 'fabric';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick<
+ RulerPlugin,
+ 'hideGuideline' | 'showGuideline' | 'rulerEnable' | 'rulerDisable'
+>;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+import initRuler from '../ruler';
+
+class RulerPlugin implements IPluginTempl {
+ static pluginName = 'RulerPlugin';
+ // static events = ['sizeChange'];
+ static apis = ['hideGuideline', 'showGuideline', 'rulerEnable', 'rulerDisable'];
+ ruler: any;
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.init();
+ }
+
+ hookSaveBefore() {
+ return new Promise((resolve) => {
+ this.hideGuideline();
+ resolve(true);
+ });
+ }
+
+ hookSaveAfter() {
+ return new Promise((resolve) => {
+ this.showGuideline();
+ resolve(true);
+ });
+ }
+
+ init() {
+ this.ruler = initRuler(this.canvas);
+ }
+
+ hideGuideline() {
+ this.ruler.hideGuideline();
+ }
+
+ showGuideline() {
+ this.ruler.showGuideline();
+ }
+
+ rulerEnable() {
+ this.ruler.enable();
+ }
+
+ rulerDisable() {
+ this.ruler.disable();
+ }
+
+ destroy() {
+ console.log('pluginDestroy');
+ }
+}
+
+export default RulerPlugin;
diff --git a/packages/core/plugin/SimpleClipImagePlugin.ts b/packages/core/plugin/SimpleClipImagePlugin.ts
new file mode 100644
index 0000000..ed3b262
--- /dev/null
+++ b/packages/core/plugin/SimpleClipImagePlugin.ts
@@ -0,0 +1,212 @@
+import { fabric } from 'fabric';
+import { getPolygonVertices } from '../../../src/utils/math';
+import { get, set } from 'lodash-es';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+const getBounds = (activeObject: fabric.Object) => {
+ const { left = 0, top = 0 } = activeObject;
+ return {
+ width: activeObject.getScaledWidth(),
+ height: activeObject.getScaledHeight(),
+ left,
+ top,
+ };
+};
+const bindInfo = (shell: fabric.Object, activeObject: fabric.Object) => {
+ bindFlagToObject(shell);
+ bindFlagToObject(shell, 'targetId', get(activeObject, 'id'));
+ bindFlagToObject(shell, 'targetType', get(activeObject, 'type'));
+};
+const bindFlagToObject = (activeObject: fabric.Object, key = 'clip', value: any = true) => {
+ set(activeObject, key, value);
+};
+const createRectClip = (activeObject: fabric.Object, inverted: boolean) => {
+ const { width = 0, height = 0, left = 0, top = 0 } = getBounds(activeObject);
+ const clipW = Math.round(width / 2);
+ const clipH = Math.round(height / 2);
+ const shell = new fabric.Rect({
+ width: clipW,
+ height: clipH,
+ fill: 'rgba(0,0,0,0)',
+ originX: 'center',
+ originY: 'center',
+ left: left + width / 2,
+ top: top + height / 2,
+ });
+ bindInfo(shell, activeObject);
+ const clipPath = new fabric.Rect({
+ absolutePositioned: true,
+ width: shell.width,
+ height: shell.height,
+ originX: 'center',
+ originY: 'center',
+ left: shell.left,
+ top: shell.top,
+ inverted: inverted,
+ });
+ return { clipPath, shell };
+};
+const createCircleClip = (activeObject: fabric.Object, inverted: boolean) => {
+ const point = activeObject.getCenterPoint();
+ const { width } = getBounds(activeObject);
+ const shell = new fabric.Ellipse({
+ fill: 'rgba(0,0,0,0)',
+ originX: 'center',
+ originY: 'center',
+ left: point.x,
+ top: point.y,
+ rx: width / 4,
+ ry: width / 4,
+ });
+ bindInfo(shell, activeObject);
+ const clipPath = new fabric.Ellipse({
+ absolutePositioned: true,
+ originX: 'center',
+ originY: 'center',
+ left: shell.left,
+ top: shell.top,
+ inverted: inverted,
+ rx: shell.rx,
+ ry: shell.ry,
+ });
+ return { shell, clipPath };
+};
+const createTriClip = (activeObject: fabric.Object, inverted: boolean) => {
+ const point = activeObject.getCenterPoint();
+ const { width = 0, height = 0 } = getBounds(activeObject);
+ const clipW = Math.round(width / 2);
+ const clipH = Math.round(height / 2);
+ const shell = new fabric.Triangle({
+ fill: 'rgba(0,0,0,0)',
+ originX: 'center',
+ originY: 'center',
+ left: point.x,
+ top: point.y,
+ width: clipW,
+ height: clipH,
+ });
+ bindInfo(shell, activeObject);
+ const clipPath = new fabric.Triangle({
+ absolutePositioned: true,
+ originX: 'center',
+ originY: 'center',
+ left: shell.left,
+ top: shell.top,
+ width: shell.width,
+ height: shell.height,
+ inverted: inverted,
+ });
+ return { shell, clipPath };
+};
+const createPolygonClip = (activeObject: fabric.Object, inverted: boolean) => {
+ const point = activeObject.getCenterPoint();
+ const points = getPolygonVertices(5, 200);
+ const shell = new fabric.Polygon(points, {
+ fill: 'rgba(0,0,0,0)',
+ originY: 'center',
+ originX: 'center',
+ left: point.x,
+ top: point.y,
+ });
+ bindInfo(shell, activeObject);
+ const clipPath = new fabric.Polygon([...points], {
+ absolutePositioned: true,
+ originX: 'center',
+ originY: 'center',
+ left: shell.left,
+ top: shell.top,
+ inverted: inverted,
+ });
+ return { shell, clipPath };
+};
+export default class SimpleClipImagePlugin implements IPluginTempl {
+ static pluginName = 'SimpleClipImagePlugin';
+ // static events = ['sizeChange'];
+ static apis = ['addClipPathToImage', 'removeClip'];
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {}
+ addClipPathToImage(value: string) {
+ const activeObject = this.canvas.getActiveObjects()[0];
+ if (activeObject && activeObject.type === 'image') {
+ let clip: { shell: fabric.Object; clipPath: fabric.Object } | null = null;
+ const [name, inverted] = value.split('-');
+ const isInverted = !!inverted;
+ switch (name) {
+ case 'polygon':
+ clip = createPolygonClip(activeObject, isInverted);
+ break;
+ case 'rect':
+ clip = createRectClip(activeObject, isInverted);
+ break;
+ case 'circle':
+ clip = createCircleClip(activeObject, isInverted);
+ break;
+ case 'triangle':
+ clip = createTriClip(activeObject, isInverted);
+ break;
+ }
+ if (clip == null) return;
+ const { shell, clipPath } = clip;
+ shell.on('moving', () => {
+ clipPath.setPositionByOrigin(shell.getCenterPoint(), 'center', 'center');
+ activeObject.set('dirty', true);
+ });
+ shell.on('rotating', () => {
+ clipPath.set({ angle: shell.angle });
+ activeObject.set('dirty', true);
+ });
+ shell.on('scaling', () => {
+ clipPath.set({ scaleX: shell.scaleX, scaleY: shell.scaleY });
+ clipPath.setPositionByOrigin(shell.getCenterPoint(), 'center', 'center');
+ activeObject.set('dirty', true);
+ });
+ shell.on('deselected', () => {
+ if (clipPath instanceof fabric.Ellipse && shell instanceof fabric.Ellipse) {
+ clipPath.set({ rx: shell.getRx(), ry: shell.getRy() });
+ this.correctPosition(activeObject, shell, clipPath);
+ } else if (shell instanceof fabric.Polygon) {
+ this.correctPosition(activeObject, shell, clipPath);
+ const { scaleX: cSx = 1, scaleY: cSy = 1 } = clipPath;
+ const { scaleX: sSx = 1, scaleY: sSy = 1 } = shell;
+ clipPath.set('scaleX', cSx * sSx);
+ clipPath.set('scaleY', cSy * sSy);
+ } else {
+ this.correctPosition(activeObject, shell, clipPath);
+ clipPath.set('width', shell.getScaledWidth());
+ clipPath.set('height', shell.getScaledHeight());
+ }
+ activeObject.set('dirty', true);
+ this.canvas.remove(shell);
+ this.canvas.requestRenderAll();
+ });
+ activeObject.set({ clipPath: clipPath });
+ this.canvas.add(shell);
+ this.canvas.setActiveObject(shell);
+ }
+ }
+ correctPosition(activeObject: fabric.Object, shell: fabric.Object, clipPath: fabric.Object) {
+ const position = activeObject.toLocalPoint(shell.getCenterPoint(), 'center', 'center');
+ const { scaleX = 1, scaleY = 1 } = activeObject;
+ clipPath.set({
+ absolutePositioned: false,
+ left: position.x / scaleX,
+ top: position.y / scaleY,
+ scaleX: 1 / scaleX,
+ scaleY: 1 / scaleY,
+ });
+ }
+ removeClip() {
+ const activeObject = this.canvas.getActiveObjects()[0];
+ if (activeObject && activeObject.type === 'image') {
+ activeObject.set({ clipPath: undefined });
+ activeObject.set('dirty', true);
+ this.canvas.requestRenderAll();
+ }
+ }
+}
diff --git a/packages/core/plugin/WaterMarkPlugin.ts b/packages/core/plugin/WaterMarkPlugin.ts
new file mode 100644
index 0000000..6cf2e19
--- /dev/null
+++ b/packages/core/plugin/WaterMarkPlugin.ts
@@ -0,0 +1,198 @@
+/*
+ * @Author: June
+ * @Description: 水印插件
+ * @Date: 2024-04-21 08:30:48
+ * @LastEditors: June 1601745371@qq.com
+ * @LastEditTime: 2024-05-23 17:56:45
+ */
+import { cloneDeep } from 'lodash-es';
+import { fabric } from 'fabric';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+enum POSITION {
+ lt = 'Left_Top',
+ lb = 'Left_Right',
+ rt = 'Right_Top',
+ rb = 'Right_Bottom',
+ full = 'Full',
+}
+
+type IPosition = POSITION.lt | POSITION.lb | POSITION.rt | POSITION.rb | POSITION.full; // lt 左上 lr 左上 rt 右上 rb 右下 full 平铺 后续可扩展其他功能
+type IDrawOps = {
+ text: string;
+ size: number;
+ fontFamily: string;
+ color: string;
+ isRotate: boolean;
+ position: IPosition;
+};
+
+const defaultOptions: IDrawOps = {
+ text: '',
+ size: 24,
+ isRotate: false, // 是否倾斜
+ fontFamily: '汉体', // 可考虑自定义字体
+ color: '#ccc', // 可考虑自定义颜色
+ position: POSITION.lt,
+};
+
+class WaterMarkPlugin implements IPluginTempl {
+ static pluginName = 'WaterMarkPlugin';
+ static apis = ['drawWaterMark', 'clearWaterMMatk', 'updateDrawStatus'];
+ private hadDraw = false;
+ private drawOps: IDrawOps = defaultOptions;
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.init();
+ }
+
+ private createCanvas(width: number, height: number) {
+ const waterCanvas: HTMLCanvasElement = document.createElement('canvas');
+ waterCanvas.width = width;
+ waterCanvas.height = height;
+ waterCanvas.style.position = 'fixed';
+ waterCanvas.style.opacity = '0';
+ waterCanvas.style.zIndex = '-1';
+ return waterCanvas;
+ }
+
+ // 待优化
+ private drawing: Record void> = {
+ [POSITION.lt]: (width: number, height: number, cb: (imgString: string) => void) => {
+ let waterCanvas: HTMLCanvasElement | null = this.createCanvas(width, height);
+ const w = waterCanvas.width || width;
+ let ctx: CanvasRenderingContext2D | null = waterCanvas.getContext('2d')!;
+ ctx.fillStyle = this.drawOps.color;
+ ctx.font = `${this.drawOps.size}px ${this.drawOps.fontFamily}`;
+ ctx.fillText(this.drawOps.text, 10, this.drawOps.size + 10, w - 20);
+ cb && cb(waterCanvas.toDataURL());
+ waterCanvas = null;
+ ctx = null;
+ },
+ [POSITION.rt]: (width: number, height: number, cb: (imgString: string) => void) => {
+ let waterCanvas: HTMLCanvasElement | null = this.createCanvas(width, height);
+ let ctx: CanvasRenderingContext2D | null = waterCanvas.getContext('2d')!;
+ const w = waterCanvas.width || width;
+ ctx.fillStyle = this.drawOps.color;
+ ctx.font = `${this.drawOps.size}px ${this.drawOps.fontFamily}`;
+ ctx.fillText(
+ this.drawOps.text,
+ w - ctx.measureText(this.drawOps.text).width - 20,
+ this.drawOps.size + 10,
+ w - 20
+ );
+ cb && cb(waterCanvas.toDataURL());
+ waterCanvas = null;
+ ctx = null;
+ },
+ [POSITION.lb]: (width: number, height: number, cb: (imgString: string) => void) => {
+ let waterCanvas: HTMLCanvasElement | null = this.createCanvas(width, height);
+ let ctx: CanvasRenderingContext2D | null = waterCanvas.getContext('2d')!;
+ const w = waterCanvas.width || width;
+ const h = waterCanvas.height || height;
+ ctx.fillStyle = this.drawOps.color;
+ ctx.font = `${this.drawOps.size}px ${this.drawOps.fontFamily}`;
+ ctx.fillText(this.drawOps.text, 10, h - this.drawOps.size, w - 20);
+ cb && cb(waterCanvas.toDataURL());
+ waterCanvas = null;
+ ctx = null;
+ },
+ [POSITION.rb]: (width: number, height: number, cb: (imgString: string) => void) => {
+ let waterCanvas: HTMLCanvasElement | null = this.createCanvas(width, height);
+ let ctx: CanvasRenderingContext2D | null = waterCanvas.getContext('2d')!;
+ const w = waterCanvas.width || width;
+ ctx.fillStyle = this.drawOps.color;
+ ctx.font = `${this.drawOps.size}px ${this.drawOps.fontFamily}`;
+ ctx.fillText(
+ this.drawOps.text,
+ w - ctx.measureText(this.drawOps.text).width - 20,
+ height - this.drawOps.size,
+ width - 20
+ );
+ cb && cb(waterCanvas.toDataURL());
+ waterCanvas = null;
+ ctx = null;
+ },
+ [POSITION.full]: (width: number, height: number, cb: (imgString: string) => void) => {
+ const angle = -30; // 按逆时针30度算
+ const R = (angle * Math.PI) / 180;
+ const font = `${this.drawOps.size}px ${this.drawOps.fontFamily}`;
+ let waterCanvas: HTMLCanvasElement | null = this.createCanvas(width, height);
+ let ctx: CanvasRenderingContext2D | null = waterCanvas.getContext('2d')!;
+ ctx.font = font;
+ const textW = ctx.measureText(this.drawOps.text).width + 40;
+ let patternCanvas: HTMLCanvasElement | null = this.createCanvas(
+ this.drawOps.isRotate ? textW * Math.abs(Math.cos(R)) + this.drawOps.size : textW,
+ this.drawOps.isRotate
+ ? textW * Math.abs(Math.sin(R)) + this.drawOps.size
+ : this.drawOps.size + 20
+ );
+ document.body.appendChild(patternCanvas);
+ let ctxWater: CanvasRenderingContext2D | null = patternCanvas.getContext('2d')!;
+ ctxWater.textAlign = 'left';
+ ctxWater.textBaseline = 'top';
+ ctxWater.font = font;
+ ctxWater.fillStyle = `${this.drawOps.color}`;
+ if (this.drawOps.isRotate) {
+ ctxWater.translate(0, textW * Math.abs(Math.sin(R)));
+ ctxWater.rotate(R);
+ ctxWater.fillText(this.drawOps.text, 0, 0);
+ } else {
+ ctxWater.fillText(this.drawOps.text, 10, 10);
+ }
+ ctx.fillStyle = ctx.createPattern(patternCanvas, 'repeat')!;
+ ctx.fillRect(0, 0, width, height);
+ cb && cb(waterCanvas.toDataURL());
+ waterCanvas = null;
+ patternCanvas = null;
+ ctx = null;
+ ctxWater = null;
+ },
+ };
+
+ drawWaterMark(ops: IDrawOps) {
+ this.drawOps = Object.assign(cloneDeep(this.drawOps), ops);
+ if (!this.drawOps.text) return;
+ const workspace = this.canvas.getObjects().find((item: any) => item.id === 'workspace');
+ const { width, height, left, top }: any = workspace;
+ this.drawing[this.drawOps?.position](width, height, (imgString: string) => {
+ this.canvas.overlayImage = undefined;
+ this.hadDraw = true;
+ this.canvas.setOverlayImage(imgString, this.canvas.renderAll.bind(this.canvas), {
+ left: left || 0,
+ top: top || 0,
+ originX: 'left',
+ originY: 'top',
+ });
+ });
+ }
+
+ // 更新handDrow 导入json时无法知道是否绘制
+ updateDrawStatus(status: boolean) {
+ this.hadDraw = status;
+ }
+
+ clearWaterMMatk() {
+ if (!this.hadDraw) return;
+ this.canvas.overlayImage = undefined;
+ this.canvas.renderAll();
+ this.hadDraw = false;
+ this.drawOps = defaultOptions;
+ }
+
+ init() {
+ this.editor.on('sizeChange', this.drawWaterMark.bind(this));
+ }
+
+ destroy() {
+ this.editor.off('sizeChange', this.drawWaterMark);
+ }
+}
+
+export default WaterMarkPlugin;
diff --git a/packages/core/plugin/WorkspacePlugin.ts b/packages/core/plugin/WorkspacePlugin.ts
new file mode 100644
index 0000000..6180b72
--- /dev/null
+++ b/packages/core/plugin/WorkspacePlugin.ts
@@ -0,0 +1,253 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2023-06-27 12:26:41
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-12-24 13:13:06
+ * @Description: 画布区域插件
+ */
+
+import { fabric } from 'fabric';
+import { throttle } from 'lodash-es';
+import type { IEditor, IPluginTempl } from '@kuaitu/core';
+
+type IPlugin = Pick<
+ WorkspacePlugin,
+ | 'big'
+ | 'small'
+ | 'auto'
+ | 'one'
+ | 'setSize'
+ | 'getWorkspase'
+ | 'setWorkspaseBg'
+ | 'setCenterFromObject'
+>;
+
+declare module '@kuaitu/core' {
+ // eslint-disable-next-line @typescript-eslint/no-empty-interface
+ interface IEditor extends IPlugin {}
+}
+
+class WorkspacePlugin implements IPluginTempl {
+ static pluginName = 'WorkspacePlugin';
+ static events = ['sizeChange'];
+ static apis = [
+ 'big',
+ 'small',
+ 'auto',
+ 'one',
+ 'setSize',
+ 'getWorkspase',
+ 'setWorkspaseBg',
+ 'setCenterFromObject',
+ ];
+ workspaceEl!: HTMLElement;
+ workspace: null | fabric.Rect;
+ resizeObserver!: ResizeObserver;
+ option: any;
+ zoomRatio: number;
+ constructor(public canvas: fabric.Canvas, public editor: IEditor) {
+ this.workspace = null;
+ this.init({
+ width: 900,
+ height: 1200,
+ });
+ this.zoomRatio = 0.85;
+ }
+
+ init(option: { width: number; height: number }) {
+ const workspaceEl = document.querySelector('#workspace') as HTMLElement;
+ if (!workspaceEl) {
+ throw new Error('element #workspace is missing, plz check!');
+ }
+ this.workspaceEl = workspaceEl;
+ this.workspace = null;
+ this.option = option;
+ this._initBackground();
+ this._initWorkspace();
+ this._initResizeObserve();
+ this._bindWheel();
+ }
+
+ hookImportAfter() {
+ return new Promise((resolve) => {
+ const workspace = this.canvas.getObjects().find((item) => item.id === 'workspace');
+ if (workspace) {
+ workspace.set('selectable', false);
+ workspace.set('hasControls', false);
+ workspace.set('evented', false);
+ if (workspace.width && workspace.height) {
+ this.setSize(workspace.width, workspace.height);
+ this.editor.emit('sizeChange', workspace.width, workspace.height);
+ }
+ }
+ resolve('');
+ });
+ }
+
+ hookSaveAfter() {
+ return new Promise((resolve) => {
+ this.auto();
+ resolve(true);
+ });
+ }
+
+ // 初始化背景
+ _initBackground() {
+ this.canvas.backgroundImage = '';
+ this.canvas.setWidth(this.workspaceEl.offsetWidth);
+ this.canvas.setHeight(this.workspaceEl.offsetHeight);
+ }
+
+ // 初始化画布
+ _initWorkspace() {
+ const { width, height } = this.option;
+ const workspace = new fabric.Rect({
+ fill: 'rgba(255,255,255,1)',
+ width,
+ height,
+ id: 'workspace',
+ strokeWidth: 0,
+ });
+ workspace.set('selectable', false);
+ workspace.set('hasControls', false);
+ workspace.hoverCursor = 'default';
+ this.canvas.add(workspace);
+ this.canvas.renderAll();
+
+ this.workspace = workspace;
+ if (this.canvas.clearHistory) {
+ this.canvas.clearHistory();
+ }
+ this.auto();
+ }
+
+ // 返回workspace对象
+ getWorkspase() {
+ return this.canvas.getObjects().find((item) => item.id === 'workspace') as fabric.Rect;
+ }
+
+ /**
+ * 设置画布中心到指定对象中心点上
+ * @param {Object} obj 指定的对象
+ */
+ setCenterFromObject(obj: fabric.Rect) {
+ const { canvas } = this;
+ const objCenter = obj.getCenterPoint();
+ const viewportTransform = canvas.viewportTransform;
+ if (canvas.width === undefined || canvas.height === undefined || !viewportTransform) return;
+ viewportTransform[4] = canvas.width / 2 - objCenter.x * viewportTransform[0];
+ viewportTransform[5] = canvas.height / 2 - objCenter.y * viewportTransform[3];
+ canvas.setViewportTransform(viewportTransform);
+ canvas.renderAll();
+ }
+
+ // 初始化监听器
+ _initResizeObserve() {
+ const resizeObserver = new ResizeObserver(
+ throttle(() => {
+ this.auto();
+ }, 50)
+ );
+ this.resizeObserver = resizeObserver;
+ this.resizeObserver.observe(this.workspaceEl);
+ }
+
+ setSize(width: number, height: number) {
+ this._initBackground();
+ this.option.width = width;
+ this.option.height = height;
+ // 重新设置workspace
+ this.workspace = this.canvas
+ .getObjects()
+ .find((item) => item.id === 'workspace') as fabric.Rect;
+ this.workspace.set('width', width);
+ this.workspace.set('height', height);
+ this.editor.emit('sizeChange', this.workspace.width, this.workspace.height);
+ this.auto();
+ }
+
+ setZoomAuto(scale: number, cb?: (left?: number, top?: number) => void) {
+ const { workspaceEl } = this;
+ const width = workspaceEl.offsetWidth;
+ const height = workspaceEl.offsetHeight;
+ this.canvas.setWidth(width);
+ this.canvas.setHeight(height);
+ const center = this.canvas.getCenter();
+ this.canvas.setViewportTransform(fabric.iMatrix.concat());
+ this.canvas.zoomToPoint(new fabric.Point(center.left, center.top), scale);
+ if (!this.workspace) return;
+ this.setCenterFromObject(this.workspace);
+
+ // 超出画布不展示
+ this.workspace.clone((cloned: fabric.Rect) => {
+ this.canvas.clipPath = cloned;
+ this.canvas.requestRenderAll();
+ });
+ if (cb) cb(this.workspace.left, this.workspace.top);
+ }
+
+ _getScale() {
+ return fabric.util.findScaleToFit(this.getWorkspase(), {
+ width: this.workspaceEl.offsetWidth,
+ height: this.workspaceEl.offsetHeight,
+ });
+ }
+
+ // 放大
+ big() {
+ let zoomRatio = this.canvas.getZoom();
+ zoomRatio += 0.05;
+ const center = this.canvas.getCenter();
+ this.canvas.zoomToPoint(new fabric.Point(center.left, center.top), zoomRatio);
+ }
+
+ // 缩小
+ small() {
+ let zoomRatio = this.canvas.getZoom();
+ zoomRatio -= 0.05;
+ const center = this.canvas.getCenter();
+ this.canvas.zoomToPoint(
+ new fabric.Point(center.left, center.top),
+ zoomRatio < 0 ? 0.01 : zoomRatio
+ );
+ }
+
+ // 自动缩放
+ auto() {
+ const scale = this._getScale();
+ this.setZoomAuto(scale * this.zoomRatio);
+ }
+
+ // 1:1 放大
+ one() {
+ this.setZoomAuto(1 * this.zoomRatio);
+ this.canvas.requestRenderAll();
+ }
+
+ setWorkspaseBg(color: string) {
+ const workspase = this.getWorkspase();
+ workspase?.set('fill', color);
+ }
+
+ _bindWheel() {
+ this.canvas.on('mouse:wheel', function (this: fabric.Canvas, opt) {
+ const delta = opt.e.deltaY;
+ let zoom = this.getZoom();
+ zoom *= 0.999 ** delta;
+ if (zoom > 20) zoom = 20;
+ if (zoom < 0.01) zoom = 0.01;
+ const center = this.getCenter();
+ this.zoomToPoint(new fabric.Point(center.left, center.top), zoom);
+ opt.e.preventDefault();
+ opt.e.stopPropagation();
+ });
+ }
+
+ destroy() {
+ this.resizeObserver.disconnect();
+ this.canvas.off();
+ console.log('pluginDestroy');
+ }
+}
+
+export default WorkspacePlugin;
diff --git a/packages/core/ruler/guideline.ts b/packages/core/ruler/guideline.ts
new file mode 100644
index 0000000..7ec79e8
--- /dev/null
+++ b/packages/core/ruler/guideline.ts
@@ -0,0 +1,126 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
+/* eslint-disable @typescript-eslint/no-unused-vars */
+import { fabric } from 'fabric';
+
+export function setupGuideLine() {
+ if (fabric.GuideLine) {
+ return;
+ }
+
+ fabric.GuideLine = fabric.util.createClass(fabric.Line, {
+ type: 'GuideLine',
+ selectable: false,
+ hasControls: false,
+ hasBorders: false,
+ stroke: '#4bec13',
+ originX: 'center',
+ originY: 'center',
+ padding: 4, // 填充,让辅助线选择范围更大,方便选中
+ globalCompositeOperation: 'difference',
+ axis: 'horizontal',
+ // excludeFromExport: true,
+
+ initialize(points: number, options: fabric.IGuideLineOptions) {
+ const isHorizontal = options.axis === 'horizontal';
+ // 指针
+ this.hoverCursor = isHorizontal ? 'ns-resize' : 'ew-resize';
+ // 设置新的点
+ const newPoints = isHorizontal
+ ? [-999999, points, 999999, points]
+ : [points, -999999, points, 999999];
+ // 锁定移动
+ options[isHorizontal ? 'lockMovementX' : 'lockMovementY'] = true;
+ // 调用父类初始化
+ this.callSuper('initialize', newPoints, options);
+
+ // 绑定事件
+ this.on('mousedown:before', (e: fabric.IEvent) => {
+ if (this.activeOn === 'down') {
+ // 设置selectable:false后激活对象才能进行移动
+ this.canvas && this.canvas.setActiveObject(this, e.e);
+ }
+ });
+
+ this.on('moving', (e) => {
+ if (this.canvas && this.canvas.ruler.options.enabled && this.isPointOnRuler(e.e)) {
+ this.moveCursor = 'not-allowed';
+ } else {
+ this.moveCursor = this.isHorizontal() ? 'ns-resize' : 'ew-resize';
+ }
+ this.canvas &&
+ this.canvas.fire('guideline:moving', {
+ target: this,
+ e: e.e,
+ });
+ });
+
+ this.on('mouseup', (e) => {
+ // 移动到标尺上,移除辅助线
+ if (this.canvas && this.canvas.ruler.options.enabled && this.isPointOnRuler(e.e)) {
+ // console.log('移除辅助线', this);
+ this.canvas.remove(this);
+ return;
+ }
+ this.moveCursor = this.isHorizontal() ? 'ns-resize' : 'ew-resize';
+ this.canvas &&
+ this.canvas.fire('guideline:mouseup', {
+ target: this,
+ e: e.e,
+ });
+ });
+
+ this.on('removed', () => {
+ this.off('removed');
+ this.off('mousedown:before');
+ this.off('moving');
+ this.off('mouseup');
+ });
+ },
+
+ getBoundingRect(absolute, calculate) {
+ this.bringToFront();
+
+ const isHorizontal = this.isHorizontal();
+ const rect = this.callSuper('getBoundingRect', absolute, calculate);
+ rect[isHorizontal ? 'top' : 'left'] += rect[isHorizontal ? 'height' : 'width'] / 2;
+ rect[isHorizontal ? 'height' : 'width'] = 0;
+ return rect;
+ },
+
+ isPointOnRuler(e) {
+ const isHorizontal = this.isHorizontal();
+ const hoveredRuler =
+ this.canvas && this.canvas.ruler.isPointOnRuler(new fabric.Point(e.offsetX, e.offsetY));
+ if (
+ (isHorizontal && hoveredRuler === 'horizontal') ||
+ (!isHorizontal && hoveredRuler === 'vertical')
+ ) {
+ return hoveredRuler;
+ }
+ return false;
+ },
+
+ isHorizontal() {
+ return this.height === 0;
+ },
+ } as fabric.GuideLine);
+
+ fabric.GuideLine.fromObject = function (object, callback) {
+ const clone = fabric.util.object.clone as (object: any, deep: boolean) => any;
+
+ function _callback(instance: any) {
+ delete instance.xy;
+ callback && callback(instance);
+ }
+
+ const options = clone(object, true);
+ const isHorizontal = options.height === 0;
+
+ options.xy = isHorizontal ? options.y1 : options.x1;
+ options.axis = isHorizontal ? 'horizontal' : 'vertical';
+
+ fabric.Object._fromObject(options.type, options, _callback, 'xy');
+ };
+}
+
+export default fabric.GuideLine;
diff --git a/packages/core/ruler/index.ts b/packages/core/ruler/index.ts
new file mode 100644
index 0000000..69fbeb1
--- /dev/null
+++ b/packages/core/ruler/index.ts
@@ -0,0 +1,82 @@
+import type { Canvas } from 'fabric/fabric-impl';
+import { fabric } from 'fabric';
+import CanvasRuler, { RulerOptions } from './ruler';
+
+function initRuler(canvas: Canvas, options?: RulerOptions) {
+ const ruler = new CanvasRuler({
+ canvas,
+ ...options,
+ });
+
+ // 辅助线移动到画板外删除
+ let workspace: fabric.Object | undefined = undefined;
+
+ /**
+ * 获取workspace
+ */
+ const getWorkspace = () => {
+ workspace = canvas.getObjects().find((item) => item.id === 'workspace');
+ };
+
+ /**
+ * 判断target是否在object矩形外
+ * @param object
+ * @param target
+ * @returns
+ */
+ const isRectOut = (object: fabric.Object, target: fabric.GuideLine): boolean => {
+ const { top, height, left, width } = object;
+
+ if (top === undefined || height === undefined || left === undefined || width === undefined) {
+ return false;
+ }
+
+ const targetRect = target.getBoundingRect(true, true);
+ const {
+ top: targetTop,
+ height: targetHeight,
+ left: targetLeft,
+ width: targetWidth,
+ } = targetRect;
+
+ if (
+ target.isHorizontal() &&
+ (top > targetTop + 1 || top + height < targetTop + targetHeight - 1)
+ ) {
+ return true;
+ } else if (
+ !target.isHorizontal() &&
+ (left > targetLeft + 1 || left + width < targetLeft + targetWidth - 1)
+ ) {
+ return true;
+ }
+
+ return false;
+ };
+
+ canvas.on('guideline:moving', (e) => {
+ if (!workspace) {
+ getWorkspace();
+ return;
+ }
+ const { target } = e;
+ if (isRectOut(workspace, target)) {
+ target.moveCursor = 'not-allowed';
+ }
+ });
+
+ canvas.on('guideline:mouseup', (e) => {
+ if (!workspace) {
+ getWorkspace();
+ return;
+ }
+ const { target } = e;
+ if (isRectOut(workspace, target)) {
+ canvas.remove(target);
+ canvas.setCursor(canvas.defaultCursor ?? '');
+ }
+ });
+ return ruler;
+}
+
+export default initRuler;
diff --git a/packages/core/ruler/ruler.ts b/packages/core/ruler/ruler.ts
new file mode 100644
index 0000000..d75d21f
--- /dev/null
+++ b/packages/core/ruler/ruler.ts
@@ -0,0 +1,615 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
+import { Canvas, Point, IEvent } from 'fabric/fabric-impl';
+import { fabric } from 'fabric';
+import { getGap, mergeLines, darwRect, darwText, darwLine, drawMask } from './utils';
+import { throttle } from 'lodash-es';
+import { setupGuideLine } from './guideline';
+
+/**
+ * 配置
+ */
+export interface RulerOptions {
+ /**
+ * Canvas
+ */
+ canvas: Canvas;
+
+ /**
+ * 标尺宽高
+ * @default 20
+ */
+ ruleSize?: number;
+
+ /**
+ * 字体大小
+ * @default 10
+ */
+ fontSize?: number;
+
+ /**
+ * 是否开启标尺
+ * @default false
+ */
+ enabled?: boolean;
+
+ /**
+ * 背景颜色
+ */
+ backgroundColor?: string;
+
+ /**
+ * 文字颜色
+ */
+ textColor?: string;
+
+ /**
+ * 边框颜色
+ */
+ borderColor?: string;
+
+ /**
+ * 高亮颜色
+ */
+ highlightColor?: string;
+}
+
+export type Rect = { left: number; top: number; width: number; height: number };
+
+export type HighlightRect = {
+ skip?: 'x' | 'y';
+} & Rect;
+
+class CanvasRuler {
+ protected ctx: CanvasRenderingContext2D;
+
+ /**
+ * 配置
+ */
+ public options: Required;
+
+ /**
+ * 标尺起始点
+ */
+ public startCalibration: undefined | Point;
+
+ private activeOn: 'down' | 'up' = 'up';
+
+ /**
+ * 选取对象矩形坐标
+ */
+ private objectRect:
+ | undefined
+ | {
+ x: HighlightRect[];
+ y: HighlightRect[];
+ };
+
+ /**
+ * 事件句柄缓存
+ */
+ private eventHandler: Record void> = {
+ // calcCalibration: this.calcCalibration.bind(this),
+ calcObjectRect: throttle(this.calcObjectRect.bind(this), 15),
+ clearStatus: this.clearStatus.bind(this),
+ canvasMouseDown: this.canvasMouseDown.bind(this),
+ canvasMouseMove: throttle(this.canvasMouseMove.bind(this), 15),
+ canvasMouseUp: this.canvasMouseUp.bind(this),
+ render: (e: any) => {
+ // 避免多次渲染
+ if (!e.ctx) return;
+ this.render();
+ },
+ };
+
+ private lastAttr: {
+ status: 'out' | 'horizontal' | 'vertical';
+ cursor: string | undefined;
+ selection: boolean | undefined;
+ } = {
+ status: 'out',
+ cursor: undefined,
+ selection: undefined,
+ };
+
+ private tempGuidelLine: fabric.GuideLine | undefined;
+
+ constructor(_options: RulerOptions) {
+ // 合并默认配置
+ this.options = Object.assign(
+ {
+ ruleSize: 20,
+ fontSize: 10,
+ enabled: false,
+ backgroundColor: '#fff',
+ borderColor: '#ddd',
+ highlightColor: '#007fff',
+ textColor: '#888',
+ },
+ _options
+ );
+
+ this.ctx = this.options.canvas.getContext();
+
+ fabric.util.object.extend(this.options.canvas, {
+ ruler: this,
+ });
+
+ setupGuideLine();
+
+ if (this.options.enabled) {
+ this.enable();
+ }
+ }
+
+ // 销毁
+ public destroy() {
+ this.disable();
+ }
+
+ /**
+ * 移除全部辅助线
+ */
+ public clearGuideline() {
+ this.options.canvas.remove(...this.options.canvas.getObjects(fabric.GuideLine.prototype.type));
+ }
+
+ /**
+ * 显示全部辅助线
+ */
+ public showGuideline() {
+ this?.options?.canvas?.getObjects(fabric.GuideLine.prototype.type).forEach((guideLine) => {
+ guideLine.set('visible', true);
+ });
+ this?.options?.canvas?.renderAll();
+ }
+
+ /**
+ * 隐藏全部辅助线
+ */
+ public hideGuideline() {
+ this.options.canvas.getObjects(fabric.GuideLine.prototype.type).forEach((guideLine) => {
+ guideLine.set('visible', false);
+ });
+ this.options.canvas.renderAll();
+ }
+
+ /**
+ * 启用
+ */
+ public enable() {
+ this.options.enabled = true;
+
+ // 绑定事件
+ this.options.canvas.on('after:render', this.eventHandler.calcObjectRect);
+ this.options.canvas.on('after:render', this.eventHandler.render);
+ this.options.canvas.on('mouse:down', this.eventHandler.canvasMouseDown);
+ this.options.canvas.on('mouse:move', this.eventHandler.canvasMouseMove);
+ this.options.canvas.on('mouse:up', this.eventHandler.canvasMouseUp);
+ this.options.canvas.on('selection:cleared', this.eventHandler.clearStatus);
+
+ // 显示辅助线
+ this.showGuideline();
+
+ // 绘制一次
+ this.render();
+ }
+
+ /**
+ * 禁用
+ */
+ public disable() {
+ // 解除事件
+ this.options.canvas.off('after:render', this.eventHandler.calcObjectRect);
+ this.options.canvas.off('after:render', this.eventHandler.render);
+ this.options.canvas.off('mouse:down', this.eventHandler.canvasMouseDown);
+ this.options.canvas.off('mouse:move', this.eventHandler.canvasMouseMove);
+ this.options.canvas.off('mouse:up', this.eventHandler.canvasMouseUp);
+ this.options.canvas.off('selection:cleared', this.eventHandler.clearStatus);
+
+ // 隐藏辅助线
+ this.hideGuideline();
+
+ this.options.enabled = false;
+ }
+
+ /**
+ * 绘制
+ */
+ public render() {
+ // if (!this.options.enabled) return;
+ const vpt = this.options.canvas.viewportTransform;
+ if (!vpt) return;
+ // 绘制尺子
+ this.draw({
+ isHorizontal: true,
+ rulerLength: this.getSize().width,
+ // startCalibration: -(vpt[4] / vpt[0]),
+ startCalibration: this.startCalibration?.x ? this.startCalibration.x : -(vpt[4] / vpt[0]),
+ });
+ this.draw({
+ isHorizontal: false,
+ rulerLength: this.getSize().height,
+ // startCalibration: -(vpt[5] / vpt[3]),
+ startCalibration: this.startCalibration?.y ? this.startCalibration.y : -(vpt[5] / vpt[3]),
+ });
+ // 绘制左上角的遮罩
+ drawMask(this.ctx, {
+ isHorizontal: true,
+ left: -10,
+ top: -10,
+ width: this.options.ruleSize * 2 + 10,
+ height: this.options.ruleSize + 10,
+ backgroundColor: this.options.backgroundColor,
+ });
+ drawMask(this.ctx, {
+ isHorizontal: false,
+ left: -10,
+ top: -10,
+ width: this.options.ruleSize + 10,
+ height: this.options.ruleSize * 2 + 10,
+ backgroundColor: this.options.backgroundColor,
+ });
+ }
+
+ /**
+ * 获取画板尺寸
+ */
+ private getSize() {
+ return {
+ width: this.options.canvas.width ?? 0,
+ height: this.options.canvas.height ?? 0,
+ };
+ }
+
+ private getZoom() {
+ return this.options.canvas.getZoom();
+ }
+
+ private draw(opt: { isHorizontal: boolean; rulerLength: number; startCalibration: number }) {
+ const { isHorizontal, rulerLength, startCalibration } = opt;
+ const zoom = this.getZoom();
+
+ const gap = getGap(zoom);
+ const unitLength = rulerLength / zoom;
+ const startValue = Math[startCalibration > 0 ? 'floor' : 'ceil'](startCalibration / gap) * gap;
+ const startOffset = startValue - startCalibration;
+
+ // 标尺背景
+ const canvasSize = this.getSize();
+ darwRect(this.ctx, {
+ left: 0,
+ top: 0,
+ width: isHorizontal ? canvasSize.width : this.options.ruleSize,
+ height: isHorizontal ? this.options.ruleSize : canvasSize.height,
+ fill: this.options.backgroundColor,
+ stroke: this.options.borderColor,
+ });
+
+ // 颜色
+ const textColor = new fabric.Color(this.options.textColor);
+ // 标尺文字显示
+ for (let i = 0; i + startOffset <= Math.ceil(unitLength); i += gap) {
+ const position = (startOffset + i) * zoom;
+ const textValue = startValue + i + '';
+ const textLength = (10 * textValue.length) / 4;
+ const textX = isHorizontal
+ ? position - textLength - 1
+ : this.options.ruleSize / 2 - this.options.fontSize / 2 - 4;
+ const textY = isHorizontal
+ ? this.options.ruleSize / 2 - this.options.fontSize / 2 - 4
+ : position + textLength;
+ darwText(this.ctx, {
+ text: textValue,
+ left: textX,
+ top: textY,
+ fill: textColor.toRgb(),
+ angle: isHorizontal ? 0 : -90,
+ });
+ }
+
+ // 标尺刻度线显示
+ for (let j = 0; j + startOffset <= Math.ceil(unitLength); j += gap) {
+ const position = Math.round((startOffset + j) * zoom);
+ const left = isHorizontal ? position : this.options.ruleSize - 8;
+ const top = isHorizontal ? this.options.ruleSize - 8 : position;
+ const width = isHorizontal ? 0 : 8;
+ const height = isHorizontal ? 8 : 0;
+ darwLine(this.ctx, {
+ left,
+ top,
+ width,
+ height,
+ stroke: textColor.toRgb(),
+ });
+ }
+
+ // 标尺蓝色遮罩
+ if (this.objectRect) {
+ const axis = isHorizontal ? 'x' : 'y';
+ this.objectRect[axis].forEach((rect) => {
+ // 跳过指定矩形
+ if (rect.skip === axis) {
+ return;
+ }
+
+ // 获取数字的值
+ const roundFactor = (x: number) => Math.round(x / zoom + startCalibration) + '';
+ const leftTextVal = roundFactor(isHorizontal ? rect.left : rect.top);
+ const rightTextVal = roundFactor(
+ isHorizontal ? rect.left + rect.width : rect.top + rect.height
+ );
+
+ const isSameText = leftTextVal === rightTextVal;
+
+ // 背景遮罩
+ const maskOpt = {
+ isHorizontal,
+ width: isHorizontal ? 160 : this.options.ruleSize - 8,
+ height: isHorizontal ? this.options.ruleSize - 8 : 160,
+ backgroundColor: this.options.backgroundColor,
+ };
+ drawMask(this.ctx, {
+ ...maskOpt,
+ left: isHorizontal ? rect.left - 80 : 0,
+ top: isHorizontal ? 0 : rect.top - 80,
+ });
+ if (!isSameText) {
+ drawMask(this.ctx, {
+ ...maskOpt,
+ left: isHorizontal ? rect.width + rect.left - 80 : 0,
+ top: isHorizontal ? 0 : rect.height + rect.top - 80,
+ });
+ }
+
+ // 颜色
+ const highlightColor = new fabric.Color(this.options.highlightColor);
+
+ // 高亮遮罩
+ highlightColor.setAlpha(0.5);
+ darwRect(this.ctx, {
+ left: isHorizontal ? rect.left : this.options.ruleSize - 8,
+ top: isHorizontal ? this.options.ruleSize - 8 : rect.top,
+ width: isHorizontal ? rect.width : 8,
+ height: isHorizontal ? 8 : rect.height,
+ fill: highlightColor.toRgba(),
+ });
+
+ // 两边的数字
+ const pad = this.options.ruleSize / 2 - this.options.fontSize / 2 - 4;
+
+ const textOpt = {
+ fill: highlightColor.toRgba(),
+ angle: isHorizontal ? 0 : -90,
+ };
+
+ darwText(this.ctx, {
+ ...textOpt,
+ text: leftTextVal,
+ left: isHorizontal ? rect.left - 2 : pad,
+ top: isHorizontal ? pad : rect.top - 2,
+ align: isSameText ? 'center' : isHorizontal ? 'right' : 'left',
+ });
+
+ if (!isSameText) {
+ darwText(this.ctx, {
+ ...textOpt,
+ text: rightTextVal,
+ left: isHorizontal ? rect.left + rect.width + 2 : pad,
+ top: isHorizontal ? pad : rect.top + rect.height + 2,
+ align: isHorizontal ? 'left' : 'right',
+ });
+ }
+
+ // 两边的线
+ const lineSize = isSameText ? 8 : 14;
+
+ highlightColor.setAlpha(1);
+
+ const lineOpt = {
+ width: isHorizontal ? 0 : lineSize,
+ height: isHorizontal ? lineSize : 0,
+ stroke: highlightColor.toRgba(),
+ };
+
+ darwLine(this.ctx, {
+ ...lineOpt,
+ left: isHorizontal ? rect.left : this.options.ruleSize - lineSize,
+ top: isHorizontal ? this.options.ruleSize - lineSize : rect.top,
+ });
+
+ if (!isSameText) {
+ darwLine(this.ctx, {
+ ...lineOpt,
+ left: isHorizontal ? rect.left + rect.width : this.options.ruleSize - lineSize,
+ top: isHorizontal ? this.options.ruleSize - lineSize : rect.top + rect.height,
+ });
+ }
+ });
+ }
+ // draw end
+ }
+
+ /**
+ * 计算起始点
+ */
+ // private calcCalibration() {
+ // if (this.startCalibration) return;
+ // // console.log('calcCalibration');
+ // const workspace = this.options.canvas.getObjects().find((item: any) => {
+ // return item.id === 'workspace';
+ // });
+ // if (!workspace) return;
+ // const rect = workspace.getBoundingRect(false);
+ // this.startCalibration = new fabric.Point(-rect.left, -rect.top).divide(this.getZoom());
+ // }
+
+ private calcObjectRect() {
+ const activeObjects = this.options.canvas.getActiveObjects();
+ if (activeObjects.length === 0) return;
+ const allRect = activeObjects.reduce((rects, obj) => {
+ const rect: HighlightRect = obj.getBoundingRect(false, true);
+ // 如果是分组单独计算坐标
+ if (obj.group) {
+ const group = {
+ top: 0,
+ left: 0,
+ width: 0,
+ height: 0,
+ scaleX: 1,
+ scaleY: 1,
+ ...obj.group,
+ };
+ // 计算矩形坐标
+ rect.width *= group.scaleX;
+ rect.height *= group.scaleY;
+ const groupCenterX = group.width / 2 + group.left;
+ const objectOffsetFromCenterX = (group.width / 2 + (obj.left ?? 0)) * (1 - group.scaleX);
+ rect.left += (groupCenterX - objectOffsetFromCenterX) * this.getZoom();
+ const groupCenterY = group.height / 2 + group.top;
+ const objectOffsetFromCenterY = (group.height / 2 + (obj.top ?? 0)) * (1 - group.scaleY);
+ rect.top += (groupCenterY - objectOffsetFromCenterY) * this.getZoom();
+ }
+ if (obj instanceof fabric.GuideLine) {
+ rect.skip = obj.isHorizontal() ? 'x' : 'y';
+ }
+ rects.push(rect);
+ return rects;
+ }, [] as HighlightRect[]);
+ if (allRect.length === 0) return;
+ this.objectRect = {
+ x: mergeLines(allRect, true),
+ y: mergeLines(allRect, false),
+ };
+ }
+
+ /**
+ * 清除起始点和矩形坐标
+ */
+ private clearStatus() {
+ // this.startCalibration = undefined;
+ this.objectRect = undefined;
+ }
+
+ /**
+ 判断鼠标是否在标尺上
+ * @param point
+ * @returns "vertical" | "horizontal" | false
+ */
+ public isPointOnRuler(point: Point) {
+ if (
+ new fabric.Rect({
+ left: 0,
+ top: 0,
+ width: this.options.ruleSize,
+ height: this.options.canvas.height,
+ }).containsPoint(point)
+ ) {
+ return 'vertical';
+ } else if (
+ new fabric.Rect({
+ left: 0,
+ top: 0,
+ width: this.options.canvas.width,
+ height: this.options.ruleSize,
+ }).containsPoint(point)
+ ) {
+ return 'horizontal';
+ }
+ return false;
+ }
+
+ private canvasMouseDown(e: IEvent) {
+ if (!e.pointer || !e.absolutePointer) return;
+ const hoveredRuler = this.isPointOnRuler(e.pointer);
+ if (hoveredRuler && this.activeOn === 'up') {
+ // 备份属性
+ this.lastAttr.selection = this.options.canvas.selection;
+ this.options.canvas.selection = false;
+ this.activeOn = 'down';
+
+ this.tempGuidelLine = new fabric.GuideLine(
+ hoveredRuler === 'horizontal' ? e.absolutePointer.y : e.absolutePointer.x,
+ {
+ axis: hoveredRuler,
+ visible: false,
+ }
+ );
+
+ this.options.canvas.add(this.tempGuidelLine);
+ this.options.canvas.setActiveObject(this.tempGuidelLine);
+
+ this.options.canvas._setupCurrentTransform(e.e, this.tempGuidelLine, true);
+
+ this.tempGuidelLine.fire('down', this.getCommonEventInfo(e));
+ }
+ }
+
+ private getCommonEventInfo = (e: IEvent) => {
+ if (!this.tempGuidelLine || !e.absolutePointer) return;
+ return {
+ e: e.e,
+ transform: this.tempGuidelLine.get('transform'),
+ pointer: {
+ x: e.absolutePointer.x,
+ y: e.absolutePointer.y,
+ },
+ target: this.tempGuidelLine,
+ };
+ };
+
+ private canvasMouseMove(e: IEvent) {
+ if (!e.pointer) return;
+
+ if (this.tempGuidelLine && e.absolutePointer) {
+ const pos: Partial = {};
+ if (this.tempGuidelLine.axis === 'horizontal') {
+ pos.top = e.absolutePointer.y;
+ } else {
+ pos.left = e.absolutePointer.x;
+ }
+ this.tempGuidelLine.set({ ...pos, visible: true });
+
+ this.options.canvas.requestRenderAll();
+
+ const event = this.getCommonEventInfo(e);
+ this.options.canvas.fire('object:moving', event);
+ this.tempGuidelLine.fire('moving', event);
+ }
+
+ const hoveredRuler = this.isPointOnRuler(e.pointer);
+ if (!hoveredRuler) {
+ // 鼠标从里面出去
+ if (this.lastAttr.status !== 'out') {
+ // 更改鼠标指针
+ this.options.canvas.defaultCursor = this.lastAttr.cursor;
+ this.lastAttr.status = 'out';
+ }
+ return;
+ }
+ // const activeObjects = this.options.canvas.getActiveObjects();
+ // if (activeObjects.length === 1 && activeObjects[0] instanceof fabric.GuideLine) {
+ // return;
+ // }
+ // 鼠标从外边进入 或 在另一侧标尺
+ if (this.lastAttr.status === 'out' || hoveredRuler !== this.lastAttr.status) {
+ // 更改鼠标指针
+ this.lastAttr.cursor = this.options.canvas.defaultCursor;
+ this.options.canvas.defaultCursor = hoveredRuler === 'horizontal' ? 'ns-resize' : 'ew-resize';
+ this.lastAttr.status = hoveredRuler;
+ }
+ }
+
+ private canvasMouseUp(e: IEvent) {
+ if (this.activeOn !== 'down') return;
+
+ // 还原属性
+ this.options.canvas.selection = this.lastAttr.selection;
+ this.activeOn = 'up';
+
+ this.tempGuidelLine?.fire('up', this.getCommonEventInfo(e));
+
+ this.tempGuidelLine = undefined;
+ }
+}
+
+export default CanvasRuler;
diff --git a/packages/core/ruler/utils.ts b/packages/core/ruler/utils.ts
new file mode 100644
index 0000000..00a2a07
--- /dev/null
+++ b/packages/core/ruler/utils.ts
@@ -0,0 +1,160 @@
+import type { Rect } from './ruler';
+import { fabric } from 'fabric';
+
+/**
+ * 计算尺子间距
+ * @param zoom 缩放比例
+ * @returns 返回计算出的尺子间距
+ */
+const getGap = (zoom: number) => {
+ const zooms = [0.02, 0.03, 0.05, 0.1, 0.2, 0.5, 1, 2, 5, 10, 18];
+ const gaps = [5000, 2500, 1000, 500, 250, 100, 50, 25, 10, 5, 2];
+
+ let i = 0;
+ while (i < zooms.length && zooms[i] < zoom) {
+ i++;
+ }
+
+ return gaps[i - 1] || 5000;
+};
+
+/**
+ * 线段合并
+ * @param rect Rect数组
+ * @param isHorizontal
+ * @returns 合并后的Rect数组
+ */
+const mergeLines = (rect: Rect[], isHorizontal: boolean) => {
+ const axis = isHorizontal ? 'left' : 'top';
+ const length = isHorizontal ? 'width' : 'height';
+ // 先按照 axis 的大小排序
+ rect.sort((a, b) => a[axis] - b[axis]);
+ const mergedLines = [];
+ let currentLine = Object.assign({}, rect[0]);
+ for (const item of rect) {
+ const line = Object.assign({}, item);
+ if (currentLine[axis] + currentLine[length] >= line[axis]) {
+ // 当前线段和下一个线段相交,合并宽度
+ currentLine[length] =
+ Math.max(currentLine[axis] + currentLine[length], line[axis] + line[length]) -
+ currentLine[axis];
+ } else {
+ // 当前线段和下一个线段不相交,将当前线段加入结果数组中,并更新当前线段为下一个线段
+ mergedLines.push(currentLine);
+ currentLine = Object.assign({}, line);
+ }
+ }
+ // 加入数组
+ mergedLines.push(currentLine);
+ return mergedLines;
+};
+
+const darwLine = (
+ ctx: CanvasRenderingContext2D,
+ options: {
+ left: number;
+ top: number;
+ width: number;
+ height: number;
+ stroke?: string | CanvasGradient | CanvasPattern;
+ lineWidth?: number;
+ }
+) => {
+ ctx.save();
+ const { left, top, width, height, stroke, lineWidth } = options;
+ ctx.beginPath();
+ stroke && (ctx.strokeStyle = stroke);
+ ctx.lineWidth = lineWidth ?? 1;
+ ctx.moveTo(left, top);
+ ctx.lineTo(left + width, top + height);
+ ctx.stroke();
+ ctx.restore();
+};
+
+const darwText = (
+ ctx: CanvasRenderingContext2D,
+ options: {
+ left: number;
+ top: number;
+ text: string;
+ fill?: string | CanvasGradient | CanvasPattern;
+ align?: CanvasTextAlign;
+ angle?: number;
+ fontSize?: number;
+ }
+) => {
+ ctx.save();
+ const { left, top, text, fill, align, angle, fontSize } = options;
+ fill && (ctx.fillStyle = fill);
+ ctx.textAlign = align ?? 'left';
+ ctx.textBaseline = 'top';
+ ctx.font = `${fontSize ?? 10}px sans-serif`;
+ if (angle) {
+ ctx.translate(left, top);
+ ctx.rotate((Math.PI / 180) * angle);
+ ctx.translate(-left, -top);
+ }
+ ctx.fillText(text, left, top);
+ ctx.restore();
+};
+
+const darwRect = (
+ ctx: CanvasRenderingContext2D,
+ options: {
+ left: number;
+ top: number;
+ width: number;
+ height: number;
+ fill?: string | CanvasGradient | CanvasPattern;
+ stroke?: string;
+ strokeWidth?: number;
+ }
+) => {
+ ctx.save();
+ const { left, top, width, height, fill, stroke, strokeWidth } = options;
+ ctx.beginPath();
+ fill && (ctx.fillStyle = fill);
+ ctx.rect(left, top, width, height);
+ ctx.fill();
+ if (stroke) {
+ ctx.strokeStyle = stroke;
+ ctx.lineWidth = strokeWidth ?? 1;
+ ctx.stroke();
+ }
+ ctx.restore();
+};
+
+const drawMask = (
+ ctx: CanvasRenderingContext2D,
+ options: {
+ isHorizontal: boolean;
+ left: number;
+ top: number;
+ width: number;
+ height: number;
+ backgroundColor: string;
+ }
+) => {
+ ctx.save();
+ const { isHorizontal, left, top, width, height, backgroundColor } = options;
+ // 创建一个线性渐变对象
+ const gradient = isHorizontal
+ ? ctx.createLinearGradient(left, height / 2, left + width, height / 2)
+ : ctx.createLinearGradient(width / 2, top, width / 2, height + top);
+ const transparentColor = new fabric.Color(backgroundColor);
+ transparentColor.setAlpha(0);
+ gradient.addColorStop(0, transparentColor.toRgba());
+ gradient.addColorStop(0.33, backgroundColor);
+ gradient.addColorStop(0.67, backgroundColor);
+ gradient.addColorStop(1, transparentColor.toRgba());
+ darwRect(ctx, {
+ left,
+ top,
+ width,
+ height,
+ fill: gradient,
+ });
+ ctx.restore();
+};
+
+export { getGap, mergeLines, darwRect, darwText, darwLine, drawMask };
diff --git a/packages/core/styles/contextMenu.css b/packages/core/styles/contextMenu.css
new file mode 100644
index 0000000..eb3c984
--- /dev/null
+++ b/packages/core/styles/contextMenu.css
@@ -0,0 +1,60 @@
+.context {
+ display: inline-block;
+ position: fixed;
+ top: 0px;
+ left: 0px;
+ min-width: 270px;
+ font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
+ color: #fff;
+ background: #262933;
+ font-size: 9pt;
+ border: 1px solid #333333;
+ border-radius: 6px;
+ box-shadow: 2px 2px 2px -1px rgba(0, 0, 0, 0.5);
+ padding: 3px 0px;
+ -webkit-touch-callout: none;
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ user-select: none;
+ z-index: 999;
+}
+
+.context .item {
+ padding: 4px 19px;
+ cursor: default;
+ color: inherit;
+}
+
+.context .item:hover {
+ background: #2777ff;
+}
+
+.context .item:hover .hotkey {
+ color: #fff;
+}
+
+.context .disabled {
+ color: #878b90;
+}
+
+.context .disabled:hover {
+ background: inherit;
+}
+
+.context .disabled:hover .hotkey {
+ color: #878b90;
+}
+
+.context .separator {
+ margin: 4px 0px;
+ height: 0;
+ padding: 0;
+ border-top: 1px solid #454545;
+}
+
+.hotkey {
+ color: #878b90;
+ float: right;
+}
diff --git a/packages/core/styles/resizePlugin.css b/packages/core/styles/resizePlugin.css
new file mode 100644
index 0000000..adf45f4
--- /dev/null
+++ b/packages/core/styles/resizePlugin.css
@@ -0,0 +1,27 @@
+.resize-bar {
+ border-radius: 3px;
+ background-color: rgba(160, 160, 160, 0.6);
+ position: absolute;
+}
+.resize-bar:hover {
+ background-color: #328cff;
+}
+.resize-bar.horizontal {
+ width: 6px;
+ height: 30px;
+}
+.resize-bar.vertical {
+ width: 30px;
+ height: 6px;
+}
+.resize-bar.active {
+ background-color: #328cff;
+}
+#resize-left-bar,
+#resize-right-bar {
+ cursor: ew-resize;
+}
+#resize-top-bar,
+#resize-bottom-bar {
+ cursor: ns-resize;
+}
diff --git a/packages/core/utils/fabric-history.js b/packages/core/utils/fabric-history.js
new file mode 100644
index 0000000..c98e3e0
--- /dev/null
+++ b/packages/core/utils/fabric-history.js
@@ -0,0 +1,234 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2024-07-09 13:46:14
+ * @LastEditors: George GeorgeSmith163@163.com
+ * @LastEditTime: 2024-10-14 16:16:16
+ * @Description: file content
+ */
+/**
+ * Override the initialize function for the _historyInit();
+ */
+import { fabric } from 'fabric';
+
+fabric.Canvas.prototype.initialize = (function (originalFn) {
+ return function (...args) {
+ originalFn.call(this, ...args);
+ this._historyInit();
+ return this;
+ };
+})(fabric.Canvas.prototype.initialize);
+
+/**
+ * Override the dispose function for the _historyDispose();
+ */
+fabric.Canvas.prototype.dispose = (function (originalFn) {
+ return function (...args) {
+ originalFn.call(this, ...args);
+ this._historyDispose();
+ return this;
+ };
+})(fabric.Canvas.prototype.dispose);
+
+/**
+ * Returns current state of the string of the canvas
+ */
+fabric.Canvas.prototype._historyNext = function () {
+ return JSON.stringify(this.toDatalessJSON(this.extraProps));
+};
+
+/**
+ * Returns an object with fabricjs event mappings
+ */
+fabric.Canvas.prototype._historyEvents = function () {
+ return {
+ 'object:added': (e) => this._historySaveAction(e),
+ 'object:removed': (e) => this._historySaveAction(e),
+ 'object:modified': (e) => this._historySaveAction(e),
+ 'object:skewing': (e) => this._historySaveAction(e),
+ };
+};
+
+/**
+ * Initialization of the plugin
+ */
+fabric.Canvas.prototype._historyInit = function () {
+ this.historyStack = [];
+ this.historyIndex = 0;
+ this.historyMaxLength = 100;
+ this.extraProps = [
+ 'id',
+ 'gradientAngle',
+ 'selectable',
+ 'hasControls',
+ 'linkData',
+ 'editable',
+ 'extensionType',
+ 'extension',
+ ];
+ this.historyNextState = this._historyNext();
+ // 需要两次操作的标记,为true时表示当前操作记录为最新记录,需要撤销两步,因为最顶层的是当前的最新记录,undo一次后后置为false
+ this.isLatestHistoryState = true;
+ // 正在读取历史记录的标记,为 true 时不允许 undo/redo
+ this.isLoadingHistory = false;
+
+ this.on(this._historyEvents());
+};
+
+/**
+ * Remove the custom event listeners
+ */
+fabric.Canvas.prototype._historyDispose = function () {
+ this.off(this._historyEvents());
+};
+
+/**
+ * It pushes the state of the canvas into history stack
+ */
+fabric.Canvas.prototype._historySaveAction = function (e) {
+ if (this.historyProcessing) return;
+ if (!e || (e.target && !e.target.excludeFromExport)) {
+ const json = this._historyNext();
+ // 当前操作记录非最新记录,更新记录前需要校正历史索引,不然会丢失一个记录(undo时撤销了两次记录)。理论上不会超出历史记录上限,不过还是加了限制
+ !this.isLatestHistoryState &&
+ (this.isLatestHistoryState = true) &&
+ this.historyIndex < this.historyMaxLength &&
+ this.historyIndex++;
+ // 每次的最新操作都要清空历史索引之后的记录,防止redo旧记录,不然可能会redo之前某个阶段的操作记录
+ this.historyStack.length > this.historyIndex && this.historyStack.splice(this.historyIndex);
+ // 最多保存 historyMaxLength 条记录
+ if (this.historyIndex >= this.historyMaxLength) this.historyStack.shift();
+ this.historyIndex < this.historyMaxLength && this.historyIndex++;
+ this.historyStack.push(json);
+ this.historyNextState = this._historyNext();
+ this.fire('history:append', { json });
+ }
+};
+
+/**
+ * Undo to latest history.
+ * Pop the latest state of the history. Re-render.
+ * Also, pushes into redo history.
+ */
+fabric.Canvas.prototype.undo = function (callback) {
+ if (this.isLoadingHistory) return;
+ if (this.historyIndex <= 0) return;
+ // The undo process will render the new states of the objects
+ // Therefore, object:added and object:modified events will triggered again
+ // To ignore those events, we are setting a flag.
+ this.historyProcessing = true;
+
+ // 当前操作记录为最新记录,需要撤销两步,因为最顶层的是当前的最新记录
+ this.isLatestHistoryState && this.historyIndex-- && (this.isLatestHistoryState = false);
+ const history = this.historyStack[--this.historyIndex];
+ if (history) {
+ // Push the current state to the redo history
+ this.historyNextState = history;
+ this._loadHistory(history, 'history:undo', callback);
+ } else {
+ console.log(1111);
+ this.historyIndex < 0 && (this.historyIndex = 0);
+ this.historyProcessing = false;
+ }
+};
+
+/**
+ * Redo to latest undo history.
+ */
+fabric.Canvas.prototype.redo = function (callback) {
+ if (this.isLoadingHistory) return;
+ if (this.historyIndex >= this.historyStack.length) return;
+ // The undo process will render the new states of the objects
+ // Therefore, object:added and object:modified events will triggered again
+ // To ignore those events, we are setting a flag.
+ this.historyProcessing = true;
+ // 当前操作记录不是最新记录(被撤销过),需要恢复两步,抵消最初撤销时撤销两步的操作
+ !this.isLatestHistoryState && ++this.historyIndex && (this.isLatestHistoryState = true);
+ const history = this.historyStack[this.historyIndex];
+ if (history) {
+ // Every redo action is actually a new action to the undo history
+ this.historyNextState = history;
+ this._loadHistory(history, 'history:redo', callback);
+ this.historyIndex++;
+ } else {
+ this.historyProcessing = false;
+ }
+};
+
+// loadFromJSON 是异步操作,所以通过 isLoadingHistory = true 表示历史读取中,不可 undo/redo,
+// 不然当页面复杂且快速 undo/redo 多次后,可能会在之前的历史上 redo/undo
+fabric.Canvas.prototype._loadHistory = function (history, event, callback) {
+ this.isLoadingHistory = true;
+ var that = this;
+
+ // 需要把历史记录中的 workspace 的 evented 属性设置为 false,否则会导致历史记录恢复后,鼠标悬浮 workspace 出现可操作的样式
+ const workspaceHistory = history.objects?.find((item) => item.id === 'workspace');
+ workspaceHistory && (workspaceHistory.evented = false);
+
+ this.loadFromJSON(history, function () {
+ that.renderAll();
+ that.fire(event);
+ that.historyProcessing = false;
+ that.isLoadingHistory = false;
+
+ if (callback && typeof callback === 'function') callback();
+ });
+};
+
+/**
+ * Clear undo and redo history stacks
+ */
+fabric.Canvas.prototype.clearHistory = function (type) {
+ const one = this.historyStack.pop();
+ if (!type || !one) {
+ this.historyStack = [];
+ this.historyIndex = 0;
+ this.fire('history:clear');
+ } else {
+ this.historyStack = [one];
+ this.historyIndex = 1;
+ this.fire('history:clear');
+ }
+ this.isLatestHistoryState = true;
+};
+
+fabric.Canvas.prototype.clearUndo = function () {
+ this.historyStack.splice(this.historyIndex);
+};
+
+// 如果在做一些操作之后,需要撤销上一步的操作并刷新历史记录(想在监听modified事件后做些额外的操作并记录操作后的历史),可以调用这个方法
+fabric.Canvas.prototype.refreshHistory = function () {
+ this.historyProcessing = false;
+ this.historyStack.splice(--this.historyIndex);
+ this._historySaveAction();
+};
+
+/**
+ * On the history
+ */
+fabric.Canvas.prototype.onHistory = function () {
+ this.historyProcessing = false;
+
+ this._historySaveAction();
+};
+
+/**
+ * Check if there are actions that can be undone
+ */
+
+fabric.Canvas.prototype.canUndo = function () {
+ return this.historyIndex > 0;
+};
+
+/**
+ * Check if there are actions that can be redone
+ */
+fabric.Canvas.prototype.canRedo = function () {
+ return this.historyStack.length > this.historyIndex;
+};
+
+/**
+ * Off the history
+ */
+fabric.Canvas.prototype.offHistory = function () {
+ this.historyProcessing = true;
+};
diff --git a/packages/core/utils/psd.js b/packages/core/utils/psd.js
new file mode 100644
index 0000000..3bd5f73
--- /dev/null
+++ b/packages/core/utils/psd.js
@@ -0,0 +1,427 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2024-06-08 18:14:43
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-06-08 18:51:03
+ * @Description: PSD转换为fabric.js
+ */
+
+import _ from 'lodash-es';
+import { v4 as uuid } from 'uuid';
+
+// 入口文件
+
+async function psdToJson(psdFile) {
+ // 初始化
+ const json = getTransform();
+
+ // 设置背景
+ const { clipPath, workspase } = getClipPath(psdFile);
+ json.clipPath = clipPath;
+ json.objects.push(workspase);
+
+ // 拍平
+ const list = flattenTree(psdFile.children);
+
+ // 转换
+ const fabricJhildren = await psdChildrenTransform(list);
+ json.objects.push(...fabricJhildren.reverse());
+
+ // 输出文件
+ const jsonStr = JSON.stringify(json, null, 2);
+ return jsonStr;
+}
+
+async function psdChildrenTransform(children) {
+ function attrTransform(childrens) {
+ const childrensFilter = childrens.filter((item) => {
+ if (item.text) {
+ item.type = 'text';
+ }
+ return !item.isHidden;
+ });
+ return childrensFilter.map(async (item) => {
+ // 公共属性映射
+ const commonAttr = baseUtils([
+ 'left',
+ 'top',
+ ['width', (info) => info.width + 50],
+ 'height',
+ 'name',
+ ['visible', () => true],
+ ['opacity', (info) => 255 / info.opacity],
+ ['id', uuid],
+ ])(item);
+
+ // 类型映射
+ const typeList = [
+ {
+ sourceType: 'Layer',
+ targetType: 'image',
+ attr: [],
+ async customTransform(item) {
+ // 图片遮罩
+ // const { maskData } = item.layerFrame.layerProperties;
+ // let clipPath;
+ // if (maskData) {
+ // clipPath = getAttrByType('rect');
+ // clipPath.left = maskData.left;
+ // clipPath.top = maskData.top;
+ // }
+ const base64 = await getLayerBse64(item);
+ return {
+ src: base64,
+ // clipPath,
+ };
+ },
+ },
+ {
+ sourceType: 'text',
+ targetType: 'textbox',
+ attr: ['text'],
+ async customTransform(item) {
+ const { FontSize, FillColor, Tracking } =
+ item.textProperties.EngineDict.StyleRun.RunArray[0].StyleSheet.StyleSheetData;
+ return {
+ charSpacing: Tracking,
+ fontFamily: '站酷快乐体',
+ fill: getColor(FillColor.Values),
+ fontSize: FontSize || 12,
+ };
+ },
+ },
+ ];
+
+ const sourctTypeKey = 'type';
+ const transformTypeInfo = typeList.find((info) => info.sourceType === item[sourctTypeKey]);
+ if (transformTypeInfo) {
+ const baseAttr = getAttrByType(transformTypeInfo.targetType);
+ const typeAttr = baseUtils(transformTypeInfo.attr)(item);
+ const customTransformAttr = transformTypeInfo.customTransform
+ ? await transformTypeInfo.customTransform(item)
+ : null;
+ return _.assign(baseAttr, commonAttr, baseAttr, typeAttr, customTransformAttr);
+ }
+ return {
+ ...getAttrByType('textbox'),
+ };
+ });
+ }
+ const resault = await Promise.all(attrTransform(children));
+ return resault;
+}
+
+function getTransform() {
+ // 初始化
+ const json = {
+ version: '5.3.0',
+ objects: [],
+ clipPath: null,
+ };
+
+ return json;
+}
+
+function baseUtils(baseAttr) {
+ return function (item) {
+ const attrs = {
+ desc: {},
+ };
+ baseAttr.forEach((attrType) => {
+ // 直接转换
+ if (typeof attrType === 'string') {
+ const value = _.get(item, attrType);
+ _.set(attrs, attrType, value);
+ } else {
+ const [key, transform] = attrType;
+ if (typeof transform === 'function') {
+ const value = transform(item);
+ if (value) {
+ _.set(attrs, key, value);
+ }
+ } else {
+ const value = _.get(item, transform);
+ _.set(attrs, key, value);
+ }
+ }
+ });
+ return attrs;
+ };
+}
+
+function getAttrByType(type) {
+ const typeMap = {
+ group: {
+ type: 'group',
+ version: '5.3.0',
+ originX: 'left',
+ originY: 'top',
+ fill: 'rgb(0,0,0)',
+ stroke: null,
+ strokeWidth: 0,
+ strokeDashArray: null,
+ strokeLineCap: 'butt',
+ strokeDashOffset: 0,
+ strokeLineJoin: 'miter',
+ strokeUniform: false,
+ strokeMiterLimit: 4,
+ scaleX: 1,
+ scaleY: 1,
+ flipX: false,
+ flipY: false,
+ shadow: null,
+ visible: true,
+ backgroundColor: '',
+ fillRule: 'nonzero',
+ paintFirst: 'fill',
+ globalCompositeOperation: 'source-over',
+ skewX: 0,
+ skewY: 0,
+ selectable: true,
+ hasControls: true,
+ },
+ textbox: {
+ type: 'textbox',
+ version: '5.3.0',
+ originX: 'left',
+ originY: 'top',
+ fill: 'rgb(0,0,0)',
+ stroke: null,
+ strokeWidth: 1,
+ strokeDashArray: null,
+ strokeLineCap: 'butt',
+ strokeDashOffset: 0,
+ strokeLineJoin: 'miter',
+ strokeUniform: false,
+ strokeMiterLimit: 4,
+ scaleX: 1,
+ scaleY: 1,
+ angle: 0,
+ flipX: false,
+ flipY: false,
+ shadow: '',
+ backgroundColor: '',
+ fillRule: 'nonzero',
+ paintFirst: 'fill',
+ globalCompositeOperation: 'source-over',
+ skewX: 0,
+ skewY: 0,
+ fontFamily: 'arial',
+ fontWeight: 'normal',
+ fontSize: 80,
+ text: '诸事顺遂',
+ underline: false,
+ overline: false,
+ linethrough: false,
+ textAlign: 'left',
+ fontStyle: 'normal',
+ lineHeight: 1.16,
+ textBackgroundColor: '',
+ charSpacing: 0,
+ styles: [],
+ direction: 'ltr',
+ path: null,
+ pathStartOffset: 0,
+ pathSide: 'left',
+ pathAlign: 'baseline',
+ minWidth: 20,
+ splitByGrapheme: true,
+ selectable: true,
+ hasControls: true,
+ },
+ image: {
+ type: 'image',
+ version: '5.3.0',
+ originX: 'left',
+ originY: 'top',
+ fill: 'rgb(0,0,0)',
+ stroke: null,
+ strokeWidth: 0,
+ strokeDashArray: null,
+ strokeLineCap: 'butt',
+ strokeDashOffset: 0,
+ strokeLineJoin: 'miter',
+ strokeUniform: false,
+ strokeMiterLimit: 4,
+ scaleX: 1,
+ scaleY: 1,
+ angle: 0,
+ flipX: false,
+ flipY: false,
+ shadow: null,
+ backgroundColor: '',
+ fillRule: 'nonzero',
+ paintFirst: 'fill',
+ globalCompositeOperation: 'source-over',
+ skewX: 0,
+ skewY: 0,
+ cropX: 0,
+ cropY: 0,
+ selectable: true,
+ hasControls: true,
+ src: '',
+ crossOrigin: 'anonymous',
+ filters: [],
+ },
+ rect: {
+ type: 'rect',
+ version: '5.3.0',
+ originX: 'center',
+ originY: 'center',
+ left: 0,
+ top: 0,
+ width: 226,
+ height: 302,
+ fill: 'rgb(0,0,0)',
+ stroke: null,
+ strokeWidth: 1,
+ strokeDashArray: null,
+ strokeLineCap: 'butt',
+ strokeDashOffset: 0,
+ strokeLineJoin: 'miter',
+ strokeUniform: false,
+ strokeMiterLimit: 4,
+ scaleX: 1,
+ scaleY: 1,
+ angle: 0,
+ flipX: false,
+ flipY: false,
+ opacity: 1,
+ shadow: null,
+ visible: true,
+ backgroundColor: '',
+ fillRule: 'nonzero',
+ paintFirst: 'fill',
+ globalCompositeOperation: 'source-over',
+ skewX: 0,
+ skewY: 0,
+ rx: 0,
+ ry: 0,
+ selectable: true,
+ hasControls: true,
+ inverted: false,
+ absolutePositioned: false,
+ },
+ };
+ return typeMap[type];
+}
+
+function getClipPath(psdFile) {
+ const { width, height } = psdFile;
+ const clipPath = {
+ type: 'rect',
+ version: '5.3.0',
+ originX: 'left',
+ originY: 'top',
+ left: 0,
+ top: 0,
+ width: width,
+ height: height,
+ fill: 'rgba(255,255,255,1)',
+ stroke: null,
+ strokeWidth: 0,
+ strokeDashArray: null,
+ strokeLineCap: 'butt',
+ strokeDashOffset: 0,
+ strokeLineJoin: 'miter',
+ strokeUniform: false,
+ strokeMiterLimit: 4,
+ scaleX: 1,
+ scaleY: 1,
+ angle: 0,
+ flipX: false,
+ flipY: false,
+ opacity: 1,
+ shadow: null,
+ visible: true,
+ backgroundColor: '',
+ fillRule: 'nonzero',
+ paintFirst: 'fill',
+ globalCompositeOperation: 'source-over',
+ skewX: 0,
+ skewY: 0,
+ rx: 0,
+ ry: 0,
+ selectable: true,
+ hasControls: true,
+ };
+ const workspase = {
+ type: 'rect',
+ version: '5.3.0',
+ originX: 'left',
+ originY: 'top',
+ left: 0,
+ top: 0,
+ width: width,
+ height: height,
+ fill: 'rgba(255,255,255,1)',
+ stroke: null,
+ strokeWidth: 0,
+ strokeDashArray: null,
+ strokeLineCap: 'butt',
+ strokeDashOffset: 0,
+ strokeLineJoin: 'miter',
+ strokeUniform: false,
+ strokeMiterLimit: 4,
+ scaleX: 1,
+ scaleY: 1,
+ angle: 0,
+ flipX: false,
+ flipY: false,
+ // "opacity": 1,
+ shadow: null,
+ visible: true,
+ backgroundColor: '',
+ fillRule: 'nonzero',
+ paintFirst: 'fill',
+ globalCompositeOperation: 'source-over',
+ skewX: 0,
+ skewY: 0,
+ rx: 0,
+ ry: 0,
+ id: 'workspace',
+ selectable: false,
+ hasControls: true,
+ };
+ return { clipPath, workspase };
+}
+
+async function getLayerBse64(layer) {
+ try {
+ const compositeBuffer = await layer.composite();
+ const canvasElement = document.createElement('canvas');
+ const context = canvasElement.getContext('2d');
+ const imageData = new ImageData(compositeBuffer, layer.width, layer.height);
+ canvasElement.width = layer.width;
+ canvasElement.height = layer.height;
+ context.putImageData(imageData, 0, 0);
+ const base64 = canvasElement.toDataURL('image/png');
+ return base64;
+ } catch (error) {
+ return '';
+ }
+}
+
+function getColor(arr) {
+ const [, r, g, b] = arr;
+ return `rgb(${r * 255}, ${g * 255}, ${b * 255})`;
+}
+
+function flattenTree(tree) {
+ const result = [];
+
+ function traverse(nodes) {
+ nodes.forEach((node) => {
+ if (node.children) {
+ traverse(node.children); // 递归遍历子节点
+ } else {
+ result.push(node); // 将当前节点添加到结果数组中
+ }
+ });
+ }
+
+ traverse(tree);
+ return result;
+}
+
+export default psdToJson;
diff --git a/packages/core/utils/utils.ts b/packages/core/utils/utils.ts
new file mode 100644
index 0000000..aa778ac
--- /dev/null
+++ b/packages/core/utils/utils.ts
@@ -0,0 +1,167 @@
+/*
+ * @Author: 秦少卫
+ * @Date: 2022-09-05 22:21:55
+ * @LastEditors: 秦少卫
+ * @LastEditTime: 2024-07-22 10:24:53
+ * @Description: 工具文件
+ */
+import { v4 as uuid } from 'uuid';
+import { useClipboard, useFileDialog, useBase64 } from '@vueuse/core';
+
+/**
+ * @description: 图片文件转字符串
+ * @param {Blob|File} file 文件
+ * @return {String}
+ */
+export function getImgStr(file: File | Blob): Promise {
+ return useBase64(file).promise.value;
+}
+
+/**
+ * @description: 选择文件
+ * @param {Object} options accept = '', capture = '', multiple = false
+ * @return {Promise}
+ */
+export function selectFiles(options: {
+ accept?: string;
+ capture?: string;
+ multiple?: boolean;
+}): Promise {
+ return new Promise((resolve) => {
+ const { onChange, open } = useFileDialog(options);
+ onChange((files) => {
+ resolve(files);
+ });
+ open();
+ });
+}
+
+/**
+ * @description: 创建图片元素
+ * @param {String} str 图片地址或者base64图片
+ * @return {Promise} element 图片元素
+ */
+export function insertImgFile(str: string) {
+ return new Promise((resolve) => {
+ const imgEl = document.createElement('img');
+ imgEl.src = str;
+ // 插入页面
+ document.body.appendChild(imgEl);
+ imgEl.onload = () => {
+ resolve(imgEl);
+ };
+ });
+}
+
+/**
+ * Copying text to the clipboard
+ * @param source Copy source
+ * @param options Copy options
+ * @returns Promise that resolves when the text is copied successfully, or rejects when the copy fails.
+ */
+export const clipboardText = (source: string, options?: Parameters[0]) => {
+ return useClipboard({ source, ...options }).copy();
+};
+
+export function downFile(fileStr: string, fileType: string) {
+ const anchorEl = document.createElement('a');
+ anchorEl.href = fileStr;
+ anchorEl.download = `${uuid()}.${fileType}`;
+ document.body.appendChild(anchorEl); // required for firefox
+ anchorEl.click();
+ anchorEl.remove();
+}
+
+export function drawImg(
+ ctx: CanvasRenderingContext2D,
+ left: number,
+ top: number,
+ img: HTMLImageElement,
+ wSize: number,
+ hSize: number,
+ angle: number | undefined
+) {
+ if (angle === undefined) return;
+ ctx.save();
+ ctx.translate(left, top);
+ ctx.rotate(angle);
+ ctx.drawImage(img, -wSize / 2, -hSize / 2, wSize, hSize);
+ ctx.restore();
+}
+
+export function shiftAngle(start: fabric.Point, end: fabric.Point) {
+ const startX = start.x;
+ const startY = start.y;
+ const x2 = end.x - startX;
+ const y2 = end.y - startY;
+ const r = Math.sqrt(x2 * x2 + y2 * y2);
+ let angle = (Math.atan2(y2, x2) / Math.PI) * 180;
+ angle = ~~(((angle + 7.5) % 360) / 15) * 15;
+
+ const cosx = r * Math.cos((angle * Math.PI) / 180);
+ const sinx = r * Math.sin((angle * Math.PI) / 180);
+
+ return {
+ x: cosx + startX,
+ y: sinx + startY,
+ };
+}
+
+/**
+ * 类型工具
+ */
+export const isImage = (thing: unknown): thing is fabric.Image => {
+ return thing instanceof fabric.Image;
+};
+
+export const isGroup = (thing: unknown): thing is fabric.Group => {
+ return thing instanceof fabric.Group;
+};
+
+export const isIText = (thing: unknown): thing is fabric.IText => {
+ return thing instanceof fabric.IText;
+};
+
+export const isActiveSelection = (thing: unknown): thing is fabric.ActiveSelection => {
+ return thing instanceof fabric.ActiveSelection;
+};
+
+export function blobToBase64(blob: Blob) {
+ return new Promise((resolve) => {
+ const reader = new FileReader();
+ reader.addEventListener('load', () => {
+ resolve(reader.result as string);
+ });
+ reader.readAsDataURL(blob);
+ });
+}
+
+export function base64ToBlob(base64Data: string) {
+ if (!base64Data) {
+ return null;
+ }
+ const dataArr = base64Data.split(',');
+ const imageType = dataArr[0].match(/:(.*?);/)[1];
+ const textData = window.atob(dataArr[1]);
+ const arrayBuffer = new ArrayBuffer(textData.length);
+ const uint8Array = new Uint8Array(arrayBuffer);
+ for (let i = 0; i < textData.length; i++) {
+ uint8Array[i] = textData.charCodeAt(i);
+ }
+ return [new Blob([arrayBuffer], { type: imageType }), imageType.slice(6)];
+}
+
+export default {
+ getImgStr,
+ downFile,
+ selectFiles,
+ insertImgFile,
+ clipboardText,
+ drawImg,
+ isImage,
+ isGroup,
+ isIText,
+ isActiveSelection,
+ blobToBase64,
+ base64ToBlob,
+};
diff --git a/packages/core/vite.config.ts b/packages/core/vite.config.ts
new file mode 100644
index 0000000..2f399fd
--- /dev/null
+++ b/packages/core/vite.config.ts
@@ -0,0 +1,33 @@
+/*
+ * @Description:
+ * @version:
+ * @Author: June
+ * @Date: 2023-04-24 00:25:39
+ * @LastEditors: June 1601745371@qq.com
+ * @LastEditTime: 2024-04-18 10:14:25
+ */
+import { defineConfig } from 'vite';
+import eslintPlugin from 'vite-plugin-eslint'; //导入包
+import { resolve } from 'path';
+
+const config = () => {
+ return {
+ base: './',
+ build: {
+ lib: {
+ entry: resolve(__dirname, './index.ts'),
+ name: 'Kuaitu',
+ fileName: 'index',
+ },
+ outDir: resolve(__dirname, '../../dist'),
+ },
+ plugins: [
+ // 增加下面的配置项,这样在运行时就能检查eslint规范
+ eslintPlugin({
+ include: ['src/**/*.js', 'src/**/*.vue', 'src/*.js', 'src/*.vue'],
+ }),
+ ],
+ };
+};
+
+export default defineConfig(config);
diff --git a/packages/core/vitest.config.ts b/packages/core/vitest.config.ts
new file mode 100644
index 0000000..7324fc6
--- /dev/null
+++ b/packages/core/vitest.config.ts
@@ -0,0 +1,26 @@
+import { defineConfig } from 'vitest/config';
+
+export default defineConfig((_configEnv) =>
+ defineConfig({
+ esbuild: { target: 'es2022' },
+ optimizeDeps: {
+ force: true,
+ esbuildOptions: {
+ target: 'es2022',
+ },
+ },
+ test: {
+ include: ['./__tests__/**/*.spec.ts'],
+
+ deps: {
+ interopDefault: true,
+ },
+ poolOptions: {
+ threads: {
+ singleThread: true,
+ },
+ },
+ environment: 'jsdom',
+ },
+ })
+);
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
new file mode 100644
index 0000000..4340350
--- /dev/null
+++ b/pnpm-workspace.yaml
@@ -0,0 +1,2 @@
+packages:
+ - 'packages/*'
\ No newline at end of file
diff --git a/public/favicon.ico b/public/favicon.ico
new file mode 100644
index 0000000..299e543
Binary files /dev/null and b/public/favicon.ico differ
diff --git a/server/index.js b/server/index.js
new file mode 100644
index 0000000..ac6357b
--- /dev/null
+++ b/server/index.js
@@ -0,0 +1,194 @@
+/* 快图设计 · 本地模板接口(Strapi 兼容,无外网依赖) */
+const http = require('http');
+const fs = require('fs');
+const path = require('path');
+
+const ROOT = path.join(__dirname, '..');
+const DIST = path.join(ROOT, 'dist');
+const DATA = process.env.TEMPLATE_DIR || path.join(ROOT, 'data');
+const INDEX = JSON.parse(fs.readFileSync(path.join(DATA, 'index.json'), 'utf8'));
+// 封面 AI 助手(AI 生图/修图服务),素材面板从这里取图
+const COVER_AI = process.env.COVER_AI || 'http://192.168.68.19:8128';
+
+const TYPES = [
+ { id: 20, name: '公众号封面' },
+ { id: 21, name: '小红书' },
+ { id: 22, name: '知乎' },
+ { id: 23, name: '头条' },
+ { id: 24, name: 'B站' },
+ { id: 25, name: '方形通用' },
+ { id: 26, name: '竖版海报' },
+ { id: 27, name: '视频封面' },
+ { id: 28, name: '朋友圈' },
+ { id: 29, name: '横版头图' },
+];
+
+/* 模板面板修复:iView 懒加载需要元素有实际面积,原始 .tmpl-img-box 高度为 0 导致
+ IntersectionObserver 永不触发,缩略图一直不显示 */
+const APP_PATCH = `
+✨ AI 生图 / 修图
+
+`;
+
+const CSS_PATCH = ``;
+
+const MIME = { '.html': 'text/html; charset=utf-8', '.js': 'application/javascript; charset=utf-8',
+ '.css': 'text/css; charset=utf-8', '.png': 'image/png', '.jpg': 'image/jpeg', '.svg': 'image/svg+xml',
+ '.woff': 'font/woff', '.woff2': 'font/woff2', '.ttf': 'font/ttf', '.otf': 'font/otf',
+ '.json': 'application/json; charset=utf-8', '.ico': 'image/x-icon', '.map': 'application/json' };
+
+const send = (res, code, body, type) => {
+ res.writeHead(code, { 'Content-Type': type || 'application/json; charset=utf-8', 'Access-Control-Allow-Origin': '*' });
+ res.end(typeof body === 'string' ? body : JSON.stringify(body));
+};
+
+function imgOf(m) {
+ const url = `/preview/${m.id}.png`;
+ return { data: { id: m.id, attributes: { url, formats: { small: { url } } } } };
+}
+
+function listItem(m) {
+ return { id: m.id, attributes: { name: m.name, desc: m.desc, templ_type: m.type, img: imgOf(m) } };
+}
+
+let indexHtml = null;
+function loadIndex() {
+ if (!indexHtml) {
+ let html = fs.readFileSync(path.join(DIST, 'index.html'), 'utf8');
+ indexHtml = html.includes('') ? html.replace('', CSS_PATCH + '\n') : html;
+ indexHtml = indexHtml.includes('