這是我到目前為止編碼的Codepen。
可以忽略背景圖片和其他元素。只需要獲取標題的影片(即黃色)和右下方的串列。關于如何改進這一點的任何想法?
body {
background-color: purple;
}
h1 {
text-align: center;
text-transform: uppercase;
background-color: transparent;
color: yellow;
width: auto;
transform: translate3d(0, 200px, 0);
font-size: 42px;
line-height: 48px;
}
h1 span {
opacity: 0;
display: inline-block;
transform: translateY(10px);
}
ul {
list-style: none;
margin: 50px auto 0 auto;
padding: 0;
width: 300px;
opacity: 0;
}
ul li {
list-style: none;
padding: 15px;
border: solid 1px #fff;
margin-bottom: 10px;
border-radius: 15px;
cursor: pointer;
color: #fff;
transition: all 0.5s ease;
}
ul li:hover {
background-color: #fff;
color: #333;
}
@keyframes slideUpHeading {
from {
transform: translate3d(0, 200px, 0);
font-size: 42px;
line-height: 48px;
}
to {
font-size: 24px;
line-height: 30px;
transform: translate3d(0, 0, 0);
}
}
.slideUpHeading {
animation-name: slideUpHeading;
animation-delay: 2s;
animation-duration: 0.6s;
transform-origin: center bottom;
animation-fill-mode: both;
animation-timing-function: cubic-bezier(1, 1, 2, 2);
}
@keyframes slideUpText {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.slideUpText {
animation-name: slideUpText;
animation-duration: 0.6s;
transform-origin: center bottom;
animation-fill-mode: both;
animation-timing-function: cubic-bezier(0.17, 0.88, 0.32, 1.5);
}
.animation_delay1 {
animation-delay: 0.2s;
}
.animation_delay2 {
animation-delay: 0.45s;
}
.animation_delay3 {
animation-delay: 0.9s;
}
.animation_delay4 {
animation-delay: 1.2s;
}
@keyframes slideUpList {
from {
opacity: 0;
transform: translateY(50px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.slideUpList {
animation-name: slideUpList;
animation-duration: 0.6s;
animation-delay: 2.65s;
transform-origin: center bottom;
animation-fill-mode: both;
animation-timing-function: cubic-bezier(0.17, 0.88, 0.32, 1.2);
}
<h1 class="slideUpHeading">
<span class="slideUpText animation_delay1">Lorem</span><br>
<span class="slideUpText animation_delay2">ipsum</span><br>
<span class="slideUpText animation_delay3">dolor sit</span><br>
<span class="slideUpText animation_delay4">amet</span>
</h1>
<ul class="slideUpList">
<li>consectetur adipiscing elit</li>
<li>consectetur adipiscing elit</li>
<li>consectetur adipiscing elit</li>
<li>consectetur adipiscing elit</li>
</ul>
uj5u.com熱心網友回復:
除了底部串列影片延遲外,一切看起來都不錯。我已經調整了所有影片持續時間......看看。
body {
background-color: purple;
font-family: 'Archivo Black', sans-serif;
}
h1 {
text-align: center;
text-transform: uppercase;
background-color: transparent;
color: yellow;
width: auto;
transform: translate3d(0, 200px, 0);
font-size: 42px;
line-height: 48px;
}
h1 span {
opacity: 0;
display: inline-block;
transform: translateY(10px);
}
ul {
list-style: none;
margin: 50px auto 0 auto;
padding: 0;
width: 300px;
opacity: 0;
}
ul li {
list-style: none;
padding: 15px;
border: solid 1px #fff;
margin-bottom: 10px;
border-radius: 15px;
cursor: pointer;
color: #fff;
transition: all 0.5s ease;
}
ul li:hover {
background-color: #fff;
color: #333;
}
@keyframes slideUpHeading {
from {
transform: translate3d(0, 200px, 0);
font-size: 42px;
line-height: 48px;
}
to {
font-size: 24px;
line-height: 30px;
transform: translate3d(0, 0, 0);
}
}
.slideUpHeading {
animation-name: slideUpHeading;
animation-delay: 2s;
animation-duration: 0.4s; /* It was 0.6s */
transform-origin: center bottom;
animation-fill-mode: both;
animation-timing-function: cubic-bezier(1, 1, 2, 2);
}
@keyframes slideUpText {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.slideUpText {
animation-name: slideUpText;
animation-duration: 0.4s; /* It was 0.6s */
transform-origin: center bottom;
animation-fill-mode: both;
animation-timing-function: cubic-bezier(0.17, 0.88, 0.32, 1.5);
}
.animation_delay1 {
animation-delay: 0.2s;
}
.animation_delay2 {
animation-delay: 0.45s;
}
.animation_delay3 {
animation-delay: 0.9s;
}
.animation_delay4 {
animation-delay: 1.2s;
}
@keyframes slideUpList {
from {
opacity: 0;
transform: translateY(50px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.slideUpList {
animation-name: slideUpList;
animation-duration: 0.4s; /* It was 0.6s */
animation-delay: 2.20s; /* It was 2.65s */
transform-origin: center bottom;
animation-fill-mode: both;
animation-timing-function: cubic-bezier(0.17, 0.88, 0.32, 1.2);
}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Archivo Black&family=Fredoka One&display=swap" rel="stylesheet">
<h1 class="slideUpHeading">
<span class="slideUpText animation_delay1">which</span><br>
<span class="slideUpText animation_delay2">statement</span><br>
<span class="slideUpText animation_delay3">best describes</span><br>
<span class="slideUpText animation_delay4">you?</span> <!-- Added : question mark ;) -->
</h1>
<ul class="slideUpList">
<li>Picking up a new skill</li>
<li>Picking up a new skill</li>
<li>Picking up a new skill</li>
<li>Picking up a new skill</li>
</ul>
Play here
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/335520.html
上一篇:Javafx插值預測/過沖
