濮阳杆衣贸易有限公司

主頁(yè) > 知識(shí)庫(kù) > 純CSS3實(shí)現(xiàn)圓圈動(dòng)態(tài)發(fā)光特效動(dòng)畫的示例代碼

純CSS3實(shí)現(xiàn)圓圈動(dòng)態(tài)發(fā)光特效動(dòng)畫的示例代碼

熱門標(biāo)簽:漯河外呼調(diào)研線路 旅游地圖標(biāo)注線路 地圖標(biāo)注位置怎么弄圖 電話機(jī)器人鑰匙扣 電銷專用外呼線路 400電話唐山辦理 電銷外呼系統(tǒng)是違法的嗎 廣西房產(chǎn)智能外呼系統(tǒng)推薦 威力最大的電銷機(jī)器人

本文主要介紹了純CSS3實(shí)現(xiàn)圓圈動(dòng)態(tài)發(fā)光特效動(dòng)畫的示例代碼,分享給大家,具體如下:

效果圖:

代碼:

<!DOCTYPE HTML>
<html>
<head>
    <title>純CSS3實(shí)現(xiàn)圓圈動(dòng)態(tài)發(fā)光特效動(dòng)畫</title>
    <style>
        body {
            background-color: #000000;
        }
 
        @keyframes twinkling {
            0% {
                opacity: 0.2;
                transform: scale(1);
            }
 
            50% {
                opacity: 0.5;
                transform: scale(1.12);
            }
 
            100% {
                opacity: 0.2;
                transform: scale(1);
            }
        }
 
        .circle-wrap {
            position: absolute;
            left: 100px;
            top: 100px;
        }
 
        .circle {
            position: relative;
            width: 24px;
            height: 24px;
        }
 
        .small-circle {
            border-radius: 50%;
            width: 12px;
            height: 12px;
            background: #FF0033;
            position: absolute;
        }
 
        .big-circle {
            position: absolute;
            top: -6px;
            left: -6px;
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background: #FF0033;
            animation: twinkling 1s infinite ease-in-out;
            animation-fill-mode: both;
        }
 
        @keyframes scale {
            0% {
                transform: scale(1)
            }
 
            50%,
            75% {
                transform: scale(3)
            }
 
            78%,
            100% {
                opacity: 0
            }
        }
 
        @keyframes scales {
            0% {
                transform: scale(1)
            }
 
            50%,
            75% {
                transform: scale(2)
            }
 
            78%,
            100% {
                opacity: 0
            }
        }
 
        .smallcircle2 {
            position: absolute;
            width: 12px;
            height: 12px;
            background-color: #ffffff;
            border-radius: 50%;
            top: 100px;
            left: 200px;
        }
 
        .smallcircle2:before {
            content: '';
            display: block;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            opacity: .4;
            background-color: #ffffff;
            animation: scale 1s infinite cubic-bezier(0, 0, .49, 1.02);
        }
 
        .bigcircle2 {
            position: absolute;
            width: 12px;
            height: 12px;
            border-radius: 50%;
            opacity: .4;
            background-color: #ffffff;
            top: 100px;
            left: 200px;
            animation: scales 1s infinite cubic-bezier(0, 0, .49, 1.02);
        }
 
        @keyframes scaless {
            0% {
                transform: scale(1)
            }
 
            50%,
            75% {
                transform: scale(3)
            }
 
            78%,
            100% {
                opacity: 0
            }
        }
 
        .item {
            position: absolute;
            width: 14px;
            height: 14px;
            background-color: #FFFF00;
            border-radius: 50%;
            top: 150px;
            left: 100px;
        }
 
        .item:before {
            content: '';
            display: block;
            width: 14px;
            height: 14px;
            border-radius: 50%;
            opacity: .7;
            background-color: #FFFF00;
            animation: scaless 1s infinite cubic-bezier(0, 0, .49, 1.02);
        }
    </style>
</head>
<body>
    <div class="circle-wrap">
        <div class="circle">
            <div class="big-circle"></div>
            <div class="small-circle"></div>
        </div>
    </div>
    <div class="smallcircle2"></div>
    <div class="bigcircle2"></div>
    <div class="item"></div>
</body>
</html>

這個(gè)效果的具體實(shí)現(xiàn)主要是用到了CSS3 的animation

它共有8個(gè)屬性:

