Features: - Magazine-style layout with CSS Grid (2-column + sidebar) - ICW NextSpread design system (colors, typography, animations) - Adaptive animation timing based on scroll speed - URL query parameter support (?parse=https://url/file.md) - Drag-and-drop file upload - Syntax highlighting (VS Code Dark+ theme) - Full-bleed hero section with gradient overlay - Responsive design (mobile-first, 44px touch targets) - Static export ready for StackCP deployment Tech Stack: - Next.js 14 (static export) - React 18 + TypeScript - Framer Motion (animations) - markdown-it + highlight.js - Tailwind CSS Design Ported From: - ICW NextSpread property pages (icantwait.ca) - useAdaptiveDuration, useScrollSpeed animation hooks - Webflow-style easing curves - Gallery staggered reveal patterns Deployment: - Configured for digital-lab.ca/infrafabric/IF.docs.md2html - .htaccess with SPA routing and CORS headers - Static files in /out/ directory 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
43 lines
1.3 KiB
TypeScript
43 lines
1.3 KiB
TypeScript
'use client';
|
|
|
|
import { motion, useReducedMotion } from 'framer-motion';
|
|
import { useAdaptiveDuration } from '@/lib/useAdaptiveDuration';
|
|
import { parseMarkdown } from '@/lib/markdown-parser';
|
|
import { HeroSection } from './HeroSection';
|
|
import { MagazineContent } from './MagazineContent';
|
|
|
|
const webflowEase = [0.25, 0.46, 0.45, 0.94] as const;
|
|
|
|
interface MarkdownViewerProps {
|
|
markdown: string;
|
|
title: string;
|
|
onReset: () => void;
|
|
}
|
|
|
|
export function MarkdownViewer({ markdown, title, onReset }: MarkdownViewerProps) {
|
|
const shouldReduceMotion = useReducedMotion();
|
|
const contentDuration = useAdaptiveDuration(0.8);
|
|
|
|
const html = parseMarkdown(markdown);
|
|
|
|
return (
|
|
<div className="relative w-full min-h-screen">
|
|
{/* Hero Section with ICW styling */}
|
|
<HeroSection title={title} onReset={onReset} />
|
|
|
|
{/* Magazine-style content */}
|
|
<motion.section
|
|
className="relative bg-white py-16 md:py-24"
|
|
initial={{ opacity: 0, y: 40 }}
|
|
animate={{ opacity: 1, y: 0 }}
|
|
transition={{
|
|
duration: shouldReduceMotion ? 0 : contentDuration,
|
|
delay: shouldReduceMotion ? 0 : 0.3,
|
|
ease: webflowEase,
|
|
}}
|
|
>
|
|
<MagazineContent html={html} />
|
|
</motion.section>
|
|
</div>
|
|
);
|
|
}
|