()
| 3 | import Footer from '../components/Footer'; |
| 4 | |
| 5 | function How() { |
| 6 | const [theme, setTheme] = useState<'light' | 'dark'>( |
| 7 | localStorage.getItem('theme') as 'light' | 'dark' || |
| 8 | (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') |
| 9 | ); |
| 10 | |
| 11 | useEffect(() => { |
| 12 | document.documentElement.classList.toggle('dark', theme === 'dark'); |
| 13 | localStorage.setItem('theme', theme); |
| 14 | }, [theme]); |
| 15 | |
| 16 | const toggleTheme = () => { |
| 17 | setTheme(prev => prev === 'light' ? 'dark' : 'light'); |
| 18 | }; |
| 19 | |
| 20 | return ( |
| 21 | <div className="min-h-screen bg-gradient-to-b from-gray-50 to-gray-100 dark:from-gray-900 dark:to-gray-800 flex flex-col"> |
| 22 | {/* Header with Theme Toggle */} |
| 23 | <Header theme={theme} toggleTheme={toggleTheme} /> |
| 24 | |
| 25 | {/* How to Use Content */} |
| 26 | <div className="flex-1 max-w-3xl mx-auto px-6 py-12 text-gray-800 dark:text-gray-300 pt-28"> |
| 27 | <h1 className="text-3xl font-bold mb-6 text-gray-900 dark:text-white">How to Use TinyWebP</h1> |
| 28 | <p className="text-sm">Author: Isuru Prabath</p> |
| 29 | <p className="text-sm mb-4">Updated on: 12th February 2025</p> |
| 30 | |
| 31 | <p className="mb-4"> |
| 32 | Welcome to TinyWebP! This tool allows you to easily compress images directly from your browser. |
| 33 | Here's how to use it: |
| 34 | </p> |
| 35 | |
| 36 | <h2 className="text-xl font-semibold mt-6 mb-2">1. Upload Your Image</h2> |
| 37 | <p> |
| 38 | Drop your images into the section labeled <strong>"Drop your images here"</strong>, or simply click the <strong>"click to browse"</strong> link and select the image you'd like to compress. No registration or account is needed. |
| 39 | </p> |
| 40 | |
| 41 | <h2 className="text-xl font-semibold mt-6 mb-2">2. Wait for Compression</h2> |
| 42 | <p> |
| 43 | TinyWebP will automatically compress the image directly in your browser. This process does not upload your image to our servers. |
| 44 | </p> |
| 45 | |
| 46 | <h2 className="text-xl font-semibold mt-6 mb-2">3. Download the Compressed Image</h2> |
| 47 | <p> |
| 48 | Once the compression is complete, you can easily download the compressed image directly to your device. |
| 49 | </p> |
| 50 | |
| 51 | <h2 className="text-xl font-semibold mt-6 mb-2">4. Watch the Tutorial Video</h2> |
| 52 | <p> |
| 53 | If you prefer visual instructions, check out the tutorial video below: |
| 54 | </p> |
| 55 | |
| 56 | {/* Embedding YouTube video */} |
| 57 | <div className="my-8 aspect-video"> |
| 58 | <iframe |
| 59 | className="w-full h-full" |
| 60 | src="https://www.youtube.com/embed/JBz-vB2-Ykg" // Replace with your YouTube video ID |
| 61 | title="TinyWebP - Convert Images to WebP" |
| 62 | frameBorder="0" |
nothing calls this directly
no outgoing calls
no test coverage detected