位置: IT常识 - 正文

大数据热点城市波动图案例【CSS3实现 + 原理分析 + 源码获取】(大数据热点话题)

编辑:rootadmin
大数据热点城市波动图案例【CSS3实现 + 原理分析 + 源码获取】 一:案例效果

       本次案例我们分析一下数据可视化页面最常见的热点图是如何实现的,其原理并不复杂,只需要用到CSS3动画属性 animation 以及 @keyframe 关键帧即可,重点是向外扩散的环如何布局比较合适,以及每个环怎么扩散何时扩散比较合适。

推荐整理分享大数据热点城市波动图案例【CSS3实现 + 原理分析 + 源码获取】(大数据热点话题),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:大数据谈论热点有,大数据热点新闻,大数据 城市,大数据热度,大数据热度,大数据热点分析,大数据热点话题,大数据的热点,内容如对您有帮助,希望把文章链接给更多的朋友!

大数据热点城市波动图案例【CSS3实现 + 原理分析 + 源码获取】(大数据热点话题)

二:源码获取

源码我已经上传到了资源里,想拿来学习引用的小伙伴直接下载即可,没有会员的可以私聊我 “大数据热点图” 免费获取,下方是源码的资源链接

大数据热点波动图,纯css3实现-Javascript文档类资源-CSDN下载通过css3动画设置的大数据热点波动图,主要利用了animation动画更多下载资源、学习资料请访问CSDN下载频道.https://download.csdn.net/download/weixin_52212950/86728456

三:原理分析

原理分析我们分为热点的布局分析与热点向外扩散的动画实现的分析

