Improve MineGeo interface and functionality
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
"use client";
|
||||
import { useI18n } from "@/components/I18nProvider";
|
||||
|
||||
import { useEffect, useRef } from "react";
|
||||
import { Plus, Minus, RotateCcw } from "lucide-react";
|
||||
import * as THREE from "three";
|
||||
@@ -21,6 +23,7 @@ export function Panorama({
|
||||
onReady: () => void;
|
||||
onError: (message: string) => void;
|
||||
}) {
|
||||
const { t } = useI18n();
|
||||
const mount = useRef<HTMLDivElement>(null),
|
||||
view = useRef({ yaw: 0, pitch: 0, fov: 80 });
|
||||
const callbacks = useRef({ onReady, onError });
|
||||
@@ -161,14 +164,15 @@ export function Panorama({
|
||||
<div
|
||||
className="panorama"
|
||||
ref={mount}
|
||||
aria-label="360 degree panorama: drag to look around"
|
||||
data-native-cursor
|
||||
aria-label={t("360 degree panorama: drag to look around")}
|
||||
/>
|
||||
{
|
||||
<div className="panorama-controls">
|
||||
{zoom && (
|
||||
<>
|
||||
<button
|
||||
aria-label="Zoom in"
|
||||
aria-label={t("Zoom in")}
|
||||
onClick={() => {
|
||||
view.current.fov = Math.max(35, view.current.fov - 10);
|
||||
}}
|
||||
@@ -176,7 +180,7 @@ export function Panorama({
|
||||
<Plus size={17} />
|
||||
</button>
|
||||
<button
|
||||
aria-label="Zoom out"
|
||||
aria-label={t("Zoom out")}
|
||||
onClick={() => {
|
||||
view.current.fov = Math.min(100, view.current.fov + 10);
|
||||
}}
|
||||
@@ -186,7 +190,7 @@ export function Panorama({
|
||||
</>
|
||||
)}
|
||||
<button
|
||||
aria-label="Reset view"
|
||||
aria-label={t("Reset view")}
|
||||
onClick={() => {
|
||||
view.current = { yaw: 0, pitch: 0, fov: 80 };
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user