Skip to content

Commit

Permalink
💄 style(custom): 修改tailwind
Browse files Browse the repository at this point in the history
  • Loading branch information
master1lan committed Feb 27, 2023
1 parent bc59157 commit 227ede4
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 18 deletions.
7 changes: 4 additions & 3 deletions src/routers/layout/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,19 @@ const ReactiveHeader = memo(() => {
return (
<header className='border-t-2 relative z-10 max-md:border-b-2'>
{/* 手机端 */}
<div className='hidden max-md:flex justify-between ml-8 mr-8'>
<div className='hidden max-sm:flex justify-between ml-8 mr-8'>
<Yituo width={"64px"} height={"30px"} />
<RouterNav />
</div>
{/* pc端和平板端header部 */}
<Header_content className={`${styles["header"]} h-20`}>
<div className='flex-shrink-0 flex-grow basis-40 max-md:hidden relative z-10'>
<div className='flex-shrink-0 flex-grow basis-40 max-sm:hidden relative z-10'>
<LOGO />
</div>
<div className='flex-grow-0 flex-shrink basis-80 h-12 max-md:mx-6 '>
<Search />
</div>
<div className='text-gray-400 text-end flex-shrink-0 flex-grow basis-40 max-md:hidden relative z-10'>
<div className='text-gray-400 text-end flex-shrink-0 flex-grow basis-40 max-sm:hidden relative z-10'>
敬请期待
</div>
</Header_content>
Expand Down
2 changes: 1 addition & 1 deletion src/routers/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ export default function Layout() {

const NavContent = () => {
const isSearchPage = useMatch(`/search`) !== null;
return <div className='max-md:hidden'>{!isSearchPage && <MidContent />}</div>;
return <div className='max-sm:hidden'>{!isSearchPage && <MidContent />}</div>;
};
8 changes: 5 additions & 3 deletions src/routers/layout/logo/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useState, useMemo, FC } from "react";
import { H1, Explain, Yituo } from "./modal";
import styles from "./logo.module.less";
import { Storage } from "../tools";
import { useScreenSize } from "@components/proview/screenSize";

const QAStorage = new Storage("QAUpdate");
//暂时先这样
Expand All @@ -26,10 +27,12 @@ export default function LOGO() {
set((open) => !open);
handlerReadedNews();
};
const { md } = useScreenSize();
return (
<div className={`${styles["logo"]}`}>
<H1>
EOEfans-web端
<Yituo width={"64px"} height={"30px"} />
<H1 className='max-md:font-medium'>
{!md ? `EOEfans-web端` : `EOEfans`}
<Button
onClick={handlerClick}
sx={{
Expand All @@ -45,7 +48,6 @@ export default function LOGO() {
</Button>
<Explain open={open} handlerClick={handlerClick} />
</H1>
<Yituo width={"64px"} height={"30px"} />
</div>
);
}
Expand Down
7 changes: 2 additions & 5 deletions src/routers/layout/logo/logo.module.less
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
.logo {
display: flex;
align-items: center;
flex-flow: row-reverse nowrap;
flex-flow: row nowrap;
padding: 5px 0;
justify-content: flex-end;
position: relative;

a {
color: inherit;
text-decoration: none;
}



h1 {
margin: 0;
white-space: nowrap;
position: relative;
padding-right: 30px;
}

}
Expand Down
2 changes: 1 addition & 1 deletion src/routers/layout/logo/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const Explain: FC<{ open: boolean; handlerClick: () => void }> = (

export const H1 = styled("h1")(({ theme }) => ({
fontSize: "24px",
[theme.breakpoints.down("sm")]: {
[theme.breakpoints.down("md")]: {
fontSize: "15px",
},
}));
Expand Down
2 changes: 1 addition & 1 deletion src/routers/layout/routernav/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default function RouterNav() {
<FormatListBulletedIcon fontSize='medium' onClick={handlerChangeShow} />
<Drawer anchor='right' open={show} onClose={handlerChangeShow}>
<div className='w-96 max-sm:w-screen'>
<div className='p-4 text-gray-600 text-left max-sm:text-right'>
<div className='p-4 text-gray-600 text-left'>
<HighlightOffIcon
fontSize='medium'
color='inherit'
Expand Down
4 changes: 3 additions & 1 deletion src/routers/layout/search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ export default function Search() {
};
return (
<>
<div className='visible max-md:hidden'>
{/* pc and pad */}
<div className='visible max-sm:hidden'>
<PCSearch />
</div>
<div className='hidden max-sm:block'></div>
</>
);
}
4 changes: 2 additions & 2 deletions src/routers/layout/search/pc/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function Search() {
onClick={!focused ? onFocus : undefined}
className={`${styles["search-box"]} ${
focused ? styles["focus"] : "py-1"
} px-2 max-md:m-0 duration-300 max-md:flex-row-reverse relative`}
} duration-300 relative`}
>
{searchMode === "搜索tag" && (
<>
Expand Down Expand Up @@ -62,7 +62,7 @@ export default function Search() {
const SearchButton: FC<{ onSubmit?: () => void }> = ({ onSubmit }) => (
<button
type='submit'
className={`${styles["search-button"]} bg-red-700 max-md:bg-white max-md:text-gray-900 `}
className={`${styles["search-button"]} bg-red-700 `}
onClick={onSubmit}
>
<SearchIcon color='inherit' fontSize='small' />
Expand Down
3 changes: 3 additions & 0 deletions src/routers/layout/search/phone/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function PhoneSearch() {
// 这个只作为因子引出真实的界面,不应该承担任何搜索功能
}
6 changes: 5 additions & 1 deletion tailwind.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
module.exports = {
content: ["./index.html", "./src/**/*.{js,ts,jsx,tsx}"],
theme: {
extend: {},
extend: {
screens: {
xs: "500px",
},
},
},
plugins: [],
};

0 comments on commit 227ede4

Please sign in to comment.