Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: v2 #65

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat: v2 #65

wants to merge 3 commits into from

Conversation

aidanaden
Copy link
Owner

@aidanaden aidanaden commented Nov 16, 2024

This PR greatly simplifies the loading bar. For now, the loading bar can only be started or stopped.

By default, starting the loading bar:

  1. Starts loading bar at 7% width
  2. Gradually increase the progress bar every 1 fps (via requestAnimationFrame)
  3. Progress bar stops at 64% (this requires 323 frames, or around 5-6s on a 60 fps screen)

Stopping the loading bar:

  1. Sets progress bar width to 100%
  2. Wait for 200ms
  3. Begin reducing opacity by 1% every 1 fps (via requestAnimationFrame) which requires roughly 100 frames, or ~1.5s at 60 fps

TODO:

  • add example page to display full load
  • add param to configure load speed
  • add param to manually configure loading bar progress

@aidanaden aidanaden self-assigned this Nov 16, 2024
Copy link

vercel bot commented Nov 16, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
solid-top-loading-bar ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 17, 2024 1:01am

Copy link

cloudflare-workers-and-pages bot commented Nov 17, 2024

Deploying solid-top-loading-bar with  Cloudflare Pages  Cloudflare Pages

Latest commit: 8c56e99
Status:🚫  Build failed.

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: add smooth animation alternative using useAnimationFrame
1 participant