From a8805772cfedef9a7428fae89bae3ac6d630ff43 Mon Sep 17 00:00:00 2001 From: the-ghost-bot Date: Thu, 21 Nov 2024 21:36:14 +0100 Subject: [PATCH] v3.0.2 improve gallery and more --- README.md | 33 ++- package-lock.json | 42 +-- package.json | 4 +- src/App.tsx | 2 - src/components/ContentTable.tsx | 5 +- src/components/ErrorLog.tsx | 24 +- src/components/GameDetails.tsx | 172 +++++------ src/components/ScreenshotGallery.tsx | 418 ++++++++++++++++++++++++--- src/components/SearchBar.tsx | 17 +- src/components/Settings.tsx | 10 +- 10 files changed, 530 insertions(+), 197 deletions(-) diff --git a/README.md b/README.md index 7be9467..3463dfe 100644 --- a/README.md +++ b/README.md @@ -9,10 +9,16 @@ A modern web application for tracking Nintendo Switch content, built with React - 🌓 Dark/Light theme support - 📱 Fully responsive design - 📊 Detailed content information -- 🖼️ Screenshot gallery with lightbox +- 🖼️ Interactive screenshot gallery with advanced features: + - Zoom and rotation controls + - Slideshow mode + - Fullscreen support + - Keyboard shortcuts + - Touch gestures + - Image download - 📈 Download statistics integration - 🔄 Auto-refresh capabilities -- 🎯 Customizable display settings +- ⚙️ Customizable display settings ## Development @@ -21,7 +27,7 @@ This project uses: - React 18 with TypeScript - Tailwind CSS for styling - Zustand for state management -- PhotoSwipe for the gallery viewer +- Lucide for icons ### Getting Started @@ -49,6 +55,25 @@ The application supports various configuration options through the settings pane - Auto-refresh intervals - Custom data source URLs +## Gallery Controls + +The screenshot gallery supports various controls: +- **Keyboard**: + - Arrow keys: Navigate between images + - R: Rotate image + - +/-: Zoom in/out + - F: Toggle fullscreen + - Space: Toggle slideshow + - ESC: Close gallery +- **Mouse**: + - Click and drag to pan + - Mouse wheel to zoom + - Click outside to close +- **Touch**: + - Swipe to navigate + - Pinch to zoom + - Double tap to toggle zoom + ## Contributing 1. Fork the repository @@ -65,4 +90,4 @@ This project is licensed under the MIT License - see the [LICENSE](LICENSE) file - Data provided by [nlib.cc](https://nlib.cc) - Icons by [Lucide](https://lucide.dev) -- Gallery powered by [PhotoSwipe](https://photoswipe.com) \ No newline at end of file +- Stats by [ghostland.at](https://stats.ghostland.at) \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a11313e..653b203 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,21 +1,19 @@ { "name": "nx-content", - "version": "3.0.0", + "version": "3.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "nx-content", - "version": "3.0.0", + "version": "3.0.2", "dependencies": { "clsx": "^2.1.0", "fuse.js": "^7.0.0", "lucide-react": "^0.344.0", "nx-content": "file:", - "photoswipe": "^5.4.3", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-photoswipe-gallery": "^3.0.1", "zustand": "^4.5.0" }, "devDependencies": { @@ -1446,6 +1444,7 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, "engines": { "node": ">=0.10.0" } @@ -1502,14 +1501,6 @@ "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", "dev": true }, - "node_modules/photoswipe": { - "version": "5.4.4", - "resolved": "https://registry.npmjs.org/photoswipe/-/photoswipe-5.4.4.tgz", - "integrity": "sha512-WNFHoKrkZNnvFFhbHL93WDkW3ifwVOXSW3w1UuZZelSmgXpIGiZSNlZJq37rR8YejqME2rHs9EhH9ZvlvFH2NA==", - "engines": { - "node": ">= 0.12.0" - } - }, "node_modules/picocolors": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", @@ -1701,17 +1692,6 @@ "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", "dev": true }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "peer": true, - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -1755,22 +1735,6 @@ "react": "^18.3.1" } }, - "node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "peer": true - }, - "node_modules/react-photoswipe-gallery": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/react-photoswipe-gallery/-/react-photoswipe-gallery-3.0.2.tgz", - "integrity": "sha512-TLkpzp2BSUUL/4GPRU5SQWXfJ8xuUBKgS8qUaHyhsT1co6CStr1mVCl4oQrSSFbWxAKhB5fHbr12l1R+TkqFcQ==", - "peerDependencies": { - "photoswipe": ">= 5.2.2", - "prop-types": ">= 15.7.0", - "react": ">= 16.8.0" - } - }, "node_modules/react-refresh": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", diff --git a/package.json b/package.json index 335accd..7c23ace 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "nx-content", "private": true, - "version": "3.0.0", + "version": "3.0.2", "type": "module", "scripts": { "dev": "vite", @@ -13,10 +13,8 @@ "fuse.js": "^7.0.0", "lucide-react": "^0.344.0", "nx-content": "file:", - "photoswipe": "^5.4.3", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-photoswipe-gallery": "^3.0.1", "zustand": "^4.5.0" }, "devDependencies": { diff --git a/src/App.tsx b/src/App.tsx index 07992bf..bbeabeb 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -176,8 +176,6 @@ export default function App() { tidQuery={tidQuery} onNameChange={setNameQuery} onTidChange={setTidQuery} - resultCount={filteredItems.length} - totalCount={items.filter(item => item.type === lastActiveTab).length} /> +
setSelectedId(null)} + >
-
+
+
e.stopPropagation()} + >
@@ -58,7 +64,7 @@ export function ErrorLog({ onClose }: ErrorLogProps) { const url = URL.createObjectURL(blob); const a = document.createElement('a'); a.href = url; - a.download = `nx-working-logs-${new Date().toISOString()}.txt`; + a.download = `nx-content-logs-${new Date().toISOString()}.txt`; document.body.appendChild(a); a.click(); document.body.removeChild(a); @@ -67,7 +73,7 @@ export function ErrorLog({ onClose }: ErrorLogProps) { className="flex items-center space-x-2 px-3 py-1.5 rounded-lg bg-primary/10 text-primary hover:bg-primary/20 transition-colors" > - Export Logs + Export Logs
-
+