|
|
|
@ -20,9 +20,9 @@ export default function Expo() { |
|
|
|
const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 }); |
|
|
|
const [mousePosition, setMousePosition] = useState({ x: 0, y: 0 }); |
|
|
|
const [showDividers, setShowDividers] = useState<boolean>(true); |
|
|
|
const [showDividers, setShowDividers] = useState<boolean>(true); |
|
|
|
const [currentView, setCurrentView] = useState<"tudengimaja" | "fuajee">( |
|
|
|
const [currentView, setCurrentView] = useState<"tudengimaja" | "fuajee">( |
|
|
|
"tudengimaja", |
|
|
|
"fuajee", |
|
|
|
); |
|
|
|
); |
|
|
|
const currentViewRef = useRef<"tudengimaja" | "fuajee">("tudengimaja"); |
|
|
|
const currentViewRef = useRef<"tudengimaja" | "fuajee">("fuajee"); |
|
|
|
const t = useTranslations(); |
|
|
|
const t = useTranslations(); |
|
|
|
|
|
|
|
|
|
|
|
// Define room names with translations
|
|
|
|
// Define room names with translations
|
|
|
|
@ -103,9 +103,9 @@ export default function Expo() { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// Position camera for isometric view (default to tudengimaja)
|
|
|
|
// Position camera for isometric view (default to fuajee)
|
|
|
|
camera.position.copy(cameraPositions.tudengimaja.position); |
|
|
|
camera.position.copy(cameraPositions.fuajee.position); |
|
|
|
camera.lookAt(cameraPositions.tudengimaja.lookAt); |
|
|
|
camera.lookAt(cameraPositions.fuajee.lookAt); |
|
|
|
|
|
|
|
|
|
|
|
// Renderer
|
|
|
|
// Renderer
|
|
|
|
const renderer = new THREE.WebGLRenderer({ antialias: true }); |
|
|
|
const renderer = new THREE.WebGLRenderer({ antialias: true }); |
|
|
|
@ -319,6 +319,9 @@ export default function Expo() { |
|
|
|
// Store tudengimaja objects (rooms, ground, dividers)
|
|
|
|
// Store tudengimaja objects (rooms, ground, dividers)
|
|
|
|
tudengimajaObjects = [...rooms, ground, ground2, ...dividers]; |
|
|
|
tudengimajaObjects = [...rooms, ground, ground2, ...dividers]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set initial visibility for fuajee default view
|
|
|
|
|
|
|
|
tudengimajaObjects.forEach((obj) => (obj.visible = false)); |
|
|
|
|
|
|
|
|
|
|
|
// Load fuajee GLTF model
|
|
|
|
// Load fuajee GLTF model
|
|
|
|
const loader = new GLTFLoader(); |
|
|
|
const loader = new GLTFLoader(); |
|
|
|
loader.load( |
|
|
|
loader.load( |
|
|
|
@ -327,7 +330,7 @@ export default function Expo() { |
|
|
|
fuajeeMesh = gltf.scene; |
|
|
|
fuajeeMesh = gltf.scene; |
|
|
|
fuajeeMesh.position.set(-1.5, 1, 0); |
|
|
|
fuajeeMesh.position.set(-1.5, 1, 0); |
|
|
|
fuajeeMesh.scale.set(0.3, 0.3, 0.3); |
|
|
|
fuajeeMesh.scale.set(0.3, 0.3, 0.3); |
|
|
|
fuajeeMesh.visible = false; // Initially hidden
|
|
|
|
fuajeeMesh.visible = true; // Initially visible for fuajee default
|
|
|
|
|
|
|
|
|
|
|
|
// Traverse the model to collect meshes
|
|
|
|
// Traverse the model to collect meshes
|
|
|
|
fuajeeMesh.traverse((child) => { |
|
|
|
fuajeeMesh.traverse((child) => { |
|
|
|
@ -342,6 +345,11 @@ export default function Expo() { |
|
|
|
|
|
|
|
|
|
|
|
// Create example rooms for fuajee after the model loads
|
|
|
|
// Create example rooms for fuajee after the model loads
|
|
|
|
createfuajeeRooms(); |
|
|
|
createfuajeeRooms(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Set initial visibility for fuajee view
|
|
|
|
|
|
|
|
tudengimajaObjects.forEach((obj) => (obj.visible = false)); |
|
|
|
|
|
|
|
fuajeeMesh.visible = true; |
|
|
|
|
|
|
|
fuajeeRooms.forEach((room) => (room.visible = true)); |
|
|
|
}, |
|
|
|
}, |
|
|
|
(progress) => { |
|
|
|
(progress) => { |
|
|
|
console.log( |
|
|
|
console.log( |
|
|
|
@ -457,7 +465,7 @@ export default function Expo() { |
|
|
|
room.castShadow = true; |
|
|
|
room.castShadow = true; |
|
|
|
room.receiveShadow = true; |
|
|
|
room.receiveShadow = true; |
|
|
|
room.userData = { name: roomDef.name, originalColor: roomDef.color }; |
|
|
|
room.userData = { name: roomDef.name, originalColor: roomDef.color }; |
|
|
|
room.visible = false; // Initially hidden
|
|
|
|
room.visible = true; // Initially visible for fuajee default
|
|
|
|
|
|
|
|
|
|
|
|
scene.add(room); |
|
|
|
scene.add(room); |
|
|
|
fuajeeRooms.push(room); |
|
|
|
fuajeeRooms.push(room); |
|
|
|
@ -890,13 +898,14 @@ export default function Expo() { |
|
|
|
{currentView === "fuajee" && ( |
|
|
|
{currentView === "fuajee" && ( |
|
|
|
<button |
|
|
|
<button |
|
|
|
onClick={() => handleViewSwitch("tudengimaja")} |
|
|
|
onClick={() => handleViewSwitch("tudengimaja")} |
|
|
|
className="group absolute left-4 bottom-4 p-4 md:p-6 transition-all duration-300 hover:scale-110 z-20 touch-manipulation min-h-[48px] min-w-[48px] flex items-center justify-center" |
|
|
|
className={`absolute bottom-2 left-1/2 transform -translate-x-1/2 px-3 py-2 bg-[#1F5673] text-white hover:bg-[#2A7A9B] ${vipnagorgialla.className} uppercase italic text-sm font-semibold flex items-center transition-colors shadow-lg z-10 cursor-pointer`} |
|
|
|
title="Switch to Tudengimaja" |
|
|
|
title="Switch to Tudengimaja" |
|
|
|
aria-label="Switch to Tudengimaja view" |
|
|
|
aria-label="Switch to Tudengimaja view" |
|
|
|
> |
|
|
|
> |
|
|
|
<span className="material-symbols-outlined !text-[clamp(2.5rem,2rem+2vw,4rem)] !font-bold text-[#007CAB] dark:text-[#00A3E0] group-hover:-translate-x-2 dark:group-hover:text-[#EEE5E5] group-hover:text-[#EEE5E5] transition transform rotate-180"> |
|
|
|
<span className="material-symbols-outlined !text-2xl !font-bold text-white mr-2 transform rotate-180"> |
|
|
|
arrow_right_alt |
|
|
|
arrow_right_alt |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
|
|
|
|
{t("schedule.locations.studentHouse")} |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
)} |
|
|
|
)} |
|
|
|
|
|
|
|
|
|
|
|
@ -904,11 +913,12 @@ export default function Expo() { |
|
|
|
{currentView === "tudengimaja" && ( |
|
|
|
{currentView === "tudengimaja" && ( |
|
|
|
<button |
|
|
|
<button |
|
|
|
onClick={() => handleViewSwitch("fuajee")} |
|
|
|
onClick={() => handleViewSwitch("fuajee")} |
|
|
|
className="group absolute right-4 bottom-4 p-4 md:p-6 transition-all duration-300 hover:scale-110 z-20 touch-manipulation min-h-[48px] min-w-[48px] flex items-center justify-center" |
|
|
|
className={`absolute bottom-2 left-1/2 transform -translate-x-1/2 px-3 py-2 bg-[#1F5673] text-white hover:bg-[#2A7A9B] ${vipnagorgialla.className} uppercase italic text-sm font-semibold flex items-center transition-colors shadow-lg z-10 cursor-pointer`} |
|
|
|
title="Switch to Fuajee" |
|
|
|
title="Switch to Fuajee" |
|
|
|
aria-label="Switch to Fuajee view" |
|
|
|
aria-label="Switch to Fuajee view" |
|
|
|
> |
|
|
|
> |
|
|
|
<span className="material-symbols-outlined !text-[clamp(2.5rem,2rem+2vw,4rem)] !font-bold text-[#007CAB] dark:text-[#00A3E0] group-hover:translate-x-2 dark:group-hover:text-[#EEE5E5] group-hover:text-[#EEE5E5] transition"> |
|
|
|
{t("schedule.locations.entranceHall")} |
|
|
|
|
|
|
|
<span className="material-symbols-outlined !text-2xl !font-bold text-white ml-2"> |
|
|
|
arrow_right_alt |
|
|
|
arrow_right_alt |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</button> |
|
|
|
</button> |
|
|
|
@ -917,7 +927,7 @@ export default function Expo() { |
|
|
|
{currentView === "tudengimaja" && ( |
|
|
|
{currentView === "tudengimaja" && ( |
|
|
|
<button |
|
|
|
<button |
|
|
|
onClick={() => setShowDividers(!showDividers)} |
|
|
|
onClick={() => setShowDividers(!showDividers)} |
|
|
|
className={`absolute top-2 right-2 px-3 py-2 bg-[#1F5673] text-white hover:bg-[#2A7A9B] ${vipnagorgialla.className} uppercase italic text-sm font-semibold flex items-center transition-colors shadow-lg z-10`} |
|
|
|
className={`absolute top-2 right-2 px-3 py-2 bg-[#1F5673] text-white hover:bg-[#2A7A9B] ${vipnagorgialla.className} uppercase italic text-sm font-semibold flex items-center transition-colors shadow-lg z-10 cursor-pointer`} |
|
|
|
> |
|
|
|
> |
|
|
|
{showDividers ? ( |
|
|
|
{showDividers ? ( |
|
|
|
<EyeClosed className="w-6 h-6 mr-2" /> |
|
|
|
<EyeClosed className="w-6 h-6 mr-2" /> |
|
|
|
|