Почему мой css не работает, несмотря на то, что работает прозрачность? - PullRequest
0 голосов
/ 21 апреля 2020

Добрый вечер всем

Я читал учебник на YouTube и пытался анимировать фон, поле должно было go вверх, но я столкнулся с проблемой в анимации моего кода. непрозрачность работает, но поле никогда не увеличивается. Я перепробовал все решения, но ничего не получалось

<div class="row justify-content-center content" >
    <div class="col-md-6" style="margin-top: 10%">
        -- content -- 
    </div>
</div>

<div class="animation-area">

    <ul class="box-area">
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
        <li></li>
    </ul>
</div>

В результате получается следующее: enter image description here

Я перепробовал все решения здесь переполнение стека, но все еще не работает, Непрозрачность работает, но переводитьY не работает

My CSS:

* {
    margin: 0;
    padding: 0;
}

.content {
    position: absolute;
    width: 100%;
}

.animation-area {
    background: linear-gradient(to left, #8942a8, #ba382f);
    height: 100vh;
    width: 100%;
}

.box-area {
    top: 0;
    left: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    /* overflow: hidden; */
}

.box-area li {
    position: absolute;
    display: block;
    list-style: none;
    width: 25px;
    height: 25px;
    background: rgba(255, 255, 255, 0.2);
    animation: animate 20s linear infinite;
    -webkit-animation: animate 20s linear infinite;
    bottom: 0;
    clip-path: polygon(0% 0%, 0% 100%, 20% 100%, 20% 20%, 80% 20%, 80% 80%, 20% 80%, 20% 100%, 100% 100%, 100% 0%);
    -webkit-clip-path: polygon(0% 0%, 0% 100%, 20% 100%, 20% 20%, 80% 20%, 80% 80%, 20% 80%, 20% 100%, 100% 100%, 100% 0%);

}

.box-area li:nth-child(1){
    left: 86%;
    width: 80px;
    height: 80px;
    animation-delay: 0s;
}

.box-area li:nth-child(2){
    left: 12%;
    width: 30px;
    height: 30px;
    animation-delay: 1.5s;
    animation-duration: 10s;
}

.box-area li:nth-child(3){
    left: 70%;
    width: 150px;
    height: 150px;
    animation-delay: 5.5s;
    animation-duration: 10s;
}

.box-area li:nth-child(4){
    left: 40%;
    width: 150px;
    height: 150px;
    animation-delay: 0s;
    animation-duration: 15s;
}

.box-area li:nth-child(5){
    left: 65%;
    width: 40px;
    height: 40px;
    animation-delay: 0s;
    animation-duration: 15s;
}


.box-area li:nth-child(6){
    left: 15%;
    width: 110px;
    height: 110px;
    animation-delay: 3.5s;
    animation-duration: 15s;
}

@-webkit-keyframes animate {
    0% {
        transform: translateX(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(-800) rotate(360deg);
        opacity: 0;
    }
}
...