站点:纯静态 HTML + CSS + 原生 JS,零框架零构建
页面:首页 / 合作品牌 / 荣誉资质 / 客户案例 / 关于我们
内容:
- site/ 站点本体(含已压缩 webp 图片,约 4.8 MB)
- deploy/ Docker Compose / Caddy / Apache 部署配置
- _tools/ 开发自检脚本与部署脚本
- Dockerfile 自建 nginx 镜像方案
- README.md 项目文档
设计:品牌黄 #ffc107 + 白,深蓝仅用于页脚;菜单长期置顶;
交互动效只加在关键词与区块级元素上。
素材说明:原始素材(背景图/老网站/方案/荣誉资质/合作品牌,约 290 MB)
未纳入版本控制,站点使用的是 site/assets 内已处理压缩的图片。
35 lines
1.7 KiB
JavaScript
35 lines
1.7 KiB
JavaScript
// 按新反馈调整 homepage 的 HTML:新首屏图、去掉非关键元素的滚动动画、去掉定宽内联样式
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const SITE = path.join(__dirname, '..', 'site');
|
|
const PAGES = ['index.html', 'brands.html', 'honors.html', 'cases.html', 'about.html'];
|
|
|
|
for (const f of PAGES) {
|
|
const p = path.join(SITE, f);
|
|
let s = fs.readFileSync(p, 'utf8');
|
|
const before = s;
|
|
let n = 0;
|
|
|
|
// 1) 去掉所有内联 --d 延迟(配合精简后的动画)
|
|
s = s.replace(/\s*style="--d:\.[0-9]+s"/g, () => { n++; return ''; });
|
|
|
|
// 2) 去掉信息块/清单里多余的零散滚动动画(保留 data-reveal="left/right/zoom" 这类大块布局动效)
|
|
s = s.replace(/<div class="infoblock" data-reveal>/g, () => { n++; return '<div class="infoblock">'; });
|
|
s = s.replace(/<div class="tl-item" data-reveal[^>]*>/g, () => { n++; return '<div class="tl-item">'; });
|
|
|
|
if (s !== before) { fs.writeFileSync(p, s, 'utf8'); console.log('updated ' + f + ' (' + n + ' 处)'); }
|
|
else console.log('no change ' + f);
|
|
}
|
|
|
|
// 3) 首页首屏图换成新图(含 2x),并给首屏文案区加大留白
|
|
const home = path.join(SITE, 'index.html');
|
|
let h = fs.readFileSync(home, 'utf8');
|
|
const oldBg = /<div class="hero__bg" data-lqip="hero\/hero-1" style="background-image:url\('assets\/img\/hero\/hero-1\.webp'\)"><\/div>/;
|
|
const newBg = '<div class="hero__bg" data-lqip="hero/hero-1" style="background-image:url(\'assets/img/hero/hero-1.webp\')"></div>';
|
|
if (oldBg.test(h)) {
|
|
h = h.replace(oldBg, newBg);
|
|
fs.writeFileSync(home, h, 'utf8');
|
|
console.log('index.html 首屏背景已指向新图(文件名不变,内容已重建)');
|
|
}
|