css - 为什么我的第一个 svg 路径设置仅在 Safari 中恢复为原始状态?
问题描述
我有一个 svg 中两条路径的笔画动画。基本上当svg进入视口并添加类“draw”时,通过js添加一个类。
它在除 safari 之外的所有浏览器中都能完美运行。我的 safari 版本都是 13+,所以我认为它与前缀无关。我完全糊涂了,因为第二条路径停留在它的最终状态。第一个在动画发生后返回。
那是我的 CSS 代码:
.drawn-connection-line {
.arrow-stroke {
stroke-dasharray: 444px;
stroke-dashoffset: 444px;
}
.arrowhead {
stroke-dasharray: 66px;
stroke-dashoffset: 66px;
}
}
.drawn-connection-line.draw {
.arrow-stroke {
animation-name: draw-connection-line-body;
animation-duration: 0.5s;
animation-direction: normal;
-webkit-animation-fill-mode: forwards;
animation-fill-mode: forwards;
animation-timing-function: cubic-bezier(.3,.03,.75,.96);
}
.arrowhead {
animation-name: draw-connection-line-head;
animation-duration: 0.4s;
animation-delay: 0.5s;
animation-direction: normal;
animation-fill-mode: forwards;
animation-timing-function: cubic-bezier(.29,.38,.48,1);
}
}
@keyframes draw-connection-line-body {
from {
stroke-dashoffset: 444px;
}
to {
stroke-dashoffset: 0px;
}
}
@keyframes draw-connection-line-head {
from {
stroke-dashoffset: 66px;
}
to {
stroke-dashoffset: 0px;
}
}
“arrow-stroke” 和 “arrowhead” 是 svg 内路径的类。“arrow-stroke”是第一个。
预先感谢您的帮助。
解决方案
推荐阅读
- importerror - LimeSurvey 附加属性不起作用(CSV 上传)
- mobile - angular2 nativescript 中的安全密钥或敏感数据
- c++ - comma in function arguments causes strange argument split in codeblocks
- android - React-Native 多部分照片上传在 android 中不起作用
- blockchain - 我们可以在多链中编写查询,例如 select * from Stream1.key1 where key1.value = “xyz”
- adobe - Adobe Acrobat Reader - 光标不会消失
- javascript - 用 express 更新了一个文档
- ios - 使用共享扩展将图像保存到文档文件夹
- javascript - 在脚本中添加图像路径以从 json 文件中获取图像
- android - 如何在 Android 中使用 SQLite 将 TABLE ID AUTO_INCREMENT 传递给另一个多表