Retro Gradient 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>Retro Gradient 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: 'Arial', sans-serif; background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%); display: flex; justify-content: center; align-items: center; height: 100vh; margin: 0; } .pagination-container { display: flex; align-items: center; padding: 10px 20px; background: rgba(255, 255, 255, 0.2); border-radius: 15px; box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255, 255, 255, 0.3); } .pagination-btn, .pagination-number { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: 0 5px; background: rgba(255, 255, 255, 0.3); border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.2); cursor: pointer; transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out; color: #fff; font-size: 1rem; } .pagination-btn:hover, .pagination-number:hover { transform: scale(1.1); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); } .pagination-number.active { background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%); border: none; color: #fff; } .pagination-btn i { font-size: 1.2rem; } </style> </head> <body> <div class="pagination-container"> <div class="pagination-btn" onclick="prevPage()"> <i class="fas fa-chevron-left"></i> </div> <div class="pagination-number active">1</div> <div class="pagination-number">2</div> <div class="pagination-number">3</div> <div class="pagination-number">4</div> <div class="pagination-number">5</div> <div class="pagination-btn" onclick="nextPage()"> <i class="fas fa-chevron-right"></i> </div> </div> <script> const paginationNumbers = document.querySelectorAll('.pagination-number'); paginationNumbers.forEach(number => { number.addEventListener('click', () => { paginationNumbers.forEach(num => num.classList.remove('active')); number.classList.add('active'); }); }); function prevPage() { const activeNumber = document.querySelector('.pagination-number.active'); const prevNumber = activeNumber.previousElementSibling; if (prevNumber && prevNumber.classList.contains('pagination-number')) { activeNumber.classList.remove('active'); prevNumber.classList.add('active'); } } function nextPage() { const activeNumber = document.querySelector('.pagination-number.active'); const nextNumber = activeNumber.nextElementSibling; if (nextNumber && nextNumber.classList.contains('pagination-number')) { activeNumber.classList.remove('active'); nextNumber.classList.add('active'); } } </script> </body> </html>