-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #243 from Light-Beacon/2025newyear
新年时合并
- Loading branch information
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
Project/libraries/Homepage/Events/NewYear/2025ChineseNewYear.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<local:MyCard Margin="3,8" MaxWidth="750"> | ||
<Border Margin="-3.5,-3" CornerRadius="5" Height="130"> | ||
<Border.Background> | ||
<ImageBrush ImageSource="http://i0.hdslb.com/bfs/new_dyn/7693a697ff7d00838ff3928fef93c07e277543816.png" Stretch="UniformToFill" /> | ||
</Border.Background> | ||
</Border> | ||
</local:MyCard> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from homepagebuilder.interfaces.Events import on, ResultOverride | ||
from homepagebuilder.core.config import enable_by_config | ||
|
||
COLOR_MAPPING = { | ||
1: None, | ||
2: "#9B2A2A", | ||
3: "#C05252", | ||
4: "#D56B6B", | ||
5: "#E18E8E", | ||
#6: "#E18E8E", | ||
#7: "#E18E8E", | ||
} | ||
|
||
@on('page.generate.return') | ||
@enable_by_config('news.replacecolor') | ||
def script(*args, **kwargs): | ||
result:str = kwargs['result'] | ||
for num, color in COLOR_MAPPING.items(): | ||
if not color: | ||
continue | ||
result = result.replace(f"{{DynamicResource ColorBrush{num}}}",color) | ||
raise ResultOverride(result) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters