Skip to content

Commit

Permalink
Add more details to theme preview (on mouse-over)
Browse files Browse the repository at this point in the history
  • Loading branch information
Aemiii91 committed May 18, 2024
1 parent 22de4f6 commit b664e63
Show file tree
Hide file tree
Showing 17 changed files with 192 additions and 184 deletions.
22 changes: 15 additions & 7 deletions .github/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,10 @@ def generate_item(theme: str, collect_data: bool = False) -> str:
print(f" invalid theme: {theme}")
return ""

title = ""
name_split = theme.split(" by ", maxsplit=1)
name = name_split[0]
author = name_split[1] if len(name_split) > 1 else ""
description = ""

is_featured = theme in themes_featured

Expand All @@ -217,12 +217,7 @@ def generate_item(theme: str, collect_data: bool = False) -> str:
if "author" in config:
author = config["author"]
if "description" in config:
title = config["description"]

if not title:
title = f"{name} by {author}" if author else name
if is_featured:
title += " [featured theme]"
description = config["description"]

theme_subdirs = [f"themes/{theme}/{subdir}" for subdir in get_subdirs(dir_path)] if has_subdirs else [f"themes/{theme}"]

Expand Down Expand Up @@ -253,6 +248,19 @@ def generate_item(theme: str, collect_data: bool = False) -> str:
if readme_path != "":
break

title = ""
if name:
title += f"Name: {name}
"
if author:
title += f"Author: {author}
"
if last_updated:
title += f"Last updated: {last_updated}
"
if description:
title += f"Description: {description}
"
if is_featured:
title += "Tags: [featured theme]
"
title += "(Click to download)"

