Skip to content

Commit fc0820e

Browse files
Edited hydratefallback UI
1 parent 6da1720 commit fc0820e

File tree

4 files changed

+39
-4
lines changed

4 files changed

+39
-4
lines changed

.DS_Store

0 Bytes
Binary file not shown.

app/root.tsx

+38-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ import {
66
ScrollRestoration,
77
} from "@remix-run/react";
88
import type { LinksFunction } from "@remix-run/node";
9-
109
import "./tailwind.css";
10+
import React, { useState, useEffect } from "react";
1111

1212
export const links: LinksFunction = () => [
1313
{
@@ -38,6 +38,7 @@ export const links: LinksFunction = () => [
3838
];
3939

4040
export function Layout({ children }: { children: React.ReactNode }) {
41+
4142
return (
4243
<html lang="en">
4344
<head>
@@ -60,5 +61,40 @@ export default function App() {
6061
}
6162

6263
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+
64100
}

app/routes/_index.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ import type { MetaFunction } from "@remix-run/node";
22
import { useEffect, useRef, useState } from "react";
33
import { useNavigate } from "@remix-run/react";
44
import "/app/routes/styles/index.scss";
5-
import CircleRightIcon from './icons/CircleRightIcon'
65
import QuestionMarkIcon from './icons/QuestionMarkIcon'
76
export const meta: MetaFunction = () => {
87
return [
98
{ title: "Sid's" },
10-
{ name: "description", content: "Embedded video in Remix portfolio" },
9+
{ name: "Siddharth Mohite portfolio Website", content: "Siddharth Mohite portfolio Website" },
1110
];
1211
};
1312

public/applew.png

24.5 KB
Loading

0 commit comments

Comments
 (0)