网站首页 美食营养 游戏数码 手工爱好 生活家居 健康养生 运动户外 职场理财 情感交际 母婴教育 生活知识 生活百科 知识问答 更多知识

HTML5分段式SVG文字动画

时间:2026-03-05 08:09:28

1、新建html文档。

    <nav class="zzsc-demos"> <a class="current-demo" href="iml">Examples</a> <a href="#">Alabet</a> </nav>

  </header>

  <section class="content">

    <ul class="list">

      <li class="list__item color-1">

        <h3 class="list__text">ashin</h3>

        <button class="control__button control__button--play" aria-label="Trigger ation"> <svg class="control__vector" aria-hidden="true" role="img" viewBox="0 0 60 60">

        <use xlink:href="#icon-play"></use>

        </svg> </button>

      </li>

      <li class="list__item color-2">

        <h3 class="list__text">bogyoke</h3>

        <button class="control__button control__button--play" aria-label="Trigger anation"> <svg class="control__vector" aria-hidden="true" role="img" viewBox="0 0 60 60">

        <use xlink:href="#icon-play"></use>

        </svg> </button>

      </li>

      <li class="list__item color-3">

        <h3 class="list__text">nang</h3>

        <button class="control__button control__button--play" aria-label="Trigger mation"> <svg class="control__vector" aria-hidden="true" role="img" viewBox="0 0 60 60">

        <use xlink:href="#icon-play"></use>

        </svg> </button>

      </li>

HTML5分段式SVG文字动画

3、书写css代码。

.related a:hover, .related a:active { opacity: 1; }

.related a img { max-width: 100%; opacity: 0.8; border-radius: 4px; }

.related a:hover img, .related a:active img { opacity: 1; }

.related h3 { font-family: "Microsoft YaHei", sans-serif; }

.related a h3 { font-weight: 300; margin-top: 0.15em; color: #fff; }

/* icomoon */

.icon-zzsc-home-outline:before { content: "\e5000"; }

.icon-zzsc-arrow-forward-outline:before { content: "\e5001"; }

 @media screen and (max-width: 50em) {

.demo-1 .zzsc-header { background: none; }

.demo-1 .zzsc-header h1 { font-size: 8vw; }

.grid__item { width: 100%; }

}

 @media screen and (max-width: 40em) {

.zzsc-header h1 { font-size: 1.85em; }

}

HTML5分段式SVG文字动画

4、书写并添加js代码。

<script>

(function() {

var decoLetter = new Letters(document.querySelector('.deco'), {

size: 1000,

weight: 5,

color: '#212028',

//color: '#63646B',

duration: 2,

fade:0,

easing: d3_ease.easeExpOut.ease

});

decoLetter.hideInstantly();

setTimeout(function() {

decoLetter.show();

}, 200);

})();

</script> 

<script src="js/mo.min.js"></script> 

<script src="js/demo-1.js"></script>

HTML5分段式SVG文字动画

5、代码整体结构。

HTML5分段式SVG文字动画

6、查看效果。

HTML5分段式SVG文字动画

© 2026 海能知识库
信息来自网络 所有数据仅供参考
有疑问请联系站长 site.kefu@gmail.com