Skip to content

Commit fb17931

Browse files
committed
responsiveness for ipad
1 parent 06fda1b commit fb17931

5 files changed

Lines changed: 31 additions & 271 deletions

File tree

src/App.tsx

Lines changed: 30 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { useEffect } from 'react';
22
import { HashRouter as Router, Routes, Route, Navigate, useLocation } from 'react-router-dom';
33
import { Navigation } from './components/Navigation';
44
import { Footer } from './components/Footer';
5-
import { LoadingScreen } from './components/LoadingScreen';
65
import { Home } from './components/pages/Home';
76
import { About } from './components/pages/About';
87
import { Experience } from './components/pages/Experience';
@@ -17,13 +16,11 @@ import { Contact } from './components/pages/Contact';
1716
import { Photography } from './components/pages/Photography';
1817
import { CMS } from './components/pages/CMS';
1918
import { preloadCriticalImages } from './utils/preloadImages';
20-
import { useImageLoading } from './hooks/useImageLoading';
2119
import './utils/navHeight';
2220

2321
function AppContent() {
2422
const location = useLocation();
2523
const isHomePage = location.pathname === '/' || location.pathname === '/#/';
26-
const isLoading = useImageLoading();
2724

2825
// Scroll to top when opening About, Stories, Projects, etc. so the top nav "moves up" into view
2926
useEffect(() => {
@@ -44,44 +41,39 @@ function AppContent() {
4441
};
4542
}, []);
4643

47-
// Preload critical images on app mount (for additional optimization)
44+
// Preload critical images on app mount
4845
useEffect(() => {
49-
if (!isLoading) {
50-
preloadCriticalImages();
51-
}
52-
}, [isLoading]);
46+
preloadCriticalImages();
47+
}, []);
5348

5449
return (
55-
<>
56-
<LoadingScreen isLoading={isLoading} />
57-
<div className="min-h-screen bg-background flex flex-col">
58-
{!isHomePage && <Navigation />}
59-
<main className="flex-1">
60-
<Routes>
61-
<Route path="/" element={
62-
<div className="min-h-screen flex flex-col items-center justify-center bg-background">
63-
<Home />
64-
</div>
65-
} />
66-
<Route path="/about" element={<About />} />
67-
<Route path="/experience" element={<Experience />} />
68-
<Route path="/projects" element={<Projects />} />
69-
<Route path="/projects/:projectId" element={<ProjectDetail />} />
70-
<Route path="/impact" element={<Impact />} />
71-
<Route path="/impact/:storyId" element={<StoryDetail />} />
72-
<Route path="/storiesofadventure" element={<StoriesOfAdventure />} />
73-
<Route path="/storiesofadventure/:storyId" element={<StoryOfAdventureDetail />} />
74-
<Route path="/accessibility" element={<Accessibility />} />
75-
<Route path="/contact" element={<Contact />} />
76-
<Route path="/photography" element={<Photography />} />
77-
<Route path="/cms" element={<CMS />} />
78-
<Route path="/CMS" element={<Navigate to="/cms" replace />} />
79-
<Route path="*" element={<Navigate to="/" replace />} />
80-
</Routes>
81-
</main>
82-
{!isHomePage && <Footer />}
83-
</div>
84-
</>
50+
<div className="min-h-screen bg-background flex flex-col">
51+
{!isHomePage && <Navigation />}
52+
<main className="flex-1">
53+
<Routes>
54+
<Route path="/" element={
55+
<div className="min-h-screen flex flex-col items-center justify-center bg-background">
56+
<Home />
57+
</div>
58+
} />
59+
<Route path="/about" element={<About />} />
60+
<Route path="/experience" element={<Experience />} />
61+
<Route path="/projects" element={<Projects />} />
62+
<Route path="/projects/:projectId" element={<ProjectDetail />} />
63+
<Route path="/impact" element={<Impact />} />
64+
<Route path="/impact/:storyId" element={<StoryDetail />} />
65+
<Route path="/storiesofadventure" element={<StoriesOfAdventure />} />
66+
<Route path="/storiesofadventure/:storyId" element={<StoryOfAdventureDetail />} />
67+
<Route path="/accessibility" element={<Accessibility />} />
68+
<Route path="/contact" element={<Contact />} />
69+
<Route path="/photography" element={<Photography />} />
70+
<Route path="/cms" element={<CMS />} />
71+
<Route path="/CMS" element={<Navigate to="/cms" replace />} />
72+
<Route path="*" element={<Navigate to="/" replace />} />
73+
</Routes>
74+
</main>
75+
{!isHomePage && <Footer />}
76+
</div>
8577
);
8678
}
8779

src/components/LoadingScreen.tsx

Lines changed: 0 additions & 74 deletions
This file was deleted.

src/components/pages/Home.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { motion } from 'motion/react';
22
import { Link } from 'react-router-dom';
33
import { Hand, BookOpen, FolderKanban, Camera } from 'lucide-react';
44
import { getImageUrl } from '../../utils/imageUtils';
5-
import { ImageWithFallback } from '../figma/ImageWithFallback';
65
import contentData from '../../data/content';
76

87
export function Home() {
@@ -19,12 +18,11 @@ export function Home() {
1918
<p className="text-sm sm:text-base md:text-lg text-gray-600 mb-3 sm:mb-4 font-medium">
2019
रेगन
2120
</p>
22-
<ImageWithFallback
21+
<img
2322
src={getImageUrl("src/assets/ray.png")}
2423
alt="Regan Maharjan"
2524
className="w-auto mx-auto rounded-full object-contain"
2625
style={{ height: 'clamp(200px, 30vh, 400px)' }}
27-
loading="eager"
2826
/>
2927
</motion.div>
3028

src/hooks/useImageLoading.ts

Lines changed: 0 additions & 42 deletions
This file was deleted.

src/utils/imageLoader.ts

Lines changed: 0 additions & 114 deletions
This file was deleted.

0 commit comments

Comments
 (0)