from pathlib import Path import gradio as gr from modules.html_generator import image_to_base64 def generate_html(): css = """ .character-gallery { margin: 1rem 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); grid-column-gap: 0.4rem; grid-row-gap: 1.2rem; } .character-container { cursor: pointer; text-align: center; position: relative; opacity: 0.85; } .character-container:hover { opacity: 1; } .character-container .placeholder, .character-container img { width: 150px; height: 200px; background-color: gray; object-fit: cover; margin: 0 auto; border-radius: 1rem; border: 3px solid white; box-shadow: 5px 5px 8px 0px rgb(0 0 0 / 50%); } .character-name { margin-top: 0.2rem; display: block; font-size: 1.2rem; font-weight: 600; overflow-wrap: anywhere; } """ container_html = f'