[FEATURE]: Add Scroll-to-Top Button with Smooth Animation

Aperta
#240 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@zaibamachhaliya ci sta già lavorando.

Dal 20/8/2026.

  • #241 di @zaibamachhaliya — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript
Ambito
frontend, web-dev

Direzione di ricerca

Il costruttore di SocialShareButton e la sua opzione proposta scrollToTop sono i punti di ingresso; individua innanzitutto l’analisi esistente delle opzioni e il rendering del componente. Confronta l’implementazione con gli attuali pattern del repository per lo styling e l’accessibilità. Il lavoro è completato quando la funzionalità è configurabile, viene mostrata dopo la soglia indicata, torna in modo fluido all’inizio e supporta l’uso da tastiera e ARIA.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
Feature and its Use Cases

Feature: Scroll-to-Top Button

What is the feature?

A floating action button (FAB) that appears when users scroll down the page. When clicked, it smoothly scrolls the page back to the top. This is a common UX pattern found on most modern websites.

How would users benefit from it?
  1. Improved Navigation: Users don't need to manually scroll back up after reading long content
  2. Better UX: Saves time and provides a convenient shortcut
  3. Mobile Friendly: Especially useful on mobile devices where scrolling is more tedious
  4. Accessibility: Helps users with mobility impairments navigate more easily
What scenarios would this feature address?
  1. Long Articles/Blog Posts: Readers can quickly return to top after finishing
  2. Product Pages: Users can navigate back to navigation/menu after scrolling
  3. Documentation Pages: Quick return to table of contents
  4. Mobile Devices: Easier navigation on small screens
  5. Single Page Applications: Quick navigation without page refresh
How does it work technically?
  1. A button is created in the DOM with fixed positioning
  2. It's hidden initially (display: none)
  3. When user scrolls past a threshold (e.g., 300px), button appears with fade animation
  4. On click, window.scrollTo() with smooth behavior is triggered
  5. Accessibility features: ARIA labels, keyboard support, focus management
Additional Context

┌─────────────────────────────────────┐
│ Website Header │
│ │
│ Content... │
│ │
│ Content... │
│ │
│ Content... │
│ │
│ ┌─────┐ │
│ │ ↑ │ ← Floating │
│ └─────┘ Button │
│ │
└─────────────────────────────────────┘

Design Specifications
  • Position: Bottom-right corner (30px from bottom, 30px from right)
  • Size: 50px × 50px circular button
  • Color: Matches library's primary gradient (#667eea to #764ba2)
  • Icon: Up arrow (↑)
  • Animation: Fade in with slight upward motion
  • Trigger: Appears after scrolling 300px
Proposed Configuration
new SocialShareButton({
  // ... existing options
  scrollToTop: {
    enabled: true,
    position: 'bottom-right',
    showAfter: 300,
    buttonColor: '#667eea',
    buttonHoverColor: '#764ba2',
  }
});
Code of Conduct
  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates
Lingua principale
TypeScript
Stelle
29
Fork
74
Merge medio
8h 52m
PR unite (30g)
4

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di AOSSIE-Org/SocialShareButton

Tutte le issue di AOSSIE-Org/SocialShareButton

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.