Skip to content

Commit 4990b1f

Browse files
committed
feat(headerBar): fix style
1 parent fb09008 commit 4990b1f

File tree

12 files changed

+43
-25
lines changed

12 files changed

+43
-25
lines changed

app/components/Home/ChanTitle.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const ChanTitle: React.FC = () => {
1717

1818
const handleMouseEnter = useDebounce(() => {
1919
setHoverState(true);
20+
console.log('ni')
2021
}, 200);
2122
const handleMouseLeave = useDebounce(() => {
2223
setHoverState(false);
@@ -44,13 +45,13 @@ const ChanTitle: React.FC = () => {
4445
}
4546
const timerId = setTimeout(() => {
4647
setAniState(true);
47-
}, 300);
48+
}, 500);
4849
return () => clearTimeout(timerId);
4950
}, [pathName]);
5051

5152
if (!isShow) return null;
5253
return (
53-
<div id="chan-title" className="relative w-full h-28 border-solid border-2">
54+
<div id="chan-title" className="relative w-full h-28 ">
5455
<div className="absolute flex top-8 left-1/2 text-4xl font-extrabold transform -translate-x-1/2">
5556
<span className="relative bottom-4 hidden xs:block">
5657
{aniState && (
@@ -64,6 +65,7 @@ const ChanTitle: React.FC = () => {
6465
alt=""
6566
width={80}
6667
height={80}
68+
layout="intrinsic"
6769
></Image>
6870
</animated.div>
6971
)}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import React from 'react';
2+
3+
const Search: React.FC = () => {
4+
return <input type="search" className="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2" placeholder="Search..."></input>;
5+
};
6+
7+
export default Search;
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
.nav-bar {
2-
display: flex;
3-
border: 1px solid red;
2+
display: flex;
3+
position: relative;
4+
border: 1px solid red;
45

5-
& a {
6-
padding: 1rem;
7-
}
8-
}
6+
& a {
7+
padding: 1rem;
8+
}
9+
}
10+
11+
.chan-header {
12+
margin-left: 0.5%;
13+
margin-right: 0.5%;
14+
border-radius: 12px;
15+
}

app/components/Home/Nav/HeaderBar/index.tsx

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
'use client'
1+
'use client';
22

33
import ChanLink from '@/components/Partial/ChanLink';
44
import styles from './headerBar.module.scss';
5-
import Info from './info';
5+
import Info from './Info';
6+
import Search from './Search';
67

78
const links = [
89
{ name: '主页', href: '/' },
@@ -15,15 +16,8 @@ const HeaderBar: React.FC = () => {
1516
return (
1617
<header
1718
id="chan-header"
18-
className="flex justify-center items-center sticky top-0 border-2 border-balck border-solid"
19+
className={` ${styles['chan-header']} flex items-center sticky top-0 border-2 border-balck border-solid`}
1920
>
20-
{/* <Image
21-
className="absolute -z-10 -left-4"
22-
src={'/title-png/site-logo.webp'}
23-
alt="SteinsGate"
24-
width={250}
25-
height={65}
26-
></Image> */}
2721
<nav className={styles['nav-bar']}>
2822
{links.map((link) => {
2923
return (
@@ -33,6 +27,7 @@ const HeaderBar: React.FC = () => {
3327
);
3428
})}
3529
</nav>
30+
<Search></Search>
3631
<Info></Info>
3732
</header>
3833
);

app/components/Home/Nav/HeaderBar/info.tsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
1+
import { Icon } from '@iconify/react/dist/iconify.js';
12
import React from 'react';
23

34
const Info: React.FC = () => {
45
return (
56
<div
67
id="header-info"
7-
className="absolute right-0 flex justify-center border-2 gap-4 border-solid border-green "
8+
className="absolute right-4 flex justify-center items-center"
89
>
9-
<div className="avator">avator</div>
10-
<div className="config">config</div>
11-
<input type="search" placeholder="Search..."></input>
10+
<div className="avator w-10 h-10 m-4 flex justify-center items-center border-solid border-2 border-yellow-300 rounded-full">
11+
<button>登录</button>
12+
</div>
13+
<div className="config">
14+
<Icon icon='eos-icons:rotating-gear' width={30} height={30}></Icon>
15+
</div>
1216
</div>
1317
);
1418
};

app/global.css

+4
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@
2626
text-size-adjust: 100%; /* 禁止 iOS 上文本大小自动调整 */
2727
text-size-adjust: 100%; /* 禁止 IE 和 Edge 自动调整文本大小 */
2828
-webkit-tap-highlight-color: rgb(0 0 0 / 0%); /* 移除ios设备上的点击高亮效果 */
29+
30+
font-synthesis: style;
31+
font-size: 16px;
32+
word-wrap: break-word;
2933
}
3034

3135

app/layout.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ export default function RootLayout({
1616
<meta name="viewport" content="width=device-width, initial-scale=1" />
1717
</head>
1818
<body>
19-
2019
<div id="chan-root" >
2120
<ThemeProvider attribute="class" defaultTheme="system">
2221
<ChanTitle></ChanTitle>

app/server/api/hello/route.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { mongoDB } from '../../../lib/mongoose';
2-
import redis from '../../../lib/redis';
1+
import { mongoDB } from '../../lib/mongoose';
2+
import redis from '../../lib/redis';
33
export async function GET() {
44
const key = 'my_key';
55
try {
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)