From 584415edff4d8ec435999d8009f6f16ed97b4314 Mon Sep 17 00:00:00 2001 From: miteruzo Date: Mon, 13 Apr 2026 18:33:50 +0900 Subject: [PATCH] #95 --- frontend/src/App.tsx | 77 ++++++++++--------- frontend/src/components/PostList.tsx | 2 +- frontend/src/components/TagSidebar.tsx | 4 +- frontend/src/components/TopNav.tsx | 10 ++- frontend/src/components/layout/MainArea.tsx | 9 ++- .../components/layout/SidebarComponent.tsx | 8 +- 6 files changed, 64 insertions(+), 46 deletions(-) diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx index d4cd701..7316e8b 100644 --- a/frontend/src/App.tsx +++ b/frontend/src/App.tsx @@ -1,4 +1,4 @@ -import { AnimatePresence, LayoutGroup } from 'framer-motion' +import { AnimatePresence, LayoutGroup, motion } from 'framer-motion' import { useEffect, useState } from 'react' import { BrowserRouter, Navigate, @@ -46,38 +46,36 @@ const RouteTransitionWrapper = ({ user, setUser }: { const location = useLocation () return ( - - - - }/> - }/> - }/> - }/> - }/> - }/> - }/> - }/> - }/> - }> - }/> - }/> - }/> - - {/* }/> */} - }/> - }/> - }/> - }/> - }/> - }/> - }/> - }/> - }/> - }/> - }/> - - - ) + + + }/> + }/> + }/> + }/> + }/> + }/> + }/> + }/> + }/> + }> + }/> + }/> + }/> + + {/* }/> */} + }/> + }/> + }/> + }/> + }/> + }/> + }/> + }/> + }/> + }/> + }/> + + ) } @@ -135,10 +133,15 @@ export default (() => { <> -
- - -
+ + + + + +
) diff --git a/frontend/src/components/PostList.tsx b/frontend/src/components/PostList.tsx index 39adbb3..c072154 100644 --- a/frontend/src/components/PostList.tsx +++ b/frontend/src/components/PostList.tsx @@ -56,7 +56,7 @@ export default (({ posts, onClick }: Props) => { cardRef.current.style.zIndex = '' cardRef.current.style.position = '' }} - transition={{ type: 'spring', stiffness: 500, damping: 40, mass: .5 }}> + transition={{ layout: { duration: .2, ease: 'easeOut' } }}> {post.title { {CATEGORIES.flatMap (cat => cat in tags ? ( tags[cat].map (tag => (
  • - +
  • ))) : [])} diff --git a/frontend/src/components/TopNav.tsx b/frontend/src/components/TopNav.tsx index aedbf82..2b5eee2 100644 --- a/frontend/src/components/TopNav.tsx +++ b/frontend/src/components/TopNav.tsx @@ -201,17 +201,17 @@ export default (({ user }: Props) => { ))} { itemsRef.current[visibleMenu.length] = el }} - onClick={e => e.preventDefault ()} + onClick={() => setMoreVsbl (false)} onMouseEnter={() => { setMoreVsbl (true) measure (-1) }} className={cn ('relative z-10 flex h-full items-center px-5', - (openItemIdx < 0) && 'font-bold')}> + (openItemIdx < 0 || moreVsbl) && 'font-bold')}> その他 » @@ -280,6 +280,7 @@ export default (({ user }: Props) => { : ( { setMoreVsbl (false)} className="h-full flex items-center px-3"> {subItem.name} @@ -317,12 +319,14 @@ export default (({ user }: Props) => { ? ( {item.component} ) : ( ( -
    + {children} -
    )) satisfies FC + )) satisfies FC diff --git a/frontend/src/components/layout/SidebarComponent.tsx b/frontend/src/components/layout/SidebarComponent.tsx index 946a251..4f8d983 100644 --- a/frontend/src/components/layout/SidebarComponent.tsx +++ b/frontend/src/components/layout/SidebarComponent.tsx @@ -1,3 +1,4 @@ +import { motion } from 'framer-motion' import { Helmet } from 'react-helmet-async' import type { FC, ReactNode } from 'react' @@ -6,7 +7,10 @@ type Props = { children: ReactNode } export default (({ children }: Props) => ( -
    +