Frosted Glass Effect with Falling Diamonds * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: Arial, sans-serif; height: 100vh; overflow: hidden; background: linear-gradient(135deg, #4a90e2, #9013fe); display: flex; align-items: center; justify-content: center; } .frosted-container { width: 300px; height: 200px; padding: 20px; display: flex; align-items: center; justify-content: center; text-align: center; color: white; position: relative; border-radius: 15px; background: rgba(255, 255, 255, 0.2); backdrop-filter: blur(15px); box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2); border: 1px solid rgba(255, 255, 255, 0.3); z-index: 10; } .frosted-container h1 { font-size: 1.5rem; z-index: 11; } /* Diamond styling */ .diamond { position: absolute; width: 10px; height: 10px; background: rgba(255, 255, 255, 0.8); transform: rotate(45deg); box-shadow: 0 0 10px rgba(255, 255, 255, 0.8); animation: fall 5s linear infinite; } /* Falling animation */ @keyframes fall { 0% { top: -10px; left: calc(100vw * var(--x)); opacity: 1; } 100% { top: 100vh; left: calc(100vw * var(--x)); opacity: 0; } } /* Generate multiple diamonds */ .diamond:nth-child(1) { --x: 0.1; animation-duration: 4s; } .diamond:nth-child(2) { --x: 0.2; animation-duration: 6s; } .diamond:nth-child(3) { --x: 0.3; animation-duration: 5s; } .diamond:nth-child(4) { --x: 0.4; animation-duration: 4.5s; } .diamond:nth-child(5) { --x: 0.5; animation-duration: 6.5s; } .diamond:nth-child(6) { --x: 0.6; animation-duration: 4.8s; } .diamond:nth-child(7) { --x: 0.7; animation-duration: 5.2s; } .diamond:nth-child(8) { --x: 0.8; animation-duration: 6.1s; } .diamond:nth-child(9) { --x: 0.9; animation-duration: 5.9s; }Frosted Glass Effect
登录后复制
以上就是使用 html css 的福斯特玻璃效果的详细内容,更多请关注【创想鸟】其它相关文章!
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至253000106@qq.com举报,一经查实,本站将立刻删除。
发布者:PHP中文网,转转请注明出处:https://www.chuangxiangniao.com/p/2845839.html