时间:2021-05-08
通过css3实现炫酷的雷达扫描图:
直接上代码:
// index.html<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>雷达扫描图</title> <link rel="stylesheet" href="css/index.css"></head><body> <div class="radar"></div></body></html>//index.css* { box-sizing: border-box;}html { height: 100%; background-color: #111; font-size: 10px;}body { background-image: linear-gradient(0deg, transparent 24%, rgba(32, 255, 77, 0.15) 26%, transparent 27%, transparent 74%, rgba(32, 255, 77, 0.15) 76%, transparent 77%, transparent), linear-gradient(90deg, transparent 24%, rgba(32, 255, 77, 0.15) 26%, transparent 27%, transparent 74%, rgba(32, 255, 77, 0.15) 76%, transparent 77%, transparent); background-size: 8rem 8rem; width: 100%; height: 100%; position: relative; padding: 0; margin: 0; font-size: 1.6rem;}.radar { background: -webkit-radial-gradient(center, rgba(32, 255, 77, 0.3) 0%, rgba(32, 255, 77, 0) 75%), -webkit-repeating-radial-gradient(rgba(32, 255, 77, 0) 5.8%, rgba(32, 255, 77, 0) 18%, #20ff4d 18.6%, rgba(32, 255, 77, 0) 18.9%), -webkit-linear-gradient(90deg, rgba(32, 255, 77, 0) 49.5%, #20ff4d 50%, rgba(32, 255, 77, 0) 50.2%), -webkit-linear-gradient(0deg, rgba(32, 255, 77, 0) 49.5%, #20ff4d 50%, rgba(32, 255, 77, 0) 50.2%); width: 75vw; height: 75vw; max-height: 75vh; max-width: 75vh; position: relative; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; border: 0.2rem solid #20ff4d; overflow: hidden;}.radar:before { content: ' '; display: block; position: absolute; width: 100%; height: 100%; border-radius: 50%; animation: blips 5s infinite; animation-timing-function: linear; animation-delay: 1.4s;}.radar:after { content: ' '; display: block; background-image: linear-gradient(44deg, rgba(0, 255, 51, 0) 50%, #00ff33 100%); width: 50%; height: 50%; position: absolute; top: 0; left: 0; animation: radar-beam 5s infinite; animation-timing-function: linear; transform-origin: bottom right; border-radius: 100% 0 0 0;}@keyframes radar-beam { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); }}@keyframes blips { 14% { background: radial-gradient(2vmin circle at 75% 70%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%); } 14.0002% { background: radial-gradient(2vmin circle at 75% 70%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 63% 72%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%); } 25% { background: radial-gradient(2vmin circle at 75% 70%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 63% 72%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 56% 86%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%); } 26% { background: radial-gradient(2vmin circle at 75% 70%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 63% 72%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 56% 86%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%); opacity: 1; } 100% { background: radial-gradient(2vmin circle at 75% 70%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 63% 72%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%), radial-gradient(2vmin circle at 56% 86%, #ffffff 10%, #20ff4d 30%, rgba(255, 255, 255, 0) 100%); opacity: 0; }}ps: 转自https://www.html5tricks.com/pure-css3-radar-scanning.html
总结
到此这篇关于CSS3 实现雷达扫描图的示例代码的文章就介绍到这了,更多相关css3雷达扫描图内容请搜索以前的文章或继续浏览下面的相关文章,希望大家以后多多支持!
声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。
本文介绍了css3实现信纸/同学录效果的示例代码,分享给大家,具体如下:实现思路:网格背景,由css3的线性渐变来实现。纸上的打孔,由圆和圆柱组成,多个打孔,可
先来看看效果图CSS3伪类target利用target的特性,可以实现纯css的tab效果切换示例代码如下复制代码代码如下:.tabmenu{position:
复制代码代码如下:css3实现多背景展示 通过css3定位多张背景并且使用固定属性。
本文介绍了css3实现画半圆弧线的示例代码,分享给大家,具体如下:css代码.circle1{width:100px;height:200px;border:1
本文章介绍了CSS3之transition实现下划线的示例代码,分享给大家,具体如下:在这里先看看我们的demo认识transition这是CSS3中新增的一个