diff options
| author | Ariel Costas Guerrero <ariel@costas.dev> | 2025-08-06 00:12:19 +0200 |
|---|---|---|
| committer | Ariel Costas Guerrero <ariel@costas.dev> | 2025-08-06 00:12:19 +0200 |
| commit | 5cc27f852b02446659e0ab85305916c9f5e5a5f0 (patch) | |
| tree | 622636a2a7eade5442a3efb1726d822657d30295 /src/frontend/app/components/PullToRefresh.css | |
| parent | b04fd7d33d07f9eddea2eb53e1389d5ca5453413 (diff) | |
feat: Implement pull-to-refresh functionality across various components
- Added `PullToRefresh` component to enable pull-to-refresh behavior in `StopList` and `Estimates` pages.
- Integrated `usePullToRefresh` hook to manage pull-to-refresh state and actions.
- Created `UpdateNotification` component to inform users of available updates from the service worker.
- Enhanced service worker management with `ServiceWorkerManager` class for better update handling and caching strategies.
- Updated CSS styles for new components and improved layout for better user experience.
- Refactored API caching logic in service worker to handle multiple endpoints and dynamic cache expiration.
- Added auto-refresh functionality for estimates data to keep information up-to-date.
Diffstat (limited to 'src/frontend/app/components/PullToRefresh.css')
| -rw-r--r-- | src/frontend/app/components/PullToRefresh.css | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/frontend/app/components/PullToRefresh.css b/src/frontend/app/components/PullToRefresh.css new file mode 100644 index 0000000..15ca74b --- /dev/null +++ b/src/frontend/app/components/PullToRefresh.css @@ -0,0 +1,72 @@ +.pull-to-refresh-container { + position: relative; + height: 100%; + overflow: hidden; +} + +.pull-to-refresh-indicator { + position: absolute; + top: -80px; + left: 50%; + transform: translateX(-50%); + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; + padding: 16px; + z-index: 1000; + opacity: 0; + transition: opacity 0.2s ease; +} + +.pull-to-refresh-icon { + display: flex; + align-items: center; + justify-content: center; + width: 40px; + height: 40px; + border-radius: 50%; + background-color: var(--button-background-color); + color: white; + transition: all 0.3s ease; + transform-origin: center; +} + +.pull-to-refresh-icon.ready { + background-color: #28a745; +} + +.pull-to-refresh-icon.spinning { + animation: spin 1s linear infinite; +} + +@keyframes spin { + from { transform: rotate(0deg); } + to { transform: rotate(360deg); } +} + +.pull-to-refresh-text { + font-size: 0.875rem; + color: var(--subtitle-color); + font-weight: 500; + text-align: center; + white-space: nowrap; +} + +.pull-to-refresh-content { + height: 100%; + overflow: auto; + transition: transform 0.2s ease; +} + +/* Disable browser's default pull-to-refresh on mobile */ +.pull-to-refresh-content { + overscroll-behavior-y: contain; +} + +@media (hover: hover) { + /* Hide pull-to-refresh on desktop devices */ + .pull-to-refresh-indicator { + display: none; + } +} |
