diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 0dbd0d0..47f8dd7 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -19,6 +19,7 @@ "@types/react-dom": "^18.3.0", "clsx": "^2.1.1", "holderjs": "^2.9.9", + "lodash": "^4.17.21", "nth-check": "^2.1.1", "openapi-fetch": "^0.12.2", "react": "^18.3.1", @@ -43,6 +44,7 @@ "@fortawesome/react-fontawesome": "^0.2.2", "@react-oauth/google": "^0.12.1", "@types/jest": "^29.5.12", + "@types/lodash": "^4.17.12", "axios": "^1.7.2", "babel-eslint": "*", "eslint": "^8.0.0", @@ -4508,6 +4510,12 @@ "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==" }, + "node_modules/@types/lodash": { + "version": "4.17.12", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.17.12.tgz", + "integrity": "sha512-sviUmCE8AYdaF/KIHLDJBQgeYzPBI0vf/17NaYehBJfYD1j6/L95Slh07NlyK2iNyBNaEkb3En2jRt+a8y3xZQ==", + "dev": true + }, "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", diff --git a/frontend/package.json b/frontend/package.json index c83b040..c95df93 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -14,6 +14,7 @@ "@types/react-dom": "^18.3.0", "clsx": "^2.1.1", "holderjs": "^2.9.9", + "lodash": "^4.17.21", "nth-check": "^2.1.1", "openapi-fetch": "^0.12.2", "react": "^18.3.1", @@ -60,6 +61,7 @@ "@fortawesome/react-fontawesome": "^0.2.2", "@react-oauth/google": "^0.12.1", "@types/jest": "^29.5.12", + "@types/lodash": "^4.17.12", "axios": "^1.7.2", "babel-eslint": "*", "eslint": "^8.0.0", diff --git a/frontend/src/App.css b/frontend/src/App.css index ba3baa8..6bb160b 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -43,6 +43,19 @@ body { /* Set transform origin to the left edge */ } +@keyframes spin-reverse { + from { + transform: rotate(360deg); + } + to { + transform: rotate(0deg); + } +} + +.animate-spin-reverse { + animation: spin-reverse 2s linear infinite; +} + @layer base { @layer base { /* Global input customization */ diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index f1c41ef..13c2c11 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -60,12 +60,7 @@ const App = () => { /> } - requiredSubscription={true} // Set true if subscription is required for this route - /> - } + element={} /> = ({ } }, [currentImage, index]); + const handleKey = (event: KeyboardEvent) => { + if (event.key === " " || event.code === "Space") { + // Prevent default action, e.g., scrolling + event.preventDefault(); + togglePlayPause(); + } + }; + + useEffect(() => { + window.addEventListener("keydown", handleKey); + return () => { + window.removeEventListener("keydown", handleKey); + }; + }, [handleKey]); + return (
- - -
- - - + {collection && ( + + )}
+ {collection && ( +
+ + + +
+ )} {/*