Skip to content

Commit f5cb225

Browse files
committed
website: update example.
1 parent 24da10c commit f5cb225

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"@types/react-dom": "17.0.8",
5858
"@types/react-router-dom": "5.1.7",
5959
"@types/react-test-renderer": "17.0.1",
60+
"@uiw/react-github-corners": "1.4.0",
6061
"@uiw/react-markdown-preview": "3.1.3",
6162
"@uiw/react-split": "5.7.4",
6263
"@uiw/react-textarea-code-editor": "1.3.0",
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.link {
2+
position: fixed;
3+
top: 10px;
4+
left: 10px;
5+
background-color: #2266d6;
6+
color: #fff;
7+
padding: 5px 13px 5px 8px;
8+
border-radius: 3px;
9+
display: flex;
10+
align-items: center;
11+
font-size: 12px;
12+
transition: 0.3s cubic-bezier(0.3, 0, 0.5, 1);
13+
transition-property: background-color;
14+
&:hover {
15+
background-color: #333;
16+
}
17+
}

website/pages/docs/index.tsx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
import MarkdownPreview from '@uiw/react-markdown-preview';
2+
import GitHubCorners from '@uiw/react-github-corners';
3+
import { Link } from 'react-router-dom';
24
import MDStr from '../../../README.md';
5+
import styles from './index.module.less';
36

47
export default function Docs() {
58
return (
69
<div style={{ margin: '0 auto', maxWidth: 650, paddingTop: 50, paddingBottom: 60 }}>
10+
<GitHubCorners fixed size={52} target="__blank" href="https://github.com/uiwjs/react-run-web" />
11+
<Link
12+
className={styles.link}
13+
to="/?html=<div>Hello%20World</div>&js=console.log('hello%20world')&css=div%20{%20color:%20red;}"
14+
>
15+
<svg viewBox="0 0 1087 1024" height="14" style={{ marginRight: 8 }}>
16+
<path
17+
fill="currentColor"
18+
d="M497.579901 211.531321V41.021661a40.850381 40.850381 0 0 0-70.481893-28.004349L39.404774 363.457054c-85.126369 62.003513-5.823534 108.506147-5.823535 108.506147L415.365299 819.234256c76.305428 58.834825 82.214602-31.001756 82.214602-31.001756V630.140671c387.693234-127.175713 546.298904 381.441499 546.298905 381.441498 14.730116 27.833068 23.465418 0 23.465417 0C1217.128952 248.699172 497.579901 211.44568 497.579901 211.44568z"
19+
/>
20+
</svg>
21+
Run Web
22+
</Link>
723
<MarkdownPreview source={MDStr} />
824
</div>
925
);

0 commit comments

Comments
 (0)