Spaces:
Sleeping
Sleeping
from src.web.utils import create_status_html | |
class HTMLGenerator: | |
def generate_error(text: str) -> str: | |
return create_status_html("Error", [], error_text=text) | |
def generate_status(stage_title: str, steps: list[tuple[str, bool]]) -> str: | |
return create_status_html(stage_title, steps) + "</div>" | |
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> | |
''' | |
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> | |
''' | |
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> | |
''' | |
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> | |
''' | |