刚刚喜欢上了扎针的感觉,有没有什么好看的主题推荐啊,默认的有点腻了
优化后的页面 <style> body { margin: 0; background: transparent; overflow: auto; height: 100vh; /* 使页面高度适应视口 */ background-image: url('背景图链接替换'); /* 背景图片 */ background-size: cover; background-attachment: fixed; /* 背景固定 */ background-…
优化后的页面
<style> body { margin: 0; background: transparent; overflow: auto; height: 100vh; /* 使页面高度适应视口 */ background-image: url('背景图链接替换'); /* 背景图片 */ background-size: cover; background-attachment: fixed; /* 背景固定 */ background-position: center center; } /* 流星效果 */ .meteor { position: absolute; width: 3px; height: 3px; background: #fff; opacity: 0.8; border-radius: 50%; animation: meteor-shower linear infinite; } /* 流星动画 */ @keyframes meteor-shower { 0% { transform: translateY(-100vh) translateX(0); opacity: 1; } 100% { transform: translateY(100vh) translateX(100vw); opacity: 0; } } /* 流星的特效延迟和速度 */ .meteor:nth-child(odd) { animation-duration: 20s; } .meteor:nth-child(even) { animation-duration: 25s; animation-delay: 5s; } /* 滚动条美化 */ ::-webkit-scrollbar { width: 12px; /* 设置垂直滚动条的宽度 */ height: 12px; /* 设置水平滚动条的高度 */ } /* 滚动条滑块设置为七彩渐变 */ ::-webkit-scrollbar-thumb { background: linear-gradient(135deg, #FF0000, #FF7F00, #FFFF00, #00FF00, #0000FF, #4B0082, #8B00FF); border-radius: 8px; /* 圆角效果 */ } ::-webkit-scrollbar-thumb:hover { background: linear-gradient(135deg, #FF4500, #FFB100, #FFEA00, #00D100, #0000FF, #6A2DFF, #9A2BFF); /* 滚动条悬停时的七彩���变 */ } ::-webkit-scrollbar-track { background-color: transparent; /* 使滚动条轨道背景透明 */ border-radius: 8px; /* 圆角效果 */ } ::-webkit-scrollbar-track:hover { background-color: transparent; /* 轨道悬停时背景透明 */ } ::-webkit-scrollbar-corner { background-color: transparent; /* 右下角交汇区域背景透明 */ } .content { position: relative; z-index: 2; /* 确保页面内容层级高于背景 */ color: white; padding: 20px; } h1 { text-align: center; } </style> <!-- 流星特效 --> <script> let meteorCount = 0; const maxMeteors = 50; // 最大流星数量 function createMeteor() { if (meteorCount >= maxMeteors) return; meteorCount++; const meteor = document.createElement('div'); meteor.classList.add('meteor'); meteor.style.top = `${Math.random() * 100}vh`; meteor.style.left = `${Math.random() * 100}vw`; meteor.style.animationDuration = `${Math.random() * (30 - 20) + 20}s`; meteor.style.animationDelay = `${Math.random() * 5}s`; document.body.appendChild(meteor); // 清理流星元素 meteor.addEventListener('animationend', function() { meteor.remove(); meteorCount--; }); } // 每秒生成多个流星 setInterval(createMeteor, 300); </script>
忘记在哪找的了
这是我得原创
哥 下面那个滑动条老缩小 整个页面可以不断往右拉什么情况
优化后的页面 <style> body { margin: 0; background: transparent; overflow: auto; height: 100vh; /* 使页面高度适应视口 */ background-image: url('背景图链接替换'); /* 背景图片 */ background-size: cover; background-attachment: fixed; /* 背景固定 */ background-…
3 条回复
排序