html网站点击特效,HTML5 svg和CSS3炫酷鼠标点击按钮特效
這是一組效果非常炫酷的HTML5 svg和CSS3鼠標(biāo)點(diǎn)擊按鈕特效。這組鼠標(biāo)點(diǎn)擊特效共有22種效果,大多數(shù)是在偽元素上使用CSS3 animations來制作動畫效果。非常適合于移動手機(jī)APP上的按鈕觸摸特效。
請注意這些效果需要在支持這些CSS屬性的現(xiàn)代瀏覽器中才有效果,IE10不支持在偽元素上使用animation,因此有些效果可能不會有效果。
該鼠標(biāo)點(diǎn)擊按鈕特效插件中使用了Font Awesome字體圖標(biāo)。
HTML結(jié)構(gòu)
該鼠標(biāo)點(diǎn)擊按鈕特效中每一個可點(diǎn)擊的元素都是一個按鈕。
Play
CSS樣式
以下是該css3點(diǎn)擊按鈕特效的通用CSS樣式:
.cbutton {
position: relative;
display: inline-block;
margin: 1em;
padding: 0;
border: none;
background: none;
color: #286aab;
font-size: 1.4em;
transition: color 0.7s;
}
.cbutton.cbutton--click,
.cbutton:focus {
outline: none;
color: #3c8ddc;
}
.cbutton__icon {
display: block;
}
.cbutton__text {
position: absolute;
opacity: 0;
pointer-events: none;
}
.cbutton::after {
content: '';
position: absolute;
top: 50%;
left: 50%;
margin: -35px 0 0 -35px;
width: 70px;
height: 70px;
border-radius: 50%;
opacity: 0;
pointer-events: none;
}
插件中通過在點(diǎn)擊按鈕時使用javascript來為它添加相應(yīng)的動畫CLASS來執(zhí)行動畫效果:
/* Effect Boris */
.cbutton--effect-boris::after {
background: rgba(111,148,182,0.1);
}
.cbutton--effect-boris.cbutton--click::after {
animation: anim-effect-boris 0.3s forwards;
}
@keyframes anim-effect-boris {
0% {
transform: scale3d(0.3, 0.3, 1);
}
25%, 50% {
opacity: 1;
}
100% {
opacity: 0;
transform: scale3d(1.2, 1.2, 1);
}
}
上面的CSS代碼可以生成如下圖的動畫效果:
在“Stana”效果中,使用了html5 SVG clipPath,在它上面添加了一個transition。這個效果可能只在Chrome瀏覽器中才能看到效果。
在“Stoja”效果中使用了CSS clip-path屬性,這個效果也不是所有瀏覽器都可以看得到的。參考CanIUse support table for the CSS clip-path property。
總結(jié)
以上是生活随笔為你收集整理的html网站点击特效,HTML5 svg和CSS3炫酷鼠标点击按钮特效的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 一名前端工程师自检清单与思考(来吧,干完
- 下一篇: iMacros使用技巧
