diff --git a/frontend/package.json b/frontend/package.json index 976e422..49a02a1 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -4,7 +4,7 @@ "private": true, "dependencies": { "@popperjs/core": "^2.11.7", - "bootstrap": "^5.2.3", + "bootstrap": "^5.3.0-alpha3", "react": "18.2.0", "react-bootstrap": "^2.7.4", "react-dom": "18.2.0", diff --git a/frontend/public/index.html b/frontend/public/index.html index f7bb90e..aa8f484 100644 --- a/frontend/public/index.html +++ b/frontend/public/index.html @@ -1,16 +1,15 @@ - + - - - - - - + + + + + + CTMMM diff --git a/frontend/src/App.css b/frontend/src/App.css index f1930ac..28ff09c 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -9,13 +9,7 @@ } button.info { - /* position: absolute; - bottom: 0.5rem; - right: 0.5rem; */ - position: relative; - right: -100%; - - font-size: 24px; + float: right; aspect-ratio: 1; border-radius: 100%; padding: 0.5rem !important; @@ -37,3 +31,8 @@ button.info svg { justify-content: center; align-items: center; } + +.headerimg { + filter: drop-shadow(1.15px 1.15px 0 #ffffff30) + drop-shadow(-1.15px -1.15px 0 #ffffff30); +} diff --git a/frontend/src/components/Help/Info.jsx b/frontend/src/components/Help/Info.jsx index a1b4e3a..f541f55 100644 --- a/frontend/src/components/Help/Info.jsx +++ b/frontend/src/components/Help/Info.jsx @@ -27,48 +27,43 @@ export default ({ override, propagateOnHide }) => { 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: -

+ This tool works on a queue-based system since this process is pretty slow. + I apologize that it might take a while to process, but while you wait you can always:

+ + ); diff --git a/frontend/src/pages/Home.jsx b/frontend/src/pages/Home.jsx index 77465b6..a696a0a 100644 --- a/frontend/src/pages/Home.jsx +++ b/frontend/src/pages/Home.jsx @@ -1,5 +1,5 @@ /* eslint-disable import/no-extraneous-dependencies */ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import { Form, Button, Container, Accordion, Image, } from 'react-bootstrap'; @@ -10,6 +10,7 @@ import Delimiter from '../components/Help/Delimiter'; import HeaderImg from '../img/ctm.png'; export default () => { + const [dark, setDark] = useState(window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches); const [modals, setModals] = useState({ info: false, delim: false }); const [jobId, setJobId] = useState(window.localStorage.getItem('last-jobid')); const [formData, setFormData] = useState({ @@ -18,12 +19,28 @@ export default () => { modrinthId: '', }); - // eslint-disable-next-line max-len - const isValidState = () => !!formData.githubPat.length && !!formData.curseforgeSlug.length && !!formData.modrinthId.length; + useEffect(() => { // DARK MODE STUFF HERE + // Set initial state before even bothering with the update state + window.document.scrollingElement.setAttribute('data-bs-theme', dark ? 'dark' : 'light'); + + const pref = window.matchMedia('(prefers-color-scheme: dark)'); + const onChange = (query) => { + window.document.scrollingElement.setAttribute( + 'data-bs-theme', + query.matches ? 'dark' : 'light', + ); + setDark(query.matches); + }; + + pref.addEventListener('change', onChange); + return () => pref.removeEventListener('change', onChange); + }, [dark, setDark]); const makeJob = async (evt) => { evt.preventDefault(); - if (!isValidState()) return; + if (!formData.githubPat.length()) return; + if (!formData.curseforgeSlug.length()) return; + if (!formData.modrinthId.length()) return; const resp = await fetch('/api/v1/jobs', { method: 'PUT', @@ -44,7 +61,23 @@ export default () => { setModals({ ...modals, delim: false })} /> - + +

+ C + urse + {' '} + T + o + {' '} + M + odrinth + {' '} + M + od + {' '} + M + igrator +

GitHub Personal Access Token @@ -116,12 +149,14 @@ export default () => { /> +
@@ -141,20 +176,11 @@ export default () => { )}
- + {/*