Login to follow
CSS Carousal

CSS Carousal (ODC)

Stable version 0.1.0 (Compatible with ODC)
Uploaded on 4 Feb by EONE TECHNOLOGIES PRIVATE LIMITED
CSS Carousal

CSS Carousal (ODC)

Details
Detailed Description

This CSS-only carousel is a cutting-edge UI component that achieves high-end interactivity without JavaScript by using the experimental CSS Scroll Snap 2 and Anchor Positioning APIs.

Core Architecture

  • Zero-JS Logic: It utilizes ::scroll-marker and ::scroll-button pseudo-elements to automatically generate functional navigation dots and "Next/Prev" arrows.

  • Precision Snapping: The scroll-snap-type: x mandatory property ensures slides lock perfectly into the center, while scroll-initial-target (via the scroll-start class) defines the default active slide on page load.

  • Responsive Scaling: The container uses width: min(calc(100% - 2rem), 700px), allowing it to be responsive while capping its maximum size.


Visual Design & UX

  • State-Aware Effects: Using @container scroll-state(snapped: inline), the carousel detects the "active" slide. Inactive slides are automatically scaled to 0.5 and faded, creating a cinematic focal point on the center item.