item = {
"NAME": name + " ★" if is_featured else name,
"AUTHOR": author or " ",
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Do you want to share your own custom themes with the community? <sup><sub>❤️
<table align="center"><tr>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Fairy-Type%20by%20UnBurn.zip">
<img title="Super effective" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Fairy-Type%20by%20UnBurn/preview.png" /><br/>
<img title="Name: Fairy-Type&#013;Author: UnBurn&#013;Last updated: 2024-03-18&#013;Description: Super effective&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Fairy-Type%20by%20UnBurn/preview.png" /><br/>
<b>Fairy-Type</b>
</a><br/>
<sup><i>UnBurn</i></sup><br>
Expand All @@ -105,7 +105,7 @@ Do you want to share your own custom themes with the community? <sup><sub>❤️

<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/AnalogPhosphor%20%283-pack%29%20by%20trash.zip">
<img title="AnalogPhosphor (3-pack) by trash" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/AnalogPhosphor%20%283-pack%29%20by%20trash/preview.png" /><br/>
<img title="Name: AnalogPhosphor (3-pack)&#013;Author: trash&#013;Last updated: 2024-03-13&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/AnalogPhosphor%20%283-pack%29%20by%20trash/preview.png" /><br/>
<b>AnalogPhosphor (3-pack)</b>
</a><br/>
<sup><i>trash</i></sup><br>
Expand All @@ -118,7 +118,7 @@ Do you want to share your own custom themes with the community? <sup><sub>❤️

<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Game%20Boy%20Scouts%20by%20UnBurn.zip">
<img title="For the Adventurer" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Game%20Boy%20Scouts%20by%20UnBurn/preview.png" /><br/>
<img title="Name: Game Boy Scouts&#013;Author: UnBurn&#013;Last updated: 2024-03-12&#013;Description: For the Adventurer&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Game%20Boy%20Scouts%20by%20UnBurn/preview.png" /><br/>
<b>Game Boy Scouts</b>
</a><br/>
<sup><i>UnBurn</i></sup><br>
Expand Down Expand Up @@ -147,7 +147,7 @@ Do you want to share your own custom themes with the community? <sup><sub>❤️
<table align="center"><tr>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Capcom%20SNK%20%28Handheld%20Filter%29%20by%20Sheezie.zip">
<img title="Capcom & SNK theme" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Capcom%20SNK%20%28Handheld%20Filter%29%20by%20Sheezie/preview.png" /><br/>
<img title="Name: Capcom SNK (Handheld Filter)&#013;Author: Sheezie&#013;Last updated: 2024-05-18&#013;Description: Capcom & SNK theme&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Capcom%20SNK%20%28Handheld%20Filter%29%20by%20Sheezie/preview.png" /><br/>
<b>Capcom SNK (Handheld Filter)</b>
</a><br/>
<sup><i>Sheezie</i></sup><br>
Expand All @@ -160,7 +160,7 @@ Do you want to share your own custom themes with the community? <sup><sub>❤️

<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Silky%20Remix%20SUPER%20GAME%20BOY%20by%20MLOPEZMAD.zip">
<img title="Silky Remix SUPER GAME BOY by MLOPEZMAD" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Silky%20Remix%20SUPER%20GAME%20BOY%20by%20MLOPEZMAD/preview.png" /><br/>
<img title="Name: Silky Remix SUPER GAME BOY&#013;Author: MLOPEZMAD&#013;Last updated: 2024-05-18&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Silky%20Remix%20SUPER%20GAME%20BOY%20by%20MLOPEZMAD/preview.png" /><br/>
<b>Silky Remix SUPER GAME BOY</b>
</a><br/>
<sup><i>MLOPEZMAD</i></sup><br>
Expand All @@ -173,7 +173,7 @@ Do you want to share your own custom themes with the community? <sup><sub>❤️

<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Mucha%20Miyoo%20by%20LamiaLazuli.zip">
<img title="Mucha Miyoo by LamiaLazuli" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Mucha%20Miyoo%20by%20LamiaLazuli/preview.png" /><br/>
<img title="Name: Mucha Miyoo&#013;Author: LamiaLazuli&#013;Last updated: 2024-05-18&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Mucha%20Miyoo%20by%20LamiaLazuli/preview.png" /><br/>
<b>Mucha Miyoo</b>
</a><br/>
<sup><i>LamiaLazuli</i></sup><br>
Expand Down
24 changes: 12 additions & 12 deletions generated/custom/index-01-79.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<table align="center"><tr>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Lilla%20by%20evolve.zip">
<img title="Lilla by evolve" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Lilla%20by%20evolve/preview.png" /><br/>
<img title="Name: Lilla&#013;Author: evolve&#013;Last updated: 2022-09-09&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Lilla%20by%20evolve/preview.png" /><br/>
<b>Lilla</b>
</a><br/>
<sup><i>evolve</i></sup><br>
Expand All @@ -82,7 +82,7 @@

<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Oransje%20by%20evolve.zip">
<img title="Oransje by evolve [featured theme]" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Oransje%20by%20evolve/preview.png" /><br/>
<img title="Name: Oransje&#013;Author: evolve&#013;Last updated: 2022-09-09&#013;Tags: [featured theme]&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Oransje%20by%20evolve/preview.png" /><br/>
<b>Oransje ★</b>
</a><br/>
<sup><i>evolve</i></sup><br>
Expand All @@ -93,7 +93,7 @@

<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Onichan%20by%20PixelShift.zip">
<img title="Onichan by PixelShift" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Onichan%20by%20PixelShift/preview.png" /><br/>
<img title="Name: Onichan&#013;Author: PixelShift&#013;Last updated: 2022-09-09&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Onichan%20by%20PixelShift/preview.png" /><br/>
<b>Onichan</b>
</a><br/>
<sup><i>PixelShift</i></sup><br>
Expand All @@ -105,7 +105,7 @@
</tr><tr>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Onion%20Mini%20by%20Jeltron.zip">
<img title="Onion Mini by Jeltron" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Onion%20Mini%20by%20Jeltron/preview.png" /><br/>
<img title="Name: Onion Mini&#013;Author: Jeltron&#013;Last updated: 2022-09-09&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Onion%20Mini%20by%20Jeltron/preview.png" /><br/>
<b>Onion Mini</b>
</a><br/>
<sup><i>Jeltron</i></sup><br>
Expand All @@ -116,7 +116,7 @@

<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Onyan%20by%20PixelShift.zip">
<img title="Onyan by PixelShift" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Onyan%20by%20PixelShift/preview.png" /><br/>
<img title="Name: Onyan&#013;Author: PixelShift&#013;Last updated: 2022-09-09&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Onyan%20by%20PixelShift/preview.png" /><br/>
<b>Onyan</b>
</a><br/>
<sup><i>PixelShift</i></sup><br>
Expand All @@ -127,7 +127,7 @@

<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Poketch%20by%20Lucario.zip">
<img title="Pokétch by Lucario" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Poketch%20by%20Lucario/preview.png" /><br/>
<img title="Name: Pokétch&#013;Author: Lucario&#013;Last updated: 2022-09-09&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Poketch%20by%20Lucario/preview.png" /><br/>
<b>Pokétch</b>
</a><br/>
<sup><i>Lucario</i></sup><br>
Expand All @@ -139,7 +139,7 @@
</tr><tr>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/2022%20Stock%20by%20Miyoo.zip">
<img title="2022 Stock by Miyoo" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/2022%20Stock%20by%20Miyoo/preview.png" /><br/>
<img title="Name: 2022 Stock&#013;Author: Miyoo&#013;Last updated: 2022-09-09&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/2022%20Stock%20by%20Miyoo/preview.png" /><br/>
<b>2022 Stock</b>
</a><br/>
<sup><i>Miyoo</i></sup><br>
Expand All @@ -150,7 +150,7 @@

<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/2021%20Stock%20by%20Miyoo.zip">
<img title="2021 Stock by Miyoo" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/2021%20Stock%20by%20Miyoo/preview.png" /><br/>
<img title="Name: 2021 Stock&#013;Author: Miyoo&#013;Last updated: 2022-09-09&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/2021%20Stock%20by%20Miyoo/preview.png" /><br/>
<b>2021 Stock</b>
</a><br/>
<sup><i>Miyoo</i></sup><br>
Expand All @@ -161,7 +161,7 @@

<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Switch%20by%20PixelShift.zip">
<img title="Switch by PixelShift" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Switch%20by%20PixelShift/preview.png" /><br/>
<img title="Name: Switch&#013;Author: PixelShift&#013;Last updated: 2022-09-09&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Switch%20by%20PixelShift/preview.png" /><br/>
<b>Switch</b>
</a><br/>
<sup><i>PixelShift</i></sup><br>
Expand All @@ -173,7 +173,7 @@
</tr><tr>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Synthwave%20by%20Ritual.zip">
<img title="Synthwave by Ritual" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Synthwave%20by%20Ritual/preview.png" /><br/>
<img title="Name: Synthwave&#013;Author: Ritual&#013;Last updated: 2022-09-09&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Synthwave%20by%20Ritual/preview.png" /><br/>
<b>Synthwave</b>
</a><br/>
<sup><i>Ritual</i></sup><br>
Expand All @@ -184,7 +184,7 @@

<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Wavedash%20by%20historymaker118.zip">
<img title="Wavedash by historymaker118" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Wavedash%20by%20historymaker118/preview.png" /><br/>
<img title="Name: Wavedash&#013;Author: historymaker118&#013;Last updated: 2022-09-09&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Wavedash%20by%20historymaker118/preview.png" /><br/>
<b>Wavedash</b>
</a><br/>
<sup><i>historymaker118</i></sup><br>
Expand All @@ -195,7 +195,7 @@

<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/BirdShot%20by%20historymaker118.zip">
<img title="BirdShot by historymaker118" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/BirdShot%20by%20historymaker118/preview.png" /><br/>
<img title="Name: BirdShot&#013;Author: historymaker118&#013;Last updated: 2022-09-09&#013;(Click to download)" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/BirdShot%20by%20historymaker118/preview.png" /><br/>
<b>BirdShot</b>
</a><br/>
<sup><i>historymaker118</i></sup><br>
Expand Down
Loading

0 comments on commit b664e63

Please sign in to comment.