svg线路图-线路动态流动效果

1.线路图

先用svg绘制,线路图,画出几条线路,然后根据线路的起始坐标,添加动态效果,出现电流流动效果。

线路图源码

<svg id="svg" width="calc(100% - 4px)" height="calc(100% - 4px)" version="1.1"
xmlns="http://www.w3.org/2000/svg" style="border:2px solid #ccc;">
	<g id="global_box" transform="translate(0,0)">
		<line x1="100" y1="100" x2="300" y2="100" stroke="black" stroke-width="1"
		transform="matrix(1,0,0,1,47.99999894389384,7.999999816329364)">
		</line>
		<circle cx="100" cy="100" r="10" stroke="#1F96DC" stroke-width="1" fill="#031546"
		transform="matrix(1,0,0,1,222.99999488018102,7.99999933949222)" id="t2">
		</circle>
		<line x1="100" y1="100" x2="300" y2="100" stroke="black" stroke-width="1"
		transform="matrix(6.123233601181349e-17,1,-1,6.123233601181349e-17,286.99999341081593,5.999999362451035)">
		</line>
		<circle cx="100" cy="100" r="10" stroke="#1F96DC" stroke-width="1" fill="#031546"
		transform="matrix(1,0,0,1,86.99999800258183,8.00000126979964)" id="t1">
		</circle>
		<circle cx="100" cy="100" r="10" stroke="#1F96DC" stroke-width="1" fill="#031546"
		transform="matrix(1,0,0,1,86.99999035022864,114.9999973597346)" id="t3">
		</circle>
	</g>
</svg>

线路图效果
在这里插入图片描述

2.html线路流动效果

利用svg线路图线路的stroke-dasharray和css的动画效果animation的结合,实现线路流动效果。

html源码

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>svg线路动态效果</title>
    <style style="text/css">
		 .svgLineDL{
		  stroke-dasharray:0% 100% ;
		  stroke:#FCFCEC;
		  animation:move2 1s infinite;
		}
		 @keyframes move2{
		   0%{
			stroke-dasharray:0,100%;
		  }
		  100%{
			stroke-dasharray:100%,0;
			stroke:#C30000;
		  }
		} 
	</style>
</head>
<body>
    <svg id="svg" width="calc(100% - 4px)" height="calc(100% - 4px)" version="1.1" xmlns="http://www.w3.org/2000/svg" style="border:2px solid #ccc;">
	<g id="global_box" transform="translate(0,0)">
		<line x1="100" y1="100" x2="300" y2="100" stroke="black" stroke-width="1"
		transform="matrix(1,0,0,1,47.99999894389384,7.999999816329364)">
		</line>
		<circle cx="100" cy="100" r="10" stroke="#1F96DC" stroke-width="1" fill="#031546"
		transform="matrix(1,0,0,1,222.99999488018102,7.99999933949222)" id="t2">
		</circle>
		<line x1="100" y1="100" x2="300" y2="100" stroke="black" stroke-width="1"
		transform="matrix(6.123233601181349e-17,1,-1,6.123233601181349e-17,286.99999341081593,5.999999362451035)">
		</line>
		<circle cx="100" cy="100" r="10" stroke="#1F96DC" stroke-width="1" fill="#031546"
		transform="matrix(1,0,0,1,86.99999800258183,8.00000126979964)" id="t1">
		</circle>
		<circle cx="100" cy="100" r="10" stroke="#1F96DC" stroke-width="1" fill="#031546"
		transform="matrix(1,0,0,1,86.99999035022864,114.9999973597346)" id="t3">
		</circle>
		<line x1="187" y1="108" x2="323" y2="108" stroke="#C30000" stroke-width="2">
		</line>
		<line x1="187" y1="108" x2="323" y2="108" stroke="#C30000" class="svgLineDL"
		stroke-width="2">
		</line>
		<line x1="187" y1="215" x2="187" y2="108" class="svgLineDL" stroke="#C30000"
		stroke-width="2">
		</line>
	</g>
</svg>
</svg>
</body>
 
</html>

3.动态效果

可以实现点到点的线路流动,也可以实现单一线路流动,也支持多分支线路流动。

在这里插入图片描述

4.svg相关资源

🧡💛💚💙💜【博主推荐】html界面绘制SVG图形(附源码)

🧡💛💚💙💜【博主推荐】html操作SVG图(附源码)

🧡💛💚💙💜【博主推荐】html引用百度地图定位闪烁弹框树形(附源码)

🧡💛💚💙💜 svg下path所有路径命令


优质资源分享

🧡🧡🧡🧡🤍【总览】程序员前端、后端资源合集

🧡🧡🧡🧡🤍【源码】程序员优质资源汇总

🧡🧡🧡🧡🤍【博主推荐】JAVA SSM框架的后台管理系统(附源码)

🧡🧡🧡🧡🤍【博主推荐】SpringBoot API接口对数据库增删改查,路由,TOKEN,WebSocket完整版(附源码)

🧡🧡🧡🧡🤍【博主推荐】HTML制作一个美观的个人简介网页(附源码)

🧡🧡🧡🧡🤍【博主推荐】html好看的个人简历网页版(附源码)

🧡🧡🧡🧡🤍【博主推荐】html好看的个人主页(附源码)

🧡🧡🧡🧡🤍【博主推荐】html好看的邀请函(附源码)

🧡🧡🧡🧡🤍【博主推荐】html好看的音乐播放器(附源码)

🧡🧡🧡🧡🤍【博主推荐】html好看的拼图小游戏(附源码)

🧡🧡🧡🤍🤍【博主推荐】html好看的拼图验证码(附源码)

🧡🧡🧡🧡🧡【博主推荐】html界面绘制SVG图形(附源码)

🧡🧡🧡🧡🤍【博主推荐】html操作SVG图(附源码)

🧡🧡🧡🧡🤍【博主推荐】html下拉框树形(附好看的登录界面)

🧡🧡🧡🧡🤍【博主推荐】HTML5响应式手机WEB(附源码)

🧡🧡🧡🧡🤍【博主推荐】大数据可视化大屏(源码下载)

🧡🧡🧡🧡🧡【博主推荐】html引用百度地图定位闪烁弹框树形(附源码)

🧡🧡🧡🧡🤍【博主推荐】HTML酷炫动画表白求爱界面(附源码)


     💞 关注博主 带你实现畅游前后端

     🏰 加入社区 带你体验马航不孤单

     💯 神秘个人简介 带你体验不一样得介绍

     🎀 酷炫邀请函 带你体验高大上得邀请

     亲,码字不易,动动小手,欢迎 点赞 ➕ 收藏,如 🈶 问题请留言(评论),博主看见后一定及时给您答复,💌💌💌

  • 8
    点赞
  • 18
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

xcLeigh

万水千山总是情,打赏两块行不行

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值