Skip to content

Commit 28f70ee

Browse files
committed
refactor: optimize site
1 parent 5a2dab4 commit 28f70ee

3 files changed

Lines changed: 20 additions & 10 deletions

File tree

site/src/components/Layout/HomeContent.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,8 @@ const TRANSLATIONS = {
156156
roadmapLabel: '未来计划',
157157
cta: '了解更多动态',
158158
alt: 'AntV Infographic 团队技术探索示意',
159+
image:
160+
'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*15OrQo7ftkAAAAAASxAAAAgAemJ7AQ/original',
159161
},
160162
welcome: {
161163
title: '欢迎使用 AntV Infographic',
@@ -256,6 +258,8 @@ const TRANSLATIONS = {
256258
roadmapLabel: 'Roadmap',
257259
cta: 'More Updates',
258260
alt: 'AntV Infographic team exploration illustration',
261+
image:
262+
'https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*ycICR7i9WDwAAAAAYPAAAAgAemJ7AQ/fmt.avif',
259263
},
260264
welcome: {
261265
title: 'Welcome to AntV Infographic',
@@ -696,7 +700,7 @@ export function HomeContent(): JSX.Element {
696700
</div>
697701
<div className="w-full lg:w-6/12 flex flex-col items-center lg:items-end">
698702
<img
699-
src="https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*15OrQo7ftkAAAAAASxAAAAgAemJ7AQ/original"
703+
src={sectionContent.evolution.image}
700704
alt={sectionContent.evolution.alt}
701705
className="w-full h-auto rounded-2xl lg:max-h-[480px] object-contain"
702706
draggable={false}

site/src/components/Layout/HomePage/StreamingSyntaxShowcase.tsx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -627,17 +627,22 @@ export function StreamingSyntaxShowcase({
627627
</button>
628628
</div>
629629
</div>
630-
<div className="grid md:grid-cols-2 h-[450px] md:h-[500px] divide-y md:divide-y-0 md:divide-x divide-border dark:divide-border-dark">
631-
<div className="relative bg-wash dark:bg-gray-95 overflow-hidden">
630+
<div className="grid md:grid-cols-2 flex-1 h-[450px] md:h-auto min-h-[500px] divide-y md:divide-y-0 md:divide-x divide-border dark:divide-border-dark">
631+
<div className="relative min-w-0 bg-wash dark:bg-gray-95 overflow-hidden">
632632
<div
633633
ref={bufferRef}
634-
className="absolute inset-0 overflow-y-scroll overflow-x-hidden scrollbar-hide"
634+
className="absolute inset-0 overflow-x-auto overflow-y-scroll scrollbar-hide"
635635
style={{
636636
overscrollBehavior: 'contain',
637637
scrollbarWidth: 'none',
638638
msOverflowStyle: 'none',
639639
}}>
640-
<pre className="text-[13px] leading-relaxed text-secondary dark:text-secondary-dark font-mono p-4 md:p-6 m-0 whitespace-pre">
640+
<pre
641+
className="text-[13px] leading-relaxed text-secondary dark:text-secondary-dark font-mono p-4 md:p-6 m-0 whitespace-pre scrollbar-hide"
642+
style={{
643+
scrollbarWidth: 'none',
644+
msOverflowStyle: 'none',
645+
}}>
641646
{displayCode}
642647
</pre>
643648
</div>
@@ -662,7 +667,7 @@ export function StreamingSyntaxShowcase({
662667
</svg>
663668
)}
664669
</div>
665-
<div className="relative bg-white dark:bg-gray-950 overflow-hidden">
670+
<div className="relative min-w-0 bg-white dark:bg-gray-950 overflow-hidden">
666671
{renderError ? (
667672
<div className="absolute inset-0 z-10 flex items-center justify-center bg-white/90 dark:bg-black/80 backdrop-blur-sm text-sm text-red-600 dark:text-red-400 px-4 text-center font-medium">
668673
{renderError}
@@ -717,7 +722,8 @@ export function StreamingSyntaxShowcase({
717722
}
718723
}
719724
.scrollbar-hide::-webkit-scrollbar {
720-
display: none;
725+
width: 0;
726+
height: 0;
721727
}
722728
.scrollbar-hide {
723729
-ms-overflow-style: none;
@@ -726,8 +732,8 @@ export function StreamingSyntaxShowcase({
726732
`,
727733
}}
728734
/>
729-
<div className="grid gap-6 lg:gap-10 lg:grid-cols-[0.5fr,1.5fr] items-stretch">
730-
<div className="relative flex flex-col justify-center gap-6 py-8 text-secondary dark:text-secondary-dark">
735+
<div className="grid gap-6 lg:gap-10 lg:grid-cols-[0.5fr,1.5fr] lg:items-stretch">
736+
<div className="relative flex flex-col justify-center gap-6 py-8 lg:py-0 text-secondary dark:text-secondary-dark">
731737
<p className="max-w-3xl mx-auto text-lg lg:text-xl text-secondary dark:text-secondary-dark leading-normal">
732738
{translation.description}
733739
</p>

site/src/content/reference/index.en.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Architecture Design
44

55
AntV Infographic uses a three-layer architecture: JSX rendering engine, runtime, and external API. The overall structure is shown below:
66

7-
![AntV Infographic Architecture](https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*zONoSqxD0gwAAAAAT8AAAAgAemJ7AQ/original)
7+
![AntV Infographic Architecture](https://mdn.alipayobjects.com/huamei_qa8qxu/afts/img/A*wzaKTKveQUgAAAAAZiAAAAgAemJ7AQ/fmt.avif)
88

99
## JSX Rendering Engine {#jsx-engine}
1010

0 commit comments

Comments
 (0)