【发布时间】:2022-12-18 00:02:26
【问题描述】:
所以我现在正在制作一个井字游戏,我正在尝试添加一个动画来显示谁赢了。当玩家通过获得 3 个水平的东西获胜时,动画效果完美,但当他们垂直获胜时,动画会轻微晃动。有什么办法可以删除它吗?
这是该行的 CSS:
@keyframes grow-left {
0% {
width: 0;
}
100% {
width: 1;
}
}
.winLine {
position: absolute;
width: 300%;
height: var(--borderThickness);
background-color: var(--textColor);
border-radius: 1rem;
transform-origin: center;
z-index: 2;
animation: grow-left 1s ease-in-out 0s;
opacity: 1;
}
要查看该网站并了解我在说什么,请访问 GitHub 上的此链接 https://bartycoding.github.io/Tic-tac-toe/
【问题讨论】:
-
垂直获胜后,Chrome 似乎没有表现出“轻微晃动”。这是浏览器特定的问题吗?
-
经过进一步审查,在与 Chrome 垂直获胜后,可以看到非常轻微的抖动。结果可能因运行此 CSS 动画的系统上的不同图形处理器而异。
标签: css css-animations