diff --git a/frontend/package.json b/frontend/package.json index 29edc44..6ba4533 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -8,6 +8,7 @@ "react": "18.2.0", "react-bootstrap": "^2.7.4", "react-dom": "18.2.0", + "react-icons": "^4.8.0", "react-scripts": "5.0.1", "web-vitals": "^2.1.0" }, diff --git a/frontend/public/favicon.png b/frontend/public/favicon.png new file mode 100644 index 0000000..1ab6760 Binary files /dev/null and b/frontend/public/favicon.png differ diff --git a/frontend/public/index.html b/frontend/public/index.html index dd885d1..f7bb90e 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -3,13 +3,13 @@ - + - + - + CTMMM diff --git a/frontend/src/App.css b/frontend/src/App.css index 2147503..f1930ac 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -7,3 +7,33 @@ .output-log { margin-top: 2rem; } + +button.info { + /* position: absolute; + bottom: 0.5rem; + right: 0.5rem; */ + position: relative; + right: -100%; + + font-size: 24px; + aspect-ratio: 1; + border-radius: 100%; + padding: 0.5rem !important; +} + +button.info svg { + vertical-align: top; +} + +.ctm-root { + margin: auto; + max-width: 768px; +} + +#root { + min-height: 100vh; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} diff --git a/frontend/src/components/Help/Delimiter.jsx b/frontend/src/components/Help/Delimiter.jsx new file mode 100644 index 0000000..691a420 --- /dev/null +++ b/frontend/src/components/Help/Delimiter.jsx @@ -0,0 +1,41 @@ +import React from 'react'; +import { Modal } from 'react-bootstrap'; + +export default ({ show, onHide }) => ( + + +
+

+ This is the splitter between parts of the filename. Many mods use the format + {' '} + MODNAME-MCVER-MAJOR.MINOR.PATCH + , where + {' '} + - + {' '} + is the delimiter. +

+

+ Using this logic, it is assumed that the Minecraft version for this + {' '} + .jar + -file is between the first and second delimiter, and that the mod version is between + the second and the end of the file. Formatting aside from this is not supported, + unfortunately, as I've got a bit of trauma + {' '} + (/s) + {' '} + from + {' '} + + this Regular Expression I wrote. + +

+
+
+
+); diff --git a/frontend/src/components/Help/Info.jsx b/frontend/src/components/Help/Info.jsx new file mode 100644 index 0000000..a1b4e3a --- /dev/null +++ b/frontend/src/components/Help/Info.jsx @@ -0,0 +1,75 @@ +import React, { useState } from 'react'; +import { Modal } from 'react-bootstrap'; + +export default ({ override, propagateOnHide }) => { + const [show, setShow] = useState(!window.localStorage.getItem('info-dismissed')); + + const onHide = () => { + window.localStorage.setItem('info-dismissed', true); + setShow(false); + propagateOnHide(); + }; + + return ( + + + CurseForge to Modrinth Mod Migrator (CTMMM) + + +

+ Welcome! + {' '} + In order to use this tool you'll need to have already created (if it's + still "Under Review", that's ok) your Modrinth Page, and a few + other things: + +

+ + This tool works on a queue-based system since I cannot afford enough computing for + everyone, so you'll be able to see your status and place in the queue down + below in the "Status & Output Log". You will not lose your place in + the queue if you close this tab or leave this page, as long as you do not clear + browser storage you will still be able to track progress here, or of course on + your Modrinth project page! +

+ +

+ I want to make this process go faster, so if you liked it and want to support it you can: +

+

+
+
+ ); +}; diff --git a/frontend/src/components/Info.jsx b/frontend/src/components/Info.jsx deleted file mode 100644 index 9cdc3b5..0000000 --- a/frontend/src/components/Info.jsx +++ /dev/null @@ -1,52 +0,0 @@ -import React, { useState } from 'react'; - -export default () => { - const [render, setRender] = useState(true); - - const hide = () => { - window.localStorage.setItem('info-dismissed', true); - setRender(false); - }; - - return render && ( -
-

- Welcome! - {' '} - In order to use this tool you'll need to have already created (if it's - still "Under Review", that's ok) your Modrinth Page, and a few other things: - -

- - This tool works on a queue-based system since I cannot afford enough computing for everyone, - so you'll be able to see your status and place in the queue down below in the - "Status & Output Log". You will not lose your place in the queue if you close - this tab or leave this page, as long as you do not clear browser storage you will still be - able to track progress here, or of course on your Modrinth project page! -

- - {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} - [Hide] -
- ); -}; diff --git a/frontend/src/img/ctm.png b/frontend/src/img/ctm.png new file mode 100644 index 0000000..9fe30c1 Binary files /dev/null and b/frontend/src/img/ctm.png differ diff --git a/frontend/src/pages/Home.jsx b/frontend/src/pages/Home.jsx index 853e309..ad9955a 100644 --- a/frontend/src/pages/Home.jsx +++ b/frontend/src/pages/Home.jsx @@ -1,12 +1,16 @@ +/* eslint-disable import/no-extraneous-dependencies */ import React, { useState } from 'react'; import { - Form, Button, Container, Accordion, Modal, + Form, Button, Container, Accordion, Image, } from 'react-bootstrap'; +import { TbInfoHexagon, TbHelp } from 'react-icons/tb'; import OutputLog from '../components/OutputLog'; -import Info from '../components/Info'; +import Info from '../components/Help/Info'; +import Delimiter from '../components/Help/Delimiter'; +import HeaderImg from '../img/ctm.png'; export default () => { - const [help, setHelp] = useState(null); + const [modals, setModals] = useState({ info: false, delim: false }); const [jobId, setJobId] = useState(window.localStorage.getItem('last-jobid')); const [formData, setFormData] = useState({ githubPat: '', @@ -16,39 +20,6 @@ export default () => { // eslint-disable-next-line max-len const isValidState = () => !!formData.githubPat.length && !!formData.slug.length && !!formData.projId.length; - const delimHelp = (evt) => { - evt.preventDefault(); - setHelp(( -
-

- This is the splitter between parts of the filename. Geolosys uses format - {' '} - MODNAME-MCVER-MAJOR.MINOR.PATCH - , where - {' '} - - - {' '} - is the delimiter. -

-

- Using this logic, it is assumed that the Minecraft version for this - {' '} - .jar - -file is between the first and second delimiter, and that the mod version is between - the second and the end of the file. Formatting aside from this is not supported, - unfortunately, as I've got a bit of trauma - {' '} - (/s) - {' '} - from - {' '} - - this Regular Expression I wrote. - -

-
- )); - }; const makeJob = async (evt) => { evt.preventDefault(); @@ -68,14 +39,12 @@ export default () => { }; return ( -
-

- CurseForge to Modrinth Mod Migrator (CTMMM) -

- - {!window.localStorage.getItem('info-dismissed') && ()} +
+ setModals({ ...modals, info: false })} /> + setModals({ ...modals, delim: false })} /> +
GitHub Personal Access Token @@ -127,7 +96,14 @@ export default () => { Delimiter (Optional) {' '} {/* eslint-disable-next-line jsx-a11y/anchor-is-valid */} - ❔ + setModals({ ...modals, delim: true })} + style={{ textDecoration: 'none', fontSize: '16px' }} + href="#" + label="delimiter_help" + > + + { + + {/* setHelp(null)}> + + Help + {help} - + */}
); };