sharat0 / php-marque
A customizable marquee with hover-pause functionality
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/sharat0/php-marque
This package is not auto-updated.
Last update: 2025-12-20 00:16:00 UTC
README
PHP Marquee is a customizable marquee component with hover-pause functionality. It allows you to create dynamic, animated rows of content with alternating directions (row and row-reverse).
✨ Features
- Dynamic Content Rendering: Easily pass data to render customizable marquee rows.
- Hover-Pause Animation: Animation pauses on hover for better user interaction.
- Alternating Directions: Supports
rowandrow-reversestyles for visual variation. - Lightweight: Built with minimal dependencies and a simple structure.
📦 Installation
Install via Composer:
composer require sharat0/php-marque
🚀 Usage
#Basic Example
<?php require __DIR__ . '/vendor/autoload.php'; use Sharat0\PhpMarque\Marquee; echo Marquee::render([ [ 'reverse' => false, // Normal direction 'content' => [ ["avatar" => "https://avatar.vercel.sh/jack", "name" => "Jack", "username" => "jack", "review" => "Amazing product!"], ["avatar" => "https://avatar.vercel.sh/jill", "name" => "Jill", "username" => "jill", "review" => "Fantastic experience!"], ], ], [ 'reverse' => true, // Reversed direction 'content' => [ ["avatar" => "https://avatar.vercel.sh/alex", "name" => "Alex", "username" => "alex", "review" => "Highly recommend!"], ["avatar" => "https://avatar.vercel.sh/maria", "name" => "Maria", "username" => "maria", "review" => "Exceeded expectations!"], ], ], ]);
Customization
Input Data Structure
The render method accepts an array of rows. Each row should have:
- reverse (bool) Determines the direction of animation (true for reverse).
- content: (array) List of items to display in the row. Each item should include:
- avatar: URL of the avatar image.
- name: Name of the reviewer.
- username: Username of the reviewer.
- review: Review content.
Example Input
[
[
'reverse' => false,
'content' => [
[
'avatar' => 'https://avatar.vercel.sh/user1',
'name' => 'User1',
'username' => 'user1',
'review' => 'Great experience!',
],
],
],
]