Skip to content

Commit 3100ef0

Browse files
committed
Optimize jump behavior of topbar title link
1 parent 87c4804 commit 3100ef0

33 files changed

+108
-40
lines changed

_posts/original/2016-05-12-停半晌,整花钿.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: original
44
title: "停半晌,整花钿"
55
author: 立泉
6-
mention: 记忆 成长
6+
mention: 记忆 童年 成长
77
date: 2016-05-12 +0800
88
description: 这更像是一颗留给自己的时间胶囊,当数年后回首会作何感想,我所做的选择是否正确,也只有未来的我才会知道。
99
cover:

_posts/original/2016-09-11-树莓派遇上Java 01:总述篇.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: original
44
title: "树莓派遇上Java 01:总述篇"
55
author: 立泉
6-
mention: 玩儿 Pi4J
6+
mention: 玩具 Pi4J
77
date: 2016-09-11 +0800
88
description: 我是一个喜欢玩的人,尤其对遥控玩具情有独钟,小时候为看它们的工作原理不知有多少玩具被我大卸八块,但除了发现几块电路板、几节电池和一堆马达外总是一无所获。而且即使在我小时候,也能看到它们在设计和功能上存在的各种缺陷,特别想拥有一个可以完全自定义的大玩具。
99
cover: https://apqx.oss-cn-hangzhou.aliyuncs.com/blog/original/20160911/shumeipai_yushang_java_01_zongshupian/raspberrypi.jpg

_posts/original/2019-02-13-只识深闺绣花鸟.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: original
44
title: "只识深闺绣花鸟"
55
author: 立泉
6-
mention: 笑傲江湖 羁绊
6+
mention: 笑傲江湖 羁绊 自由
77
date: 2019-02-13 +0800
88
description: 前段时间看键客行的一期视频,开始对金庸的武侠世界有点好奇。我其实没有耐心去研读《笑傲江湖》原著,也不喜欢仙侠文风,但翻到的几张任盈盈定妆照却让我在两天内对央视2001版电视剧“研读”得颇有心得,不得不感慨这个看脸的世界😶。
99
cover: https://apqx.oss-cn-hangzhou.aliyuncs.com/blog/original/20190213/xvqing_02.jpg

_posts/original/2019-03-05-Java中的ThreadLocal.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: original
44
title: "Java中的ThreadLocal"
55
author: 立泉
6-
mention: 线程私有
6+
mention: 线程私有 源码
77
date: 2019-03-05 +0800
88
description: 虽然没怎么用过,但也很好奇它是怎么实现的。
99
cover:

_posts/original/2019-03-07-Android中的MVP与MVVM.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: original
44
title: "Android中的MVP与MVVM"
55
author: 立泉
6-
mention: 架构
6+
mention: 架构 生命周期
77
date: 2019-03-07 +0800
88
description: 我在工作和学习中大量使用过MVP,对MVC和MVVM只是有所耳闻,后来接触Kotlin和Jetpack,开始尝试更现代的新东西。编程感觉也不再是入门时枯燥的堆砌代码,而是像打造艺术品一样津津有味,这样的变化真实而有趣。
99
cover:

_posts/original/2019-06-06-旅行志01:去南京看昆曲.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ categories: original
44
title: "旅行志01:去南京看昆曲"
55
author: 立泉
66
actor: 单雯 施夏明
7-
mention: 玉簪记
7+
mention: 玉簪记 江南剧院
88
date: 2019-06-06 +0800
99
description: 第一次在电视上看到昆曲,应该是2009年,在一部关于中国近代史的政论片《复兴之路》第一集里,清廷正沉浸在一片“祥和”的歌舞笙箫中,然枪炮声突起,惊碎了这个自大腐朽的清帝国最后的美梦。在马嘎尔尼被乾隆帝拒绝通商无功而返的50年后,英国人最终是用火枪打开中国大门,舞台上对这一段的演绎正是「牡丹亭·惊梦」一折里的传世名段【皂罗袍】。
1010
cover: https://apqx.oss-cn-hangzhou.aliyuncs.com/blog/original/20190606/shanwen_shixiaming_yuzanji_thumb.jpg

