Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/build-exe.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build and Release EXE

on:
push:
tags:
- "v*" # 只有推送 tag (如 v1.0.0) 时才触发
workflow_dispatch: # 允许手动触发

jobs:
build:
runs-on: windows-latest # 运行环境:Windows

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16 # 选择合适的 Node.js 版本

- name: Install pkg
run: npm install -g pkg

- name: Build EXE
run: pkg .

- name: Upload EXE to Release
uses: softprops/action-gh-release@v1
with:
files: watermark.exe
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3 changes: 3 additions & 0 deletions FileSaver.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion blog/en/batch-watermark-tool.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="description" content="Looking for batch watermark software? Try our free online tool at jiashuiyin.com. No download required, process up to 20 images at once, simple to use and privacy-focused.">
<meta name="keywords" content="batch watermark software,bulk image watermark,online watermark tool,free watermark tool">
<link rel="stylesheet" href="../../blog/blog.css">
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="../../tailwind-2.2.19.min.css">
<script
defer
data-domain="jiashuiyin.com"
Expand Down
2 changes: 1 addition & 1 deletion blog/en/business-license-watermark.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="description" content="Add watermarks to business licenses online to protect company information. Perfect for WeChat Official Account verification and other business authentications. Free and privacy-focused.">
<meta name="keywords" content="business license watermark,company verification,WeChat official account,document security,enterprise protection">
<link rel="stylesheet" href="../../blog/blog.css">
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="../../tailwind-2.2.19.min.css">
<script
defer
data-domain="jiashuiyin.com"
Expand Down
2 changes: 1 addition & 1 deletion blog/en/id-watermark.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="description" content="Learn how to protect your ID card information with watermarks. Free online tool for adding watermarks to ID cards, ensuring privacy and security.">
<meta name="keywords" content="ID card watermark,privacy protection,document security,online watermark tool">
<link rel="stylesheet" href="../../blog/blog.css">
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="../../tailwind-2.2.19.min.css">
<script
defer
data-domain="jiashuiyin.com"
Expand Down
2 changes: 1 addition & 1 deletion blog/en/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>Watermark Master Blog - Image Watermark Tips and Use Cases</title>
<meta name="description" content="Explore various watermark applications, including private domain operations, document protection, and brand marketing guides.">
<link rel="stylesheet" href="../../blog/blog.css">
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="../../tailwind-2.2.19.min.css">
<script
defer
data-domain="jiashuiyin.com"
Expand Down
2 changes: 1 addition & 1 deletion blog/en/private-materials-watermark.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="description" content="Professional watermark solution for private domain and social media marketers. Protect your marketing materials, enhance brand value, and boost customer conversion. Free online tool.">
<meta name="keywords" content="private domain marketing,image watermark,content protection,brand protection,social media marketing">
<link rel="stylesheet" href="../../blog/blog.css">
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="../../tailwind-2.2.19.min.css">
<script
defer
data-domain="jiashuiyin.com"
Expand Down
2 changes: 1 addition & 1 deletion blog/zh/batch-watermark-tool.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="description" content="寻找批量加水印软件?推荐免费在线工具jiashuiyin.com,无需下载安装,支持批量处理,一次可处理20张图片,简单易用还能保护隐私。">
<meta name="keywords" content="批量加水印软件,图片批量加水印,在线批量加水印,免费加水印工具">
<link rel="stylesheet" href="../../blog/blog.css">
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="../../tailwind-2.2.19.min.css">
<script
defer
data-domain="jiashuiyin.com"
Expand Down
2 changes: 1 addition & 1 deletion blog/zh/business-license-watermark.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="description" content="在线为营业执照添加水印,保护企业信息安全。适用于微信公众号认证等场景,支持图片和PDF格式,完全免费且保护隐私。">
<meta name="keywords" content="营业执照水印,公司认证,微信公众号认证,PDF水印,企业信息保护">
<link rel="stylesheet" href="../../blog/blog.css">
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="../../tailwind-2.2.19.min.css">
<script
defer
data-domain="jiashuiyin.com"
Expand Down
2 changes: 1 addition & 1 deletion blog/zh/id-watermark.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>身份证加水印:保护您的隐私与安全 - 加水印 JiaShuiYin.com</title>
<link rel="stylesheet" href="../../blog/blog.css">
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="../../tailwind-2.2.19.min.css">
<script
defer
data-domain="jiashuiyin.com"
Expand Down
2 changes: 1 addition & 1 deletion blog/zh/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>加水印网 博客 - 图片水印技巧与应用场景分享</title>
<meta name="description" content="探索图片水印的多种应用场景,包括私域运营、证件保护、品牌营销等实用指南。">
<link rel="stylesheet" href="../../blog/blog.css">
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="../../tailwind-2.2.19.min.css">
<script
defer
data-domain="jiashuiyin.com"
Expand Down
2 changes: 1 addition & 1 deletion blog/zh/private-materials-watermark.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="description" content="为私域运营、社媒运营者提供专业的图片水印解决方案。防止素材被盗用,提升品牌价值,促进客户转化。在线工具,简单易用,永久免费。">
<meta name="keywords" content="私域运营,图片水印,防盗图,品牌保护,社群营销,微信营销">
<link rel="stylesheet" href="../../blog/blog.css">
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="../../tailwind-2.2.19.min.css">
<script
defer
data-domain="jiashuiyin.com"
Expand Down
2 changes: 2 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@
</script>
<!-- 延迟加载非关键脚本 -->
<script src="i18n.js" type="module" defer></script>
<script src="jszip.min.js"></script>
<script src="FileSaver.min.js"></script>
<script src="script.js" type="module" defer></script>
<!-- 优化 Google Analytics 加载 -->
<script>
Expand Down
13 changes: 13 additions & 0 deletions jszip.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion legal/en/privacy.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>Privacy Policy - Watermark Master</title>
<meta name="description" content="Learn how Watermark Master protects your privacy and personal information. All image processing is done locally, no files are uploaded to servers.">
<link rel="stylesheet" href="../../blog/blog.css">
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="../../tailwind-2.2.19.min.css">
</head>
<body class="bg-gray-100 font-sans">
<!-- Navigation -->
Expand Down
2 changes: 1 addition & 1 deletion legal/zh/privacy.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>隐私政策 - 加水印 JiaShuiYin.com</title>
<meta name="description" content="了解加水印网如何保护您的隐私和个人信息。我们承诺所有图片处理均在本地完成,不会上传服务器。">
<link rel="stylesheet" href="../../blog/blog.css">
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="../../tailwind-2.2.19.min.css">
</head>
<body class="bg-gray-100 font-sans">
<!-- 导航栏 -->
Expand Down
2 changes: 1 addition & 1 deletion legal/zh/terms.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>使用条款 - 加水印 JiaShuiYin.com</title>
<meta name="description" content="了解加水印网的使用条款和服务协议。我们致力于提供安全、便捷的图片水印服务。">
<link rel="stylesheet" href="../../blog/blog.css">
<link rel="stylesheet" href="https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css">
<link rel="stylesheet" href="../../tailwind-2.2.19.min.css">
</head>
<body class="bg-gray-100 font-sans">
<!-- 导航栏 -->
Expand Down
17 changes: 17 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "watermark",
"bin": "preview-node.js",
"scripts": {
"pkg": "pkg . --out-path ./"
},
"pkg": {
"assets": [
"**/*.js",
"**/*.xml",
"**/*.css",
"**/*.html",
"./images/*"
],
"targets": ["node16-win-x64"]
}
}
10 changes: 10 additions & 0 deletions preview-node.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
const http = require('http');
const fs = require('fs');
const path = require('path');
const { exec } = require('child_process');

