Skip to content

Commit becf1a6

Browse files
committed
update: 修改文件 🥳
1 parent eb32bf4 commit becf1a6

File tree

8 files changed

+85
-69
lines changed

8 files changed

+85
-69
lines changed

.idea/.gitignore

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/.vitepress/nav/index.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,29 +9,29 @@ const nav: DefaultTheme.NavItem[] = [
99
text: "CSS",
1010
link: "/css/introduction",
1111
},
12+
// {
13+
// text: "前端",
14+
// items: [
15+
// {
16+
// text: "html",
17+
// link: "/basic/html/introduction",
18+
// },
19+
// ],
20+
// },
1221
{
13-
text: "前端",
14-
items: [
15-
{
16-
text: "html",
17-
link: "/basic/html/introduction",
18-
},
19-
{
20-
text: "浏览器 & 网络",
21-
link: "/basic/browser/introduction",
22-
},
23-
{
24-
text: "Coding",
25-
link: "/basic/code/introduction",
26-
},
27-
],
22+
text: "network",
23+
link: "/basic/browser/introduction",
24+
},
25+
{
26+
text: "coding",
27+
link: "/basic/code/introduction",
2828
},
2929
{
3030
text: "blog",
3131
link: "/blog/introduction",
3232
},
3333
{
34-
text: "About",
34+
text: "about",
3535
link: "/about",
3636
},
3737
];

docs/.vitepress/scripts/sidebar.ts

Lines changed: 41 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,61 @@
11
import fg from "fast-glob";
22

3-
const javaScriptIntroduction = { text: "Introduction", link: "/javascript/introduction" };
4-
const blogIntroduction = { text: "Introduction", link: "/blog/introduction" };
5-
const cssIntroduction = { text: "Introduction", link: "/css/introduction" };
3+
const javaScriptIntroduction = { text: "Introduction", link: "/javascript/introduction", order: 0 };
4+
const blogIntroduction = { text: "Introduction", link: "/blog/introduction", order: 0 };
5+
const cssIntroduction = { text: "Introduction", link: "/css/introduction", order: 0 };
66

