Skip to content
/ kaysa Public

✨ Kaysa: Modular horizontal slider with touch controls, custom scrollbars, and responsive gap settings. Built with pure JavaScript for seamless integration.

License

Notifications You must be signed in to change notification settings

edukah/kaysa

Repository files navigation

🎠 Kaysa - Lightweight JavaScript Slider

MIT License GitHub Live Demo

✨ Kaysa: Modular horizontal slider with touch controls, custom scrollbars, and responsive gap settings. Built with pure JavaScript for seamless integration.

✨ Features

  • 🎨 Dual Configuration (JS + HTML attributes)
  • 🌓 Dark/Light Mode Support (via CSS class)
  • 📱 Mobile-friendly touch support
  • Minimal footprint, zero dependencies
  • 🔍 Interactive Help (Kaysa.manual())

📦 Installation & ⚙️ Initialization

Note: The target parameter is required and must be a valid DOM element or selector. All other options are optional.

Include in your HTML <head>

Make sure to include the stylesheet and the script:

<head>
  <link rel="stylesheet" href="dist/kaysa.min.css">
  <script type="text/javascript" src="dist/kaysa.min.js"></script>
</head>

Understanding HTML Structure

Minyatur also allows configuring behavior using data-* attributes directly in HTML. This is ideal for simple use-cases without writing JavaScript.

Example:

<div class="slider"
     data-kaysa-scroll-speed="0.7"
     data-kaysa-gap="20px"
     data-kaysa-enhanced-scrollbar="true">
  <div>Item 1</div>
  <div>Item 2</div>
  <div>Item 3</div>
</div>

Dark Mode Integration

Add .dark-mode class to <body> to activate dark theme:

<body class="dark-mode">
  <div class="slider">...</div>
</body>

🚀 Basic Usage

JavaScript Configuration

new Kaysa({
  target: '.slider',        // Required - selector or element
  scrollSpeed: 0.7,
  gap: '20px',
  enhancedScrollbar: true,
  prevButtonContent: '←',
  nextButtonContent: '→'
});

HTML Attribute Configuration

<div class="slider"
     data-kaysa-scroll-speed="0.7"
     data-kaysa-gap="20px"
     data-kaysa-enhanced-scrollbar="true"
     data-kaysa-prev-button-content=""
     data-kaysa-next-button-content="">
  <!-- slider items here -->
</div>

⚙️ Configuration Options

Option Type Default Description HTML Attribute
scrollSpeed number 0.8 Determines the scrolling speed (value between 0.1–1). data-kaysa-scroll-speed
gap string '15px' Sets the gap between items (CSS value). data-kaysa-gap
enhancedScrollbar boolean false Enables/disables the custom scrollbar. data-kaysa-enhanced-scrollbar
prevButtonContent string '<' Content of the previous button. data-kaysa-prev-button-content
nextButtonContent string '>' Content of the next button. data-kaysa-next-button-content

🌟 Interactive Help

Run the following command in the browser console to view interactive documentation:

Kaysa.manual(); // Shows both syntax options

🌐 GitHub Links


📜 License

MIT © 2024 edukah

About

✨ Kaysa: Modular horizontal slider with touch controls, custom scrollbars, and responsive gap settings. Built with pure JavaScript for seamless integration.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •