feat: 二维码生成插件

master
lichaojun 1 week ago
parent 3dd9324308
commit 075ca62f7e

@ -1,18 +1,27 @@
<!DOCTYPE html> <!doctype html>
<html lang="zh-CN"> <html lang="zh-CN">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta
name="viewport"
content="width=device-width, initial-scale=1.0"
/>
<title>内容转二维码</title> <title>内容转二维码</title>
<link rel="stylesheet" href="style.css"> <link
</head> rel="stylesheet"
<body> href="style.css"
/>
</head>
<body>
<div class="container"> <div class="container">
<h1>内容转二维码生成器</h1> <h1>内容转二维码生成器</h1>
<p>将您的文本粘贴到下面的框中,然后点击“生成二维码”按钮。</p> <p>将您的文本粘贴到下面的框中,然后点击“生成二维码”按钮。</p>
<textarea id="text-input" rows="10" placeholder="请在此处粘贴您的文本内容..."></textarea> <textarea
id="text-input"
rows="10"
placeholder="请在此处粘贴您的文本内容..."
></textarea>
<button id="generate-btn">生成二维码</button> <button id="generate-btn">生成二维码</button>
@ -22,8 +31,8 @@
</div> </div>
<!-- 引入 qrcode.js 库 --> <!-- 引入 qrcode.js 库 -->
<script src="https://cdn.jsdelivr.net/npm/qrcodejs@1.0.0/qrcode.min.js"></script> <script src="qrcode.min.js"></script>
<!-- 引入我们自己的逻辑脚本 --> <!-- 引入我们自己的逻辑脚本 -->
<script src="main.js"></script> <script src="main.js"></script>
</body> </body>
</html> </html>

@ -22,7 +22,7 @@ document.addEventListener('DOMContentLoaded', () => {
} }
// 定义每个二维码的最大字符数 // 定义每个二维码的最大字符数
const chunkSize = 2000; const chunkSize = 1000;
// 计算需要生成多少个二维码 // 计算需要生成多少个二维码
const totalChunks = Math.ceil(text.length / chunkSize); const totalChunks = Math.ceil(text.length / chunkSize);
@ -66,7 +66,7 @@ document.addEventListener('DOMContentLoaded', () => {
height: 400, // 二维码高度 height: 400, // 二维码高度
colorDark: '#000000', // 二维码颜色 colorDark: '#000000', // 二维码颜色
colorLight: '#ffffff', // 二维码背景色 colorLight: '#ffffff', // 二维码背景色
correctLevel: QRCode.CorrectLevel.H // 纠错级别H是最高级 correctLevel: QRCode.CorrectLevel.H, // 纠错级别H是最高级
}); });
console.log(`已为第 ${i + 1} 块内容生成二维码。`); console.log(`已为第 ${i + 1} 块内容生成二维码。`);

@ -8,10 +8,5 @@
}, },
"background": { "background": {
"service_worker": "background.js" "service_worker": "background.js"
},
"icons": {
"16": "images/icon16.png",
"48": "images/icon48.png",
"128": "images/icon128.png"
} }
} }

File diff suppressed because one or more lines are too long

@ -1,12 +1,12 @@
{ {
"totalNotes": 74, "totalNotes": 76,
"categories": 5, "categories": 5,
"lastUpdated": "2025-10-15T08:30:23.764Z", "lastUpdated": "2025-10-17T12:02:18.785Z",
"weeklyAdded": 8, "weeklyAdded": 20,
"categoryChartData": [ "categoryChartData": [
{ {
"name": "demo", "name": "demo",
"value": 63 "value": 65
}, },
{ {
"name": "python", "name": "python",
@ -27,16 +27,16 @@
], ],
"recentNotes": [ "recentNotes": [
{ {
"path": "demo/scssLiveTranslate/index.vue", "path": "demo/messageBoxWithHtml.vue",
"title": "SCSS → CSS 实时翻译器", "title": "messageBoxWithHtml",
"category": "demo", "category": "demo",
"date": "2025-10-15" "date": "2025-10-17"
}, },
{ {
"path": "demo/cssDemo.vue", "path": "demo/base64Tool.vue",
"title": "cssDemo", "title": "base64编码解码工具",
"category": "demo", "category": "demo",
"date": "2025-10-15" "date": "2025-10-17"
}, },
{ {
"path": "demo/tuiImageEditor/index.vue", "path": "demo/tuiImageEditor/index.vue",
@ -45,16 +45,16 @@
"date": "2025-10-15" "date": "2025-10-15"
}, },
{ {
"path": "demo/deletdNodeModules/index.vue", "path": "demo/scssLiveTranslate/index.vue",
"title": "删除 node_modules 文件夹非常耗时解决办法", "title": "SCSS → CSS 实时翻译器",
"category": "demo", "category": "demo",
"date": "2025-10-14" "date": "2025-10-15"
}, },
{ {
"path": "demo/asyncDynComp/index.vue", "path": "demo/cssDemo.vue",
"title": "异步动态加载组件", "title": "cssDemo",
"category": "demo", "category": "demo",
"date": "2025-10-11" "date": "2025-10-15"
} }
] ]
} }
Loading…
Cancel
Save