diff --git a/src/pages/Download.tsx b/src/pages/Download.tsx index 88666cf..777946c 100644 --- a/src/pages/Download.tsx +++ b/src/pages/Download.tsx @@ -1,108 +1,129 @@ -import React from 'react'; -import { Download as DownloadIcon, Monitor, Server, HardDrive, Smartphone, Code } from 'lucide-react'; +import React, { useEffect, useState } from 'react'; +import { + Download as DownloadIcon, + Monitor, + Server, + HardDrive, + Smartphone, + Code, +} from 'lucide-react'; export function DownloadPage() { + const [userLocation, setUserLocation] = useState(null); + + // Detect user location using a public API + useEffect(() => { + async function fetchLocation() { + try { + const response = await fetch('https://ipapi.co/json/'); + const data = await response.json(); + setUserLocation(`${data.city}, ${data.country}`); + } catch (error) { + console.error('Failed to fetch user location:', error); + setUserLocation(null); + } + } + fetchLocation(); + }, []); + return (
{/* Hero Section */}
-

Download Snigdha OS

+

+ Download Snigdha OS +

- Choose the edition that best suits your needs. All versions are free to - download and use. + Choose the edition that best suits your needs. All versions are free + to download and use, providing the best experience for developers, + students, and professionals alike.

+
+
+ + + +
+

+ Snigdha OS is designed to provide an unparalleled experience, + whether you're working on an older device or a high-end system. + Built with efficiency, reliability, and beauty in mind, it’s + perfect for home users, professionals, and enterprises. Download + today to unlock the full potential of your hardware. +

+
+ + +
+
{/* Edition Cards */} -
- } - recommended={true} - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> - } - /> +
+ {editionData.map((edition, index) => ( + + ))}
{/* System Requirements */}
-

System Requirements

-
-
-
-

Minimum Requirements

-
    -
  • 2GB RAM (4GB recommended)
  • -
  • 20GB of disk space (100GB recommended)
  • -
  • 1024×768 resolution
  • -
-
-
-

Recommended

-
    -
  • 4GB RAM or more
  • -
  • 100GB of disk space or more
  • -
  • 1920×1080 resolution or higher
  • -
-
+

+ System Requirements +

+
+
+ +
{/* Download Mirrors */} -
-

Download Mirrors

-
- - - +
+

+ Download Mirrors +

+

+ Select a mirror closest to your location for faster download speeds.{' '} +
+ {userLocation ? ( + + Your detected location: {userLocation} + + ) : ( + Detecting your location... + )} +

+
+ {mirrorData.map((mirror, index) => ( + + ))}
@@ -110,28 +131,86 @@ export function DownloadPage() { ); } +// Components +function FeatureBadge({ + color, + text, +}: { + color: string; + text: string; +}) { + return ( + + {text} + + ); +} + +function ActionButton({ + href, + text, + color, + className = '', +}: { + href: string; + text: string; + color: string; + className?: string; +}) { + return ( + + {text} + + ); +} + function EditionCard({ title, description, + keyFeatures, + idealFor, icon, - recommended = false, + recommended, }: { title: string; description: string; + keyFeatures: string[]; + idealFor: string; icon: React.ReactNode; recommended?: boolean; }) { return ( -
+
{recommended && ( -
+
Recommended
)}
{icon}

{title}

-

{description}

-
+

{description}

+
+

Key Features:

+
    + {keyFeatures.map((feature, index) => ( +
  • {feature}
  • + ))} +
+
+
+

Ideal For:

+

{idealFor}

+
+
); } + +// Data +const editionData = [ + { + title: 'Gnome Edition', + description: 'Modern, innovative features while being traditional and familiar.', + keyFeatures: ['Dynamic Workspaces', 'Extensible Extensions', 'Built-in Accessibility'], + idealFor: 'General users who prefer a sleek and functional desktop experience.', + icon: , + recommended: true, + }, + { + title: 'MATE Edition', + description: 'Traditional desktop experience, highly stable and reliable.', + keyFeatures: ['Low Resource Usage', 'Consistent Workflow', 'Legacy Support'], + idealFor: 'Users who value simplicity and reliability over modern features.', + icon: , + }, + { + title: 'Xfce Edition', + description: 'Lightweight and stable. Perfect for older computers.', + keyFeatures: ['Minimal Resource Usage', 'Fast Boot Times', 'Highly Customizable'], + idealFor: 'Users with older hardware or those who need maximum performance.', + icon: , + }, + { + title: 'KDE Plasma Edition', + description: 'Customizable and visually stunning, perfect for power users.', + keyFeatures: ['Advanced Widgets', 'Custom Themes', 'Built-in Productivity Apps'], + idealFor: 'Tech enthusiasts and power users who love customization.', + icon: , + }, + { + title: 'Minimal Edition', + description: 'Barebones version for advanced users who prefer custom setups.', + keyFeatures: ['Minimal Preinstalled Apps', 'Manual Configuration', 'Highly Flexible'], + idealFor: 'Experienced users who want a clean slate to build their OS.', + icon: , + }, + { + title: 'ARM Edition', + description: 'Optimized for ARM-based devices like Raspberry Pi.', + keyFeatures: ['Optimized for ARM', 'Pre-configured Packages', 'Energy Efficient'], + idealFor: 'Raspberry Pi enthusiasts and developers working on ARM devices.', + icon: , + }, + { + title: 'Education Edition', + description: 'Packed with educational tools for students and teachers.', + keyFeatures: ['Preloaded Educational Software', 'Child-friendly Interface', 'Classroom Tools'], + idealFor: 'Students, teachers, and educational institutions.', + icon: , + }, + { + title: 'Gaming Edition', + description: 'Enhanced with gaming tools and pre-installed gaming libraries.', + keyFeatures: ['Gaming Drivers', 'Pre-installed Steam', 'Optimized Performance'], + idealFor: 'Gamers who need a robust environment for PC gaming.', + icon: , + }, +]; + +// const mirrorData = [ +// { +// region: 'North America', +// speed: 'Fast', +// host: 'MirrorHost USA', +// url: '#', +// }, +// // ... Add other mirrors similarly +// ]; +const mirrorData = [ + { + region: 'North America', + speed: 'Fast', + host: 'MirrorHost USA', + url: '#', + }, + { + region: 'Europe', + speed: 'Very Fast', + host: 'EuroMirror DE', + url: '#', + }, + { + region: 'Asia', + speed: 'Fast', + host: 'AsiaNet JP', + url: '#', + }, + { + region: 'Australia', + speed: 'Moderate', + host: 'AusSpeed AU', + url: '#', + }, + { + region: 'South America', + speed: 'Moderate', + host: 'LATAM Mirror BR', + url: '#', + }, + { + region: 'Africa', + speed: 'Fast', + host: 'Afrinet ZA', + url: '#', + }, +];