3.1 布局分析布局我们那单独的一个城市分析,例如地图中北京的 ,其由一个类名为city1的最外层盒子来添加定位以定到目标城市位置,其不设置宽高,大小完全由中心点撑起(即第二个类名为center的盒子) ,波纹其实是有三个圈圈组成的,最开始是完全重合的,用中心小算法来保证其永远是围绕center来扩散的。 <div class="city1"> <div class="center1"></div> <p class="bj">Beijing</p> <div class="bw1"></div> <div class="bw2"></div> <div class="bw3"></div> </div>波纹的样式添加我们采用了属性选择器 .city1 div[class^="bw"],即选择父类city1里面类名以bw开头的所有子div标签 .city1{ position: absolute; top: 370px; right: 403px; color: aliceblue; } .center1{ width: 5px; height: 5px; background-color: rgb(255, 255, 255); box-shadow: 0 0 12px 2px #fff; border-radius: 50%; } .city1 div[class^="bw"]{ position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 5px; height: 5px; box-shadow: 0 0 7px #fff; border-radius: 50%; animation: scla 3s linear infinite; } .map .city1 div.bw2{ animation-delay: 1s; } .map .city1 div.bw3{ animation-delay: 2s; }3.2 动画分析本次添加的关键帧为:0%的时候波纹是完全不透明的,50%的时候宽高均变大为105px,即圈圈在总动画时间50%的时候要从宽高5px扩散到宽高105px,然后变为半透明状态。再下一个是100%的时候,扩散到宽高150px,并变成完全不透明。要给波纹添加属性:animation: scla 3s linear infinite;  含义为3s做完动画,匀速,并且无限循环为了呈现出波纹一个接一个往外扩散而不是一起扩散,需要给第一个圈圈直接开始扩散,第二个圈圈第三个圈圈设置不同的 animation-delay 动画延迟,第二个设置为1s,第二个设置为2s,这样就可以呈现出一个接一个往外扩散了 /* @keyframes关键帧动画 */ @keyframes scla{ 0% { opacity: 1; } 50% { width: 105px; height: 105px; opacity: 0.5; } 100% { width: 150px; height: 150px; opacity: 0; } } .city3 div[class^="bw"]{ position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 5px; height: 5px; box-shadow: 0 0 7px #fff; border-radius: 50%; animation: scla 3s linear infinite; } .map .city3 div.bw2{ animation-delay: 1s; } .map .city3 div.bw3{ animation-delay: 2s; }四:主要代码<style> *{ margin: 0; padding: 0; box-sizing: border-box; } body{ background-color: rgb(45, 45, 45); } .map{ position: relative; width: 1400px; height: 830px; background-image: url(./img/QX3OPNW5qY.png); background-repeat: no-repeat; background-size: 100%; margin: 0 auto; } .bj{ position: absolute; top: 15px; left: 10px; font-size: 10px; } .Gambia{ position: absolute; top: 15px; left: 10px; font-size: 10px; color:rgb(255, 153, 153) } .Island{ position: absolute; top: 15px; left: 10px; font-size: 10px; } /* 城市1 */ .city1{ position: absolute; top: 370px; right: 403px; color: aliceblue; } .center1{ width: 5px; height: 5px; background-color: rgb(255, 255, 255); box-shadow: 0 0 12px 2px #fff; border-radius: 50%; } .city1 div[class^="bw"]{ position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 5px; height: 5px; box-shadow: 0 0 7px #fff; border-radius: 50%; animation: scla 3s linear infinite; } .map .city1 div.bw2{ animation-delay: 1s; } .map .city1 div.bw3{ animation-delay: 2s; } /* 城市2 */ .city2{ position: absolute; top: 500px; right: 703px; color: aliceblue; } .center2{ width: 5px; height: 5px; background-color: rgb(255, 255, 255); box-shadow: 0 0 12px 2px #fff; border-radius: 50%; } .city2 div[class^="bw"]{ position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 5px; height: 5px; box-shadow: 0 0 7px rgb(255, 149, 149); border-radius: 50%; animation: scla1 3s linear infinite; } .map .city2 div.bw2{ animation-delay: 0.75s; } .map .city2 div.bw3{ animation-delay: 1.5s; } .map .city2 div.bw4{ animation-delay: 2.25s; } /* 城市3 */ .city3{ position: absolute; top: 200px; right: 1003px; color: aliceblue; } .center3{ width: 5px; height: 5px; background-color: rgb(255, 255, 255); box-shadow: 0 0 12px 2px #fff; border-radius: 50%; } /* 属性选择器 正则表达式筛选bw开头类名 */ .city3 div[class^="bw"]{ position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 5px; height: 5px; box-shadow: 0 0 7px #fff; border-radius: 50%; animation: scla 3s linear infinite; } .map .city3 div.bw2{ animation-delay: 1s; } .map .city3 div.bw3{ animation-delay: 2s; } /* @keyframes关键帧动画 */ @keyframes scla{ 0% { opacity: 1; } 50% { width: 105px; height: 105px; opacity: 0.5; } 100% { width: 150px; height: 150px; opacity: 0; } } @keyframes scla1{ 0% { opacity: 1; } 50% { width: 285px; height: 285px; opacity: 0.5; } 100% { width: 330px; height: 330px; opacity: 0; } } </style></head><body> <div class="map"> <div class="city1"> <div class="center1"></div> <p class="bj">Beijing</p> <div class="bw1"></div> <div class="bw2"></div> <div class="bw3"></div> </div> <div class="city2"> <div class="center2"></div> <p class="Gambia">Gambia</p> <div class="bw1"></div> <div class="bw2"></div> <div class="bw3"></div> <div class="bw4"></div> </div> <div class="city3"> <div class="center3"></div> <p class="Island">Island</p> <div class="bw1"></div> <div class="bw2"></div> <div class="bw3"></div> </div> </div></body>
本文链接地址:https://www.jiuchutong.com/zhishi/299556.html 转载请保留说明!

上一篇:ansible命令 运维自动化工具(基于ansible的运维平台)

下一篇:【ChatGPT】ChatGPT 能否取代程序员?(chatb)

  • 六税两费指的是什么
  • 赔偿给客户的货财务怎么处理
  • 电子承兑汇票兑现
  • 空调安装发票税率
  • 佣金开什么发票内容
  • 减免的城建税怎么计算
  • 购货方要求退货合理吗
  • 上月营业外收入少报入了怎么办
  • 建筑行业未收款先开发票如何做账?
  • 借款合同法律规定的表述
  • 支付宝转账到银行卡多久到账
  • 哪些税不适用征管法
  • 已核销的贷款收回计入什么科目
  • 社会保险基金管理局是干什么的
  • 退回剩余工程物资计入什么科目
  • 个税手续费返还计入哪个科目
  • 技术开发合同免征企业所得税吗
  • 应交增值税减免税额期末需要结转吗
  • 差额纳税的会计处理
  • 城镇土地使用税减免税政策
  • 个体工商户的税收优惠政策有哪些
  • 公司获得投资
  • 税控机减免会计分录
  • 集资建房减免那些配套资金
  • 餐厨垃圾处理有哪些设备
  • 公司作为二房东怎么给别人开发票
  • 股权投资收入会计处理
  • 生育津贴支付方式
  • 职工赔偿金的账务处理
  • 手机型号不在鸿蒙系统里
  • 财务红冲是什么意思
  • 哪些业务可以进入共享服务中心
  • 事业单位政府预算
  • 银行存款调账怎么调
  • 以公允价值计量的投资性房地产
  • 游戏出现d3d11lostdevice
  • 阿里云 ide
  • web安全如何入门
  • jsonobject忽略字段
  • php的curl实例
  • 项目成本估算的结果一般不包括
  • 营业外支出会计准则
  • yolo s
  • 个税返还的会计处理
  • 看望员工现金属于什么费用
  • 个税申报子女教育有年龄限制吗
  • 租金收入怎么做分录
  • mysql查询重复的全部删除
  • 分公司计提递延所得税吗
  • 销售增长率计算公式财务管理
  • 税控服务费减免月底怎样结转
  • 内账会计的主要工作
  • 工商年报认缴时间过期了怎么办
  • 支付劳务公司的劳务费如何扣缴个人所得税?
  • 如何确定费用归属哪个部门
  • 建安类资质指什么资质
  • 售后租回会计处理分录
  • 营业执照可以注册几个抖音号
  • mysql总是安装失败
  • 电脑更新win10系统软件
  • centos 7.5 7.6
  • win10选择软件打开方式
  • 苹pp助手
  • 电脑系统 win7
  • windows资源管理器在哪个文件夹
  • win10系统怎么卸载ie浏览器
  • linux 11
  • 微信小程序实现轮播图
  • jquery checkbox的相关操作总结
  • unity3d官方
  • Forward Render VS Deferred Rendering
  • python asyncio await
  • 最多跑一次改革是谁提出来的
  • 建筑行业增值税税收优惠政策
  • 南京税务局几点下班?
  • 营业税未达起征点
  • 个人独资企业如何避税
  • 企业年度申报怎么修改
  • 小规模企业降税
  • 如何计算土地增值税税率
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设