'use client'; import { useState, useEffect } from 'react'; import Viewport from './components/Viewport'; import World from './components/World'; import Room from './components/Room'; import Door from './components/Door'; export default function Home() { const [currentPos, setCurrentPos] = useState({ x: 0, y: 0 }); const gridSize = { width: 2, height: 2 }; const navigateTo = (targetStr) => { const [x, y] = targetStr.split(',').map(Number); if (!isNaN(x) && !isNaN(y)) { setCurrentPos({ x, y }); } }; const moveRelative = (dx, dy) => { setCurrentPos((prev) => { const newX = prev.x + dx; const newY = prev.y + dy; if (newX >= 0 && newX < gridSize.width && newY >= 0 && newY < gridSize.height) { return { x: newX, y: newY }; } return prev; }); }; useEffect(() => { const handleKeyDown = (e) => { switch (e.key.toLowerCase()) { case 'arrowup': case 'w': moveRelative(0, -1); break; case 'arrowdown': case 's': moveRelative(0, 1); break; case 'arrowleft': case 'a': moveRelative(-1, 0); break; case 'arrowright': case 'd': moveRelative(1, 0); break; } }; window.addEventListener('keydown', handleKeyDown); return () => window.removeEventListener('keydown', handleKeyDown); }, []); return (

Tír na nÓg

Welcome to the Land of Eternal Youth.

The Meadow

Where pixels bloom and legends grow.

The Alleys

Navigating the narrow paths of creation.

The Portal

Step through to join the faebits.

); }