Colorful

这种是 SVG 动效还是 canvas 动效?实现的思路是怎么样的?

  •  
  •   Colorful · Dec 11, 2019 · 4474 views
    This topic created in 2338 days ago, the information mentioned may be changed or developed.

    https://magi.com/search?q=python

    鼠标经过左侧的时候,会有一个动效

    这种看着简单,但是感觉实现起来有点复杂

    10 replies    2019-12-14 14:34:55 +08:00
    shenyu1996
        1
    shenyu1996  
       Dec 11, 2019
    看了下引入的 js
    是这个 https://anseki.github.io/leader-line/
    Colorful
        2
    Colorful  
    OP
       Dec 11, 2019
    @shenyu1996 我先看看,太感谢了
    Idealyouth
        3
    Idealyouth  
       Dec 11, 2019
    好像是基于 svg 的
    Colorful
        4
    Colorful  
    OP
       Dec 11, 2019
    @Idealyouth 是的
    rioshikelong121
        5
    rioshikelong121  
       Dec 11, 2019
    这种东西怎么基于 canvas 啊。 性能肯定比较差吧。乱猜一下, 得把 A,B 连接点之间的矩形全部使用 canvas 绘制?
    Colorful
        6
    Colorful  
    OP
       Dec 11, 2019
    @rioshikelong121 我不清楚,看了一些组件,大部分都是用的 SVG
    zoikhemlab
        7
    zoikhemlab  
       Dec 12, 2019
    大哥~那是右。
    Colorful
        8
    Colorful  
    OP
       Dec 12, 2019
    @zoikhemlab 我靠,居然是右,我一直以为是左了,经常左右,傻傻分不清
    iamgqb
        9
    iamgqb  
       Dec 14, 2019
    看上去就两坐标间贝塞尔一下
    iamgqb
        10
    iamgqb  
       Dec 14, 2019
    svg 本身就支持贝塞尔曲线,所以还是比较简单的 https://developer.mozilla.org/zh-CN/docs/Web/SVG/Attribute/d
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3300 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 43ms · UTC 11:55 · PVG 19:55 · LAX 04:55 · JFK 07:55
    ♥ Do have faith in what you're doing.