Add Your Heading Text Here

Carousel Charlie CSS


.carousel-charlie {
  /* Responsive slide gap
   12px → 24px, fluid between
   Tuned to avoid tablet over-spacing */
  --cc-gap: clamp(0.75rem, 1.147vw + 0.521rem, 1.5rem);

  /* EDIT HERE — transition speed */
  --cc-duration: 1500ms;

  /* EDIT HERE — easing curve */
  --cc-ease: cubic-bezier(0.22, 1, 0.36, 1);

  /* EDIT HERE — side slide styling */
  --cc-side-opacity: 0.5;
  --cc-blur: 5px;

  /* EDIT HERE — arrow button position and size */
  --cc-nav-inset: 1rem; /* 16px */
  --cc-nav-size: 2.75rem; /* 44px */

  /* EDIT HERE — arrow circle backgrounds */
  --cc-nav-bg: rgba(0, 0, 0, 0.5);
  --cc-nav-bg-hover: rgba(0, 0, 0, 0.7);

  /* internal state (JS sets this) */
  --cc-index: 0;
}

/* ----- viewport / track: force off-canvas visibility + layout ----- */

.carousel-charlie__viewport {
  position: relative;
  overflow: visible !important;
  user-select: none;
  -webkit-user-select: none;

  /* allow vertical scroll, we’ll prevent default only on horizontal swipe in JS */
  touch-action: pan-y;
}

.carousel-charlie__track {
  display: flex !important;
  gap: var(--cc-gap) !important;
  overflow: visible !important;

  /* IMPORTANT: uses --cc-gap (px) so the step math matches your current behaviour */
  --cc-step: calc(100% + var(--cc-gap));
  transform: translateX(calc(var(--cc-index) * var(--cc-step) * -1));
  transition: transform var(--cc-duration) var(--cc-ease);
  will-change: transform;
}

/* ----- slides: force 16:9 and the “active vs side” look ----- */

.carousel-charlie__slide {
  flex: 0 0 100% !important;
  margin: 0 !important; /* kill default figure margins */
  aspect-ratio: 16 / 9;

  /* EDIT HERE — image border radius */
  border-radius: 1rem; /* 16px */

  overflow: hidden;

  opacity: var(--cc-side-opacity) !important;
  filter: blur(var(--cc-blur)) !important;

  transition:
    opacity var(--cc-duration) var(--cc-ease),
    filter var(--cc-duration) var(--cc-ease);
}

.carousel-charlie__slide.is-active {
  opacity: 1 !important;
  filter: blur(0) !important;
}

.carousel-charlie__slide.is-prev,
.carousel-charlie__slide.is-next {
  opacity: var(--cc-side-opacity) !important;
  filter: blur(var(--cc-blur)) !important;
}

.carousel-charlie__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* ----- nav buttons: force visible, locked position, above slides ----- */

.carousel-charlie__nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--cc-nav-size);
  height: var(--cc-nav-size);

  border: 0;
  padding: 0;

  /* keep giant radius so it's always a circle */
  border-radius: 62.4375rem; /* 999px */

  /* EDIT HERE — arrow circle background */
  background-color: var(--cc-nav-bg);

  color: #ffffff;

  display: grid !important;
  place-items: center;

  cursor: pointer;
  z-index: 9999; /* ensure it sits above images */
}

.carousel-charlie__nav-button:hover {
  /* EDIT HERE — hover background */
  background-color: var(--cc-nav-bg-hover);
}

.carousel-charlie__nav-button-previous {
  left: var(--cc-nav-inset);
}

.carousel-charlie__nav-button-next {
  right: var(--cc-nav-inset);
}

.carousel-charlie__nav-icon {
  width: 1.25rem; /* 20px */
  height: 1.25rem; /* 20px */
  display: block;
}

/* disabled */
.carousel-charlie__nav-button.is-disabled,
.carousel-charlie__nav-button:disabled {
  opacity: 0.2 !important;
  cursor: default;
  pointer-events: none;
}

/* =========================================================
   RESPONSIVE — NAV BUTTON SIZE (CLAMP)
   ---------------------------------------------------------
   Makes the arrow buttons smaller on mobile, up to full size
   on desktop.

   EDIT HERE:
   - min: mobile button size
   - mid: fluid scaling term
   - max: desktop button size
   ========================================================= */

@media (max-width: 1024px) {
  .carousel-charlie {
    --cc-nav-size: clamp(1.5rem, 1.912vw + 1.118rem, 2.75rem);
    /* 34px min  → fluid → 44px max */
  }

  /* =========================================================
   MICRO MOBILE FIX (≤ 420px)
   - Prevent the huge off-canvas “ghost slide” on tiny screens
   - Keep everything else the same
   ========================================================= */

  @media (max-width: 420px) {
    .carousel-charlie__viewport {
      overflow: hidden !important;
    }

    /* Optional: tighten arrow placement a touch on tiny screens */
    .carousel-charlie {
      --cc-nav-inset: 0.5rem; /* 8px */
    }
  }
}

}

How can we help you?

Let’s meet?

Logos

A collection of some of the logos I have created over the years.