前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >随便做的svg动画

随便做的svg动画

作者头像
用户3258338
发布2021-01-04 15:07:11
1K0
发布2021-01-04 15:07:11
举报

?

备忘:

1.

代码语言:javascript
复制
<section  x="0" y="40%" width="100%" style="height:20%;" >
    <svg width="100%" height="100%">
        <rect x="0" y="0" width="100%" height="100%" fill="#ff9902" style="fill: #ff9902;">
            <animate attributeName="y"  from="0" to="-100%"  begin="0s" dur="3s" repeatCount="indefinite" fill="freeze"></animate>
        </rect>
    </svg>
</section>
  1. svg 需要设置高度,否则高度可能会超出父元素(百叶窗)
代码语言:javascript
复制
<rect x="0" y="0" width="100%" height="100%" fill="#ff9902" style="fill: #ff9902;">
       <animate attributeName="height"  from="0" to="-100%"  begin="0s" dur="3s" repeatCount="indefinite" fill="freeze"></animate>
</rect>

2. 以上情况下atrributeName = "height"会被微信公众号的富文本编辑器过滤掉(出现在百叶窗那个例子中)

1. 卷轴

2. 百叶窗

3. 弹幕

我是一条弹幕111我是一条弹幕222我是一条弹幕333我是第3条弹幕我是第888条弹幕我是第999条弹幕我是一条很长很长很长的弹幕~~~~~我是一条很长很长很

4.点击看大图

敲我的大脑瓜子看长图

5.左右滑动试试呢?

6.底图不动,字滑动

I met you in a bathroom stall

Kissing up against the wall

Why'd you have to make me fall

Hoping you will tell me where and when

Cause I just wanna do it again

I've known you for a second, but it's more than enough

bathroom stall

Some kind of a record giving all that I've got

I met you in a bathroom stall

bathroom stall

Why'd you have to make me fall

Hoping you will tell me where and when

Cause I just wanna do it again

I've known you for a second, but it's more than enough

Some kind of a record giving all that I've got

7.长按换图

8.转圈

围着我转圈

9.逐行显示(如果没看到效果可以刷新看一下)

归去来兮辞

舟遥遥以轻飏

风飘飘而吹衣。

问征夫以前路,

恨晨光之熹微。

参考链接:

张鑫旭文章:https://www.zhangxinxu.com/wordpress/category/graphic/svg-graphic/

贝塞尔曲线工具:https://www.tweenmax.com.cn/tool/bezier/


打不倒我的,便成了我的铠甲~

本文参与 腾讯云自媒体同步曝光计划,分享自微信公众号。
原始发表:2020-12-29,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 女程序员的日常 微信公众号,前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档