-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
117 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type {SubNavigationItem} from "../_types/SubNavigationItem.ts"; | ||
|
||
const DemoSubNavigationItems: SubNavigationItem[] = [...Array(100)] | ||
.map((item, index): SubNavigationItem => ({title: `子导航项 - ${index}`, href: ""})) | ||
|
||
export default DemoSubNavigationItems |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import {IconArrow} from "./SvgIcons.tsx"; | ||
|
||
export default function GoBackTool({goBackHref}: { goBackHref?: string }) { | ||
const base = import.meta.env.BASE_URL | ||
return <> | ||
<a href={goBackHref ? goBackHref : base} target="_self" | ||
className="w-[14.875rem] h-[3.75rem] text-inherit no-underline hover:text-black hover:bg-white bg-[#5a5a5a] px-[2.5rem] flex items-center justify-between cursor-pointer transition-[color,background-color] duration-300"> | ||
<IconArrow className="w-2 rotate-180 pointer-events-none"/> | ||
<div> | ||
<div className="text-[1.25rem] font-bold">{goBackHref ? "返回列表" : "返回首页"}</div> | ||
<div className="text-[.875rem] font-benderBold">GO BACK</div> | ||
</div> | ||
</a> | ||
{ | ||
goBackHref && | ||
<a href={base} target="_self" | ||
className="w-[10.5rem] h-[3.75rem] text-inherit no-underline hover:text-black hover:bg-white bg-[#3f3f3f] px-[2.25rem] flex items-center justify-between cursor-pointer transition-[color,background-color] duration-300"> | ||
<div> | ||
<div className="text-[1.25rem] font-bold">返回首页</div> | ||
<div className="text-[.875rem] font-benderBold">HOMEPAGE</div> | ||
</div> | ||
</a> | ||
} | ||
</> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
--- | ||
import type {MarkdownHeading} from "astro" | ||
import type {SubNavigationItem} from "../_types/SubNavigationItem" | ||
import InfoLayout from "./InfoLayout.astro" | ||
import DocsLeftAside from "../components/DocsLeftAside.astro" | ||
import DocsLeftAsideSwitch from "../components/DocsLeftAsideSwitch" | ||
import DemoSubNavigationItems from "../components/DemoSubNavigationItems" | ||
import DocumentIndexUL from "../components/DocumentIndexUL.astro" | ||
import DocsToolPanel from "../components/DocsToolPanel" | ||
interface Props { | ||
title?: string | ||
subNavigationItems?: SubNavigationItem[] | ||
headings?: MarkdownHeading[] | ||
} | ||
const {title, subNavigationItems, headings} = Astro.props | ||
const tabTitle = title ? title + " - 文档" : "文档" | ||
--- | ||
|
||
<InfoLayout title="DOCS" subTitle="文档" {...{tabTitle, subNavigationItems}}> | ||
<nav slot="left-aside" | ||
class="h-full mix-blend-difference bg-list-texture bg-cover bg-center bg-opacity-30 flex flex-col"> | ||
<DocsLeftAside/> | ||
<DocsLeftAsideSwitch client:load/> | ||
</nav> | ||
|
||
|
||
<div id="docs-content" | ||
class="max-w-[80.75rem] h-full mx-auto overflow-y-auto transition-[height] duration-300"> | ||
{/* TODO: 面包屑导航 */} | ||
{ | ||
headings && headings.length > 0 && | ||
<details class="pb-8 landscape:hidden"> | ||
<summary class="text-black bg-white text-[24px] font-bold px-3 font-oswaldMedium"> | ||
Document Index - 文档索引 | ||
</summary> | ||
<DocumentIndexUL {...{headings}}/> | ||
</details> | ||
} | ||
<slot/> | ||
</div> | ||
|
||
{ | ||
headings && headings.length > 0 && | ||
<nav slot="aside-header"> | ||
<h2 class="text-black bg-white text-[1.75rem] font-bold px-3 font-oswaldMedium"> | ||
Document Index - 文档索引 | ||
</h2> | ||
<DocumentIndexUL {...{headings}}/> | ||
</nav> | ||
} | ||
|
||
<DocsToolPanel slot="tool-panel" client:load/> | ||
</InfoLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
import DocsLayout from "../../layouts/DocsLayout.astro"; | ||
import DemoSlotBlock from "../../components/DemoSlotBlock.astro"; | ||
import DemoSubNavigationItems from "../../components/DemoSubNavigationItems"; | ||
--- | ||
|
||
<DocsLayout subNavigationItems={DemoSubNavigationItems}> | ||
<DemoSlotBlock title="Slot" fontSize="25rem" | ||
background="linear-gradient(to bottom right, darkred, darkgreen)"/> | ||
</DocsLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters