Adds a customizable scroll-to-top button near the page bottom.
Από την
This script adds a customizable "scroll to top" button to web pages, making it easy for users to quickly navigate back to the top of long content. It's designed to be user-friendly, performance-focused, and highly configurable.
The script uses APP_CONFIG to control its behavior. Here's a detailed breakdown:
button: {
size: '45px', // Size of the button
fontSize: '18px', // Size of the icon
backgroundColor: '#3a3a3a', // Background color
hoverColor: '#555', // Background color on hover
textColor: '#f5f5f5', // Text/icon color
borderRadius: '55%', // Button corner radius
position: { // Button's position
bottom: '25px', // Distance from bottom
right: '25px' // Distance from right
},
shadow: '0 3px 10px rgba(0,0,0,0.45)', // CSS box shadow
transitionSpeed: 350, // Fade in/out speed in ms
zIndex: 2147483647, // Button's z-index (ensures it's on top)
svg: { // SVG icon settings
width: '20px',
height: '20px',
viewBox: '0 0 16 16'
}
}