diff --git a/frontend/src/components/modals/DivaNetModal.tsx b/frontend/src/components/modals/DivaNetModal.tsx
new file mode 100644
index 0000000..f38913b
--- /dev/null
+++ b/frontend/src/components/modals/DivaNetModal.tsx
@@ -0,0 +1,128 @@
+import type { SupportedGame } from "../../types/game";
+
+interface DivaNetModalProps {
+ isOpen: boolean;
+ onClose: () => void;
+ game: SupportedGame | undefined;
+ renderAsCard?: () => void;
+}
+
+const DivaNetModal = ({
+ isOpen,
+ onClose,
+ game,
+ renderAsCard
+}: DivaNetModalProps) => {
+ if (renderAsCard) {
+ return (
+
+
+
+ DIVA.NET Play History
+
+
+ Import via scraping your playdata from SEGA DIVA.NET
+
+
+
+ );
+ }
+
+ if (!isOpen) return null;
+
+ const handleClose = () => {
+ onClose();
+ };
+ if(game === undefined){
+ return "Sorry, due to some extreme error the game you're looking for doesn't seem to exist..."
+ }
+ return (
+
+ {/* Backdrop */}
+
+
+ {/* Modal */}
+
+
+ {/* Header */}
+
+
+ Import {game.formattedName} Data
+
+
+ Follow the instructions below to import your data
+
+
+
+ {/* Instructions */}
+
+
+ Instructions:
+
+
+ - Log into your DIVA.NET account
+ -
+ Navigate to the Play History (履歴) Page
+
+ -
+ Install the userscript to your browser (use an extension such
+ as Tampermonkey).
+
+ -
+ A button will appear on the page that you can click to start the scraping process.
+
+ - Upload the resulting JSON file into Mirage using the Batch-Manual Upload functionality
+ - Verify that all data has been imported correctly
+
+
+
+ {/* Additional Info */}
+
+
+ {/* Actions */}
+
+
+
+
+
+
+ );
+};
+
+export default DivaNetModal;
diff --git a/frontend/src/components/modals/EamusementModal.tsx b/frontend/src/components/modals/EamusementModal.tsx
index a861315..cb5c542 100644
--- a/frontend/src/components/modals/EamusementModal.tsx
+++ b/frontend/src/components/modals/EamusementModal.tsx
@@ -5,13 +5,54 @@ interface EamusementUploadModalProps {
isOpen: boolean;
onClose: () => void;
game: SupportedGame | undefined;
+ renderAsCard?: () => void;
+}
+
+const scriptLinkMap = {
+ "dancerush": "https://github.com/pinapelz/Mirage/raw/refs/heads/main/scripts/dancerush/dancerush_play_history.user.js",
+ "dancearound": "https://github.com/pinapelz/Mirage/raw/refs/heads/main/scripts/dancearound/dancearound_play_history.user.js",
}
const EamusementUploadModal = ({
isOpen,
onClose,
game,
+ renderAsCard
}: EamusementUploadModalProps) => {
+ if (renderAsCard) {
+ return (
+
+
+
+ e-amusement Play History
+
+
+ Import via scraping your playdata from KONAMI e-amusement
+
+
+
+ );
+ }
+
if (!isOpen) return null;
const handleClose = () => {
@@ -92,8 +133,12 @@ const EamusementUploadModal = ({
{/* Additional Info */}
diff --git a/frontend/src/pages/Import.tsx b/frontend/src/pages/Import.tsx
index 08976c7..dc88ab4 100644
--- a/frontend/src/pages/Import.tsx
+++ b/frontend/src/pages/Import.tsx
@@ -7,6 +7,7 @@ import SessionExpiredPopup from "../components/SessionExpiredPopup";
import type { SupportedGame } from "../types/game";
import { uploadScore } from "../utils/scoreUpload";
import { NavBar } from "../components/NavBar";
+import DivaNetModal from "../components/modals/DivaNetModal";
const Import = () => {
const { user, isLoading, logout } = useAuth();
@@ -14,6 +15,7 @@ const Import = () => {
const [selectedGame, setSelectedGame] = useState("");
const [isJsonModalOpen, setIsJsonModalOpen] = useState(false);
const [isEamusementModalOpen, setIsEamusementModalOpen] = useState(false);
+ const [isDivaNetModalOpen, setIsDivaNetModalOpen] = useState(false);
const [supportedGames, setSupportedGames] = useState([]);
const [gamesLoading, setGamesLoading] = useState(true);
const [uploadStatus, setUploadStatus] = useState<{
@@ -121,52 +123,49 @@ const Import = () => {
);
- const EamusementScrapeUploadCard = () => (
- <>
- {/* e-amusement Card */}
-
-
-
- e-amusement Play History
-
-
- Import via scraping your playdata from KONAMI e-amusement
-
-
-
- >
- );
+ // Component removed - moved to EamusementModal.tsx
const renderImportOptions = () => {
switch (selectedGame) {
case "dancerush":
return (
<>
- {/* JSON Upload Card */}
-
+ {}}
+ game={supportedGames.find((g) => g.internalName === selectedGame)}
+ renderAsCard={() => setIsEamusementModalOpen(true)}
+ />
>
);
-
+ break;
+ case "dancearound":
+ return (
+ <>
+
+ {}}
+ game={supportedGames.find((g) => g.internalName === selectedGame)}
+ renderAsCard={() => setIsEamusementModalOpen(true)}
+ />
+ >
+ );
+ break;
+ case "diva":
+ return (
+ <>
+
+ {}}
+ game={supportedGames.find((g) => g.internalName === selectedGame)}
+ renderAsCard={() => setIsDivaNetModalOpen(true)}
+ />
+ >
+ );
+ break;
default:
return ;
}
@@ -293,6 +292,16 @@ const Import = () => {
undefined
}
/>
+
+ {/* DivaNet Modal */}
+ setIsDivaNetModalOpen(false)}
+ game={
+ supportedGames.find((g) => g.internalName === selectedGame) ||
+ undefined
+ }
+ />
);
};
diff --git a/scripts/projectdiva-arcade/diva_net_history.user..js b/scripts/projectdiva-arcade/diva_net_history.user.js
similarity index 100%
rename from scripts/projectdiva-arcade/diva_net_history.user..js
rename to scripts/projectdiva-arcade/diva_net_history.user.js