<div class="container">
        <div id="1" class="panel active" style="background-image: url('https://source.unsplash.com/random');">
            <h3>Come visit!</h3>
        </div>
        <div id="2" class="panel" style="background-image: url('https://source.unsplash.com/random');">
            <h3>Know our culture</h3>
        </div>
        <div id="3" class="panel" style="background-image: url('https://source.unsplash.com/random');">
            <h3>You can see our truck</h3>
        </div>
        <div id="4" class="panel" style="background-image: url('https://source.unsplash.com/random');">
            <h3>Know our leader</h3>
        </div>
    </div>
@import url('https://fonts.googleapis.com/css2?family=KoHo:wght@400&display=swap');

* {
    box-sizing: border-box;
}

body {
    font-family: 'KoHo', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    overflow: hidden;
    margin: 0;
}

.container {
    display: flex;
    width: 90vw;
}

.panel {
    background-size: auto auto;
    background-position: center;
    background-repeat: no-repeat;
    height: 80vh;
    border-radius: 50px;
    color: white;
    cursor: pointer;
    flex: 0.5;
    margin: 10px;
    transition: flex 0.7s ease-in;
    position: relative;
}

.panel h3 {
    font-size: 24px;
    position: absolute;
    bottom: 20px;
    left: 20px;
    margin: 0;
    opacity: 0;
}


.panel.active {
    flex: 6;
}

.panel.active h3 {
    opacity: 1;
    transition: opacity 0.3s ease-in 0.4s;
}

@media(max-width: 480px) {
    .container {
        width: 100vw;
    }

    .panel.active {
        flex: 5;
    }

    .panel:nth-of-type(4) {
        display: none;
    } 
}
const panels = document.querySelectorAll(".panel");

function toggleClass(event) {
  panels.forEach( (el) => {       el.classList.remove("active")
  });
  
  event.target.classList.add("active");
}

panels.forEach((el) => el.addEventListener("click", toggleClass));

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.