import gradio as gr from solver import get_results from ui.display import ( get_blooms_acquisition_rate, get_budget, get_confiserie_acquisition_rate, get_currency, get_dishes_selector, get_language, get_plants_selector, get_strategy, get_talent_price_bonus, prerender_inventory_inputs, update_all_ui_components, update_dishes_selector_on_language, update_inventory_inputs, update_inventory_ui_by_language, update_plants_selector_on_language, update_selectors_on_currency, ) # Hightlight the first tier of item css = """ /* Minimal tier distinction for inventory inputs */ .tier-radiant { background-color: #fff8dc; } .tier-radiant-rarecolor { background-color: #fff8dc; } .tier-flourishing { background-color: #e6e6fa; } .tier-flourishing-rarecolor { background-color: #e6e6fa; } .tier-hardy { background-color: #f0f8ff; } .tier-hardy-rarecolor { background-color: #f0f8ff; } .tier-legendary { background-color: #fff8dc; } .tier-epic { background-color: #e6e6fa; } .tier-rare { background-color: #f0f8ff; } """ # Title Animation js = """ function createGradioAnimation() { var container = document.createElement('div'); container.id = 'gradio-animation'; container.style.fontSize = '3em'; container.style.fontWeight = 'bold'; container.style.textAlign = 'center'; container.style.marginBottom = '20px'; var text = 'Arithmancy Solver for HPMA π'; for (var i = 0; i < text.length; i++) { (function(i){ setTimeout(function(){ var letter = document.createElement('span'); letter.style.opacity = '0'; letter.style.transition = 'opacity 0.5s'; letter.innerText = text[i]; container.appendChild(letter); setTimeout(function() { letter.style.opacity = '1'; }, 25); }, i * 125); })(i); } var gradioContainer = document.querySelector('.gradio-container'); gradioContainer.insertBefore(container, gradioContainer.firstChild); return 'Animation created'; } """ with gr.Blocks(js=js, css=css, theme=gr.themes.Monochrome()) as demo: gr.HTML("""
""") gr.HTML( """β¨β¨β¨Click here to try another cool solver!β¨β¨β¨
π΄"Horse" you doing? Happy New Year! π΄