没改轮播图的版本

This commit is contained in:
2026-04-02 18:46:06 +08:00
parent 08a4c9a885
commit 9266c83fe5
9 changed files with 371 additions and 211 deletions
+29 -1
View File
@@ -22,8 +22,9 @@
font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
background: var(--bg);
color: var(--text);
min-width: 320px;
min-width: 1280px;
line-height: 1.6;
transform-origin: top left;
}
a { color: inherit; text-decoration: none; }
@@ -574,6 +575,33 @@
</div>
</div>
<script>
// 视口缩放 - 基于1920px设计稿
(() => {
const designWidth = 1920;
const minWidth = 1280;
const maxWidth = 2560;
function scale() {
const vw = window.innerWidth;
let scale = 1;
if (vw < minWidth) {
scale = vw / minWidth;
} else if (vw > maxWidth) {
scale = vw / maxWidth;
} else {
scale = vw / designWidth;
}
document.body.style.transform = `scale(${scale})`;
document.body.style.width = `${designWidth}px`;
}
scale();
window.addEventListener('resize', scale);
})();
</script>
<script>
// 产品数据库
const products = {