dryymatt commited on
Commit
22edfe2
·
verified ·
1 Parent(s): c59762e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +26 -23
app.py CHANGED
@@ -1,33 +1,36 @@
1
  import gradio as gr
2
 
3
- def update_foundry(prompt):
4
- # This is your Foundry Core engine.
5
- # It takes your prompt and injects it into a pre-styled Neural-UI shell.
6
- # The 'preview' is rendered directly by the browser in the gr.HTML block.
 
 
 
 
 
 
 
 
 
7
  return f"""
8
- <div id="neural-container" style="background:#0a0a0a; color:#00ff41; font-family:monospace; padding:20px; border:1px solid #003300; border-radius:8px; height:600px; overflow-y:auto;">
9
- <h2 style="border-bottom:1px solid #00ff41;">SOVEREIGN FOUNDRY V3: ACTIVE</h2>
10
- <p><strong>System Status:</strong> {prompt}</p>
11
- <hr style="border:0; border-top:1px solid #333;">
12
- <div id="preview-shell">
13
- <p>Waiting for architecture commands...</p>
14
  </div>
15
- <script>
16
- // This is where your autonomous logic will execute.
17
- console.log("Foundry Engine Initialized.");
18
- </script>
19
  </div>
20
  """
21
 
22
- with gr.Blocks(theme=gr.themes.Monochrome()) as demo:
23
- gr.Markdown("# Sovereign Foundry: Autonomous App Generator")
 
 
24
  with gr.Row():
25
- with gr.Column(scale=1):
26
- cmd_input = gr.Textbox(label="Command Surface", placeholder="Describe the module you want to build...", lines=3)
27
- init_btn = gr.Button("INITIALIZE MODULE", variant="primary")
28
- with gr.Column(scale=2):
29
- preview = gr.HTML(label="Live Neural Preview")
30
-
31
- init_btn.click(fn=update_foundry, inputs=cmd_input, outputs=preview)
32
 
33
  demo.launch()
 
1
  import gradio as gr
2
 
3
+ # The 'Soul' of your app - custom CSS that defines the 'DeepSite' feel
4
+ custom_css = """
5
+ #foundry-canvas {
6
+ height: 90vh !important;
7
+ border: none !important;
8
+ background: #050505 !important;
9
+ }
10
+ .gradio-container { max-width: 100% !important; }
11
+ """
12
+
13
+ # The 'Brain' - your core logic
14
+ def run_command(prompt):
15
+ # This block generates the actual frontend code that gets injected
16
  return f"""
17
+ <div style="padding:20px; color:white;">
18
+ <h2>Engine Active</h2>
19
+ <p>Executing: {prompt}</p>
20
+ <div id="module-container" style="border: 1px solid #333; padding: 20px;">
21
+ <button onclick="alert('Module Logic Triggered!')" style="background: cyan; padding:10px;">TEST MODULE</button>
 
22
  </div>
 
 
 
 
23
  </div>
24
  """
25
 
26
+ with gr.Blocks(css=custom_css, theme=gr.themes.Base()) as demo:
27
+ # A cleaner, full-screen approach
28
+ canvas = gr.HTML(elem_id="foundry-canvas")
29
+
30
  with gr.Row():
31
+ cmd_input = gr.Textbox(placeholder="Describe your next module...", show_label=False)
32
+ btn = gr.Button("INITIALIZE")
33
+
34
+ btn.click(fn=run_command, inputs=cmd_input, outputs=canvas)
 
 
 
35
 
36
  demo.launch()