位置: 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)

  • 税务申报退税
  • 增值税专用发票的税率是多少啊
  • 私车公用如何处理
  • 员工离职社保未及时减员怎么处理
  • 社保是当月计提当月的吗
  • 红字发票申请表盖什么章
  • 软件和硬件可以用什么代名词
  • 城市维护建设税减免税优惠政策
  • 什么情况下征税
  • 企业间借款增值税税率
  • 一般纳税人城建税怎么计算
  • 出租设备应计入什么科目
  • 消费税征收范围包括
  • 税控服务系统
  • 增值税普通发票红冲之后还能查询吗
  • 政府性基金预算收入包括
  • 持有公司股票是股东吗
  • 培训费发票模板
  • 酒店布草间有摄像头吗
  • 配股的基本含义是什么
  • 个税系统添加人员出现证件号码不符合一般规则
  • eclipse 4.19
  • 协调费用应该怎么表述才合理
  • 自创商誉的确认
  • nwtray.exe - nwtray是什么进程 作用是什么
  • 新公司成立前期费用
  • php调用soap
  • 纺织企业成本核算表
  • 如果企业亏损要交企业所得税吗
  • 取得政府补助后怎么处理
  • thinkphp d
  • 已抵扣增值税进什么科目
  • php curl_exec
  • 股票溢价发行会亏本吗
  • 说好的运费少给怎么办
  • python语言接收信息的内置函数
  • 旅行社代订机票的发票可以抵税吗
  • 公司股东与公司往来怎么处理
  • 有合同没有发票怎么入账
  • 净利润除以实收资本是什么
  • sqlserver2012安装好了桌面没有图标
  • 微信小程序 滚动 变色
  • 收到项目资本金入什么科目
  • 工伤保险退费了是什么意思
  • 企业捐赠自产产品的所得税处理
  • 应付账款预付账款应收账款预收账款
  • 加油卡充值可以开增值税专用发票吗
  • 未开票的收入如何申报增值税
  • 到期无法收回的银行承兑汇票计入什么科目
  • 税前扣除凭证按照用途分为哪些
  • 融资租入固定资产改建支出计入
  • 发票额开多了多出的金额怎么处理?
  • 上年多计提的费用,今年如何记账
  • 核定应税所得率征收
  • 土地使用权入账务处理
  • 公司库存现金提现流程
  • 最新的会计规定出台时间
  • 研发费用属于哪类会计科目
  • 什么是利润表?其作用有哪些?
  • 出口的样品如何销售
  • win8安装出现了一些问题
  • 进程关不掉怎么解决
  • 苹果电脑安装虚拟机会有什么影响
  • winxp系统介绍
  • ubuntu系统怎么用
  • mac10.10.5无法升级
  • 怎么关闭无服务状态
  • 如何手动修改VID与PID
  • winxp系统优化
  • onekey.exe是什么
  • win10一周年版本
  • bootstrap怎样为进度条添加动画
  • 各种常用的js函数有哪些
  • 资源加载中是什么原因
  • shell脚本遍历
  • win10安装python2.7
  • jquery内容过滤选择器有哪些
  • javascript入门基础
  • 双流税务总局电话
  • 逆光代售和神仙代售那个好一点
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设