快图设计封面工坊版:106套本地模板 + Strapi兼容本地接口 + 模板缩略图修复 + AI生图素材面板接入 + 悬浮AI面板
NodeJS with Webpack / build (push) Canceled after 0s
No files matched your search
@@ -0,0 +1,3 @@
|
||||
> 1%
|
||||
last 2 versions
|
||||
not dead
|
||||
@@ -0,0 +1,9 @@
|
||||
# path: ./.dockerignore
|
||||
|
||||
.DS_Store
|
||||
node_modules
|
||||
dist
|
||||
.npmrc
|
||||
yarn.lock
|
||||
pnpm-lock.yaml
|
||||
package-lock.json
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -0,0 +1,3 @@
|
||||
APP_FLAG=dev
|
||||
# APP_APIHOST=https://github.kuaitu.cc
|
||||
# APP_APIHOST=http://localhost:1337
|
||||
@@ -0,0 +1 @@
|
||||
APP_FLAG=prod
|
||||
@@ -0,0 +1 @@
|
||||
APP_FLAG=staging
|
||||
@@ -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,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -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']
|
||||
@@ -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.
|
||||
@@ -0,0 +1,10 @@
|
||||
---
|
||||
name: Custom issue template
|
||||
about: Describe this issue template's purpose here.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -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.
|
||||
@@ -0,0 +1,21 @@
|
||||
## 贡献者你好
|
||||
|
||||
很高兴你能付出自己的时间参与到 vue-fabric-editor 的共建当中,相信很多人都会因为你提交的代码而受益。
|
||||
|
||||
### 原则
|
||||
|
||||
我们希望每次提交尽量小(较大重构除外),确保每次改动的影响范围清晰明了,能够方便项目维护者快速将代码合并到主分支。
|
||||
|
||||
### 确保你的代码与主仓库没有冲突
|
||||
|
||||
在 PR 前,请确保你的代码与主仓库保持同步,可以参考这篇[文章](https://zhuanlan.zhihu.com/p/467670042)。
|
||||
|
||||
### 确保你的代码能正常打包构建
|
||||
|
||||
在 PR 前,请在本地进行打包构建,并进行功能测试,确保功能正常,且不影响其他功能。
|
||||
|
||||
- [ ] 代码构建正常
|
||||
|
||||
### 告知项目维护者本次修改的功能
|
||||
|
||||
请在下方描述你的修改内容:
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npx --no -- commitlint --edit ${1}
|
||||
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npx lint-staged
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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
|
||||
};
|
||||
@@ -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.
|
||||
@@ -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
|
||||
|
||||
@@ -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/
|
||||
|
||||
@@ -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"]
|
||||
@@ -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.
|
||||
@@ -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 的 `<Image>` 用 `IntersectionObserver` 懒加载,
|
||||
高度为 0 就永远不触发 → **模板列表一片空白,但控制台无报错**。
|
||||
处理:服务端在 `index.html` 的 `</head>` 前注入一段 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/<file>` 反代 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 原样保留。
|
||||
@@ -0,0 +1,480 @@
|
||||
English| [中文](https://github.com/ikuaitu/vue-fabric-editor/blob/main/README.md)
|
||||
|
||||
<p align="center">
|
||||
<a href="https://pro.kuaitu.cc/index-en.html" target="_blank">
|
||||
<img src="https://github.com/user-attachments/assets/a0f4b8b8-a8d2-480b-b43e-49c0faaff917" width="418px" alt="Open source image editor" />
|
||||
<!-- <img src="https://github.com/user-attachments/assets/aff17bdf-cea6-4b7e-8091-6661ea8c4f69" width="418px" alt="Open source image editor" /> -->
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<h3 align="center"> Plugin architecture · Drag-and-drop design · Complete functions </h3>
|
||||
<p align="center">Based on fabric.js and Vue developed plug-in image editor, can customize fonts, materials, design templates, right-click menu, shortcut keys</p>
|
||||
|
||||
<p align="center"><a href="https://ikuaitu.github.io/vue-fabric-editor/" target="_blank">Preview</a> · <a href="https://ikuaitu.github.io/doc/#/" target="_blank">Document</a> · <a href="https://www.kuaitu.cc/" target="_blank">Enterprise Edition Preview</a> · <a href="https://pro.kuaitu.cc/index-en.html" target="_blank">Enterprise Edition</a></p>
|
||||
<br />
|
||||
|
||||
<p align="center">
|
||||
<a href="" target="_blank">
|
||||
<img src="https://img.shields.io/github/stars/ikuaitu/vue-fabric-editor?style=flat" alt="stars" />
|
||||
</a>
|
||||
|
||||
<a href="" target="_blank">
|
||||
<img src="https://img.shields.io/github/forks/ikuaitu/vue-fabric-editor?style=flat" alt="stars" />
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/ikuaitu/vue-fabric-editor/graphs/contributors" target="_blank">
|
||||
<img src="https://img.shields.io/github/contributors/ikuaitu/vue-fabric-editor" alt="contributors" />
|
||||
</a>
|
||||
<a href="https://github.com/ikuaitu/vue-fabric-editor?tab=MIT-1-ov-file" target="_blank">
|
||||
<img src="https://img.shields.io/github/license/ikuaitu/vue-fabric-editor?style=flat" alt="license" />
|
||||
</a>
|
||||
<a href="https://www.kuaitu.cc/" target="_blank">
|
||||
<img src="https://img.shields.io/website?url=http%3A%2F%2Fpro.kuaitu.cc%2F" alt="快图设计网站" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<br>
|
||||
<p align="center">
|
||||
<a href="" >
|
||||
<img src="https://github.com/user-attachments/assets/2a41f5ac-2211-45b8-b683-ffbdf72e6d8b" alt="演示" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## 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.
|
||||
|
||||
<a href="https://pro.kuaitu.cc/index-en.html" target="_blank">
|
||||
<img src="https://github.com/user-attachments/assets/514479be-b73e-4170-800d-f8fae4adcd5e" alt="Open source image editor" />
|
||||
</a>
|
||||
|
||||
## 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).
|
||||
|
||||
<!-- <img src="https://user-images.githubusercontent.com/13534626/231202488-f35be6bc-617a-412e-831e-b3764466d833.jpeg" width="20%"> -->
|
||||
|
||||
## Administrator
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/nihaojob">
|
||||
<img src="https://avatars.githubusercontent.com/u/13534626?v=4" width="80;" alt="nihaojob"/>
|
||||
<br />
|
||||
<sub><b>nihaojob</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Qiu-Jun">
|
||||
<img src="https://avatars.githubusercontent.com/u/24954362?v=4" width="80;" alt="Qiu-Jun"/>
|
||||
<br />
|
||||
<sub><b>Qiu-Jun</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/wuchenguang1998">
|
||||
<img src="https://avatars.githubusercontent.com/u/63847336?v=4" width="80;" alt="wuchenguang1998"/>
|
||||
<br />
|
||||
<sub><b>wuchenguang1998</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tbody>
|
||||
</table>
|
||||
|
||||
## Collaborators
|
||||
|
||||
<!-- readme: collaborators,contributors -start -->
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/nihaojob">
|
||||
<img src="https://avatars.githubusercontent.com/u/13534626?v=4" width="80;" alt="nihaojob"/>
|
||||
<br />
|
||||
<sub><b>nihaojob</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Qiu-Jun">
|
||||
<img src="https://avatars.githubusercontent.com/u/24954362?v=4" width="80;" alt="Qiu-Jun"/>
|
||||
<br />
|
||||
<sub><b>Qiu-Jun</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/wuchenguang1998">
|
||||
<img src="https://avatars.githubusercontent.com/u/63847336?v=4" width="80;" alt="wuchenguang1998"/>
|
||||
<br />
|
||||
<sub><b>wuchenguang1998</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/AliceLanniste">
|
||||
<img src="https://avatars.githubusercontent.com/u/17617116?v=4" width="80;" alt="AliceLanniste"/>
|
||||
<br />
|
||||
<sub><b>AliceLanniste</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/ylx252">
|
||||
<img src="https://avatars.githubusercontent.com/u/6425957?v=4" width="80;" alt="ylx252"/>
|
||||
<br />
|
||||
<sub><b>ylx252</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/liumingye">
|
||||
<img src="https://avatars.githubusercontent.com/u/8676207?v=4" width="80;" alt="liumingye"/>
|
||||
<br />
|
||||
<sub><b>liumingye</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/momo2019">
|
||||
<img src="https://avatars.githubusercontent.com/u/26078793?v=4" width="80;" alt="momo2019"/>
|
||||
<br />
|
||||
<sub><b>momo2019</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/ByeWord">
|
||||
<img src="https://avatars.githubusercontent.com/u/37115721?v=4" width="80;" alt="ByeWord"/>
|
||||
<br />
|
||||
<sub><b>ByeWord</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/bigFace2019">
|
||||
<img src="https://avatars.githubusercontent.com/u/55651401?v=4" width="80;" alt="bigFace2019"/>
|
||||
<br />
|
||||
<sub><b>bigFace2019</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/wohuweixiya">
|
||||
<img src="https://avatars.githubusercontent.com/u/86701050?v=4" width="80;" alt="wohuweixiya"/>
|
||||
<br />
|
||||
<sub><b>wohuweixiya</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/zjc2233">
|
||||
<img src="https://avatars.githubusercontent.com/u/43945226?v=4" width="80;" alt="zjc2233"/>
|
||||
<br />
|
||||
<sub><b>zjc2233</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/ijry">
|
||||
<img src="https://avatars.githubusercontent.com/u/3102798?v=4" width="80;" alt="ijry"/>
|
||||
<br />
|
||||
<sub><b>ijry</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/makeng">
|
||||
<img src="https://avatars.githubusercontent.com/u/23654388?v=4" width="80;" alt="makeng"/>
|
||||
<br />
|
||||
<sub><b>makeng</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/z09176141">
|
||||
<img src="https://avatars.githubusercontent.com/u/49260613?v=4" width="80;" alt="z09176141"/>
|
||||
<br />
|
||||
<sub><b>z09176141</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/a847244052">
|
||||
<img src="https://avatars.githubusercontent.com/u/28621500?v=4" width="80;" alt="a847244052"/>
|
||||
<br />
|
||||
<sub><b>a847244052</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/briver0825">
|
||||
<img src="https://avatars.githubusercontent.com/u/87807886?v=4" width="80;" alt="briver0825"/>
|
||||
<br />
|
||||
<sub><b>briver0825</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/skyscraperno1">
|
||||
<img src="https://avatars.githubusercontent.com/u/63391543?v=4" width="80;" alt="skyscraperno1"/>
|
||||
<br />
|
||||
<sub><b>skyscraperno1</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/pengzhijian">
|
||||
<img src="https://avatars.githubusercontent.com/u/133614612?v=4" width="80;" alt="pengzhijian"/>
|
||||
<br />
|
||||
<sub><b>pengzhijian</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/JiangShuQ">
|
||||
<img src="https://avatars.githubusercontent.com/u/95730895?v=4" width="80;" alt="JiangShuQ"/>
|
||||
<br />
|
||||
<sub><b>JiangShuQ</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/hudenghui">
|
||||
<img src="https://avatars.githubusercontent.com/u/17875293?v=4" width="80;" alt="hudenghui"/>
|
||||
<br />
|
||||
<sub><b>hudenghui</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/ddshiyu">
|
||||
<img src="https://avatars.githubusercontent.com/u/37503208?v=4" width="80;" alt="ddshiyu"/>
|
||||
<br />
|
||||
<sub><b>ddshiyu</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/yehan68">
|
||||
<img src="https://avatars.githubusercontent.com/u/40497166?v=4" width="80;" alt="yehan68"/>
|
||||
<br />
|
||||
<sub><b>yehan68</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/luke358">
|
||||
<img src="https://avatars.githubusercontent.com/u/48149577?v=4" width="80;" alt="luke358"/>
|
||||
<br />
|
||||
<sub><b>luke358</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/xiaozeo">
|
||||
<img src="https://avatars.githubusercontent.com/u/13568242?v=4" width="80;" alt="xiaozeo"/>
|
||||
<br />
|
||||
<sub><b>xiaozeo</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/x007xyz">
|
||||
<img src="https://avatars.githubusercontent.com/u/13807549?v=4" width="80;" alt="x007xyz"/>
|
||||
<br />
|
||||
<sub><b>x007xyz</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/wozhi-cl">
|
||||
<img src="https://avatars.githubusercontent.com/u/25359239?v=4" width="80;" alt="wozhi-cl"/>
|
||||
<br />
|
||||
<sub><b>wozhi-cl</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/vvbear">
|
||||
<img src="https://avatars.githubusercontent.com/u/32010827?v=4" width="80;" alt="vvbear"/>
|
||||
<br />
|
||||
<sub><b>vvbear</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/slarkerino">
|
||||
<img src="https://avatars.githubusercontent.com/u/7014849?v=4" width="80;" alt="slarkerino"/>
|
||||
<br />
|
||||
<sub><b>slarkerino</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/rolitter">
|
||||
<img src="https://avatars.githubusercontent.com/u/27326998?v=4" width="80;" alt="rolitter"/>
|
||||
<br />
|
||||
<sub><b>rolitter</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/moJiXiang">
|
||||
<img src="https://avatars.githubusercontent.com/u/5847011?v=4" width="80;" alt="moJiXiang"/>
|
||||
<br />
|
||||
<sub><b>moJiXiang</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/macheteHot">
|
||||
<img src="https://avatars.githubusercontent.com/u/26652329?v=4" width="80;" alt="macheteHot"/>
|
||||
<br />
|
||||
<sub><b>macheteHot</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/liuyaojun">
|
||||
<img src="https://avatars.githubusercontent.com/u/25071631?v=4" width="80;" alt="liuyaojun"/>
|
||||
<br />
|
||||
<sub><b>liuyaojun</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/jooyyy">
|
||||
<img src="https://avatars.githubusercontent.com/u/30552622?v=4" width="80;" alt="jooyyy"/>
|
||||
<br />
|
||||
<sub><b>jooyyy</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/guda-art">
|
||||
<img src="https://avatars.githubusercontent.com/u/66010134?v=4" width="80;" alt="guda-art"/>
|
||||
<br />
|
||||
<sub><b>guda-art</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/nanfb">
|
||||
<img src="https://avatars.githubusercontent.com/u/56207464?v=4" width="80;" alt="nanfb"/>
|
||||
<br />
|
||||
<sub><b>nanfb</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/dulltackle">
|
||||
<img src="https://avatars.githubusercontent.com/u/45963660?v=4" width="80;" alt="dulltackle"/>
|
||||
<br />
|
||||
<sub><b>dulltackle</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Bamzc">
|
||||
<img src="https://avatars.githubusercontent.com/u/10151046?v=4" width="80;" alt="Bamzc"/>
|
||||
<br />
|
||||
<sub><b>Bamzc</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Yangzongtai">
|
||||
<img src="https://avatars.githubusercontent.com/u/93592008?v=4" width="80;" alt="Yangzongtai"/>
|
||||
<br />
|
||||
<sub><b>Yangzongtai</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Alicehhhmm">
|
||||
<img src="https://avatars.githubusercontent.com/u/86783773?v=4" width="80;" alt="Alicehhhmm"/>
|
||||
<br />
|
||||
<sub><b>Alicehhhmm</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/fuqianxi">
|
||||
<img src="https://avatars.githubusercontent.com/u/20251751?v=4" width="80;" alt="fuqianxi"/>
|
||||
<br />
|
||||
<sub><b>fuqianxi</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/icleitoncosta">
|
||||
<img src="https://avatars.githubusercontent.com/u/3260480?v=4" width="80;" alt="icleitoncosta"/>
|
||||
<br />
|
||||
<sub><b>icleitoncosta</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/liucity">
|
||||
<img src="https://avatars.githubusercontent.com/u/12006542?v=4" width="80;" alt="liucity"/>
|
||||
<br />
|
||||
<sub><b>liucity</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tbody>
|
||||
</table>
|
||||
<!-- readme: collaborators,contributors -end -->
|
||||
|
||||
## License
|
||||
|
||||
Licensed under the [MIT](./LICENSE) License.
|
||||
@@ -0,0 +1,531 @@
|
||||
<!--
|
||||
* @Author: 秦少卫
|
||||
* @Date: 2024-09-11 17:07:42
|
||||
* @LastEditors: 秦少卫
|
||||
* @LastEditTime: 2025-02-20 14:10:05
|
||||
* @Description: file content
|
||||
-->
|
||||
|
||||
[English](https://github.com/ikuaitu/vue-fabric-editor/blob/main/README-en.md)| 中文
|
||||
|
||||
<p align="center">
|
||||
<a href="https://pro.kuaitu.cc" target="_blank">
|
||||
<img src="https://github.com/user-attachments/assets/4e519179-8d19-41cc-ad2b-a1d7ebc63836" width="318px" alt="开源图片编辑器" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<h3 align="center">开源图片编辑器 · 插件化架构 · 拖拽式设计 · 功能完善 </h3>
|
||||
<p align="center">基于 fabric.js 和 Vue 开发的插件化图片编辑器,可自定义字体、素材、设计模板、右键菜单、快捷键</p>
|
||||
|
||||
<p align="center"><a href="https://ikuaitu.github.io/vue-fabric-editor/" target="_blank">演示</a> · <a href="https://ikuaitu.github.io/doc/#/" target="_blank">文档</a> · <a href="https://www.kuaitu.cc/" target="_blank">商业版演示</a> · <a href="https://pro.kuaitu.cc/" target="_blank">商业版介绍</a>
|
||||
· <a href="https://new.kuaitu.cc/#/store" target="_blank">商品DIY设计器</a> · <a href="https://ws0gdejldw.feishu.cn/docx/P8ZGdHQ9OoGxcaxyFYecXwO9nig?from=from_copylink" target="_blank">DIY产品介绍</a></p>
|
||||
<br />
|
||||
|
||||
<p align="center">
|
||||
<a href="" target="_blank">
|
||||
<img src="https://img.shields.io/github/stars/ikuaitu/vue-fabric-editor?style=flat" alt="stars" />
|
||||
</a>
|
||||
|
||||
<a href="" target="_blank">
|
||||
<img src="https://img.shields.io/github/forks/ikuaitu/vue-fabric-editor?style=flat" alt="stars" />
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/ikuaitu/vue-fabric-editor/graphs/contributors" target="_blank">
|
||||
<img src="https://img.shields.io/github/contributors/ikuaitu/vue-fabric-editor" alt="contributors" />
|
||||
</a>
|
||||
<a href="https://github.com/ikuaitu/vue-fabric-editor?tab=MIT-1-ov-file" target="_blank">
|
||||
<img src="https://img.shields.io/github/license/ikuaitu/vue-fabric-editor?style=flat" alt="license" />
|
||||
</a>
|
||||
<a href="https://www.kuaitu.cc/" target="_blank">
|
||||
<img src="https://img.shields.io/website?url=http%3A%2F%2Fpro.kuaitu.cc%2F" alt="快图设计网站" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<br>
|
||||
<p align="center">
|
||||
<a href="" >
|
||||
<img src="https://github.com/user-attachments/assets/2a41f5ac-2211-45b8-b683-ffbdf72e6d8b" alt="演示" />
|
||||
</a>
|
||||
</p>
|
||||
|
||||
## 简介
|
||||
|
||||
快图设计,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 的相关资料,沉淀最佳实践、开发经验分享、代码示例等。
|
||||
<img src="https://github.com/nihaojob/vue-fabric-editor/assets/13534626/25e9075e-f751-4110-aadd-30fe453e02d9" width="500px" alt="二维码" />
|
||||
|
||||
## 付费版本
|
||||
|
||||
帮助企业快速搭建在线设计工具,**减少企业研发投入,避免重复造轮子。**
|
||||
|
||||
[功能介绍](https://ws0gdejldw.feishu.cn/docx/GKmnddCgFokr4sxFeYNcoql1nAb) · [产品介绍](http://pro.kuaitu.cc/) · [演示](https://www.kuaitu.cc/)
|
||||
|
||||
开源版本仅前端代码,付费版本**提供完整的前后端、管理后台,功能完整开箱即用,提供源码授权、支持二次开发**。
|
||||
|
||||
- **开箱即用,功能完整**:设计能力丰富,提供完整前台、后台功能,部署即可使用。
|
||||
- **插件架构,扩展方便**:基于插件化 API,快速对编辑器进行二次开发。
|
||||
- **批量生成,快速出图**:支持通过 HTTP 接口、表格文件批量生成图片。
|
||||
- **拖拽式设计,简单易用**:适合普通用户操作,无需培训轻松上手。
|
||||
- **全平台适配**:PC 版本、H5 版本支持各种应用场景。
|
||||
- **技术对接,文档培训**:提供更多的支持,高效完成技术对接。
|
||||
- **定制开发,减少投入**:支持快速完成功能定制开发,减少研发投入。
|
||||
<a href="https://pro.kuaitu.cc" target="_blank">
|
||||
<img src="https://github.com/user-attachments/assets/5303395b-247d-45be-a411-ef27a389156c" alt="开源图片编辑器" />
|
||||
</a>
|
||||
|
||||
## 商品/服装DIY设计器
|
||||
|
||||
<a href="https://new.kuaitu.cc/#/store" target="_blank">商品DIY设计器</a> · <a href="https://ws0gdejldw.feishu.cn/docx/P8ZGdHQ9OoGxcaxyFYecXwO9nig?from=from_copylink" target="_blank">DIY产品介绍</a></p>
|
||||
|
||||

|
||||
|
||||
## 二次元设计器
|
||||
吧唧/亚克力设计器 二次元自印小程序商城
|
||||

|
||||
<img width="2506" height="864" alt="image" src="https://github.com/user-attachments/assets/06f53e9e-7511-4b8f-b5c4-3840a8502651" />
|
||||
<img width="2596" height="1092" alt="image" src="https://github.com/user-attachments/assets/27f79026-0d21-4688-a65c-ec06e5fed451" />
|
||||
<img width="2544" height="918" alt="image" src="https://github.com/user-attachments/assets/cdd5645e-f11d-4f11-8292-88b90300d3e2" />
|
||||
|
||||
电商平台DIY
|
||||
<img width="2586" height="1256" alt="image" src="https://github.com/user-attachments/assets/32a2bc39-e60c-45dc-b6a5-0ddda32fe618" />
|
||||
|
||||
|
||||
## 定制开发案例
|
||||
面料印花
|
||||
<img width="2684" height="1294" alt="image" src="https://github.com/user-attachments/assets/7c465f96-8f99-410b-812f-1bc1958a1c81" />
|
||||
丝巾设计试戴
|
||||
<img width="2386" height="950" alt="image" src="https://github.com/user-attachments/assets/d441540f-316f-415a-af9f-f0cfdf191a56" />
|
||||
工艺仿真
|
||||
<img width="2528" height="862" alt="image" src="https://github.com/user-attachments/assets/2d78111f-4b09-4aa1-8d13-d088d79b8dcf" />
|
||||
参数化盒型
|
||||
<img width="2532" height="974" alt="image" src="https://github.com/user-attachments/assets/496dcdbc-3b21-4d23-a24d-a13becd3e0f5" />
|
||||
各类DIY设计器
|
||||
<img width="2192" height="712" alt="image" src="https://github.com/user-attachments/assets/85a8f443-3b64-4c9c-b7d0-313e0d771212" />
|
||||
|
||||
|
||||
|
||||
|
||||
## 贡献指南
|
||||
|
||||
项目致力于打造一个开箱即用的 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)。
|
||||
|
||||
<!-- <img src="https://user-images.githubusercontent.com/13534626/231202488-f35be6bc-617a-412e-831e-b3764466d833.jpeg" width="20%"> -->
|
||||
|
||||
## 致谢
|
||||
|
||||
- [刘明野](https://github.com/liumingye)标尺功能作者。
|
||||
- [palxiao](https://github.com/palxiao/poster-design/tree/main/packages/color-picker)设计编辑器的渐变组件。
|
||||
|
||||
## 友情赞助
|
||||
|
||||
<a href="https://github.com/wangyuan389/mall-cook" target="_blank">
|
||||
<img src="https://www.sunmao-design.top/sunmao/admin/assets/logo.896aa176.png" width="50px" alt="开源图片编辑器" />
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/rubickCenter/rubick" target="_blank">
|
||||
<img src="https://raw.githubusercontent.com/rubickCenter/rubick/refs/heads/master/public/logo.png" width="50px" alt="开源图片编辑器" />
|
||||
</a>
|
||||
|
||||
<a href="https://github.com/leaferjs/leafer-ui" target="_blank">
|
||||
<img src="https://github.com/user-attachments/assets/0c6ed3c4-bc2b-49fb-854d-f9ed75a96121" width="50px" alt="开源图片编辑器" />
|
||||
</a>
|
||||
|
||||
## 管理员
|
||||
|
||||
<!-- readme: collaborators -start -->
|
||||
|
||||
<!-- readme: collaborators -end -->
|
||||
|
||||
## 贡献者
|
||||
|
||||
<!-- readme: collaborators,contributors -start -->
|
||||
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/nihaojob">
|
||||
<img src="https://avatars.githubusercontent.com/u/13534626?v=4" width="80;" alt="nihaojob"/>
|
||||
<br />
|
||||
<sub><b>nihaojob</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Qiu-Jun">
|
||||
<img src="https://avatars.githubusercontent.com/u/24954362?v=4" width="80;" alt="Qiu-Jun"/>
|
||||
<br />
|
||||
<sub><b>Qiu-Jun</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/wuchenguang1998">
|
||||
<img src="https://avatars.githubusercontent.com/u/63847336?v=4" width="80;" alt="wuchenguang1998"/>
|
||||
<br />
|
||||
<sub><b>wuchenguang1998</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/AliceLanniste">
|
||||
<img src="https://avatars.githubusercontent.com/u/17617116?v=4" width="80;" alt="AliceLanniste"/>
|
||||
<br />
|
||||
<sub><b>AliceLanniste</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/ylx252">
|
||||
<img src="https://avatars.githubusercontent.com/u/6425957?v=4" width="80;" alt="ylx252"/>
|
||||
<br />
|
||||
<sub><b>ylx252</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/liumingye">
|
||||
<img src="https://avatars.githubusercontent.com/u/8676207?v=4" width="80;" alt="liumingye"/>
|
||||
<br />
|
||||
<sub><b>liumingye</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/momo2019">
|
||||
<img src="https://avatars.githubusercontent.com/u/26078793?v=4" width="80;" alt="momo2019"/>
|
||||
<br />
|
||||
<sub><b>momo2019</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/ByeWord">
|
||||
<img src="https://avatars.githubusercontent.com/u/37115721?v=4" width="80;" alt="ByeWord"/>
|
||||
<br />
|
||||
<sub><b>ByeWord</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/bigFace2019">
|
||||
<img src="https://avatars.githubusercontent.com/u/55651401?v=4" width="80;" alt="bigFace2019"/>
|
||||
<br />
|
||||
<sub><b>bigFace2019</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/wohuweixiya">
|
||||
<img src="https://avatars.githubusercontent.com/u/86701050?v=4" width="80;" alt="wohuweixiya"/>
|
||||
<br />
|
||||
<sub><b>wohuweixiya</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/zjc2233">
|
||||
<img src="https://avatars.githubusercontent.com/u/43945226?v=4" width="80;" alt="zjc2233"/>
|
||||
<br />
|
||||
<sub><b>zjc2233</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/ijry">
|
||||
<img src="https://avatars.githubusercontent.com/u/3102798?v=4" width="80;" alt="ijry"/>
|
||||
<br />
|
||||
<sub><b>ijry</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/makeng">
|
||||
<img src="https://avatars.githubusercontent.com/u/23654388?v=4" width="80;" alt="makeng"/>
|
||||
<br />
|
||||
<sub><b>makeng</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/z09176141">
|
||||
<img src="https://avatars.githubusercontent.com/u/49260613?v=4" width="80;" alt="z09176141"/>
|
||||
<br />
|
||||
<sub><b>z09176141</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/a847244052">
|
||||
<img src="https://avatars.githubusercontent.com/u/28621500?v=4" width="80;" alt="a847244052"/>
|
||||
<br />
|
||||
<sub><b>a847244052</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/briver0825">
|
||||
<img src="https://avatars.githubusercontent.com/u/87807886?v=4" width="80;" alt="briver0825"/>
|
||||
<br />
|
||||
<sub><b>briver0825</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/skyscraperno1">
|
||||
<img src="https://avatars.githubusercontent.com/u/63391543?v=4" width="80;" alt="skyscraperno1"/>
|
||||
<br />
|
||||
<sub><b>skyscraperno1</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/pengzhijian">
|
||||
<img src="https://avatars.githubusercontent.com/u/133614612?v=4" width="80;" alt="pengzhijian"/>
|
||||
<br />
|
||||
<sub><b>pengzhijian</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/JiangShuQ">
|
||||
<img src="https://avatars.githubusercontent.com/u/95730895?v=4" width="80;" alt="JiangShuQ"/>
|
||||
<br />
|
||||
<sub><b>JiangShuQ</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/hudenghui">
|
||||
<img src="https://avatars.githubusercontent.com/u/17875293?v=4" width="80;" alt="hudenghui"/>
|
||||
<br />
|
||||
<sub><b>hudenghui</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/ddshiyu">
|
||||
<img src="https://avatars.githubusercontent.com/u/37503208?v=4" width="80;" alt="ddshiyu"/>
|
||||
<br />
|
||||
<sub><b>ddshiyu</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/yehan68">
|
||||
<img src="https://avatars.githubusercontent.com/u/40497166?v=4" width="80;" alt="yehan68"/>
|
||||
<br />
|
||||
<sub><b>yehan68</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/luke358">
|
||||
<img src="https://avatars.githubusercontent.com/u/48149577?v=4" width="80;" alt="luke358"/>
|
||||
<br />
|
||||
<sub><b>luke358</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/xiaozeo">
|
||||
<img src="https://avatars.githubusercontent.com/u/13568242?v=4" width="80;" alt="xiaozeo"/>
|
||||
<br />
|
||||
<sub><b>xiaozeo</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/x007xyz">
|
||||
<img src="https://avatars.githubusercontent.com/u/13807549?v=4" width="80;" alt="x007xyz"/>
|
||||
<br />
|
||||
<sub><b>x007xyz</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/wozhi-cl">
|
||||
<img src="https://avatars.githubusercontent.com/u/25359239?v=4" width="80;" alt="wozhi-cl"/>
|
||||
<br />
|
||||
<sub><b>wozhi-cl</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/vvbear">
|
||||
<img src="https://avatars.githubusercontent.com/u/32010827?v=4" width="80;" alt="vvbear"/>
|
||||
<br />
|
||||
<sub><b>vvbear</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/slarkerino">
|
||||
<img src="https://avatars.githubusercontent.com/u/7014849?v=4" width="80;" alt="slarkerino"/>
|
||||
<br />
|
||||
<sub><b>slarkerino</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/rolitter">
|
||||
<img src="https://avatars.githubusercontent.com/u/27326998?v=4" width="80;" alt="rolitter"/>
|
||||
<br />
|
||||
<sub><b>rolitter</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/moJiXiang">
|
||||
<img src="https://avatars.githubusercontent.com/u/5847011?v=4" width="80;" alt="moJiXiang"/>
|
||||
<br />
|
||||
<sub><b>moJiXiang</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/macheteHot">
|
||||
<img src="https://avatars.githubusercontent.com/u/26652329?v=4" width="80;" alt="macheteHot"/>
|
||||
<br />
|
||||
<sub><b>macheteHot</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/liuyaojun">
|
||||
<img src="https://avatars.githubusercontent.com/u/25071631?v=4" width="80;" alt="liuyaojun"/>
|
||||
<br />
|
||||
<sub><b>liuyaojun</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/jooyyy">
|
||||
<img src="https://avatars.githubusercontent.com/u/30552622?v=4" width="80;" alt="jooyyy"/>
|
||||
<br />
|
||||
<sub><b>jooyyy</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/guda-art">
|
||||
<img src="https://avatars.githubusercontent.com/u/66010134?v=4" width="80;" alt="guda-art"/>
|
||||
<br />
|
||||
<sub><b>guda-art</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/nanfb">
|
||||
<img src="https://avatars.githubusercontent.com/u/56207464?v=4" width="80;" alt="nanfb"/>
|
||||
<br />
|
||||
<sub><b>nanfb</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/dulltackle">
|
||||
<img src="https://avatars.githubusercontent.com/u/45963660?v=4" width="80;" alt="dulltackle"/>
|
||||
<br />
|
||||
<sub><b>dulltackle</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Bamzc">
|
||||
<img src="https://avatars.githubusercontent.com/u/10151046?v=4" width="80;" alt="Bamzc"/>
|
||||
<br />
|
||||
<sub><b>Bamzc</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Yangzongtai">
|
||||
<img src="https://avatars.githubusercontent.com/u/93592008?v=4" width="80;" alt="Yangzongtai"/>
|
||||
<br />
|
||||
<sub><b>Yangzongtai</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/Alicehhhmm">
|
||||
<img src="https://avatars.githubusercontent.com/u/86783773?v=4" width="80;" alt="Alicehhhmm"/>
|
||||
<br />
|
||||
<sub><b>Alicehhhmm</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/fuqianxi">
|
||||
<img src="https://avatars.githubusercontent.com/u/20251751?v=4" width="80;" alt="fuqianxi"/>
|
||||
<br />
|
||||
<sub><b>fuqianxi</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/icleitoncosta">
|
||||
<img src="https://avatars.githubusercontent.com/u/3260480?v=4" width="80;" alt="icleitoncosta"/>
|
||||
<br />
|
||||
<sub><b>icleitoncosta</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
<td align="center">
|
||||
<a href="https://github.com/liucity">
|
||||
<img src="https://avatars.githubusercontent.com/u/12006542?v=4" width="80;" alt="liucity"/>
|
||||
<br />
|
||||
<sub><b>liucity</b></sub>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tbody>
|
||||
</table>
|
||||
<!-- readme: collaborators,contributors -end -->
|
||||
|
||||
## License
|
||||
|
||||
Licensed under the [MIT](./LICENSE) License.
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
};
|
||||
@@ -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()
|
||||
@@ -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
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,7 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="117" height="44" viewBox="0 0 117 44">
|
||||
<defs><linearGradient id="g" x1="0" y1="0" x2="1" y2="1">
|
||||
<stop offset="0" stop-color="#2563eb"/><stop offset="1" stop-color="#7c3aed"/></linearGradient></defs>
|
||||
<rect x="1" y="1" width="115" height="42" rx="10" fill="url(#g)"/>
|
||||
<text x="58" y="30" font-size="22" font-weight="bold" fill="#ffffff" text-anchor="middle"
|
||||
font-family="'PingFang SC','Microsoft YaHei',sans-serif">快图设计</text>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 505 B |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 56 KiB |
|
After Width: | Height: | Size: 52 KiB |
|
After Width: | Height: | Size: 45 KiB |
|
After Width: | Height: | Size: 42 KiB |
|
After Width: | Height: | Size: 59 KiB |
|
After Width: | Height: | Size: 49 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 41 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 46 KiB |
|
After Width: | Height: | Size: 83 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 37 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 34 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 35 KiB |
|
After Width: | Height: | Size: 33 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 32 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 29 KiB |
|
After Width: | Height: | Size: 40 KiB |
|
After Width: | Height: | Size: 38 KiB |
|
After Width: | Height: | Size: 43 KiB |
|
After Width: | Height: | Size: 31 KiB |
|
After Width: | Height: | Size: 35 KiB |