//import React from 'react'; const BookPageTemplate = () => { // Only three state variables as requested const [title, setTitle] = React.useState("ADVENTURES OF DON QUIXOTE"); const [pageNumber, setPageNumber] = React.useState("289"); const [text, setText] = React.useState( "deed,\" said Don Quixote, \"thou hast hit the point, Sancho, which can alone shake my resolution; I neither can, nor ought to, draw my sword, as I have often told thee, against those who are not dubbed knights. To thee which I had premeditated, thy share of the booty would have been at least the emperor's crown of gold and Cupid's painted wings; for I would have plucked them off perforce, and delivered them into thy hands.\" \"The" ); // Styles for heavily degraded scan effect const heavilyDegradedStyles = { filter: 'grayscale(30%) contrast(120%) brightness(85%) sepia(20%)', position: 'relative', backgroundColor: '#e6ddc6', // More yellowed aged paper backgroundImage: 'url("data:image/svg+xml,%3Csvg viewBox=\'0 0 200 200\' xmlns=\'http://www.w3.org/2000/svg\'%3E%3Cfilter id=\'noiseFilter\'%3E%3CfeTurbulence type=\'fractalNoise\' baseFrequency=\'0.85\' numOctaves=\'3\' stitchTiles=\'stitch\'/%3E%3C/filter%3E%3Crect width=\'100%25\' height=\'100%25\' filter=\'url(%23noiseFilter)\' opacity=\'0.25\'/%3E%3C/svg%3E")', boxShadow: 'inset 0 0 70px rgba(0, 0, 0, 0.3), 0 0 5px rgba(0,0,0,0.1)', padding: '32px', borderRadius: '2px', overflow: 'hidden', transform: 'rotate(0.3deg)', // Slightly askew scan }; // Heavily degraded text const badScanTextStyle = { fontFamily: '"Times New Roman", serif', letterSpacing: '-0.01em', wordSpacing: '0.02em', fontWeight: '500', color: '#222222', textShadow: '0 0 1px rgba(0, 0, 0, 0.5)', transform: 'scale(1.01, 0.99) rotate(-0.4deg)', // Distorted proportions }; // Random coffee stain effect const coffeeStain = { position: 'absolute', width: '100px', height: '80px', top: '25%', right: '15%', borderRadius: '50%', background: 'radial-gradient(ellipse at center, rgba(139,69,19,0.15) 0%, rgba(139,69,19,0.1) 50%, rgba(139,69,19,0.05) 70%, rgba(139,69,19,0) 100%)', transform: 'rotate(30deg) scale(1.5, 1)', pointerEvents: 'none', zIndex: 1, }; // Water damage effect const waterDamage = { position: 'absolute', width: '70%', height: '40%', bottom: '10%', left: '5%', opacity: 0.07, background: 'radial-gradient(ellipse at center, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.1) 40%, rgba(0,0,0,0) 70%)', borderRadius: '40% 60% 70% 30% / 40% 50% 60% 50%', pointerEvents: 'none', zIndex: 1, }; // Add fold lines const foldLine = { position: 'absolute', width: '100%', height: '3px', top: '30%', left: 0, background: 'linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,0.03) 20%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.03) 80%, rgba(0,0,0,0) 100%)', boxShadow: '0 1px 3px rgba(255,255,255,0.2)', pointerEvents: 'none', zIndex: 2, }; // Torn edge effect const tornEdge = { position: 'absolute', top: 0, right: 0, width: '100%', height: '100%', background: 'linear-gradient(135deg, transparent 97%, #e6ddc6 97%, #e6ddc6 100%)', pointerEvents: 'none', }; return (
{/* Heavily degraded scan container */}
{/* Noise overlay */}
{/* Scan lines effect */}
{/* Add coffee stain */}
{/* Add water damage */}
{/* Add fold line */}
{/* Add torn edge */}
{/* Header with skewed alignment */}

{title}

{pageNumber}
{/* Horizontal divider with uneven quality */}
{/* Text content with severely degraded appearance */}
{/* Bad scan text with random character fading */}

{text.split('').map((char, index) => { const opacity = Math.random() > 0.8 ? 0.4 + Math.random() * 0.5 : 0.9 + Math.random() * 0.1; const blur = Math.random() > 0.95 ? 1 : 0; return {char}; })}

{/* Extra random ink spill */}
); }; //export default BookPageTemplate; window.BookPageTemplate = BookPageTemplate;