feat: add draggable mobile refresh button with improved UX
- Repositioned mobile refresh button to bottom-right (80px from bottom) - Implemented full drag-to-reposition functionality * Touch and mouse support with 200ms/10px threshold * RequestAnimationFrame for smooth dragging * Position saved to extensionSettings.mobileRefreshPosition * Viewport constraints with 10px padding - Fixed sticky tap highlight issue * Added -webkit-tap-highlight-color: transparent * Added blur() on click to remove focus * Set user-select: none and touch-action: none - Show/hide based on panel state * Only visible when panel is expanded (rpg-mobile-open) * Listens to rpg-panel-toggled events * Auto-hides when panel closes - Prevent accidental refresh after drag * just-dragged flag prevents click for 100ms * Click handler checks flag before executing - Changed from absolute to fixed positioning for viewport-wide dragging - Added mobileRefreshPosition to default settings (bottom: 80px, right: 20px) - z-index: 99 (below FAB toggle at 100)
This commit is contained in:
@@ -49,6 +49,10 @@ export const defaultSettings = {
|
||||
top: 'calc(var(--topBarBlockSize) + 60px)',
|
||||
right: '12px'
|
||||
}, // Saved position for mobile FAB button
|
||||
mobileRefreshPosition: {
|
||||
bottom: '80px',
|
||||
right: '20px'
|
||||
}, // Saved position for mobile refresh button
|
||||
userStats: {
|
||||
health: 100,
|
||||
satiety: 100,
|
||||
|
||||
@@ -37,6 +37,10 @@ export let extensionSettings = {
|
||||
top: 'calc(var(--topBarBlockSize) + 60px)',
|
||||
right: '12px'
|
||||
}, // Saved position for mobile FAB button
|
||||
mobileRefreshPosition: {
|
||||
bottom: '80px',
|
||||
right: '20px'
|
||||
}, // Saved position for mobile refresh button
|
||||
userStats: {
|
||||
health: 100,
|
||||
satiety: 100,
|
||||
|
||||
Reference in New Issue
Block a user