Skip to content

Commit

Permalink
添加物理猫主题,优化低分辨率设备显示
Browse files Browse the repository at this point in the history
  • Loading branch information
caol64 committed Dec 17, 2024
1 parent a1dfc3f commit 0fdf32b
Show file tree
Hide file tree
Showing 14 changed files with 384 additions and 36 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- [Pie](https://github.com/kevinzhao2233/typora-theme-pie)
- [Maize](https://github.com/BEATREE/typora-maize-theme)
- [Purple](https://github.com/hliu202/typora-purple-theme)
- [物理猫-薄荷](https://github.com/sumruler/typora-theme-phycat)
- 自定义主题
- 支持自定义样式
- 支持导入现成的主题
Expand Down
8 changes: 4 additions & 4 deletions WenYan.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = WenYan/WenYan.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 14;
CURRENT_PROJECT_VERSION = 15;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"WenYan/Preview Content\"";
DEVELOPMENT_TEAM = NNQB2TH9QC;
Expand All @@ -423,7 +423,7 @@
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 2.3.2;
MARKETING_VERSION = 2.4;
PRODUCT_BUNDLE_IDENTIFIER = com.yztech.WenYan;
PRODUCT_MODULE_NAME = WenYan;
PRODUCT_NAME = "文颜";
Expand All @@ -443,7 +443,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
CODE_SIGN_ENTITLEMENTS = WenYan/WenYan.entitlements;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 14;
CURRENT_PROJECT_VERSION = 15;
DEAD_CODE_STRIPPING = YES;
DEVELOPMENT_ASSET_PATHS = "\"WenYan/Preview Content\"";
DEVELOPMENT_TEAM = NNQB2TH9QC;
Expand All @@ -468,7 +468,7 @@
LD_RUNPATH_SEARCH_PATHS = "@executable_path/Frameworks";
"LD_RUNPATH_SEARCH_PATHS[sdk=macosx*]" = "@executable_path/../Frameworks";
MACOSX_DEPLOYMENT_TARGET = 12.0;
MARKETING_VERSION = 2.3.2;
MARKETING_VERSION = 2.4;
PRODUCT_BUNDLE_IDENTIFIER = com.yztech.WenYan;
PRODUCT_MODULE_NAME = WenYan;
PRODUCT_NAME = "文颜";
Expand Down
5 changes: 4 additions & 1 deletion WenYan/Enums.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ enum ThemeStyle: String {
case pie = "themes/pie.css"
case maize = "themes/maize.css"
case purple = "themes/purple.css"
case phycat = "themes/phycat.css"

var name: String {
switch self {
Expand All @@ -31,6 +32,7 @@ enum ThemeStyle: String {
case .pie: "Pie"
case .maize: "Maize"
case .purple: "Purple"
case .phycat: "物理猫-薄荷"
}
}

Expand All @@ -47,6 +49,7 @@ enum ThemeStyle: String {
case .pie: "kevinzhao2233"
case .maize: "BEATREE"
case .purple: "hliu202"
case .phycat: "sumruler"
}
}
}
Expand Down Expand Up @@ -74,7 +77,7 @@ enum Platform: String, CaseIterable, Identifiable {
var themes: [ThemeStyle] {
switch self {
case .gzh:
return [.gzhDefault, .orangeHeart, .rainbow, .lapis, .pie, .maize, .purple]
return [.gzhDefault, .orangeHeart, .rainbow, .lapis, .pie, .maize, .purple, .phycat]
case .zhihu:
return [.zhihuDefault]
case .toutiao:
Expand Down
4 changes: 0 additions & 4 deletions WenYan/Resources.bundle/csstree/handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,11 +299,9 @@ function parseCss(css, compatibilityMode) {
const defaultCss = `
#wenyan table td {
font-size: 0.75em;
height: 40px;
padding: 9px 12px;
line-height: 22px;
color: #222;
min-width: 60px;
border: 1px solid #d8d8d8;
vertical-align: top;
}`;
Expand All @@ -321,11 +319,9 @@ function parseCss(css, compatibilityMode) {
const defaultCss = `
#wenyan table th {
font-size: 0.75em;
height: 40px;
padding: 9px 12px;
line-height: 22px;
color: #222;
min-width: 60px;
border: 1px solid #d8d8d8;
vertical-align: top;
font-weight: bold;
Expand Down
20 changes: 10 additions & 10 deletions WenYan/Resources.bundle/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,16 +244,16 @@ function getContentForGzh() {
element.insertBefore(buildPseudoSpan(beforeResults), element.firstChild);
}
});
// 不知是否是bug,公众号不再支持blockquote样式
elements = clonedWenyan.querySelectorAll('blockquote');
elements.forEach(element => {
const preElement = document.createElement('section');
preElement.style.cssText = element.style.cssText;
while (element.firstChild) {
preElement.appendChild(element.firstChild);
}
element.parentNode.replaceChild(preElement, element);
});
// // 不知是否是bug,公众号不再支持blockquote样式
// elements = clonedWenyan.querySelectorAll('blockquote');
// elements.forEach(element => {
// const preElement = document.createElement('section');
// preElement.style.cssText = element.style.cssText;
// while (element.firstChild) {
// preElement.appendChild(element.firstChild);
// }
// element.parentNode.replaceChild(preElement, element);
// });
clonedWenyan.setAttribute("data-provider", "WenYan");
return `${clonedWenyan.outerHTML.replace(/class="mjx-solid"/g, 'fill="none" stroke-width="70"')}`;
}
Expand Down
2 changes: 0 additions & 2 deletions WenYan/Resources.bundle/themes/gzh_default.css
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,9 @@
#wenyan table td,
#wenyan table th {
font-size: 0.75em;
height: 40px;
padding: 9px 12px;
line-height: 22px;
color: #222;
min-width: 60px;
border: 1px solid #d8d8d8;
vertical-align: top;
}
Expand Down
2 changes: 0 additions & 2 deletions WenYan/Resources.bundle/themes/lapis.css
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,9 @@
#wenyan table th,
#wenyan table td {
border: 1px solid #d9dfe4;
height: 40px;
padding: 9px 12px;
font-size: 0.75em;
line-height: 22px;
min-width: 60px;
vertical-align: top;
}
#wenyan table th {
Expand Down
2 changes: 0 additions & 2 deletions WenYan/Resources.bundle/themes/maize.css
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,9 @@
#wenyan table td,
#wenyan table th {
font-size: 0.75em;
height: 40px;
padding: 9px 12px;
line-height: 22px;
color: #222;
min-width: 60px;
border: 1px solid rgb(255, 216, 181);
vertical-align: top;
}
Expand Down
2 changes: 0 additions & 2 deletions WenYan/Resources.bundle/themes/orangeheart.css
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,9 @@
#wenyan table td,
#wenyan table th {
font-size: 0.75em;
height: 40px;
padding: 9px 12px;
line-height: 22px;
color: #222;
min-width: 60px;
border: 1px solid rgb(239, 112, 96);
vertical-align: top;
}
Expand Down
Loading

0 comments on commit 0fdf32b

Please sign in to comment.