没改轮播图的版本

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
+30 -1
View File
@@ -23,7 +23,10 @@
"Helvetica Neue", Arial, sans-serif;
background: var(--bg);
color: var(--text);
min-width: 320px;
min-width: 1280px;
}
body {
transform-origin: top left;
}
a {
color: inherit;
@@ -1133,6 +1136,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 socialModal = document.getElementById('socialModal');