Skip to content

Commit 8ca47bc

Browse files
Merge branch 'dev'
2 parents 65bdc3e + 39a95d2 commit 8ca47bc

File tree

4 files changed

+126
-24
lines changed

4 files changed

+126
-24
lines changed

public/The-Infinite.svg

Lines changed: 36 additions & 0 deletions
Loading

src/app/globals.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ header a {
5656
font-style: italic;
5757
font-weight: 600;
5858
padding: 1em;
59+
padding-left: 0;
5960
text-decoration: none;
6061
}
6162

src/app/layout/header.tsx

Lines changed: 41 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
import { Chakra_Petch } from "next/font/google";
44
import Link from "next/link";
55
import Image from "next/image"; // Import Image component
6+
import TheInfiniteImage from "../../../public/The-Infinite.svg";
67
import React, { useState } from "react";
7-
8+
import { TheInfiniteX } from "./img";
89
const 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>

src/app/layout/img.tsx

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
export const TheInfiniteX = (
2+
<svg
3+
version="1.1"
4+
xmlns="http://www.w3.org/2000/svg"
5+
width="251.54369"
6+
height="89.94669"
7+
viewBox="0,0,251.54369,89.94669"
8+
fill="var(--foreground)"
9+
stroke="none"
10+
style={{
11+
width: "auto",
12+
height: "1em",
13+
}}
14+
>
15+
<g transform="translate(-114.86424,-135.02666)">
16+
<g strokeMiterlimit="10">
17+
<path
18+
d="M321.98668,219.12827v5.84509h-44.97334v-5.84509z"
19+
strokeWidth="0"
20+
/>
21+
<path
22+
d="M205.22406,219.12827v5.84509h-44.97334v-5.84509z"
23+
strokeWidth="0"
24+
/>
25+
<path
26+
d="M231.62877,186.88706l-35.63506,-51.8604h26.20781l23.99671,34.92281l30.04348,-34.92281h7.76462l-34.361,39.93932l34.361,50.00737h-26.20781l-22.72259,-33.06978l-28.44957,33.06978h-7.76418l32.76468,-38.08629zM242.26157,174.5235l-23.71287,-33.91756h-11.92601l29.05884,41.56549l3.48148,4.97961l22.35499,31.97723h11.926l-27.70095,-39.62325l-3.48148,-4.97961z"
27+
strokeWidth="1"
28+
/>
29+
<path
30+
d="M348.39137,186.88706l-35.63505,-51.8604h26.20781l23.99671,34.92281l3.44709,5.01651l-14.56939,16.93759l-28.44956,33.06978h-7.76418l32.76468,-38.08629zM359.02417,174.5235l-23.71286,-33.91756h-11.926l29.05882,41.56549l6.58005,-7.64602z"
31+
strokeWidth="1"
32+
/>
33+
<path
34+
d="M277.01334,140.87176v-5.84509h44.97334v5.84509z"
35+
strokeWidth="0"
36+
/>
37+
<path
38+
d="M114.86614,186.88706l14.56946,-16.93759l30.04348,-34.92281h7.76462l-34.361,39.93932l34.361,50.00737h-26.20781l-22.72258,-33.06978l-3.44907,-5.01651zM122.4004,187.15104l22.35499,31.97723h11.926l-27.70095,-39.62325z"
39+
strokeWidth="1"
40+
/>
41+
<path
42+
d="M160.25073,140.87176v-5.84509h44.97334v5.84509z"
43+
strokeWidth="0"
44+
/>
45+
</g>
46+
</g>
47+
</svg>
48+
);

0 commit comments

Comments
 (0)