RFTSystems commited on
Commit
e4ec569
·
verified ·
1 Parent(s): c523790

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +36 -2
app.py CHANGED
@@ -1,4 +1,4 @@
1
- import os, json, urllib.request, math, time
2
  import gradio as gr
3
  from datetime import datetime
4
 
@@ -64,7 +64,7 @@ def process_query(message, history):
64
  return f"[{t}] {reply}"
65
 
66
  # ============================================================
67
- # QUANTUM-STYLE THEME (light + animated grid)
68
  # ============================================================
69
  custom_css = """
70
  body {
@@ -168,6 +168,40 @@ with gr.Blocks(css=custom_css, title=APP_TITLE, theme=gr.themes.Soft(primary_hue
168
 
169
  run_btn.click(rft_calc, expr_box, result_box)
170
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  gr.Markdown(
172
  "<hr><p style='text-align:center;'>© 2025 NexFrame Research | Rendered Frame Theory Interface Demo</p>"
173
  )
 
1
+ import os, json, urllib.request, math, time, random
2
  import gradio as gr
3
  from datetime import datetime
4
 
 
64
  return f"[{t}] {reply}"
65
 
66
  # ============================================================
67
+ # QUANTUM-STYLE THEME
68
  # ============================================================
69
  custom_css = """
70
  body {
 
168
 
169
  run_btn.click(rft_calc, expr_box, result_box)
170
 
171
+ # ================= RFT Launch Game Tab =================
172
+ with gr.Tab("🚀 RFT Launch Protocol"):
173
+ gr.Markdown(
174
+ "### Click the Power Button as fast as you can in 5 seconds!<br>"
175
+ "Charge the coherence drive and launch the render rocket."
176
+ )
177
+ power_btn = gr.Button("⚡ POWER UP", variant="primary")
178
+ launch_btn = gr.Button("Initiate Launch Sequence", variant="secondary")
179
+ score_box = gr.Number(value=0, label="Clicks", interactive=False)
180
+ result_box = gr.HTML(label="Result")
181
+
182
+ # store click count in session variable
183
+ state = gr.State(0)
184
+
185
+ def add_click(count):
186
+ return count + 1, count + 1
187
+
188
+ power_btn.click(add_click, inputs=state, outputs=[state, score_box])
189
+
190
+ def launch(count):
191
+ freq = min(212.76, count * 5 + random.uniform(-3, 3))
192
+ if freq > 210:
193
+ msg = f"🟢 Coherence achieved — NexFrame synchronised at {freq:.2f} Hz 🚀"
194
+ elif freq > 150:
195
+ msg = f"🟡 Good flight — harmonic drift {freq:.2f} Hz"
196
+ else:
197
+ msg = f"🔴 Render pad failure — only {freq:.2f} Hz generated"
198
+ # simple emoji 'animation'
199
+ rocket_height = min(10, int(freq / 25))
200
+ rocket = "<br>".join(["&nbsp;"*10 + "🚀" for _ in range(rocket_height)])
201
+ return f"<div style='text-align:center;font-weight:bold;'>{msg}<br>{rocket}</div>", 0, 0
202
+
203
+ launch_btn.click(launch, inputs=state, outputs=[result_box, state, score_box])
204
+
205
  gr.Markdown(
206
  "<hr><p style='text-align:center;'>© 2025 NexFrame Research | Rendered Frame Theory Interface Demo</p>"
207
  )