如何使用纯css3实现here显示的效果。带纯css3的动画提交/进度按钮
回答
使用这个(纯CSS /无javascript):
我创建一个例子,可能仍然不是你在找什么,但这是我最亲近的。
例(Demo in jsfiddle):
<style>
@-webkit-keyframes rotate {
from {
-webkit-transform: rotate(0deg);
}
to {
-webkit-transform: rotate(360deg);
}
}
@-moz-keyframes rotate {
from {
-moz-transform: rotate(0deg);
}
to {
-moz-transform: rotate(360deg);
}
}
@-o-keyframes rotate {
from {
-o-transform: rotate(0deg);
}
to {
-o-transform: rotate(360deg);
}
}
@keyframes rotate {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
#startupload:target {
/*"disable" button*/
background: transparent;
border: none;
}
#startupload:target div.before {
/*Hide If has hash in url address browser*/
display: none;
}
#startupload div.progress-circle-container {
position: relative;
height: 230px;
width: 230px;
margin: 0 auto;
display: none; /*hide If no Hash in address*/
}
#startupload:target div.progress-circle-container {
display: block; /*Show If Hash in address*/
}
#startupload div.progress-circle-container div.progress-circle-outer {
background-color: #faef85;
background-repeat: repeat-x;
background-image: -moz-linear-gradient(0deg, #d66f0f, #faef85);
background-image: -webkit-linear-gradient(0deg, #d66f0f, #faef85);
background-image: -o-linear-gradient(0deg, #d66f0f, #faef85);
background-image: linear-gradient(0deg, #d66f0f, #faef85);
width: 230px;
height: 230px;
position: absolute;
-webkit-animation-play-state: paused;
-moz-animation-play-state: paused;
-o-animation-play-state: paused;
animation-play-state: paused;
-webkit-animation: rotate 2.2s infinite linear;
-moz-animation: rotate 2.2s infinite linear;
-o-animation: rotate 2.2s infinite linear;
animation: rotate 2.2s infinite linear;
-webkit-box-shadow: inset 0 2px 10px #d58513,inset 0 0 20px #b93d00,0 0 15px rgba(216, 140, 23, 0.25);
-moz-box-shadow: inset 0 2px 10px #d58513,inset 0 0 20px #b93d00,0 0 15px rgba(216, 140, 23, 0.25);
box-shadow: inset 0 2px 10px #d58513,inset 0 0 20px #b93d00,0 0 15px rgba(216, 140, 23, 0.25);
-webkit-border-radius: 200px;
-moz-border-radius: 200px;
border-radius: 200px;
}
#startupload:target div.progress-circle-container div.progress-circle-outer.animate {
-webkit-animation-play-state: running;
-moz-animation-play-state: running;
-o-animation-play-state: running;
animation-play-state: running;
}
#startupload div.progress-circle-container div.progress-circle-inner {
height: 170px;
width: 170px;
margin: 0 auto;
position: absolute;
left: 30px;
top: 30px;
-webkit-border-radius: 200px;
-moz-border-radius: 200px;
border-radius: 200px;
background-color: #fff;/*change color background*/
-webkit-box-shadow: inset 0 2px 1px #ffffff,inset 0 -1px 1px rgba(0, 0, 0, 0.08),inset 0 -3px 1px rgba(0, 0, 0, 0.09),0 2px 2px rgba(0, 0, 0, 0.3);
-moz-box-shadow: inset 0 2px 1px #ffffff,inset 0 -1px 1px rgba(0, 0, 0, 0.08),inset 0 -3px 1px rgba(0, 0, 0, 0.09),0 2px 2px rgba(0, 0, 0, 0.3);
box-shadow: inset 0 2px 1px #ffffff,inset 0 -1px 1px rgba(0, 0, 0, 0.08),inset 0 -3px 1px rgba(0, 0, 0, 0.09),0 2px 2px rgba(0, 0, 0, 0.3);
text-align: center;
}
</style>
<form action="#startupload">
<button id="startupload" type="submit">
<div class="before">
Start upload
</div>
<div class="progress-circle-container">
<div class="progress-circle-outer animate">
</div>
<div class="progress-circle-inner"></div>
</div>
</button>
</form>
也许最终的目标,以达到最佳的是一样的东西:
发现这[文章](https://medium.com/secoya-tech/radial-progress-indicator-using-css-a917b80c43f9)它真的很接近 –
@ 254code_rep你说的是“纯CSS”,但是这篇文章使用lesscss,所以可以使用javascript,那么我们可以使用canvas来代替CSS。 –
@GuilhermeNascimento,更少的CSS是“纯CSS”,你只需要编译它。 JavaScript不会编译成CSS,是吗? :-D –
- 1. 提交按钮动画
- 2. CSS3动画/翻译DIV与提交按钮
- 3. 按动按钮提交按钮的动画背景?
- 4. 动画提交按钮的值更改
- 5. 按下使用CSS3动画的按钮
- 6. 使用css3动画的浮动按钮
- 7. Rails的:替代提交按钮纯HTML
- 8. 按钮上的CSS3动画点击
- 9. 带图标的CSS3按钮
- 10. yui提交按钮和调度动作
- 11. CSS3动画宽度
- 12. CSS3动画进度条IE9填充CSS3Pie
- 13. CSS3动画 - 图像的动画宽度
- 14. 带一次性提交按钮的Dropzone.js
- 15. 带提交按钮的编辑框
- 16. 带两个提交按钮的表单
- 17. 带多个提交按钮的Ajax
- 18. 带有高度的自由滑动CSS3动画:自动
- 19. 将CSS3动画转换为纯JavaScript
- 20. 纬度和经度提交按钮
- 21. 纯粹的CSS3动画:2部分动画,一个接一个
- 22. 提交按钮动作
- 23. Java提交按钮动作
- 24. 带多个提交按钮的表单不提交
- 25. casperjs提交表单不带按钮
- 26. 带动画的UIButton图像按钮
- 27. 带覆盖按钮的动画UIImageView
- 28. 带触发按钮的动画制作
- 29. 提交不提交按钮
- 30. 提交按钮不提交
你去翻评论?这是关闭:http://codepen.io/rikschennink/pen/mjBsA –
是的,它是接近的,但它没有实现边界的圆形加载效果 –