// 设置静态文件的根目录
const staticPath = path.join(__dirname, '/');
Expand All @@ -9,10 +10,12 @@ const staticPath = path.join(__dirname, '/');
http.createServer((req, res) => {
// 检查请求的URL路径
const filePath = path.join(staticPath, req.url === '/' ? 'index.html' : req.url);
console.log('filePath = ' + filePath)

// 读取文件并返回给客户端
fs.readFile(filePath, (err, data) => {
if (err) {
console.log('readFile error: ' + filePath)
// 如果文件不存在,返回404错误
res.writeHead(404);
res.end('404 Not Found');
Expand All @@ -32,4 +35,11 @@ http.createServer((req, res) => {
});
}).listen(8080, () => {
console.log('Server is running on http://localhost:8080');

// 在 Windows 上使用默认浏览器打开
exec('start http://127.0.0.1:8080', (err) => {
if (err) {
console.error('Failed to open browser:', err);
}
});
});
15 changes: 15 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,22 @@ blog/
```
node preview-node.js

## 打包windows运行的exe

运行时直接开浏览器页面,命令窗口需收到关闭
1. 安装依赖+打包
```
cd watermark-master
npm install -g pkg
pkg preview-node.js --output watermark.exe
#如果exe执行报not found,使用以下打包命令
npm run pkg

```
- 如果下载很慢,可以去https://github.com/vercel/pkg-fetch/releases手动下载
- 放到C:\Users\Administrator\.pkg-cache\v3.4
- 下载的内容是“node-v16.16.0-win-x64”,需要重命名“fetched-v16.16.0-win-x64”

## 贡献

欢迎提交 Pull Requests 来改进这个项目。对于重大变更,请先开 issue 讨论您想要改变的内容。
Expand Down
8 changes: 0 additions & 8 deletions script.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { translations, setLanguage, updateURL, currentLang } from './i18n.js';
import JSZip from 'https://jspm.dev/jszip';
import FileSaver from 'https://jspm.dev/file-saver';

const imageInput = document.getElementById('imageInput');
const watermarkText = document.getElementById('watermarkText');
Expand Down Expand Up @@ -120,12 +118,6 @@ function initializeColorInput() {
// 将所有初始化和事件监听器的设置放个函数中
async function initialize() {
try {
// 等待所有模块加载完成
await Promise.all([
import('https://jspm.dev/jszip'),
import('https://jspm.dev/file-saver')
]);

initializeColorInput();
initializeFileInput();
watermarkColor.addEventListener('input', updateColorPreview);
Expand Down
2 changes: 1 addition & 1 deletion styles.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@import url('https://lf3-cdn-tos.bytecdntp.com/cdn/expire-1-M/tailwindcss/2.2.19/tailwind.min.css');
@import url('../../tailwind-2.2.19.min.css');

body {
background-color: #f3f4f6;
Expand Down
1 change: 1 addition & 0 deletions tailwind-2.2.19.min.css

Large diffs are not rendered by default.