33import { Chakra_Petch } from "next/font/google" ;
44import Link from "next/link" ;
55import Image from "next/image" ; // Import Image component
6+ import TheInfiniteImage from "../../../public/The-Infinite.svg" ;
67import React , { useState } from "react" ;
7-
8+ import { TheInfiniteX } from "./img" ;
89const chakraPetch = Chakra_Petch ( {
910 variable : "--font-chakra-petch" ,
1011 subsets : [ "latin" ] ,
@@ -15,10 +16,17 @@ const menus_list = [
1516 {
1617 name : "Home" ,
1718 link : "/" ,
19+ target : "_self" ,
1820 } ,
1921 {
2022 name : "Articles" ,
2123 link : "/article" ,
24+ target : "_self" ,
25+ } ,
26+ {
27+ img : TheInfiniteX ,
28+ link : "https://x.com" ,
29+ target : "_blank" ,
2230 } ,
2331] ;
2432
@@ -38,26 +46,34 @@ export default function Header() {
3846 // Added padding, flex layout for alignment
3947 < header className = "p-4 flex justify-between items-center relative" >
4048 { /* Title */ }
41- < h1
42- className = { `${ chakraPetch . className } italic font-semibold text-3xl` } // Use Tailwind classes
49+ < div
4350 style = { {
44- fontStyle : "italic " ,
45- fontWeight : "600 " ,
46- fontSize : "32px" , // Use text-3xl or similar
51+ display : "flex " ,
52+ alignItems : "center " ,
53+ justifyContent : "flex-start" ,
4754 } }
4855 >
49- < Link
50- href = "/"
51- onClick = { handleLinkClick }
56+ < Image src = { TheInfiniteImage } alt = "" width = { 30 } height = { 30 } />
57+ < h1
58+ className = { ` ${ chakraPetch . className } italic font-semibold text-3xl` } // Use Tailwind classes
5259 style = { {
53- color : "var(--foreground)" ,
60+ fontStyle : "italic" ,
61+ fontWeight : "600" ,
62+ fontSize : "32px" , // Use text-3xl or similar
5463 } }
5564 >
56- { "The Infinity's" }
57- { /* Added Link here for consistency */ }
58- </ Link >
59- </ h1 >
60-
65+ < Link
66+ href = "/"
67+ onClick = { handleLinkClick }
68+ style = { {
69+ color : "var(--foreground)" ,
70+ } }
71+ >
72+ { "The Infinity's" }
73+ { /* Added Link here for consistency */ }
74+ </ Link >
75+ </ h1 >
76+ </ div >
6177 { /* Hamburger Button - Hidden on md and larger screens */ }
6278 < button
6379 onClick = { toggleMenu }
@@ -81,32 +97,33 @@ export default function Header() {
8197 className = { `
8298 ${
8399 isMenuOpen ? "opacity-100 max-h-screen" : "opacity-0 max-h-0"
84- } md:opacity-100 md:max-h-none /* Show/hide based on state and screen size */
85- transition-all duration-300 ease-in-out /* Smooth animation */
100+ } md:opacity-100 md:max-h-none
101+ transition-all duration-300 ease-in-out
86102 fixed md:relative top-0 left-0 w-full h-full md:w-auto md:h-100%
87- bg-[var(--primary)] md:bg-transparent /* Background for mobile */
88- z-20 /* Ensure menu is below header content but above main */
89- overflow-hidden /* Prevent content overflow during animation */
90- flex flex-col md:flex-row items-center justify-center md:justify-end /* Center items for mobile, right-align for desktop */
103+ bg-[var(--primary)] md:bg-transparent
104+ z-20 overflow-hidden
105+ flex flex-col md:flex-row items-center justify-center md:justify-end
91106 ` }
92107 >
93108 < ul
94109 className = { `
95- flex flex-col md:flex-row md:space-x-6 /* Layout adjustments */
96- items-center /* Center items for better mobile view */
97- p-4 md:p-0 /* Padding for mobile */
110+ flex flex-col md:flex-row md:space-x-6
111+ items-center
112+ p-4 md:p-0
98113 ` }
99114 >
100115 { menus_list . map ( ( menu , index ) => (
101116 < li key = { index } >
102117 < Link
103118 href = { menu . link }
104119 onClick = { handleLinkClick }
120+ target = { menu . target } // target属性を追加
105121 className = { `${ chakraPetch . className } block py-2 md:py-0 hover:text-[var(--foreground)]` }
106122 style = { {
107123 fontStyle : "italic" ,
108124 } }
109125 >
126+ { menu . img && menu . img }
110127 { menu . name }
111128 </ Link >
112129 </ li >
0 commit comments