.mainBox{
     background-image: url(bg.jpg);
  background-size: cover;
  animation: backgroundMove 15s ease infinite;
  width: 100%;
  height:150vh;
  overflow: hidden;
  background-repeat: no-repeat;
}
@keyframes backgroundMove {
    0%{
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}
.login-2.login-background .cube {
    position: absolute;
    top: 80vh;
    right: 200px;
    width: 10px;
    height: 10px;
    border: solid 1px red;
    transform-origin: top left;
    transform: scale(0) rotate(0deg) translate(-50%, -50%);
    animation: cube 6s ease-in forwards infinite;
}

    .login-2.login-background .cube:nth-child(2n) {
        border-color: #00cad4;
    }

    .login-2.login-background .cube:nth-child(2) {
        animation-delay: 2s;
        right: 300px;
        border-color: yellow;
        top: 200px;
    }

    .login-2.login-background .cube:nth-child(3) {
        animation-delay: 3s;
        left: 90px;
        top: 150px;
        border-color: #a26d39;
    }

    .login-2.login-background .cube:nth-child(4) {
        animation-delay: 4s;
        left: 27%;
        top: 200px;
    }

    .login-2.login-background .cube:nth-child(5) {
        animation-delay: 5s;
        left: 10%;
        bottom: 0px;
        border-color: #ffc107;
    }

    .login-2.login-background .cube:nth-child(6) {
        animation-delay: 6s;
        right: 10%;
        top: 50%;
        border-color: aquamarine;
    }
    @keyframes Gradient {
        0% {
            background-position: 0% 50%;
        }
    
        50% {
            background-position: 100% 50%;
        }
    
        100% {
            background-position: 0% 50%;
        }
    }
    
    @keyframes cube {
        from {
            transform: scale(0) rotate(0deg) translate(-50%, -50%);
            opacity: 1;
        }
    
        to {
            transform: scale(20) rotate(960deg) translate(-50%, -50%);
            opacity: 0;
        }
    }
.login-2.login-background .cube:nth-child(2) {
    right: 100px;
    top: 100px;
}

.login-2.login-background .cube:nth-child(3) {
    left: 50px;
    top: 50px;
}

.login-2.login-background .cube:nth-child(4) {
    left: 100px;
    top: 350px;
}

.login-2.login-background .cube:nth-child(5) {
    left: 100px;
    bottom: 50px;
}

.login-2.login-background .cube:nth-child(6) {
    right: 50px;
    top: 5%;
}