Merge pull request #312 from Zagrios/feature/use-arcviewer/237

[feature-237] use ArcViewer
This commit is contained in:
MathieuG-P
2023-08-28 00:36:09 +02:00
committed by GitHub
3 changed files with 2 additions and 14 deletions
@@ -12,7 +12,6 @@ import { AudioPlayerService } from "renderer/services/audio-player.service";
import { useObservable } from "renderer/hooks/use-observable.hook";
import { map } from "rxjs/operators";
import equal from "fast-deep-equal/es6";
import { getMapZipUrlFromHash } from "renderer/helpers/maps-utils";
import { BsmBasicSpinner } from "../shared/bsm-basic-spinner/bsm-basic-spinner.component";
import defaultImage from "../../../../assets/images/default-version-img.jpg";
import { useTranslation } from "renderer/hooks/use-translation.hook";
@@ -73,8 +72,7 @@ export const MapItem = memo(({ hash, title, autor, songAutor, coverUrl, songUrl,
const songPlaying = useObservable(audioPlayer.playing$.pipe(map(playing => playing && audioPlayer.src === songUrl)));
const zipUrl = getMapZipUrlFromHash(hash);
const previewUrl = mapId ? `https://skystudioapps.com/bs-viewer/?url=${zipUrl}` : null;
const previewUrl = mapId ? `https://allpoland.github.io/ArcViewer/?id=${mapId}` : null;
const mapUrl = mapId ? `https://beatsaver.com/maps/${mapId}` : null;
const authorUrl = autorId ? `https://beatsaver.com/profile/${autorId}` : null;
const createdDate = createdAt ? dateFormat(createdAt, "d mmm yyyy") : null;
@@ -18,7 +18,7 @@ export function BsmIframeView() {
<div className="top-0 absolute w-screen h-screen flex content-center items-center justify-center z-[150]">
<motion.span className="absolute w-full h-full bg-black top-0 right-0" initial={{ opacity: 0 }} animate={{ opacity: 0.6 }} exit={{ opacity: 0 }} transition={{ duration: 0.2 }} />
<motion.div ref={ref} className="z-[1] w-[calc(100vw-250px)] h-[calc(100vh-250px)] shadow-black shadow-md rounded-md overflow-hidden bg-black" initial={{ y: "100vh" }} animate={{ y: 0 }} exit={{ y: "100vh" }}>
<iframe className="w-full h-full" src={iframeUrl} />
<iframe className="w-full h-full" src={iframeUrl} allowFullScreen/>
</motion.div>
</div>
)}
-10
View File
@@ -1,10 +0,0 @@
import { BsvMapDetail } from "shared/models/maps";
export function getMapZipUrlFromMapDetails(map: BsvMapDetail) {
const { hash } = map.versions.at(0);
return getMapZipUrlFromHash(hash);
}
export function getMapZipUrlFromHash(hash: string) {
return `https://r2cdn.beatsaver.com/${hash}.zip`;
}