Skip to content

Commit b49bf2d

Browse files
committed
.
1 parent 2b088b6 commit b49bf2d

3 files changed

Lines changed: 158 additions & 0 deletions

File tree

app/(default)/(home)/landing.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,22 @@ import {
2020
import { AspectRatio } from "@/components/ui/aspect-ratio"
2121

2222

23+
import {
24+
Drawer,
25+
DrawerClose,
26+
DrawerContent,
27+
DrawerDescription,
28+
DrawerFooter,
29+
DrawerHeader,
30+
DrawerTitle,
31+
DrawerTrigger,
32+
} from "@/components/ui/drawer"
33+
import { Chen2025_value_learning } from "@/components/citation-drawer"
34+
35+
2336

2437
import { publications } from "@/data/publications"
38+
import { Button } from "@/components/ui/button"
2539
const landings = [0,1,2,3,5,4].map(index => [...publications.values()].filter(publication => publication.keys.includes('home_sliding'))[index])
2640
const type_mapping: Record<string, string> = {
2741
"page": "Page",
@@ -208,6 +222,23 @@ export function Landing() {
208222
</Link>
209223
)
210224
}
225+
{
226+
landing.title.startsWith('Intelligent Robot') && (
227+
<span className="text-xs mr-3"> | </span>
228+
)
229+
} {
230+
landing.title.startsWith('Intelligent Robot') && (
231+
232+
<Drawer direction="top">
233+
<DrawerTrigger asChild>
234+
<span className="animated-underline-gray mr-3 text-nowrap">
235+
Cite
236+
</span>
237+
</DrawerTrigger>
238+
<Chen2025_value_learning />
239+
</Drawer>
240+
)
241+
}
211242
</div>
212243
</div>
213244

components/citation-chen2025.tsx

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
'use client';
2+
3+
import { useRef, useState } from 'react';
4+
5+
export default function CitationChen2025() {
6+
const blockRef = useRef<HTMLPreElement>(null);
7+
const [copied, setCopied] = useState(false);
8+
9+
const handleCopy = async () => {
10+
if (!blockRef.current) return;
11+
12+
try {
13+
await navigator.clipboard.writeText(blockRef.current.innerText);
14+
setCopied(true);
15+
setTimeout(() => setCopied(false), 2000);
16+
} catch (err) {
17+
console.error('复制失败:', err);
18+
}
19+
};
20+
21+
return (
22+
<div className="mt-6 flex flex-row gap-6 justify-center">
23+
<div />
24+
<div className="relative w-full max-w-4xl">
25+
{/* 右上角复制按钮 */}
26+
<button
27+
onClick={handleCopy}
28+
className="absolute top-2 right-2 p-2 rounded-sm bg-transparent hover:bg-black/10 transition"
29+
title="Copy"
30+
>
31+
{copied ? (
32+
<svg
33+
xmlns="http://www.w3.org/2000/svg"
34+
viewBox="0 0 24 24"
35+
fill="none"
36+
stroke="white"
37+
strokeWidth={2.5}
38+
strokeLinecap="round"
39+
strokeLinejoin="round"
40+
className="w-5 h-5"
41+
>
42+
<path d="M5 13l4 4L19 7" />
43+
</svg>
44+
) : (
45+
<svg
46+
xmlns="http://www.w3.org/2000/svg"
47+
fill="none"
48+
viewBox="0 0 24 24"
49+
strokeWidth={2.5}
50+
stroke="white"
51+
strokeLinecap="round"
52+
strokeLinejoin="round"
53+
className="w-5 h-5"
54+
>
55+
<path d="M8 16h8M8 12h8m-6 8h6a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2h2" />
56+
</svg>
57+
)}
58+
</button>
59+
60+
{/* Citation Code Block (wrap, no scroll) */}
61+
<pre
62+
ref={blockRef}
63+
className="
64+
w-full p-4 rounded-sm
65+
bg-black/10
66+
font-mono text-sm
67+
text-muted-foreground
68+
leading-relaxed
69+
70+
whitespace-pre-wrap
71+
break-words
72+
"
73+
>
74+
<code>{`@article{chen2025_value_learning,
75+
title={Intelligent Robot Manipulation Requires Self-Directed Learning},
76+
author={Chen, Li and Sima, Chonghao and Chitta, Kashyap and Loquercio, Antonio and Luo, Ping and Ma, Yi and Li, Hongyang},
77+
journal={OpenReview},
78+
year={2026},
79+
url={https://openreview.net/forum?id=Seb7rprW1Y},
80+
note={Accessed: 2026-01-02}
81+
}`}</code>
82+
</pre>
83+
</div>
84+
<div />
85+
</div>
86+
);
87+
}

components/citation-drawer.tsx

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import Image from 'next/image'
2+
3+
4+
5+
import CitationChen2025 from "@/components/citation-chen2025"
6+
7+
8+
9+
import { AspectRatio } from "@/components/ui/aspect-ratio"
10+
import {
11+
Drawer,
12+
DrawerClose,
13+
DrawerContent,
14+
DrawerDescription,
15+
DrawerFooter,
16+
DrawerHeader,
17+
DrawerTitle,
18+
DrawerTrigger,
19+
} from "@/components/ui/drawer"
20+
21+
22+
23+
24+
export function Chen2025_value_learning() {
25+
return (
26+
<DrawerContent className='pt-12 pb-6'>
27+
<DrawerHeader>
28+
<DrawerTitle className='text-xl'>
29+
Please cite this work as
30+
</DrawerTitle>
31+
</DrawerHeader>
32+
<div className="w-full flex justify-center px-6">
33+
<div className="max-w-5xl">
34+
<CitationChen2025 />
35+
</div>
36+
</div>
37+
<DrawerFooter></DrawerFooter>
38+
</DrawerContent>
39+
)
40+
}

0 commit comments

Comments
 (0)