_posts/original/2020-07-10-记笔记与写博客.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: original
44
title: "记笔记与写博客"
55
author: 立泉
6-
mention: VSCode Markdown
6+
mention: VSCode Markdown 内敛 分享
77
date: 2020-07-10 +0800
88
description: 小时候并不记笔记,只是到中学科目的数量和内容一起爆炸,需要脱离书本从课堂提炼知识,才开始整理思路写在单独的笔记里,之后形成习惯一直到大学都是如此。
99
cover: https://apqx.oss-cn-hangzhou.aliyuncs.com/blog/original/20200710/note_vscode.webp

_posts/original/2020-11-25-为软件付费很难吗.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: original
44
title: "为软件付费很难吗"
55
author: 立泉
6-
mention: Mac FCP 正版
6+
mention: Mac 教育优惠 正版
77
date: 2020-11-25 +0800
88
description: 一周前把MacBook Pro升级到Big Sur,新系统的新UI让我耳目一新,一边感慨苹果相对于微软的设计品味,一边打开各种软件看看有什么变化。不幸的是,使用好久的Final Cut Pro和Compressor均提示不兼容,无法启动。
99
cover: https://apqx.oss-cn-hangzhou.aliyuncs.com/blog/original/20201125/fcp_shantaohong.jpg

_posts/original/2022-01-17-趣算法01:小鼠试毒.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: original
44
title: "趣算法01:小鼠试毒"
55
author: 立泉
6-
mention: 二进制
6+
mention: 二进制 逻辑
77
date: 2022-01-17 +0800
88
description: 程序本就是为解决现实问题而诞生,算法则是以计算机的角度解决问题的方法,所以编程离不开算法,无论这个算法是简单的自增赋值还是复杂到难以理解。
99
cover:

_posts/original/2022-07-20-西湖Apple,蝶式键盘保修笔记.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: original
44
title: "西湖Apple,蝶式键盘保修笔记"
55
author: 立泉
6-
mention: 天才吧 杭州
6+
mention: Mac 粘滞 天才吧 杭州
77
date: 2022-07-20 +0800
88
description: 蝶式键盘并不能单独更换,因为集成度过高,Apple会换掉包括附着在上面的电池、Touch Bar和铝合金中框的整个键盘区,这意味着我用了4年已经提示容量显著缩减的电池和可能因过热而一部分不显示的Touch Bar将会得到免费的换新,有些意外,也有些兴奋。
99
cover: https://apqx.oss-cn-hangzhou.aliyuncs.com/blog/original/20220720/apple_west_lake_thumb.jpg

_posts/poetry/2018-02-12-孔雀东南飞.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: poetry
44
title: "孔雀东南飞"
55
author: 乐府诗集
6-
mention: 五里一徘徊
6+
mention: 南北朝 寒风摧树木 严霜结庭兰
77
date: 2018-02-12 +0800
88
moreDate: 南北朝
99
description: 序曰:汉末建安中,庐江府小吏焦仲卿妻刘氏,为仲卿母所遣,自誓不嫁。其家逼之,乃投水而死。仲卿闻之,亦自缢于庭树。时人伤之,为诗云尔。

_posts/poetry/2019-07-12-煤山恨.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: poetry
44
title: "煤山恨"
55
author: 曲艺人
6-
mention: 闯王 八旗 吴三桂
6+
mention: 清末 国破家亡生为贵 怎当皇家之女掌上珠明
77
date: 2019-07-12 +0800
88
moreDate: 清末
99
description: 西河大鼓《煤山恨》的全词,讲述明末闯王李自成进北京、崇祯帝自缢煤山、吴三桂引八旗兵入山海关以致改朝换代的故事,此版本由郭德纲演唱,十分沧桑。

_posts/poetry/2019-09-25-木兰辞.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: post
33
categories: poetry
44
title: "木兰辞"
5-
mention: 送儿还故乡
5+
mention: 南北朝 木兰不用尚书郎 送儿还故乡
66
author: 乐府诗集
77
date: 2019-09-25 +0800
88
moreDate: 南北朝

_posts/poetry/2019-09-25-长恨歌.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: poetry
44
title: "长恨歌"
55
author: 白居易
6-
mention: 比翼鸟 连理枝
6+
mention: 唐 在天愿作比翼鸟 夜雨闻铃肠断声
77
date: 2019-09-25 +0800
88
moreDate:
99
description: 在天愿作比翼鸟,在地愿为连理枝。

_posts/poetry/2022-06-28-春江花月夜.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: poetry
44
title: "春江花月夜"
55
author: 张若虚
6-
mention: 何处春江无月明
6+
mention: 唐 谁家今夜扁舟子 何处春江无月明
77
date: 2022-06-28 +0800
88
moreDate:
99
description: 记得中学时这首诗并不要求背诵,但是我背了下来。

_posts/poetry/2023-01-21-牡丹亭·节选.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@ layout: post
33
categories: poetry
44
title: "牡丹亭·节选"
55
author: 汤显祖
6-
mention: 昆曲 曲牌
6+
mention: 明 良辰美景奈何天 一生爱好是天然
77
date: 2023-01-21 +0800
88
moreDate:
9-
description: 汤显祖所著《牡丹亭》真是为昆曲而生,半文言半口语的词在舞台上演出来美极了,这些节选是我在看剧时印象深刻并且非常喜欢的曲子。
9+
description: 汤显祖所著《牡丹亭》真是为昆曲而生,半文言半口语的词在舞台上演出来优美之极。这些节选是我在看剧时印象深刻并且非常喜欢的曲子。
1010
cover:
1111
tags: 诗文 汤显祖 明 昆曲
1212
pin: true
1313
---
1414

