body {
    margin: 0;
    height: 100vh;
    background-color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.image-container {
    position: relative;
    width: 768px;
    height: 500px;
    overflow: hidden;
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 2s; /* This determines the fade duration. Change the "2s" as needed */
}

.image-container img.active {
    opacity: 1;
}

@media screen and (max-width: 768px) {
    .image-container {
        width: 100%;
        padding-bottom: 65.1041667%; /* aspect ratio of 500/768 */
        height: auto;
    }
}
