【发布时间】:2018-01-24 23:44:21
【问题描述】:
我正在尝试使用 CSS 和/或 JavaScript 来模仿下面显示的动画。我已经创建了开始步骤,但无法弄清楚如何为部分放大设置动画。
body {
background-color: #222;
}
.container {
background-image: url(test.jpg);
height: 96vh;
width: 100%;
}
.box {
background-color: #fff;
height: 98vh;
width: 100%;
}
.big {
font-size: 17vw;
background: url(http://viralsweep.com/blog/wp-content/uploads/2015/02/unsplash.jpg) 33px 659px;
-webkit-text-fill-color: transparent;
-webkit-background-clip: text;
padding-top: 24vh;
margin-top: 0;
text-align: center;
animation: opac 2s infinite;
}
@keyframes opac {
0%, 100% {
/*rest the move*/
}
50% {
/*move some distance in y position*/
}
}
<div class="container">
<div class="box">
<h1 class="big">TRY THIS</h1>
</div>
<!--end of box-->
</div>
<!--end of conatiner-->
【问题讨论】:
-
嗯,这不是故障排除。尽管您提供了有效的尝试,但恐怕您的要求太多。我会试一试,但没有承诺,因为这个问题可以结束。
-
您能否为您所询问的代码命名一个可靠/官方的来源?即便是这样的来源的一个例子,无论如何,如果这种代码不可用?
标签: javascript html css css-animations