7-
const javaScriptOptions: Record<string, string> = {
8-
type: "类型和语法",
9-
"array-string": "Array & String",
10-
object: "Object",
11-
"type-conversion": "类型转换",
12-
prototype: "原型和原型链",
13-
this: "this",
14-
closure: "闭包",
15-
"throttle-debounce": "节流和防抖",
16-
async: "同步和异步",
17-
regexp: "正则",
18-
"ES5+": "ES6+",
19-
"proxy-reflect": "代理和反射",
20-
"broadcast-channel": "Broadcast Channel API",
21-
"web-speech-api": "Web Speech API",
22-
observer: "Observer API",
23-
other: "其他",
24-
eventloop: "Event Loop",
7+
const javaScriptOptions: Record<string, { text: string; order: number }> = {
8+
type: { text: "类型和语法", order: 1 },
9+
"array-string": { text: "Array & String", order: 2 },
10+
object: { text: "Object", order: 3 },
11+
"type-conversion": { text: "类型转换", order: 4 },
12+
prototype: { text: "原型和原型链", order: 5 },
13+
this: { text: "this", order: 6 },
14+
closure: { text: "闭包", order: 7 },
15+
"throttle-debounce": { text: "节流和防抖", order: 8 },
16+
async: { text: "同步和异步", order: 9 },
17+
regexp: { text: "正则", order: 10 },
18+
"ES5+": { text: "ES6+", order: 11 },
19+
"proxy-reflect": { text: "代理和反射", order: 12 },
20+
"broadcast-channel": { text: "Broadcast Channel API", order: 13 },
21+
"web-speech-api": { text: "Web Speech API", order: 14 },
22+
observer: { text: "Observer API", order: 15 },
23+
other: { text: "其他", order: 16 },
24+
eventloop: { text: "Event Loop", order: 17 },
2525
};
2626

27-
const CSSOptions = {
28-
"@font-face": "@font-face",
29-
center: "居中",
30-
flex: "flex布局",
31-
layout: "常见布局",
32-
grid: "grid布局",
33-
"text-hidden-overflow": "文本溢出",
34-
bfc: "BFC",
35-
position: "层叠与定位",
36-
"pseudo-classes-element": "伪类与伪元素",
37-
selectors: "CSS选择器",
27+
const CSSOptions: Record<string, { text: string; order: number }> = {
28+
center: { text: "居中", order: 1 },
29+
flex: { text: "flex布局", order: 2 },
30+
layout: { text: "常见布局", order: 3 },
31+
grid: { text: "grid布局", order: 4 },
32+
"@font-face": { text: "@font-face", order: 5 },
33+
"text-hidden-overflow": { text: "文本溢出", order: 6 },
34+
bfc: { text: "BFC", order: 7 },
35+
position: { text: "层叠与定位", order: 8 },
36+
"pseudo-classes-element": { text: "伪类与伪元素", order: 9 },
37+
selectors: { text: "CSS选择器", order: 10 },
3838
};
39-
4039
/**
4140
* @description: 生成侧边栏
4241
*/
4342
const generateSidebar = (
4443
cwd: string,
45-
introduction: Record<string, string>,
46-
options: Record<string, string>,
44+
introduction: { text: string; link: string; order: number },
45+
options: Record<string, { text: string; order: number }>,
4746
prefix: string
4847
) => {
4948
const files = fg.sync(["./*.md"], { cwd: cwd, ignore: ["./introduction.md"] });
5049
const result = files.map((file) => {
5150
const path = file.replace(/(\/index)?\.md$/, "");
52-
const text = path.replace(/\/$/, "").split("/").pop();
53-
return { text: options[text] || text, link: `/${prefix}/${path}` };
51+
const key = path.replace(/\/$/, "").split("/").pop();
52+
return {
53+
text: (options[key] && options[key].text) || key,
54+
link: `/${prefix}/${path}`,
55+
order: (options[key] && options[key].order) || 0,
56+
};
5457
});
55-
return [introduction, ...result];
58+
return [introduction, ...result].sort((a, b) => a.order - b.order);
5659
};
5760

5861
export const generateJavaScriptSidebar = () => {

docs/.vitepress/serviceWorker.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
setTimeout(() => {
2+
console.log("Hello from the service worker");
3+
}, 1000);

docs/.vitepress/theme/custom.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@
1515
--vp-home-hero-image-filter: blur(60px);
1616
}
1717

18-
html,
19-
body {
20-
/*font-size: 14px !important;*/
21-
}
22-
2318
.components-container {
2419
margin: 20px 0;
2520
}

docs/.vitepress/theme/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import Layout from "./Layout.vue";
77
export default {
88
...DefaultTheme,
99
Layout: Layout,
10-
enhanceApp(ctx) {
10+
enhanceApp(ctx: { app: any; router: any }) {
1111
// console.log(ctx);
1212
const { app, router } = ctx;
13-
router.onBeforeRouteChange = (to: string) => {
14-
console.log("before", to);
15-
};
16-
router.onAfterRouteChanged = (to: string) => {
17-
console.log("after", to);
18-
};
13+
// router.onBeforeRouteChange = (to: string) => {
14+
// console.log("before", to);
15+
// };
16+
// router.onAfterRouteChanged = (to: string) => {
17+
// console.log("after", to);
18+
// };
1919
app.use(naive);
2020
},
2121
};

docs/index.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,6 @@ hero:
1414
- theme: alt
1515
text: View on GitHub
1616
link: https://github.com/godwei123/javascript-guide
17-
# - theme: alt
18-
# text: View on GitHub
19-
# link: https://github.com/godwei123/javascript-guide
2017

2118
features:
2219
- title: HTML

docs/readme.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
11
# JavaScriptGuide dev
22

33
![img.png](./public/javascript-guide-logo.svg)
4+
5+
```text
6+
canvas
7+
requestAnimationFrame
8+
innerWidth/Height...
9+
style="--i: 2; --j: 0"
10+
transform-style: preserve-3d;
11+
perspective: 1000px;
12+
scroll-snap-type
13+
scroll-snap-align: start;
14+
textShadow
15+
shape-outside: circle();
16+
background-clip: text;
17+
-webkit-background-clip: text;
18+
-webkit-text-fill-color: transparent;
19+
```

0 commit comments

Comments
 (0)