Gradient Slide Pagination - MeggiTools
Run
Toggle Theme
Share Link
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Gradient Slide Pagination</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css"> <style> body { font-family: 'Verdana', sans-serif; display: flex; justify-content: center; align-items: center; height: 100vh; background: linear-gradient(120deg, #ff9a9e, #fad0c4); margin: 0; } .pagination { display: flex; list-style: none; padding: 0; } .pagination li { margin: 0 5px; } .pagination a { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; background: #fff; color: #333; text-decoration: none; font-size: 1.2em; transition: all 0.3s; } .pagination a:hover { background: #ff9a9e; color: #fff; animation: slide 0.5s; } @keyframes slide { 0% { transform: translateY(0); } 50% { transform: translateY(-10px); } 100% { transform: translateY(0); } } .pagination a.active { background: #ff6f61; color: #fff; } .pagination a i { font-size: 1em; } </style> </head> <body> <ul class="pagination"> <li><a href="#" class="prev"><i class="fas fa-chevron-left"></i></a></li> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">4</a></li> <li><a href="#">5</a></li> <li><a href="#" class="next"><i class="fas fa-chevron-right"></i></a></li> </ul> <script> document.querySelectorAll('.pagination a').forEach(link => { link.addEventListener('click', function(event) { event.preventDefault(); document.querySelectorAll('.pagination a').forEach(link => link.classList.remove('active')); this.classList.add('active'); }); }); </script> </body> </html>