diff --git a/App.tsx b/App.tsx index 9aedb62..c03367e 100644 --- a/App.tsx +++ b/App.tsx @@ -16,47 +16,75 @@ const App: React.FC = () => { useLayoutEffect(() => { const ctx = gsap.context(() => { - // Hero Animation - const tl = gsap.timeline(); - - tl.fromTo(titleRef.current, - { y: 50, opacity: 0, rotate: 2 }, - { y: 0, opacity: 1, rotate: 0, duration: 1, ease: "power3.out" } - ) - .fromTo(subtitleRef.current, - { y: 20, opacity: 0 }, - { y: 0, opacity: 1, duration: 0.8, ease: "power2.out" }, - "-=0.5" - ); + const mm = gsap.matchMedia(); - // Section Entry Animations - const sections = gsap.utils.toArray('.guide-section'); - sections.forEach(section => { - gsap.fromTo(section, - { opacity: 0, y: 50 }, - { - opacity: 1, - y: 0, - duration: 0.8, - ease: "power2.out", - scrollTrigger: { - trigger: section, - start: "top 80%", - toggleActions: "play none none reverse" - } - } + // Desktop Animations + mm.add("(min-width: 768px)", () => { + // Hero Animation + const tl = gsap.timeline(); + + tl.fromTo(titleRef.current, + { y: 50, opacity: 0, rotate: 2 }, + { y: 0, opacity: 1, rotate: 0, duration: 1, ease: "power3.out" } + ) + .fromTo(subtitleRef.current, + { y: 20, opacity: 0 }, + { y: 0, opacity: 1, duration: 0.8, ease: "power2.out" }, + "-=0.5" ); + + // Section Entry Animations + const sections = gsap.utils.toArray('.guide-section'); + sections.forEach(section => { + gsap.fromTo(section, + { opacity: 0, y: 50 }, + { + opacity: 1, + y: 0, + duration: 0.8, + ease: "power2.out", + scrollTrigger: { + trigger: section, + start: "top 80%", + toggleActions: "play none none reverse" + } + } + ); + }); }); + + // Mobile Animations (Simplified) + mm.add("(max-width: 767px)", () => { + gsap.set([titleRef.current, subtitleRef.current], { opacity: 1, y: 0, rotate: 0 }); + + const sections = gsap.utils.toArray('.guide-section'); + sections.forEach(section => { + gsap.fromTo(section, + { opacity: 0 }, + { + opacity: 1, + duration: 0.5, + ease: "power1.out", + scrollTrigger: { + trigger: section, + start: "top 90%", + toggleActions: "play none none reverse" + } + } + ); + }); + }); + }, mainRef); return () => ctx.revert(); }, []); return ( -
+
-
+
{/* Hero Section */}
{/* Subtle blurred blobs */} @@ -90,14 +118,14 @@ const App: React.FC = () => {
{/* Content Sections */} -
+
{GUIDE_CONTENT.map((section, index) => (
-
+
{index + 1} @@ -111,7 +139,7 @@ const App: React.FC = () => {
{index < GUIDE_CONTENT.length - 1 && ( -
+
)}
))} diff --git a/components/ContentRenderer.tsx b/components/ContentRenderer.tsx index bf4a67a..2138348 100644 --- a/components/ContentRenderer.tsx +++ b/components/ContentRenderer.tsx @@ -15,34 +15,23 @@ const Callout: React.FC<{ variant?: string; content: string }> = ({ variant = 'i case 'warning': return ; case 'tip': return ; case 'success': return ; - default: return ; + default: return ; } }; const getStyles = () => { switch(variant) { - case 'warning': return 'bg-destructive/10 border-destructive/20 text-destructive-foreground'; - case 'tip': return 'bg-accent/10 border-accent/20 text-accent-foreground'; - case 'success': return 'bg-primary/10 border-primary/20 text-primary-foreground'; - default: return 'bg-blue-50 border-blue-200 text-blue-900'; + case 'warning': return 'bg-destructive/10 border-destructive/20 text-foreground'; + case 'tip': return 'bg-accent/10 border-accent/20 text-foreground'; + case 'success': return 'bg-primary/10 border-primary/20 text-foreground'; + default: return 'bg-secondary border-secondary-foreground/10 text-secondary-foreground'; } }; - // Adjusting styles to match new variables more closely for text colors where simple bg/text classes might fail due to variable usage - // The tailwind classes using vars (like text-primary) work if defined in config, which we did. - const getContainerClass = () => { - switch(variant) { - case 'warning': return 'bg-red-50 border-red-200 text-red-900'; - case 'tip': return 'bg-amber-50 border-amber-200 text-amber-900'; - case 'success': return 'bg-green-50 border-green-200 text-green-900'; - default: return 'bg-blue-50 border-blue-200 text-blue-900'; - } - } - return ( -
+
{getIcon()}
-

{content}

+

{content}

); }; diff --git a/components/GitWorkflowDiagram.tsx b/components/GitWorkflowDiagram.tsx index 2d3dc8b..a91b002 100644 --- a/components/GitWorkflowDiagram.tsx +++ b/components/GitWorkflowDiagram.tsx @@ -68,11 +68,11 @@ export const GitWorkflowDiagram: React.FC = () => {

Where you edit files.

{state === 'modified' && ( -
- +
+
-
script.js
-
Modified
+
script.js
+
Modified
)} @@ -82,7 +82,7 @@ export const GitWorkflowDiagram: React.FC = () => { disabled={state !== 'modified'} onClick={() => setState('staged')} className={` - px-4 py-2 rounded-full text-xs font-bold transition-all + px-4 py-2 rounded-full text-sm font-bold transition-all ${state === 'modified' ? 'bg-primary text-primary-foreground hover:bg-primary/90 hover:scale-105 shadow-md cursor-pointer' : 'bg-muted text-muted-foreground cursor-not-allowed opacity-50' @@ -96,18 +96,18 @@ export const GitWorkflowDiagram: React.FC = () => { {/* Staging Area Zone */}
-
+
Staging Area
-

Files ready to commit.

+

Files ready to commit.

{state === 'staged' && ( -
- +
+
-
script.js
-
Staged
+
script.js
+
Staged
)} @@ -117,7 +117,7 @@ export const GitWorkflowDiagram: React.FC = () => { disabled={state !== 'staged'} onClick={() => setState('committed')} className={` - px-4 py-2 rounded-full text-xs font-bold transition-all + px-4 py-2 rounded-full text-sm font-bold transition-all ${state === 'staged' ? 'bg-primary text-primary-foreground hover:bg-primary/90 hover:scale-105 shadow-md cursor-pointer' : 'bg-muted text-muted-foreground cursor-not-allowed opacity-50' @@ -131,18 +131,18 @@ export const GitWorkflowDiagram: React.FC = () => { {/* Repository Zone */}
-
+
Repository
-

Saved history.

+

Saved history.

{state === 'committed' && ( -
- +
+
-
script.js
-
Committed
+
script.js
+
Committed
)} @@ -151,7 +151,7 @@ export const GitWorkflowDiagram: React.FC = () => {
- {/* Sidebar Container */} + {isMobileOpen && ( +
setIsMobileOpen(false)} + /> + )} + + {/* Mobile Sidebar Content */} + + {/* NEW: Minimal Desktop Navigation */} +