站点:纯静态 HTML + CSS + 原生 JS,零框架零构建
页面:首页 / 合作品牌 / 荣誉资质 / 客户案例 / 关于我们
内容:
- site/ 站点本体(含已压缩 webp 图片,约 4.8 MB)
- deploy/ Docker Compose / Caddy / Apache 部署配置
- _tools/ 开发自检脚本与部署脚本
- Dockerfile 自建 nginx 镜像方案
- README.md 项目文档
设计:品牌黄 #ffc107 + 白,深蓝仅用于页脚;菜单长期置顶;
交互动效只加在关键词与区块级元素上。
素材说明:原始素材(背景图/老网站/方案/荣誉资质/合作品牌,约 290 MB)
未纳入版本控制,站点使用的是 site/assets 内已处理压缩的图片。
23 lines
963 B
JavaScript
23 lines
963 B
JavaScript
// 品牌 logo 画布改成 360x240 后,同步 HTML 里声明的 width/height,避免加载前后尺寸跳变
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const SITE = path.join(__dirname, '..', 'site');
|
|
for (const f of ['index.html', 'brands.html']) {
|
|
const p = path.join(SITE, f);
|
|
let s = fs.readFileSync(p, 'utf8');
|
|
const before = s;
|
|
s = s.replace(/(assets\/img\/brands\/[\w-]+\.webp"[^>]*?)width="320" height="320"/g,
|
|
(m, head) => head + 'width="360" height="240"');
|
|
if (s !== before) { fs.writeFileSync(p, s, 'utf8'); console.log('updated ' + f); }
|
|
else console.log('no change ' + f);
|
|
}
|
|
|
|
// 复查
|
|
for (const f of ['index.html', 'brands.html']) {
|
|
const s = fs.readFileSync(path.join(SITE, f), 'utf8');
|
|
const n = (s.match(/width="360" height="240"/g) || []).length;
|
|
const old = (s.match(/width="320" height="320"/g) || []).length;
|
|
console.log(' ' + f + ': 新尺寸 ' + n + ' 处,旧尺寸残留 ' + old + ' 处');
|
|
}
|