Панель управления моделью (Engee-приложение)
作者
using Engee, GenieFramework
@app begin
@out message = ""
@in press_btn = false
@onbutton press_btn begin
try
# engee.eval("""engee.open("model_1.engee"); engee.run("model_1")""")
engee.eval("data = engee.run();") # Запустить открытую на холсте модель
message = "Команда выполнена успешно! Модель запущена."
catch e
message = "Ошибка: $e"
end
end
end
function ui()
[
h5("Специальная кнопка для запуска модели", style="color: #2c3e50; text-align: center; margin-bottom: 30px; font-family: 'Arial', sans-serif;"),
h6("(не забудьте открыть любую модель в Engee)", style="color: #7f8c8d; text-align: center; margin-top: -20px; margin-bottom: 40px; font-family: 'Courier New', monospace;"),
row([
column([
row([
column([
btn("🚀 ПУСК", @click(:press_btn),
style="""
font-size: 36px;
font-weight: bold;
font-family: 'Arial', sans-serif;
width: 250px;
height: 250px;
border-radius: 50%;
background: linear-gradient(145deg, #27ae60, #2ecc71);
color: white;
border: 4px solid #27ae60;
box-shadow: 0 8px 25px rgba(46, 204, 113, 0.4);
transition: all 0.3s ease;
text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
cursor: pointer;
&:hover {
transform: scale(1.05);
box-shadow: 0 12px 35px rgba(46, 204, 113, 0.6);
}
"""
)
], style="""
background: linear-gradient(135deg, #ecf0f1 0%, #dfe6e9 100%);
border-radius: 25px;
padding: 50px;
display: flex;
justify-content: center;
align-items: center;
box-shadow: 0 10px 30px rgba(0,0,0,0.1);
border: 3px solid #bdc3c7;
position: relative;
""")
], style="display: flex; justify-content: center;")
], style="display: flex; justify-content: center;")
], style="""
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
border-radius: 20px;
padding: 40px;
margin: 20px auto;
max-width: 500px;
box-shadow:
inset 0 4px 8px rgba(255,255,255,0.8),
inset 0 -4px 8px rgba(0,0,0,0.05),
0 10px 25px rgba(0,0,0,0.1);
border: 1px solid #dee2e6;
""")
]
end
@page("/", ui)