jquery文本文字星星闪烁CSS3动画特效代码

所属分类: 网页特效-动画效果    2023-08-30 09:05:14

jquery文本文字星星闪烁CSS3动画特效代码 ie兼容6
 查看演示  登录后下载 温馨提示
登录会员即可享受免费下载
 我要建站

jquery文本文字星星闪烁CSS3动画特效代码(共7个文件)

    • Style.css
    • SparklingStars.js
    • r-right.svg
    • r-left.svg
    • sparkle.svg
    • index.html
    • SparklingStars.css

使用方法

function initSparkling() {
    // settings
    const color = "#FFC700";
    const svgPath = 'M26.5 25.5C19.0043 33.3697 0 34 0 34C0 34 19.1013 35.3684 26.5 43.5C33.234 50.901 34 68 34 68C34 68 36.9884 50.7065 44.5 43.5C51.6431 36.647 68 34 68 34C68 34 51.6947 32.0939 44.5 25.5C36.5605 18.2235 34 0 34 0C34 0 33.6591 17.9837 26.5 25.5Z';

    // sparkling effect
    let sparkling = function() {
        $('.sparkling').each(function() {
            let sparklingElement = $(this);
            let stars = sparklingElement.find('.star');

            // remove the first star when more than 6 stars existing
            if(stars.length > 5) {
                stars.each(function(index) {
                    if(index === 0) {
                        $(this).remove();
                    }
                });
            }
            // add a new star
            sparklingElement.append(addStar());
        });

        let rand = Math.round(Math.random() * 700) + 100;
        setTimeout(sparkling, rand);
    }
			
    // star
    let addStar = function() {
        let size = Math.floor(Math.random() * 20) + 10;
        let top = Math.floor(Math.random() * 100) - 50;
        let left = Math.floor(Math.random() * 100);

        return '<span class="star" style="top:' + top + '%; left:' + left + '%;">'
            + '<svg width="' + size + '" height="' + size + '" viewBox="0 0 68 68" fill="none">'
            + '<path d="' + svgPath + '" fill="' + color + '" /></svg></span>';
    }

    // execute
    sparkling();
}

$(function() {
    // init sparkling stars
    initSparkling();
});

站长提示:
1. 苦力吧素材官方QQ群:950875342
2. 平台上所有素材资源,需注册登录会员方能正常下载。
3. 会员用户积极反馈网站、素材资源BUG或错误问题,每次奖励2K币
4. PHP源码类素材,如需协助安装调试,或你有二次开发需求,可联系苦力吧客服。
5. 付费素材资源,需充值后方能下载,如有任何疑问可直接联系苦力吧客服
相关资源 / 动画效果

jquery动态旋转的3D标签云插件

一款动态旋转标签云特效代码,3D立体感自动旋转,很实用的动画特效。
  动画效果
 2902  0

原生js实现精美放羊动画效果

原生js羊群走动动画效果,支持鼠标拖拽小羊放置任何位置。
  动画效果
 21078  0

jquery基于SVG可自定义的模拟时速表仪表盘插件

一款css仪表盘插件,它基于SVG和JavaScript在页面上绘制的,可自定义默认数值和其它参数。
  动画效果
 5644  0

纯CSS3实现的水平进度条加载动画特效

一款黑色风格进度条加载动画效果,人推圆球进度条动画。
  动画效果
 5711  0

评论数(0) 回复有机会获得K币 用户协议

^_^ 还没有人评论,快来抢个沙发!
😀
  • 😀
  • 😊
  • 😂
  • 😍
  • 😑
  • 😷
  • 😵
  • 😛
  • 😣
  • 😱
  • 😋
  • 😎
  • 😵
  • 😕
  • 😶
  • 😚
  • 😜
  • 😭
发表评论