Skip to content

Commit

Permalink
feat: add Early Theme
Browse files Browse the repository at this point in the history
  • Loading branch information
teaSummer committed Jul 22, 2024
1 parent ab4c300 commit 1746cce
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ <h2 class="page-title" al="config"></h2>
<text al="nighttime"></text>
</mdui-segmented-button>
</mdui-tooltip>
<mdui-tooltip al-aplto="content: earlyTheme;" placement="top" openDelay="0" closeDelay="0">
<mdui-segmented-button value="classic" icon="access_time" selected-icon="access_time">
<text al="classic"></text>
</mdui-segmented-button>
</mdui-tooltip>
</mdui-segmented-button-group>
</label>
<label>
Expand Down
2 changes: 2 additions & 0 deletions locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ data:
default: Default
daytime: Daytime
nighttime: Nighttime
classic: Classic
systemTheme: System
lightTheme: Light Theme
darkTheme: Dark Theme
earlyTheme: Early Theme
ellipsis: ....
statistics: Statistics
visitorCount: Visitor Count
Expand Down
2 changes: 2 additions & 0 deletions locales/zh-CN.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ data:
default: 默认
daytime: 日间
nighttime: 夜间
classic: 经典
systemTheme: 跟随系统
lightTheme: 浅色主题
darkTheme: 深色主题
earlyTheme: 早期主题
ellipsis: ....
statistics: 统计信息
visitorCount: 访问计数
Expand Down
11 changes: 11 additions & 0 deletions scripts/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,17 @@ const themeChanged = (() => {
$('[alt="Stars Over Time"]').attr('src', 'https://starchart.cc/teaSummer/MCiSEE.svg?background=%2300000000&axis=%23ffffff&line=%236b63ff');
};
break;
case 'classic':
const classic = new CSSStyleSheet();
classic.insertRule(`
div.background {
background-image: url("/assets/image/classic.png");
transform: none;
filter: none;
}`);
document.adoptedStyleSheets = [main, classic, light];
$('[alt="Stars Over Time"]').attr('src', 'https://starchart.cc/teaSummer/MCiSEE.svg?background=%2300000000&axis=%23101010&line=%236b63ff');
break;
};
});
$('.theme').change(themeChanged);
Expand Down

0 comments on commit 1746cce

Please sign in to comment.