animation-name 規(guī)定 @keyframes 動(dòng)畫的名稱。
用來(lái)定義一個(gè)動(dòng)畫的名稱。
如果要設(shè)置幾個(gè)animation給一個(gè)元素,我們只需要以列表的形式,用逗號(hào)“,”隔開

animation-duration 動(dòng)畫時(shí)長(zhǎng)

用來(lái)指定元素播放一個(gè)周期的動(dòng)畫所持續(xù)的時(shí)間長(zhǎng),單位為秒(s)或毫秒(ms),默認(rèn)值為0

animation-timing-function 規(guī)定動(dòng)畫的速度曲線。默認(rèn)是 “ease”。
linear 規(guī)定以相同速度開始至結(jié)束的過(guò)渡效果(等于 cubic-bezier(0,0,1,1))。 ease 規(guī)定慢速開始,然后變快,然后慢速結(jié)束的過(guò)渡效果(cubic-bezier(0.25,0.1,0.25,1))。
ease-in 規(guī)定以慢速開始的過(guò)渡效果(等于 cubic-bezier(0.42,0,1,1))。
ease-out 規(guī)定以慢速結(jié)束的過(guò)渡效果(等于 cubic-bezier(0,0,0.58,1))。
ease-in-out 規(guī)定以慢速開始和結(jié)束的過(guò)渡效果(等于 cubic-bezier(0.42,0,0.58,1))。
cubic-bezier(n,n,n,n) 在 cubic-bezier 函數(shù)中定義自己的值??赡艿闹凳?0 至 1 之間的數(shù)值。

animation-delay 規(guī)定動(dòng)畫何時(shí)開始。默認(rèn)是 0。允許負(fù)值,動(dòng)畫跳過(guò) 2 秒進(jìn)入動(dòng)畫周期,也就是從2s的動(dòng)畫開始

animation-iteration-count 規(guī)定動(dòng)畫被播放的次數(shù)。默認(rèn)是 1

animation-direction 規(guī)定動(dòng)畫是否在下一周期逆向地播放。默認(rèn)是 “normal”。

animation-fill-mode 規(guī)定動(dòng)畫在播放之前或之后,其動(dòng)畫效果是否可見。

animation-play-state 規(guī)定動(dòng)畫是否正在運(yùn)行或暫停。默認(rèn)是 “running”。

綜合起來(lái)簡(jiǎn)寫

animation : name duration timing-function delay iteration-count direction fill-mode play-state

原文:https://blog.csdn.net/qq_34576876/article/details/95532946

           https://blog.csdn.net/weixin_42541698/article/details/102686976

到此這篇關(guān)于純CSS3實(shí)現(xiàn)圓圈動(dòng)態(tài)發(fā)光特效動(dòng)畫的示例代碼的文章就介紹到這了,更多相關(guān)CSS3圓圈動(dòng)態(tài)發(fā)光內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持腳本之家!

標(biāo)簽:銅陵 焦作 無(wú)錫 欽州 試駕邀約 綏化 湘西 湖北

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《純CSS3實(shí)現(xiàn)圓圈動(dòng)態(tài)發(fā)光特效動(dòng)畫的示例代碼》,本文關(guān)鍵詞  純,CSS3,實(shí)現(xiàn),圓圈,動(dòng)態(tài),;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 下面列出與本文章《純CSS3實(shí)現(xiàn)圓圈動(dòng)態(tài)發(fā)光特效動(dòng)畫的示例代碼》相關(guān)的同類信息!
  • 本頁(yè)收集關(guān)于純CSS3實(shí)現(xiàn)圓圈動(dòng)態(tài)發(fā)光特效動(dòng)畫的示例代碼的相關(guān)信息資訊供網(wǎng)民參考!
  • 推薦文章
    民丰县| 武清区| 北流市| 布拖县| 佛学| 宜兰县| 沙洋县| 濉溪县| 阳曲县| 江西省| 龙门县| 阿勒泰市| 金坛市| 黄山市| 丽水市| 贵阳市| 阳高县| 明星| 崇阳县| 东丽区| 天气| 喀什市| 高台县| 楚雄市| 东兰县| 旬邑县| 伊宁县| 昆明市| 寿光市| 宿州市| 波密县| 水城县| 富阳市| 临沭县| 宁河县| 淅川县| 措美县| 汾阳市| 焦作市| 婺源县| 冷水江市|