diff --git a/src/app/layout.tsx b/src/app/layout.tsx index a81bbda..a230ef3 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -8,7 +8,7 @@ export const metadata: Metadata = { title: 'Ultimate History Map', description: 'Bản đồ tương tác lịch sử thế giới qua các thời kỳ', }; - + const inter = Inter({ subsets: ['latin', 'vietnamese'], weight: ['400', '500', '600', '700'], diff --git a/src/uhm/components/preview/MapPlaceholder.tsx b/src/uhm/components/preview/MapPlaceholder.tsx index ae83ebf..04a5cf6 100644 --- a/src/uhm/components/preview/MapPlaceholder.tsx +++ b/src/uhm/components/preview/MapPlaceholder.tsx @@ -141,8 +141,8 @@ export default function MapPlaceholder({ onEnter }: MapPlaceholderProps) { diff --git a/src/uhm/components/preview/PublicPreviewClientPage.tsx b/src/uhm/components/preview/PublicPreviewClientPage.tsx index d7c32f2..5882a2b 100644 --- a/src/uhm/components/preview/PublicPreviewClientPage.tsx +++ b/src/uhm/components/preview/PublicPreviewClientPage.tsx @@ -130,7 +130,7 @@ export default function PublicPreviewClientPage({ } else { const timer = setTimeout(() => { setLoadInteractiveMap(true); - }, 2000); + }, 2500); return () => clearTimeout(timer); } }, [instantLoad]); @@ -794,102 +794,213 @@ export default function PublicPreviewClientPage({ return ( <> - {isBackgroundVisibilityReady && loadInteractiveMap && ( - { - setGeometryVisibility((prev) => ({ - ...prev, - [typeKey]: prev[typeKey] === false, - })); - }} - timelineYear={currentTimelineYear} - onTimelineYearChange={handleTimelineYearChange} - timelineTimeRange={timeRange} - onTimelineTimeRangeChange={handleTimeRangeChange} - isTimelineLoading={isTimelineLoading || isRelationsLoading} - timelineStatusText={relationsStatus || timelineStatus} - timelineStyle={computedTimelineStyle} - onFeatureClick={handleMapFeatureClick} - hoverPopupEnabled - getHoverPopupContent={getHoverPopupContent} - activeEntity={displayedActiveEntity} - activeWiki={displayedActiveWiki} - isWikiLoading={isActiveWikiLoading} - wikiError={activeWikiError} - onCloseWikiSidebar={handleCloseWikiSidebar} - onWikiLinkRequest={handlePanelWikiLinkRequest} - onWikiLinkEntitySelectionRequest={handlePanelWikiLinkEntitySelectionRequest} - sidebarWidth={sidebarWidth} - onSidebarWidthChange={setSidebarWidth} - maxSidebarDragWidth={maxDragWidth} - sidebarHeight={sidebarHeight} - onSidebarHeightChange={handleSidebarHeightChange} - showViewportControls={false} - onPlayPreviewReplay={activeReplay && replayMode === "idle" ? handlePlayPreviewReplay : undefined} - timelineDisabled={replayMode !== "idle"} - hasAnyBottomPanel={isWikiChooserOpen || isGeometryChooserOpen} - overlay={ - replayMode !== "idle" ? ( - + {isBackgroundVisibilityReady && loadInteractiveMap && ( + { + setGeometryVisibility((prev) => ({ + ...prev, + [typeKey]: prev[typeKey] === false, + })); + }} + timelineYear={currentTimelineYear} + onTimelineYearChange={handleTimelineYearChange} + timelineTimeRange={timeRange} + onTimelineTimeRangeChange={handleTimeRangeChange} + isTimelineLoading={isTimelineLoading || isRelationsLoading} + timelineStatusText={relationsStatus || timelineStatus} + timelineStyle={computedTimelineStyle} + onFeatureClick={handleMapFeatureClick} + hoverPopupEnabled + getHoverPopupContent={getHoverPopupContent} + activeEntity={displayedActiveEntity} + activeWiki={displayedActiveWiki} + isWikiLoading={isActiveWikiLoading} + wikiError={activeWikiError} + onCloseWikiSidebar={handleCloseWikiSidebar} + onWikiLinkRequest={handlePanelWikiLinkRequest} + onWikiLinkEntitySelectionRequest={handlePanelWikiLinkEntitySelectionRequest} + sidebarWidth={sidebarWidth} + onSidebarWidthChange={setSidebarWidth} + maxSidebarDragWidth={maxDragWidth} + sidebarHeight={sidebarHeight} + onSidebarHeightChange={handleSidebarHeightChange} + showViewportControls={false} + onPlayPreviewReplay={activeReplay && replayMode === "idle" ? handlePlayPreviewReplay : undefined} + timelineDisabled={replayMode !== "idle"} + hasAnyBottomPanel={isWikiChooserOpen || isGeometryChooserOpen} + overlay={ + replayMode !== "idle" ? ( + + ) : null + } + > + + - ) : null - } - > - - + ) : null} + + + + )} + + {linkEntityPopup ? ( + + + + Related Entities + + + /wiki/{linkEntityPopup.slug} + + + + {linkEntityPopup.entities.length ? ( + + {linkEntityPopup.entities.map((entity) => ( + { + setWikiSelectionPanelAnchor(null); + setRightPanelMode("wiki"); + selectEntity(entity.id, { preferredWikiSlug: linkEntityPopup.slug }); + setLinkEntityPopup(null); + }} + className="rounded-lg px-3 py-2 text-left text-sm text-gray-700 transition hover:bg-gray-50 hover:text-gray-900 dark:text-gray-200 dark:hover:bg-white/[0.04] dark:hover:text-white" + > + {entity.name} + + ))} + + ) : ( + + Không có entity liên quan. + + )} + + + ) : null} + + {isGeometryChooserOpen && geometrySelectionPanel ? ( + + ) : null} + + {isWikiChooserOpen ? ( + - - - )} + + ) : null} + {/* Smooth transition loading overlay */} - - {linkEntityPopup ? ( - - - - Related Entities - - - /wiki/{linkEntityPopup.slug} - - - - {linkEntityPopup.entities.length ? ( - - {linkEntityPopup.entities.map((entity) => ( - { - setWikiSelectionPanelAnchor(null); - setRightPanelMode("wiki"); - selectEntity(entity.id, { preferredWikiSlug: linkEntityPopup.slug }); - setLinkEntityPopup(null); - }} - className="rounded-lg px-3 py-2 text-left text-sm text-gray-700 transition hover:bg-gray-50 hover:text-gray-900 dark:text-gray-200 dark:hover:bg-white/[0.04] dark:hover:text-white" - > - {entity.name} - - ))} - - ) : ( - - Không có entity liên quan. - - )} - - - ) : null} - - {isGeometryChooserOpen && geometrySelectionPanel ? ( - - ) : null} - - {isWikiChooserOpen ? ( - - ) : null} > ); } diff --git a/src/uhm/components/preview/PublicPreviewWrapper.tsx b/src/uhm/components/preview/PublicPreviewWrapper.tsx index 3eb6caa..40a505f 100644 --- a/src/uhm/components/preview/PublicPreviewWrapper.tsx +++ b/src/uhm/components/preview/PublicPreviewWrapper.tsx @@ -88,14 +88,6 @@ export default function PublicPreviewWrapper() { }; }, [handleEnter, mapEntered]); - if (!mapEntered && !instantLoad) { - return ( - - ); - } - return (