Spaces:
Running
on
Zero
Running
on
Zero
Update html_templates.py
Browse files- html_templates.py +38 -8
html_templates.py
CHANGED
|
@@ -37,17 +37,47 @@ def get_color_scheme(is_single_dog: bool) -> Union[str, List[str]]:
|
|
| 37 |
]
|
| 38 |
return single_dog_color if is_single_dog else color_list
|
| 39 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 40 |
def format_hint_html(message: str) -> str:
|
| 41 |
-
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 42 |
return f'''
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
</div>
|
|
|
|
| 51 |
'''
|
| 52 |
|
| 53 |
def format_unknown_breed_message(color: str, index: int) -> str:
|
|
|
|
| 37 |
]
|
| 38 |
return single_dog_color if is_single_dog else color_list
|
| 39 |
|
| 40 |
+
# def format_hint_html(message: str) -> str:
|
| 41 |
+
# """Format warning messages in a consistent style."""
|
| 42 |
+
# return f'''
|
| 43 |
+
# <div class="dog-info-card">
|
| 44 |
+
# <div class="breed-info">
|
| 45 |
+
# <p class="warning-message">
|
| 46 |
+
# <span class="icon">💡</span>
|
| 47 |
+
# {message}
|
| 48 |
+
# </p>
|
| 49 |
+
# </div>
|
| 50 |
+
# </div>
|
| 51 |
+
# '''
|
| 52 |
+
|
| 53 |
def format_hint_html(message: str) -> str:
|
| 54 |
+
"""
|
| 55 |
+
提示訊息的 HTML。
|
| 56 |
+
|
| 57 |
+
Args:
|
| 58 |
+
message: str, 要顯示的提示訊息
|
| 59 |
+
Returns:
|
| 60 |
+
str: 格式化後的 HTML 字符串
|
| 61 |
+
"""
|
| 62 |
return f'''
|
| 63 |
+
<div style="
|
| 64 |
+
padding: 20px;
|
| 65 |
+
background-color: #f8f9fa;
|
| 66 |
+
border-radius: 10px;
|
| 67 |
+
margin: 10px 0;
|
| 68 |
+
border-left: 5px solid #4A90E2;
|
| 69 |
+
">
|
| 70 |
+
<div style="
|
| 71 |
+
display: flex;
|
| 72 |
+
align-items: center;
|
| 73 |
+
gap: 10px;
|
| 74 |
+
color: #2C5282;
|
| 75 |
+
font-weight: 500;
|
| 76 |
+
">
|
| 77 |
+
<span style="font-size: 24px">💡</span>
|
| 78 |
+
<span>{message}</span>
|
| 79 |
</div>
|
| 80 |
+
</div>
|
| 81 |
'''
|
| 82 |
|
| 83 |
def format_unknown_breed_message(color: str, index: int) -> str:
|