15-
> 汤显祖所著《牡丹亭》是为昆曲而生,半文言半口语的词在舞台上演出来美极了,这些节选是我看剧时印象深刻并且非常喜欢的曲子,其余全文详见[维基文库](https://zh.wikisource.org/wiki/牡丹亭){: target="_blank" }或[这里](http://www.taiwan.cn/zt/wj/mdt/qt/200801/t20080102_523770.htm){: target="_blank" }。
15+
> 汤显祖所著《牡丹亭》是为昆曲而生,半文言半口语的词在舞台上演出来优美之极。这些节选是我看剧时印象深刻并且非常喜欢的曲子,其余全文详见[维基文库](https://zh.wikisource.org/wiki/牡丹亭){: target="_blank" }或[这里](http://www.taiwan.cn/zt/wj/mdt/qt/200801/t20080102_523770.htm){: target="_blank" }。
1616
1717
## 游园
1818

_posts/poetry/2023-05-27-石壕吏.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@ layout: post
33
categories: poetry
44
title: "石壕吏"
55
author: 杜甫
6-
mention: 战乱 兵役
6+
mention: 唐 急应河阳役 有吏夜捉人
77
date: 2023-05-27 +0800
88
moreDate:
9-
description: “三吏三别”,我小时候只知道这首《石壕吏》🙁
9+
description: “三吏三别”,我小时候只知道这首《石壕吏》。
1010
cover:
11-
tags: 诗文 杜甫 唐 战乱 兵役 吏
11+
tags: 诗文 杜甫 唐 战乱
1212
---
1313

14-
> “三吏三别”,我小时候只知道这首《石壕吏》🙁
14+
> “三吏三别”,我小时候只知道这首《石壕吏》。
1515
1616
**暮投石壕村,有吏夜捉人**
1717

_posts/poetry/2023-05-27-蒿里行&短歌行.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ layout: post
33
categories: poetry
44
title: "蒿里行&短歌行"
55
author: 曹操
6-
mention: 三国
6+
mention: 东汉末年 千里无鸡鸣 人生几何
77
date: 2023-05-27 +0800
88
moreDate: 东汉末年
99
description: “千里无鸡鸣”🥲。
1010
cover:
11-
tags: 诗文 曹操 东汉 三国 战乱
11+
tags: 诗文 曹操 东汉末年 战乱
1212
---
1313

1414
> “千里无鸡鸣”🥲。

_posts/poetry/2023-10-25-爱莲说.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
categories: poetry
44
title: "爱莲说"
55
author: 周敦颐
6-
mention: 北宋
6+
mention: 北宋 出淤泥不染 可远观不可亵玩也
77
date: 2023-10-25 +0800
88
moreDate: 北宋
99
description: “出淤泥不染,濯清涟不妖”🤥。
+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
layout: post
3+
categories: poetry
4+
title: "归园田居"
5+
author: 陶渊明
6+
mention: 魏晋 性本爱丘山 复得返自然
7+
date: 2024-09-06 +0800
8+
moreDate: 魏晋
9+
description: 久在樊笼里,复得返自然。
10+
cover:
11+
tags: 诗文 陶渊明 魏晋
12+
---
13+
14+
> 久在樊笼里,复得返自然。
15+
16+
**少无适俗韵,性本爱丘山。**
17+
误落尘网中,一去三十年。
18+
羁鸟恋旧林,池鱼思故渊。
19+
开荒南野际,守拙归园田。
20+
方宅十余亩,草屋八九间。
21+
榆柳荫后檐,桃李罗堂前。
22+
暧暧远人村,依依墟里烟。
23+
狗吠深巷中,鸡鸣桑树颠。
24+
户庭无尘杂,虚室有余闲。
25+
**久在樊笼里,复得返自然。**
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
layout: post
3+
categories: poetry
4+
title: "枫桥夜泊"
5+
author: 张继
6+
mention: 唐 江枫渔火对愁眠
7+
date: 2025-01-06 +0800
8+
moreDate:
9+
description: 万家灯火,夜半客船...
10+
cover:
11+
tags: 诗文 张继 唐
12+
---
13+
14+
> 万家灯火,夜半客船...
15+
16+
月落乌啼霜满天,江枫渔火对愁眠。
17+
姑苏城外寒山寺,夜半钟声到客船。
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
layout: post
3+
categories: poetry
4+
title: "题都城南庄"
5+
author: 崔护
6+
mention: 唐 人面不知何处去 桃花依旧笑春风
7+
date: 2025-01-07 +0800
8+
moreDate:
9+
description: 人面不知何处去,桃花依旧笑春风。
10+
cover:
11+
tags: 诗文 崔护 唐
12+
---
13+
14+
> 桃花依旧笑春风。
15+
16+
去年今日此门中,人面桃花相映红。
17+
人面不知何处去,桃花依旧笑春风。

npm/dist/blog-404-v2.0.0.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

npm/dist/blog-index-v2.0.0.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

npm/dist/blog-post-v2.0.0.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

npm/dist/blog-scaffold-v2.0.0.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

npm/dist/blog-scaffold-v2.0.0.js

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

npm/src/base/constant.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export const SECTION_TYPE_ORIGINAL: SectionType = {
33
name: "随笔",
44
indexPath: "/",
55
// / /index /index.html /post/original/
6-
pathRegex: "^(\\/|(\\/index.*)|(\\/post\\/original\\/.*))$"
6+
pathRegex: "^((\\/)|(\\/index.*)|(\\/post\\/original\\/.*))$"
77
}
88
export const SECTION_TYPE_REPOST: SectionType = {
99
identifier: "repost",
@@ -83,4 +83,8 @@ export function getSectionTypeByPath(path: string): SectionType {
8383
} else {
8484
return SECTION_TYPE_OTHER
8585
}
86+
}
87+
88+
export function isIndexPage(path: string): boolean {
89+
return path.match("^((\\/)|(\\/index.*)|(\\/section/.*))$") != null
8690
}

npm/src/component/dialog/SearchDialog.scss

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
margin: 1.2rem 1rem;
2121
color: var(--list-secondary-ink);
2222
line-break: loose;
23+
font-weight: 300;
2324
}
2425

2526
.mdc-text-field {

npm/src/component/text.scss

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ h1 {
3131

3232
h2 {
3333
@include typography.typography(headline2);
34+
font-size: calc(var(--mdc-typography-body1-font-size) + 0.5rem);
3435
}
3536

3637
h2::before {
@@ -47,6 +48,7 @@ h2.h2-mini {
4748

4849
h3 {
4950
@include typography.typography(headline3);
51+
font-size: calc(var(--mdc-typography-body1-font-size) + 0.3rem);
5052
}
5153

5254
h3::before {

npm/src/component/theme.scss

+2-2
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ $text-block-2-bg: (
201201
);
202202

203203
$text-block-3-ink: (
204-
light: #d89c3b,
205-
dark: rgb(248, 237, 194),
204+
light: #dc7d51,
205+
dark: #ffc5ab,
206206
);
207207

208208
$text-block-3-bg: (

npm/src/component/topbar.ts

+7-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { localRepository } from "../repository/LocalRepository";
55
import { MDCTopAppBar } from "@material/top-app-bar";
66
import { clearFocusListener, isMobileOrTablet, toggleClassWithEnable } from "../util/tools";
77
import { showAboutMeDialog } from "./dialog/AboutMeDialog";
8-
import { getSectionTypeByPath, SECTION_TYPE_OPERA, SECTION_TYPE_ORIGINAL, SECTION_TYPE_POETRY, SECTION_TYPE_PRINT, SECTION_TYPE_REPOST, SECTION_TYPE_SHARE, SECTION_TYPE_TAG } from "../base/constant";
8+
import { getSectionTypeByPath, isIndexPage, SECTION_TYPE_OPERA, SECTION_TYPE_ORIGINAL, SECTION_TYPE_POETRY, SECTION_TYPE_PRINT, SECTION_TYPE_REPOST, SECTION_TYPE_SHARE, SECTION_TYPE_TAG } from "../base/constant";
99
// import "./topbar.scss"
1010

1111
export var iconToggleTheme: MDCIconButtonToggle = null
@@ -193,7 +193,9 @@ export function blockTopbarKeyFrameAnimation(block: boolean) {
193193
}
194194

195195
function initTitle(topAppBarE: HTMLElement) {
196-
let section = getSectionTypeByPath(window.location.pathname)
196+
const path = window.location.pathname
197+
const section = getSectionTypeByPath(path)
198+
const isIndex = isIndexPage(path)
197199
let titleAE: HTMLLinkElement = topAppBarE.querySelector(".mdc-top-app-bar__title a")
198200
switch (section.identifier) {
199201
case SECTION_TYPE_ORIGINAL.identifier: {
@@ -203,17 +205,17 @@ function initTitle(topAppBarE: HTMLElement) {
203205
}
204206
case SECTION_TYPE_REPOST.identifier: {
205207
titleAE.innerText = "Repost"
206-
titleAE.href = "/"
208+
titleAE.href = isIndex ? "/" : section.indexPath
207209
break
208210
}
209211
case SECTION_TYPE_POETRY.identifier: {
210212
titleAE.innerText = "Poetry"
211-
titleAE.href = "/"
213+
titleAE.href = isIndex ? "/" : section.indexPath
212214
break
213215
}
214216
case SECTION_TYPE_OPERA.identifier: {
215217
titleAE.innerText = "Opera"
216-
titleAE.href = "/"
218+
titleAE.href = isIndex ? "/" : section.indexPath
217219
break
218220
}
219221
case SECTION_TYPE_TAG.identifier: {

npm/src/page/post.scss

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
/* 文章题目 */
99
.post-title {
10-
font-size: calc(var(--mdc-typography-body1-font-size) + 0.8rem);
10+
font-size: calc(var(--mdc-typography-body1-font-size) + 0.6rem);
1111
line-height: 2.5rem;
1212
margin: 1rem 2rem;
1313
text-align: center;

0 commit comments

Comments
 (0)