6
6
ScrollRestoration ,
7
7
} from "@remix-run/react" ;
8
8
import type { LinksFunction } from "@remix-run/node" ;
9
-
10
9
import "./tailwind.css" ;
10
+ import React , { useState , useEffect } from "react" ;
11
11
12
12
export const links : LinksFunction = ( ) => [
13
13
{
@@ -38,6 +38,7 @@ export const links: LinksFunction = () => [
38
38
] ;
39
39
40
40
export function Layout ( { children } : { children : React . ReactNode } ) {
41
+
41
42
return (
42
43
< html lang = "en" >
43
44
< head >
@@ -60,5 +61,40 @@ export default function App() {
60
61
}
61
62
62
63
export function HydrateFallback ( ) {
63
- return < p > Loading...</ p > ;
64
+ const [ progress , setProgress ] = useState ( 0 ) ;
65
+
66
+ useEffect ( ( ) => {
67
+ const interval = setInterval ( ( ) => {
68
+ setProgress ( ( prev ) => {
69
+ if ( prev >= 80 ) {
70
+ clearInterval ( interval ) ;
71
+ return prev ;
72
+ }
73
+ return prev + 1 ; // Increment speed; adjust as needed.
74
+ } ) ;
75
+ } , 50 ) ; // Adjust the interval speed as needed.
76
+ return ( ) => clearInterval ( interval ) ;
77
+ } , [ ] ) ;
78
+ return (
79
+ < div className = "bg-black min-h-screen" >
80
+ < div className = "bg-black min-h-screen relative" >
81
+ < img
82
+ src = "/applew.png"
83
+ alt = "Apple Logo"
84
+ className = "w-40 h-40 absolute top-1/3 left-1/2 transform -translate-x-1/2 -translate-y-1/2"
85
+ />
86
+ </ div >
87
+ < div className = "absolute bottom-80 left-1/2 transform -translate-x-1/2 w-64" >
88
+ < div className = "w-full bg-gray-700 rounded-full h-3" >
89
+ < div
90
+ className = "bg-white h-3 rounded-full"
91
+ style = { { width : `${ progress } %` } }
92
+ > </ div >
93
+ </ div >
94
+ { /* <p className="text-white text-center mt-2">{progress}%</p> */ }
95
+ </ div >
96
+ </ div >
97
+
98
+ ) ;
99
+
64
100
}
0 commit comments