【发布时间】:2019-08-27 21:36:37
【问题描述】:
我喜欢这个website 让他们的戒指发光和跳动的方式,我想知道他们是怎么做到的。
我可以做类似的东西,但我不是很好。
所以这就是我能够弄清楚但它似乎不起作用。
CSS:
glowycircleouter.blue .glow4 {
box-shadow: 0 0 25px #287ec6;
}
.glowycircleouter .glow4 {
-webkit-animation: glowyglow 3s 2250ms infinite;
-moz-animation: glowyglow 3s 2250ms infinite;
-ms-animation: glowyglow 3s 2250ms infinite;
-o-animation: glowyglow 3s 2250ms infinite;
animation: glowyglow 3s 2250ms infinite;
animation-name: glowyglow;
animation-duration: 3s;
animation-timing-function: initial;
animation-delay: 2250ms;
animation-iteration-count: infinite;
animation-direction: initial;
animation-fill-mode: initial;
animation-play-state: initial;
}
.glowycircleouter .glow4 {
opacity: 0;
display: block;
position: absolute;
left: 50%;
top: 50%;
width: 200%;
height: 200%;
-webkit-transform: translate(-50%, -50%);
-moz-transform: translate(-50%, -50%);
-o-transform: translate(-50%, -50%);
-ms-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
}
HTML:
<span class="glow4"></span>
【问题讨论】:
-
从他们的源代码来看,他们使用了
keyframes、border-radius: 50%、opacity、transform、translate和scale。 -
谷歌搜索“css pulsating ring”返回一堆代码笔和东西:jsfiddle.net/dirtyharry/dw51cgu6
标签: css css-animations visual-web-developer