<nav>
  <div class="logo heading">
    Vinci
  </div>
  <ul>
    <li>
      <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-search" width="26" height="26" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
        <path stroke="none" d="M0 0h24v24H0z" />
        <circle cx="10" cy="10" r="7" />
        <line x1="21" y1="21" x2="15" y2="15" />
      </svg>
    </li>
    <li>
      <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-menu" width="26" height="26" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
        <path stroke="none" d="M0 0h24v24H0z" />
        <line x1="4" y1="8" x2="20" y2="8" />
        <line x1="4" y1="16" x2="20" y2="16" />
      </svg>
    </li>
  </ul>
</nav>
<div class="absolute-wrapper">
  <div class="colored-backgrounds">
    <div></div>
    <div></div>
    <div></div>
    <div></div>
  </div>
</div>
<main>
  <div class="content">
    <div class="heading">
      <h1>Portrait Love</h1>
      <p>
        A portrait is a painting, photograph,<br />
        sculpture, or other artistic representation<br />
        of a person, in which the face and its<br />
        expression is predominant.
      </p>
      <button type="button">View Portraits</button>
    </div>
  </div>
  <div class="wrapper">
    <div class="images">
      <div class="image"></div>
      <div class="image"></div>
      <div class="image"></div>
      <div class="image"></div>
    </div>
  </div>
  <div class="navigation">
    <div class="right">
      <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-right" width="26" height="26" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
        <path stroke="none" d="M0 0h24v24H0z" />
        <polyline points="9 6 15 12 9 18" />
      </svg>
    </div>
    <div class="left">
      <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-left" width="26" height="26" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
        <path stroke="none" d="M0 0h24v24H0z" />
        <polyline points="15 6 9 12 15 18" />
      </svg>
    </div>
  </div>
</main>
@import url("https://fonts.googleapis.com/css2?family=Open+Sans&family=Playfair+Display:wght@600&display=swap");
* {
  margin: 0;
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

body {
  font-family: "Open Sans", sans-serif;
}

nav {
  height: 5rem;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  padding: 0 3.125rem;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

nav .logo {
  font-size: 1.5rem;
}

nav ul {
  list-style: none;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

nav ul li + li {
  margin-left: 2rem;
}

.heading {
  font-family: "Playfair Display", serif;
}

main {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: justify;
  -ms-flex-pack: justify;
  justify-content: space-between;
  height: calc(100vh - 5rem);
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  padding: 0 3.125rem;
}

.wrapper {
  overflow: hidden;
}

.absolute-wrapper {
  position: absolute;
  overflow: hidden;
  height: 100vh;
  width: 60%;
  top: 0;
  left: 0;
  z-index: -1;
}

.colored-backgrounds {
  position: absolute;
  height: inherit;
  width: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

.colored-backgrounds div {
  width: 100%;
  height: 100%;
  -webkit-box-flex: 1;
  -ms-flex-positive: 1;
  flex-grow: 1;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

.colored-backgrounds div:nth-child(1) {
  background-color: #d1d0c4;
}

.colored-backgrounds div:nth-child(2) {
  background-color: #adc1a8;
}

.colored-backgrounds div:nth-child(3) {
  background-color: #d3d8d6;
}

.colored-backgrounds div:nth-child(4) {
  background-color: #d3ae99;
}

.content h1 {
  margin-bottom: 1rem;
  font-size: 3.5rem;
}

.content p {
  margin-bottom: 1.5rem;
  font-family: open sans;
}

.content button {
  border: none;
  background-color: #7bcc3c;
  text-transform: uppercase;
  letter-spacing: 3px;
  padding: 1rem 2.5rem;
  cursor: pointer;
}

.content button:active {
  -webkit-transform: scale(0.96);
  transform: scale(0.96);
}

.images {
  width: 350px;
  height: 500px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
}

.images .image {
  height: 100%;
  width: 100%;
  -webkit-box-flex: 1;
  -ms-flex-positive: 1;
  flex-grow: 1;
  -ms-flex-negative: 0;
  flex-shrink: 0;
}

.image:nth-child(1) {
  background: url("https://vikram-hegde.github.io/ui-animation/images/image1.png")
    no-repeat 50% 50% / cover;
}

.image:nth-child(2) {
  background: url("https://vikram-hegde.github.io/ui-animation/images/image2.png")
    no-repeat 50% 50% / cover;
}

.image:nth-child(3) {
  background: url("https://vikram-hegde.github.io/ui-animation/images/image3.png")
    no-repeat 50% 50% / cover;
}

.image:nth-child(4) {
  background: url("https://vikram-hegde.github.io/ui-animation/images/image4.png")
    no-repeat 50% 50% / cover;
}

.navigation .right,
.navigation .left {
  height: 60px;
  width: 60px;
  border: 1px solid #333;
  border-radius: 50%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  margin-top: 1rem;
  cursor: pointer;
}

.navigation .right:hover,
.navigation .left:hover {
  background-color: #333;
  color: white;
}

.navigation .right:active,
.navigation .left:active {
  -webkit-transform: scale(0.96);
  transform: scale(0.96);
}

.images,
.colored-backgrounds {
  -webkit-transition: -webkit-transform 0.35s
    cubic-bezier(0.39, 0.575, 0.565, 1);
  transition: -webkit-transform 0.35s cubic-bezier(0.39, 0.575, 0.565, 1);
  transition: transform 0.35s cubic-bezier(0.39, 0.575, 0.565, 1);
  transition: transform 0.35s cubic-bezier(0.39, 0.575, 0.565, 1),
    -webkit-transform 0.35s cubic-bezier(0.39, 0.575, 0.565, 1);
}

.colored-backgrounds {
  -webkit-transition-delay: 150ms;
  transition-delay: 150ms;
}
const navLeft = document.querySelector(".left");
const navRight = document.querySelector(".right");

const images = document.querySelector(".images");
const colors = document.querySelector(".colored-backgrounds");

let index = 0;

function right() {
  transform((index = index < 3 ? ++index : 0));
}

function left() {
  transform((index = index > 0 ? --index : 3));
}

navLeft.addEventListener("click", left);
navRight.addEventListener("click", right);

function transform(index) {
  images.style.transform = `translateX(-${index * 100}%)`;
  colors.style.transform = `translateX(-${index * 100}%)`;
}
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.