svg+css实现奖牌走光动画效果代码

代码语言:html

所属分类:动画

代码描述:svg+css实现奖牌走光动画效果代码

代码标签: svg css 奖牌 走光 动画

下面为部分代码预览,完整代码请点击下载或在bfwstudio webide中打开


<!DOCTYPE html>
<html lang="en" >

<head>

  <meta charset="UTF-8">

  
  
  
<style>
svg {
/* 	position:relative; */
	height:150px;
	width:150px;
/* 	border:1px solid red; */
}
body{
	background:#224;
}
.box {
	position:absolute;
	top:50%;
	left:50%;
	transform:translate(-50%,-50%);
	width:100%;
	text-align:center;
}
</style>



</head>

<body  >
  <div class="box">
	<svg id="gold" viewbox="0 0 100 100">
		<clipPath id="medalMask">
			<circle cx="50" cy="50" r="35" />
		</clipPath>
		<circle clip-path="url(#medalMask)" cx="50" cy="50" r="35" fill="gold" />
		<path clip-path="url(#medalMask)" d="M -10 90 L 0 100 L 100 0 L 90 -10" fill="rgba(255,255,255,1)">
			<animate id="shine" attributeName="d" values="M -10 90 L 0 100 L 100 0 L 90 -10; M 50 150 L 60 160 L 160 60 L 150 50" dur="1s" begin="0s;shine.end+5s" fill="freeze" />
		</path>
		<path clip-path="url(#medalMask)" d="M 0 0 V 100 L 100 0 Z" fill="rgb(255, 240, 25)" />
		<circle cx="50" cy="50" r="30" fill="rgb(255, 230, 15)" />
		<text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" fill="rgb(235,195,0)" font-family="Arial, Helvetica, sans-serif" font-size="25px">1st</text>
		<!-- 	shine -->
		<path clip-path="url(#medalMask)" d="M 40 140 L 50 150 L 150 50 L 140 40;" fill="rgba(255,255,255,1)">
			<animate attributeName="d" values="M 40 140 L 50 150 L 150 50 L 140 40; M -60 40 L -50 50 L 50 -50 L 40 -60" dur="1s" begin="0.5s;shine.end+5.5s" fill="freeze" />
		</path>
		<text x="50%" y="50%" dominant-baseline="middle" text-anchor="middle" fill="rgba(255, 230, 15,0.1)" font-family="Arial, Helvetica, sans-serif" font-size="25px">1st</text>
	</svg>

	<svg id="silver" viewbox="0 0 100 100">
		<clipPath id="meedalMask">
			<circle cx="50" cy="50" r="35" />
		</clipPath>
		<circle clip-path="url(#medalMask)" cx="50" cy="50" r="35" fill="silver" />
		<path clip-path="url(#medalMask)" d="M -10 90 L 0 100 L 100 0 L 90 -10" fill="rgba(255,255,255,1)">
			<animate id="shine2" attributeName="d" values="M -10 90 L 0 100 L 100 0 L 90 -10; M 50 150 L 60 160 L 160 60 L 150 50" dur="1s" begin="0s;shine2.end+5s" fill="freeze" />
		</pat.........完整代码请登录后点击上方下载按钮下载查看

网友评论0