From 9c0244149b943dfe6e48d19743965474c4bd04ac Mon Sep 17 00:00:00 2001 From: Michiel Sikma Date: Thu, 7 Jul 2022 13:29:51 +0200 Subject: [PATCH] Switch to using a special attribute for all-white items --- data/misc.json | 156 +++++++++++++++++++---------- docs/resources/gh-markdown.css | 8 +- docs/resources/pokesprite-docs.css | 6 ++ scripts/gen_docs.py | 8 +- 4 files changed, 119 insertions(+), 59 deletions(-) diff --git a/data/misc.json b/data/misc.json index 9746675f..4f46f9d6 100644 --- a/data/misc.json +++ b/data/misc.json @@ -3549,8 +3549,10 @@ "legends-arceus": "2x", "home": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3568,8 +3570,10 @@ "legends-arceus": "2x", "home": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3587,8 +3591,10 @@ "legends-arceus": "2x", "home": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3606,8 +3612,10 @@ "legends-arceus": "2x", "home": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3625,8 +3633,10 @@ "legends-arceus": "2x", "home": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3644,8 +3654,10 @@ "legends-arceus": "2x", "home": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3663,8 +3675,10 @@ "legends-arceus": "2x", "home": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3682,8 +3696,10 @@ "legends-arceus": "2x", "home": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } } ], @@ -3711,8 +3727,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3738,8 +3756,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3765,8 +3785,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3792,8 +3814,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3819,8 +3843,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3846,8 +3872,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3873,8 +3901,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3900,8 +3930,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3927,8 +3959,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3954,8 +3988,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -3981,8 +4017,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -4008,8 +4046,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -4035,8 +4075,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -4062,8 +4104,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -4089,8 +4133,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -4116,8 +4162,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -4143,8 +4191,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } }, { @@ -4170,8 +4220,10 @@ "resolution": { "gen-8": "2x" }, - "default-background-color": { - "legends-arceus": "#b3b3b3" + "attributes": { + "legends-arceus": { + "is_all_white": true + } } } ], diff --git a/docs/resources/gh-markdown.css b/docs/resources/gh-markdown.css index 787ef7ef..0bd7e9f3 100644 --- a/docs/resources/gh-markdown.css +++ b/docs/resources/gh-markdown.css @@ -7,7 +7,9 @@ :root { --gh-black: #24292e; --gh-blue: #0366d6; - --shade-8: #444d56; + --shade-10: #3e4650; + --shade-9: #444d56; + --shade-8: #545c68; --shade-7: #6a737d; --shade-6: #959da5; --shade-5: #c6cbd1; @@ -309,7 +311,7 @@ border-bottom-color: var(--shade-6); border-radius: 3px; box-shadow: inset 0 -1px 0 var(--shade-6); - color: var(--shade-8); + color: var(--shade-9); display: inline-block; font-size: 11px; line-height: 10px; @@ -502,7 +504,7 @@ border-bottom-color: var(--shade-5); border-radius: 3px; box-shadow: inset 0 -1px 0 var(--shade-5); - color: var(--shade-8); + color: var(--shade-9); display: inline-block; font: 11px SFMono-Regular, Consolas, Liberation Mono, Menlo, Courier, monospace; line-height: 10px; diff --git a/docs/resources/pokesprite-docs.css b/docs/resources/pokesprite-docs.css index 413eebee..8e08f9b9 100644 --- a/docs/resources/pokesprite-docs.css +++ b/docs/resources/pokesprite-docs.css @@ -79,6 +79,12 @@ .markdown-body .pokesprite tbody tr.variable-height td { vertical-align: middle; } +.markdown-body .pokesprite tbody td.is-all-white { + background-color: var(--shade-10); +} +.markdown-body .pokesprite tbody tr:hover td.is-all-white { + background-color: var(--shade-7); +} .markdown-body .pokesprite tbody span[title] { border-bottom: 1px dotted var(--gh-black); } diff --git a/scripts/gen_docs.py b/scripts/gen_docs.py index 5769ef26..0a211111 100755 --- a/scripts/gen_docs.py +++ b/scripts/gen_docs.py @@ -453,7 +453,7 @@ def generate_misc_table(misc, meta, curr_page, json_file, version = '[unknown]', count = get_counter() gen_n = get_gen_str(k) res = item['resolution'][k] - default_background_color = item.get("default-background-color", {}).get(k, None) + attributes = item.get("attributes", {}).get(k, {}) retina_type = \ 'ribbon-gen8' if (res == '2x' and misc_set in ['ribbon', 'mark']) else \ 'origin-mark' if (res == '2x' and misc_set in ['origin-marks']) else \ @@ -467,7 +467,7 @@ def generate_misc_table(misc, meta, curr_page, json_file, version = '[unknown]', buffer.append(f'{name_eng_desc}') buffer.append(f'{name_jpn}') buffer.append(f'Gen {origin_gen}') - buffer.append('' + get_img_node(get_misc_url(base_url, v), None, f"Sprite for '{name_eng}'", 'm', retina_type) + '') + buffer.append('' + get_img_node(get_misc_url(base_url, v), None, f"Sprite for '{name_eng}'", 'm', retina_type) + '') buffer.append(f' 1 and row_n > 0 else ""}">{v}') if len(vs) > 1: if gen_row_n == 0: @@ -531,7 +531,7 @@ def generate_misc_table(misc, meta, curr_page, json_file, version = '[unknown]', gen_n = get_gen_str(k) colors = item['colors'][k] main_color = colors[0] - default_background_color = item.get("default-background-color", {}).get(k, None) + attributes = item.get("attributes", {}).get(k, {}) buffer.append('') buffer.append(f'{count}') if row_n == 0: @@ -540,7 +540,7 @@ def generate_misc_table(misc, meta, curr_page, json_file, version = '[unknown]', buffer.append(f'{name_eng.capitalize()}') buffer.append(f'{name_jpn}') - buffer.append('' + \ + buffer.append('' + \ f'' + \ get_img_node(get_misc_url(base_url, v), None, f"Sprite for '{name_eng}'", 'm', 'body-style-gen8') + '') buffer.append(f'{v}')