Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion website/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ type LayoutProps = Readonly<{
}>;

const RootLayout: FC<LayoutProps> = ({ children }) => {
// 根据环境设置字体路径前缀
const isProduction = process.env.NODE_ENV === "production";
const fontPrefix = isProduction ? "/qwen-code-docs" : "";

return (
<html suppressHydrationWarning>
<Head
Expand All @@ -44,7 +48,9 @@ const RootLayout: FC<LayoutProps> = ({ children }) => {
saturation: { dark: 74, light: 74 },
}}
/>
<body>{children}</body>
<body style={{ "--font-prefix": fontPrefix } as React.CSSProperties}>
{children}
</body>
</html>
);
};
Expand Down
7 changes: 5 additions & 2 deletions website/mdx-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ import type { ImgHTMLAttributes } from "react";
// 自定义 img 组件,动态替换路径
const CustomImg = (props: ImgHTMLAttributes<HTMLImageElement>) => {
const { src, ...rest } = props;
// 将 ../assets/ 替换为 /assets/
const adjustedSrc = src?.replace(/\.\.\/assets\//, "/assets/");
// 根据环境设置资源前缀
const isProduction = process.env.NODE_ENV === "production";
const assetPrefix = isProduction ? "/qwen-code-docs" : "";
// 将 ../assets/ 替换为带前缀的 /assets/
const adjustedSrc = src?.replace(/\.\.\/assets\//, `${assetPrefix}/assets/`);
return <img src={adjustedSrc} {...rest} />;
};

Expand Down
Binary file removed website/public/Orbitron.zip
Binary file not shown.
62 changes: 38 additions & 24 deletions website/src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,99 +4,113 @@
@source "../**/*.{ts,tsx}";

/* Terminal/Monospace Fonts */
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Fira+Code:wght@300..700&display=swap');
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&family=Fira+Code:wght@300..700&display=swap");

/* Local Monoton Font */
@font-face {
font-family: 'Monoton';
src: url('/Monoton/Monoton-Regular.ttf') format('truetype');
font-family: "Monoton";
src: url('var(--font-prefix, "")/Monoton/Monoton-Regular.ttf')
format("truetype");
font-weight: normal;
font-style: normal;
font-display: swap;
}

/* Local Orbitron Font - Multiple Weights */
@font-face {
font-family: 'Orbitron';
src: url('/Orbitron/Orbitron-VariableFont_wght.ttf') format('truetype-variations');
font-family: "Orbitron";
src: url('var(--font-prefix, "")/Orbitron/Orbitron-VariableFont_wght.ttf')
format("truetype-variations");
font-weight: 400 900;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: 'Orbitron';
src: url('/Orbitron/static/Orbitron-Regular.ttf') format('truetype');
font-family: "Orbitron";
src: url('var(--font-prefix, "")/Orbitron/static/Orbitron-Regular.ttf')
format("truetype");
font-weight: 400;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: 'Orbitron';
src: url('/Orbitron/static/Orbitron-Medium.ttf') format('truetype');
font-family: "Orbitron";
src: url('var(--font-prefix, "")/Orbitron/static/Orbitron-Medium.ttf')
format("truetype");
font-weight: 500;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: 'Orbitron';
src: url('/Orbitron/static/Orbitron-SemiBold.ttf') format('truetype');
font-family: "Orbitron";
src: url('var(--font-prefix, "")/Orbitron/static/Orbitron-SemiBold.ttf')
format("truetype");
font-weight: 600;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: 'Orbitron';
src: url('/Orbitron/static/Orbitron-Bold.ttf') format('truetype');
font-family: "Orbitron";
src: url('var(--font-prefix, "")/Orbitron/static/Orbitron-Bold.ttf')
format("truetype");
font-weight: 700;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: 'Orbitron';
src: url('/Orbitron/static/Orbitron-ExtraBold.ttf') format('truetype');
font-family: "Orbitron";
src: url('var(--font-prefix, "")/Orbitron/static/Orbitron-ExtraBold.ttf')
format("truetype");
font-weight: 800;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: 'Orbitron';
src: url('/Orbitron/static/Orbitron-Black.ttf') format('truetype');
font-family: "Orbitron";
src: url('var(--font-prefix, "")/Orbitron/static/Orbitron-Black.ttf')
format("truetype");
font-weight: 900;
font-style: normal;
font-display: swap;
}

/* Terminal cursor animation */
@keyframes cursor-blink {
0%, 50% { opacity: 1; }
51%, 100% { opacity: 0; }
0%,
50% {
opacity: 1;
}
51%,
100% {
opacity: 0;
}
}

.terminal-cursor {
animation: cursor-blink 1s infinite;
}

.terminal-text {
font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
font-family: "JetBrains Mono", "Fira Code", "Consolas", "Monaco", monospace;
}

.code-font {
font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', 'Monaco', monospace;
font-family: "JetBrains Mono", "Fira Code", "Consolas", "Monaco", monospace;
}

.monoton-font {
font-family: 'Monoton', monospace;
font-family: "Monoton", monospace;
letter-spacing: 0.1em;
}

.orbitron-font {
font-family: 'Orbitron', sans-serif;
font-family: "Orbitron", sans-serif;
letter-spacing: 0.05em;
}

Expand All @@ -115,7 +129,7 @@

/* Scanline effect for terminal aesthetic with purple tint */
.scanlines::before {
content: '';
content: "";
position: absolute;
top: 0;
left: 0;
Expand Down