Spaces:
Sleeping
Sleeping
File size: 2,043 Bytes
f655f69 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
from src.web.utils import create_status_html
class HTMLGenerator:
@staticmethod
def generate_error(text: str) -> str:
return create_status_html("Error", [], error_text=text)
@staticmethod
def generate_status(stage_title: str, steps: list[tuple[str, bool]]) -> str:
return create_status_html(stage_title, steps) + "</div>"
@staticmethod
def generate_text_split(text_split_html: str) -> str:
return f'''
<div class="section" style="background-color: #31395294; padding: 1rem; border-radius: 8px; margin-top: 1rem; color: #e0e0e0;">
<h3 style="color: rgb(224, 224, 224); font-size: 1.5em; margin-bottom: 1rem;">Text Split by Character:</h3>
{text_split_html}
</div>
'''
@staticmethod
def generate_voice_assignments(voice_assignments_html: str) -> str:
return f'''
<div class="section" style="background-color: #31395294; padding: 1rem; border-radius: 8px; margin-top: 1rem; color: #e0e0e0;">
<h3 style="color: rgb(224, 224, 224); font-size: 1.5em; margin-bottom: 1rem;">Voice Assignments:</h3>
{voice_assignments_html}
</div>
'''
@staticmethod
def generate_message_without_voice_id() -> str:
return '''
<div class="audiobook-ready" style="background-color: #31395294; padding: 1rem; border-radius: 8px; margin-top: 1rem; text-align: center;">
<h3 style="color: rgb(224, 224, 224); font-size: 1.5em; margin-bottom: 1rem;">π«€ At first you should add your voice</h3>
</div>
'''
@staticmethod
def generate_final_message() -> str:
return '''
<div class="audiobook-ready" style="background-color: #31395294; padding: 1rem; border-radius: 8px; margin-top: 1rem; text-align: center;">
<h3 style="color: rgb(224, 224, 224); font-size: 1.5em; margin-bottom: 1rem;">π Your audiobook is ready!</h3>
</div>
'''
|