我制作了一个具有背景图像的页面,当用户滚动时,它应该放大并突出显示页面的不同部分。它在桌面版 Chrome 上以及当我在开发工具中进行响应式视图时效果非常好。然而,当我在手机上尝试时,它一点也不起作用。
我尝试更改背景图像的大小以及其他内容,但由于某种原因它保持在一种大小并且根本没有动画。 这是页面
body {
min-height: 100vh;
background: url(./sebastian-svenson-d2w-_1LJioQ-unsplash.jpg) no-repeat center center fixed;
background-color: hsl(214, 34%, 13%);
background-size: cover;
animation: zoom linear;
animation-timeline: view();
}
@keyframes zoom {
0%,25% {
background-size: 300%;
background-position: center;
}
33% {
background-size: 400%;
background-position: right center;
}
66% {
background-size: 400%;
background-position: 40% center;
}
100% {
background-size: 600%;
background-position: top center;
}
}