没改轮播图的版本

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
+28 -1
View File
@@ -31,7 +31,8 @@
color: var(--text);
overflow-y: auto;
scroll-behavior: smooth;
min-width: 320px;
min-width: 1280px;
transform-origin: top left;
}
a {
color: inherit;
@@ -1157,6 +1158,32 @@
</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 categoryBtns = document.querySelectorAll('.category-btn');