Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

stick loading bar to the top of the screen

Blue Mouse272770d87bcd
diff --git a/web/app/pages/Project/View/ViewProject.tsx b/web/app/pages/Project/View/ViewProject.tsx
index a5e9b249f..921f74dec 100644
--- a/web/app/pages/Project/View/ViewProject.tsx
+++ b/web/app/pages/Project/View/ViewProject.tsx
@@ -2799,6 +2799,7 @@ const ViewProject = () => {
}}
>
<>
+ {dataLoading ? <LoadingBar /> : null}
{!isEmbedded ? <Header /> : null}
<EventsRunningOutBanner />
<div
@@ -3730,11 +3731,6 @@ const ViewProject = () => {
onRemoveMetric={(id) => onRemoveCustomMetric(id)}
resetMetrics={resetCustomMetrics}
/>
- {dataLoading ? (
- <div className='mt-4'>
- <LoadingBar />
- </div>
- ) : null}
<div className='mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2'>
{!_isEmpty(panelsData.types)
? _map(TRAFFIC_PANELS_ORDER, (type: string) => {
@@ -4031,11 +4027,6 @@ const ViewProject = () => {
/>
</div>
<Filters tnMapping={tnMapping} />
- {dataLoading ? (
- <div className='mt-4'>
- <LoadingBar />
- </div>
- ) : null}
<div className='mt-3 grid grid-cols-1 gap-3 sm:grid-cols-2'>
{!_isEmpty(panelsDataPerf.types)
? _map(PERFORMANCE_PANELS_ORDER, (type: keyof typeof tnMapping) => {
@@ -4204,11 +4195,6 @@ const ViewProject = () => {
<div className='h-80'>
<div className='mt-5 h-80 md:mt-0' id='dataChart' />
</div>
- {dataLoading ? (
- <div className='mt-4'>
- <LoadingBar />
- </div>
- ) : null}
</div>
) : null}
diff --git a/web/app/ui/LoadingBar.tsx b/web/app/ui/LoadingBar.tsx
index 548edf178..ab2769236 100644
--- a/web/app/ui/LoadingBar.tsx
+++ b/web/app/ui/LoadingBar.tsx
@@ -7,10 +7,7 @@ interface LoadingBarProps {
const LoadingBar: React.FC<LoadingBarProps> = ({ className }) => {
return (
- <div
- className={cx('relative h-1 w-full overflow-hidden rounded-full bg-gray-200/60 dark:bg-gray-700/60', className)}
- >
- {/* First indeterminate bar */}
+ <div className={cx('fixed top-0 right-0 left-0 z-50 h-0.5 w-full overflow-hidden', className)}>
<div
className='absolute h-full rounded-full bg-gradient-to-r from-indigo-500 to-blue-600 opacity-90 shadow-sm'
style={{
@@ -18,7 +15,6 @@ const LoadingBar: React.FC<LoadingBarProps> = ({ className }) => {
}}
/>
- {/* Second indeterminate bar */}
<div
className='absolute h-full rounded-full bg-gradient-to-r from-indigo-500 to-blue-600 opacity-75 shadow-sm'
style={{
@@ -26,15 +22,6 @@ const LoadingBar: React.FC<LoadingBarProps> = ({ className }) => {
animationDelay: '1.15s',
}}
/>
-
- {/* Subtle glow effect */}
- <div
- className='absolute h-full rounded-full bg-gradient-to-r from-indigo-400/30 via-indigo-500/40 to-indigo-600/30 blur-sm'
- style={{
- animation: 'indeterminate1 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite',
- transform: 'scaleY(1.5)',
- }}
- />
</div>
)
}