Update app.py
Browse files5 unmodified lines678991011121 unmodified line1415161717181920212223242122232426252627282930313233343536373839404142433544453746474840414249505152534546475455565758505152535455596061626364656667596061686970717273747576777879808182838485866587886768899091717273749293949596977898991001018283102103104105106107108109909111011111211394114115116971171181191001201211221231241051061251261271081091281291301121131311321331341351361181371381201391401411231421431251441451461281471481301491501511331341521531541361371551561571581591601611621631641651661671681691701711721731741751761771781791501801811821531831841851861871881891601611901911921931942 unmodified lines19719819917020020120220313 unmodified lines2172182191902202212222231 unmodified line22522622719822822923020123123223323412 unmodified lines2472482492202502512222522532542 unmodified lines25725825923123223326026126223526326426526614 unmodified lines28128228325628428528628712 unmodified lines3003013022753033043053065 unmodified linesapp = Flask(__name__)
# ==========================================# FRONTEND: The Ultimate Cinematic IDE# FRONTEND: The Ultimate Floating Glass IDE# ==========================================HTML_TEMPLATE = """<!DOCTYPE html>1 unmodified line<head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Twenty IDE | Pure Cinematic Environment</title> <title>Twenty IDE | Glassmorphism Edition</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css"> <style> :root { --bg-dark: #020203; --bg-panel: #0a0a0f; --bg-terminal: #010f1a; --border-glass: rgba(255, 255, 255, 0.08); --bg-dark: #020204; --glass-bg: rgba(15, 15, 20, 0.45); /* Şüşə arxa planı */ --glass-border: rgba(255, 255, 255, 0.08); /* Şüşə kənarı parıltısı */ --text-main: #f4f4f5; --text-muted: #7a7a8c; --text-muted: #888899; --accent: #00f2fe; --radius-big: 24px; /* Dairəvi fason */ --radius-small: 12px; }
* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', system-ui, sans-serif; } body { background-color: var(--bg-dark); color: var(--text-main); height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
/* --- ARXA PLAN NEON İŞIQLARI (Blur üçün) --- */ .ambient-bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; background: #020204; } .orb { position: absolute; border-radius: 50%; filter: blur(150px); opacity: 0.3; } .orb-1 { width: 600px; height: 600px; background: #00f2fe; top: -10%; left: -10%; animation: float 30s infinite alternate ease-in-out; } .orb-2 { width: 500px; height: 500px; background: #4facfe; bottom: -10%; right: -10%; animation: floatReverse 25s infinite alternate ease-in-out; } @keyframes float { 0% { transform: translate(0, 0); } 100% { transform: translate(20vw, 20vh); } } @keyframes floatReverse { 0% { transform: translate(0, 0); } 100% { transform: translate(-20vw, -20vh); } }
/* --- SİRR Lİ KÖLGƏ SPLASH EKRANI --- */ #splash { position: fixed; inset: 0; background: #020203; position: fixed; inset: 0; background: #020204; z-index: 9999; display: flex; flex-direction: column; justify-content: center; align-items: center; transition: opacity 1s ease-in-out; transition: opacity 1.5s ease-in-out; } .splash-text { font-size: 65px; font-weight: 100; letter-spacing: 35px; color: transparent; margin-left: 35px; /* Hərfləri mərkəzləşdirmək üçün */ animation: shadowMelt 3.5s ease-in-out forwards; font-size: 65px; font-weight: 200; color: transparent; margin-left: 30px; animation: breatheMelt 4s cubic-bezier(0.25, 1, 0.5, 1) forwards; } .splash-sub { font-size: 13px; color: var(--accent); letter-spacing: 15px; margin-top: 20px; text-transform: uppercase; margin-left: 15px; opacity: 0; animation: subFade 3.5s ease-in-out forwards; font-size: 13px; color: var(--accent); letter-spacing: 20px; margin-top: 25px; text-transform: uppercase; margin-left: 20px; opacity: 0; animation: subFade 4s ease-in-out forwards; }
/* Kino effekti: Kölgədən çıxıb kölgəyə qayıtmaq */ @keyframes shadowMelt { 0% { opacity: 0; filter: blur(30px); text-shadow: 0 0 0px rgba(0, 242, 254, 0); transform: scale(1.1); color: #000; } 30% { opacity: 1; filter: blur(0px); text-shadow: 0 0 50px rgba(0, 242, 254, 0.6); transform: scale(1); color: var(--color-white); } 70% { opacity: 1; filter: blur(0px); text-shadow: 0 0 50px rgba(0, 242, 254, 0.6); transform: scale(1); color: var(--color-white); } 100% { opacity: 0; filter: blur(30px); text-shadow: 0 0 0px rgba(0, 242, 254, 0); transform: scale(0.9); color: #000; } /* Kino effekti: Nəfəs alan hərflər */ @keyframes breatheMelt { 0% { opacity: 0; filter: blur(30px); text-shadow: 0 0 0px rgba(0, 242, 254, 0); transform: scale(1.1); letter-spacing: 45px; } 40% { opacity: 1; filter: blur(0px); text-shadow: 0 0 60px rgba(0, 242, 254, 0.7); transform: scale(1); letter-spacing: 30px; color: var(--color-white); } 70% { opacity: 1; filter: blur(0px); text-shadow: 0 0 40px rgba(0, 242, 254, 0.5); transform: scale(1); letter-spacing: 30px; color: var(--color-white); } 100% { opacity: 0; filter: blur(30px); text-shadow: 0 0 0px rgba(0, 242, 254, 0); transform: scale(0.9); letter-spacing: 15px; color: transparent; } } @keyframes subFade { 0% { opacity: 0; filter: blur(10px); } 30% { opacity: 0.8; filter: blur(0px); } 70% { opacity: 0.8; filter: blur(0px); } 100% { opacity: 0; filter: blur(10px); } 40% { opacity: 0.9; filter: blur(0px); } 70% { opacity: 0.9; filter: blur(0px); } 100% { opacity: 0; filter: blur(15px); } }
/* --- ŞÜŞƏ PANEL STİLLƏRİ (GLASSMORPHISM) --- */ .glass-panel { background: var(--glass-bg); backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px); border: 1px solid var(--glass-border); border-top: 1px solid rgba(255,255,255,0.15); /* İşıq düşmə effekti */ border-radius: var(--radius-big); box-shadow: 0 15px 35px rgba(0,0,0,0.4); overflow: hidden; display: flex; flex-direction: column; }
/* --- BAŞLANĞICDA GİZLİ PANELLƏR --- */ #top-bar { transform: translateY(-100%); opacity: 0; } #top-bar { transform: translateY(-50px); opacity: 0; } #sidebar-left { transform: translateX(-50px); opacity: 0; } /* Orta panel artıq yuxarıdan gələcək deyə -50px edirik */ #center-panel { transform: translateY(-50px); opacity: 0; } #center-panel { transform: translateY(50px); opacity: 0; }
/* --- SİNXRON ANİMASİYALAR --- */ .anim-top { animation: slideInTop 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; } .anim-left { animation: slideInLeft 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.2s; } /* Orta panel üçün yeni yuxarıdan sürüşmə animasiyası */ .anim-center-down { animation: slideInDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.4s; } .anim-top { animation: slideInTop 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; } .anim-left { animation: slideInLeft 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.2s; } .anim-center { animation: slideInUp 1s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.3s; }
@keyframes slideInTop { to { transform: translateY(0); opacity: 1; } } @keyframes slideInLeft { to { transform: translateX(0); opacity: 1; } } @keyframes slideInDown { to { transform: translateY(0); opacity: 1; } } @keyframes slideInUp { to { transform: translateY(0); opacity: 1; } }
/* --- ÜST PANEL --- */ .top-bar { height: 60px; background: rgba(10, 10, 15, 0.9); border-bottom: 1px solid var(--border-glass); display: flex; justify-content: space-between; align-items: center; padding: 0 20px; z-index: 100; height: 65px; margin: 15px 15px 0 15px; display: flex; justify-content: space-between; align-items: center; padding: 0 25px; z-index: 100; } .brand { font-size: 18px; font-weight: 300; letter-spacing: 4px; display: flex; align-items: center; gap: 20px; } .brand i { color: var(--accent); } .controls { display: flex; align-items: center; gap: 15px; } .lang-select { background: transparent; color: var(--text-muted); border: 1px solid var(--border-glass); padding: 6px 10px; border-radius: 4px; cursor: pointer; outline: none; transition: 0.3s; background: rgba(0,0,0,0.3); color: var(--text-muted); border: 1px solid var(--glass-border); padding: 8px 15px; border-radius: var(--radius-small); cursor: pointer; outline: none; transition: 0.3s; font-size: 13px; letter-spacing: 1px; } .lang-select:hover { color: white; border-color: rgba(255,255,255,0.3); } .lang-select:hover { color: white; border-color: rgba(255,255,255,0.3); background: rgba(0,0,0,0.5); }
.run-btn { background: var(--text-main); color: #000; border: none; padding: 8px 25px; border-radius: 4px; background: rgba(255,255,255,0.9); color: #000; border: none; padding: 10px 25px; border-radius: var(--radius-small); cursor: pointer; font-weight: 600; transition: 0.3s; display: flex; align-items: center; gap: 8px; } .run-btn:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(255,255,255,0.2); } .run-btn:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 5px 20px rgba(255,255,255,0.3); } .panel-toggle { background: transparent; color: var(--text-muted); border: none; cursor: pointer; font-size: 18px; transition: 0.3s; padding: 5px; } .panel-toggle:hover { color: white; transform: scale(1.1); }
/* --- ƏSAS İŞ ZONASI --- */ .main-layout { display: flex; flex: 1; overflow: hidden; } /* --- ƏSAS İŞ ZONASI (BOŞLUQLAR VƏ DAİRƏVİ KƏNARLAR) --- */ .main-layout { display: flex; flex: 1; overflow: hidden; padding: 15px; gap: 15px; } .panel { background: var(--bg-panel); display: flex; flex-direction: column; } .panel-title { padding: 15px 20px; font-size: 11px; text-transform: uppercase; letter-spacing: 3px; color: var(--text-muted); border-bottom: 1px solid var(--border-glass); background: rgba(0,0,0,0.4); } .panel-title { padding: 18px 25px; font-size: 11px; text-transform: uppercase; letter-spacing: 3px; color: var(--text-muted); border-bottom: 1px solid var(--glass-border); background: rgba(0,0,0,0.2); }
/* Sol Panel */ .sidebar-left { width: 280px; border-right: 1px solid var(--border-glass); transition: width 0.4s; } .sidebar-left.collapsed { width: 0; border: none; overflow: hidden; opacity: 0; } .sidebar-left { width: 300px; transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1); } .sidebar-left.collapsed { width: 0; border: none; margin: 0; opacity: 0; padding: 0; } .file-list { padding: 20px; flex: 1; overflow-y: auto; font-size: 14px; } .folder { margin-bottom: 15px; } .folder-name { color: var(--text-main); display: flex; align-items: center; gap: 10px; margin-bottom: 8px; cursor: pointer; font-weight: 500; opacity: 0.9; } .folder-items { margin-left: 22px; display: flex; flex-direction: column; gap: 5px; border-left: 1px solid rgba(255,255,255,0.1); padding-left: 12px; } .file-item { display: flex; align-items: center; gap: 10px; color: var(--text-muted); cursor: pointer; padding: 8px 10px; border-radius: 6px; transition: 0.2s; font-size: 13.5px; } .file-item { display: flex; align-items: center; gap: 10px; color: var(--text-muted); cursor: pointer; padding: 10px 12px; border-radius: var(--radius-small); transition: 0.2s; font-size: 13.5px; } .file-item:hover { color: white; background: rgba(255,255,255,0.05); } .file-item.active { color: white; background: rgba(255,255,255,0.08); border-left: 2px solid var(--accent); } .file-item.active { color: white; background: rgba(255,255,255,0.1); border-left: 3px solid var(--accent); }
/* Orta Panel */ .center-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #000; } .center-panel { flex: 1; display: flex; flex-direction: column; min-width: 0; } #editor-container { flex: 1; min-height: 100px; } #editor-container { flex: 1; min-height: 100px; background: rgba(0,0,0,0.2); } /* DRAG RESİZER */ .resizer { height: 6px; background: #15151e; cursor: ns-resize; display: flex; justify-content: center; align-items: center; transition: 0.2s; z-index: 50; border-top: 1px solid #000; border-bottom: 1px solid #000; } .resizer { height: 6px; background: rgba(0,0,0,0.3); cursor: ns-resize; display: flex; justify-content: center; align-items: center; transition: 0.2s; z-index: 50; border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); } .resizer:hover, .resizer:active { background: var(--accent); } .resizer::after { content: ""; width: 50px; height: 2px; background: rgba(255,255,255,0.2); border-radius: 2px; } .resizer::after { content: ""; width: 40px; height: 3px; background: rgba(255,255,255,0.3); border-radius: 3px; }
/* Terminal */ .terminal-wrapper { height: 300px; min-height: 100px; background: var(--bg-terminal); display: flex; flex-direction: column; } .terminal-header { background: rgba(0,0,0,0.6); padding: 10px 20px; font-size: 12px; color: #888; display: flex; justify-content: space-between; border-bottom: 1px solid rgba(255,255,255,0.05); } .terminal-wrapper { height: 320px; min-height: 100px; background: rgba(1, 15, 25, 0.5); display: flex; flex-direction: column; } .terminal-header { background: rgba(0,0,0,0.4); padding: 12px 25px; font-size: 12px; color: #999; display: flex; justify-content: space-between; border-bottom: 1px solid var(--glass-border); } #terminal-output { flex: 1; padding: 20px; font-family: 'Consolas', monospace; font-size: 15px; color: #d1d1d1; overflow-y: auto; white-space: pre-wrap; line-height: 1.6; text-align: left; flex: 1; padding: 25px; font-family: 'Consolas', monospace; font-size: 15px; color: #d1d1d1; overflow-y: auto; white-space: pre-wrap; line-height: 1.7; text-align: left; } .ps-prompt { color: #82aaff; font-weight: bold; } .ps-success { color: #c3e88d; } .ps-error { color: #ff5370; }
/* Scrollbar dizaynı */ ::-webkit-scrollbar { width: 8px; height: 8px; } ::-webkit-scrollbar-track { background: transparent; } ::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; } ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }
</style> <script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.36.1/min/vs/loader.min.js"></script></head><body>
<div class="ambient-bg"> <div class="orb orb-1"></div> <div class="orb orb-2"></div> </div>
<div id="splash"> <div class="splash-text">TWENTY</div> <div class="splash-sub">Pure Development</div> <div class="splash-sub">Glassmorphism UI</div> </div>
<div class="top-bar" id="top-bar"> <div class="glass-panel top-bar" id="top-bar"> <div class="brand"> <button class="panel-toggle" onclick="togglePanel('left')"><i class="fa-solid fa-folder-tree"></i></button> <i class="fa-solid fa-code"></i> TWENTY IDE </div> <div class="controls"> <select class="lang-select" id="lang-select" onchange="changeLanguage()"> <option value="az">AZ</option> <option value="en">EN</option> <option value="az">🇦🇿 AZ</option> <option value="en">🇬🇧 EN</option> </select> <button class="run-btn" onclick="runCode()" id="btn-run"> <i class="fa-solid fa-play"></i> <span id="t-run">İcra Et</span>2 unmodified lines </div>
<div class="main-layout"> <div class="panel sidebar-left" id="sidebar-left"> <div class="glass-panel sidebar-left" id="sidebar-left"> <div class="panel-title" id="t-explorer">LAYİHƏ STRUKTURU</div> <div class="file-list"> <div class="folder">13 unmodified lines </div> </div>
<div class="center-panel" id="center-panel"> <div class="glass-panel center-panel" id="center-panel"> <div id="editor-container"></div> <div class="resizer" id="resizer"></div>1 unmodified line <div class="terminal-wrapper" id="terminal-wrapper"> <div class="terminal-header"> <span><i class="fa-solid fa-terminal"></i> PowerShell Engine</span> <i class="fa-solid fa-broom" style="cursor:pointer;" onclick="clearTerminal()" title="Təmizlə"></i> <i class="fa-solid fa-broom" style="cursor:pointer; transition:0.3s;" onclick="clearTerminal()" onmouseover="this.style.color='white'" onmouseout="this.style.color='#999'" title="Təmizlə"></i> </div> <div id="terminal-output"><span style="color: #888;">// Twenty Cloud Engine v2.0 Aktivdir...</span><span style="color: #888;">// Twenty Glass Engine Aktivdir...</span><span class="ps-prompt">PS C:\\Twenty\\src></span> Hazırdır. Kodunuzu icra edin.</div> </div> </div>12 unmodified lines } }
// --- KİNO GİRİŞİ VƏ YUXARIDAN SÜRÜŞMƏ --- // --- KİNO GİRİŞİ --- window.onload = () => { // Animasiyamız 3.5 saniyədir. Tam yox olanda panelləri gətiririk. setTimeout(() => { const splash = document.getElementById('splash'); splash.style.opacity = '0';2 unmodified lines splash.remove(); document.getElementById('top-bar').classList.add('anim-top'); document.getElementById('sidebar-left').classList.add('anim-left'); // Orta panel artıq yuxarıdan gəlir! document.getElementById('center-panel').classList.add('anim-center-down'); }, 800); document.getElementById('center-panel').classList.add('anim-center'); }, 1000); }, 3500); // 3.5 saniyə shadowMelt animasiyası gözləyir }, 4000); // Nəfəs alma animasiyasını tam görmək üçün vaxt };
function togglePanel(side) {14 unmodified lines document.addEventListener('mousemove', (e) => { if (!isResizing) return; const containerHeight = document.getElementById('center-panel').clientHeight; const newTerminalHeight = containerHeight - e.clientY + 60; const newTerminalHeight = containerHeight - e.clientY + 85; if (newTerminalHeight > 100 && newTerminalHeight < containerHeight - 100) { terminalWrapper.style.height = `${newTerminalHeight}px`;12 unmodified lines require.config({ paths: { 'vs': 'https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.36.1/min/vs' }}); require(['vs/editor/editor.main'], function() { editor = monaco.editor.create(document.getElementById('editor-container'), { value: "# Twenty IDE Pure Environment\\n# Buludda input() islemediyi ucun deyisenleri bele teyin et:\\n\\na = 500\\nb = 300\\nprint(f'Neticeniz: {a + b}')\\nprint('Twenty IDE ugurla isleyir!')", value: "# Twenty IDE: Glassmorphism Edition\\n# Dizayn tam olaraq senin istediyin kimi dairevi ve blurludur.\\n\\nprint('Havada asili qalan paneller mukemmel gorunur!')", language: 'python', theme: 'vs-dark', automaticLayout: true,app.py+99-71