日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > CSS >内容正文

CSS

html直播点赞特效,CSS3实现红心点赞特效

發布時間:2024/1/1 CSS 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 html直播点赞特效,CSS3实现红心点赞特效 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1.創建html

2. css

.heart {

background: url(http://demo.htmleaf.com/1511/201511131551/images/web_heart_animation.png);

background-position: left;

background-repeat: no-repeat;

height: 100px;

width: 100px;

cursor: pointer;

position: absolute;

left: -14px;

background-size: 2900%;

}

.heart:hover,

.heart:focus {

background-position: right;

}

@-webkit-keyframes heartBlast {

0% {

background-position: left;

}

100% {

background-position: right;

}

}

@keyframes heartBlast {

0% {

background-position: left;

}

100% {

background-position: right;

}

}

.heartAnimation {

display: inline-block;

-webkit-animation-name: heartBlast;

animation-name: heartBlast;

-webkit-animation-duration: .8s;

animation-duration: .8s;

-webkit-animation-iteration-count: 1;

animation-iteration-count: 1;

-webkit-animation-timing-function: steps(28);

animation-timing-function: steps(28);

background-position: right;

}

@-webkit-keyframes dorsyHover {

0% {

-webkit-box-shadow: 0 0 1px 1px #aaa30a;

}

50% {

-webkit-box-shadow: 0 0 1px 1px #fdfbc4;

}

100% {

-webkit-box-shadow: 0 0 1px 1px yellow;

}

}

@-webkit-keyframes dorsyDelete {

0% {

-webkit-transform: rotate(0deg);

}

40% {

-webkit-transform: rotate(10deg);

}

80% {

-webkit-transform: rotate(-10deg);

}

100% {

-webkit-transform: rotate(0deg);

}

}

3.js 點擊事件添加類名

4.核心語義

1.backgroundbackground-position: left; (結束為right)

3.animate-duration:1s;(動畫運行時間)

4.animation-iteration-count :n / infinite ;(循環次數 n 不限)

5.animation-timing-function: steps(28);

速度曲線,使用三次貝塞爾函數的數學函數來生成速度曲線

參數為steps時:

第一個參數指定了時間函數中的間隔數量(必須是正整數)

第二個參數可選,接受 start 和 end 兩個值,指定在每個間隔的起點或是終點發生階躍變化,默認為 end。

step-start等同于steps(1,start),動畫分成1步,動畫執行時為開始左側端點的部分為開始;

step-end等同于steps(1,end):動畫分成一步,動畫執行時以結尾端點為開始,默認值為end。

steps() 第一個參數 number 為指定的間隔數,即把動畫分為 n 步階段性展示,估計大多數人理解就是keyframes寫的變化次數

作者:AstarX

鏈接:https://www.jianshu.com/p/753c4ea0c18c

總結

以上是生活随笔為你收集整理的html直播点赞特效,CSS3实现红心点赞特效的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。