Jofax commited on
Commit
467e9b5
Β·
verified Β·
1 Parent(s): 6f2184f

Create R.py

Browse files
Files changed (1) hide show
  1. R.py +42 -0
R.py ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+
3
+ # Enhanced CSS for Mobile Optimization
4
+ mobile_ui_css = """
5
+ .gradio-container { max-width: 500px !important; margin: auto !important; } /* Mobile center */
6
+ .hotel-card { border-radius: 20px; background: white; padding: 15px; margin-bottom: 10px; border: 1px solid #eee; }
7
+ .price-tag { background: #D4AF37; color: white; padding: 5px 12px; border-radius: 50px; font-weight: bold; float: right; }
8
+ .status-badge { display: inline-block; padding: 4px 10px; border-radius: 4px; font-size: 0.8em; margin-top: 5px; }
9
+ .available { background: #E6F4EA; color: #1E8E3E; }
10
+ .occupied { background: #FCE8E6; color: #D93025; }
11
+ footer { display: none !important; }
12
+ """
13
+
14
+ with gr.Blocks(css=mobile_ui_css, title="Hulhumale Direct") as demo:
15
+ # 1. Top Promotion Bar (Sticky style)
16
+ gr.HTML("<div style='background: #0A1828; color: white; padding: 10px; text-align: center; border-radius: 0 0 15px 15px;'>🌟 Tonight's Special: 10% Off in Phase 2</div>")
17
+
18
+ # 2. Header
19
+ gr.HTML("<h2 style='text-align:center; color:#0A1828; margin-top:20px;'>🏝️ Hulhumale Direct</h2>")
20
+
21
+ with gr.Tabs():
22
+ # TRAVELER VIEW
23
+ with gr.Tab("Explore"):
24
+ # Mock Card 1
25
+ gr.HTML("""
26
+ <div class='hotel-card'>
27
+ <span class='price-tag'>850 MVR</span>
28
+ <h3 style='margin:0;'>Coral View Inn</h3>
29
+ <p style='color:#666; font-size:0.9em;'>πŸ“ Hulhumale Phase 1</p>
30
+ <span class='status-badge available'>● Available Now</span>
31
+ <a href='tel:+9607771234' style='display:block; background:#0A1828; color:white; text-align:center; padding:10px; margin-top:10px; border-radius:10px; text-decoration:none;'>πŸ“ž Call to Book</a>
32
+ </div>
33
+ """)
34
+
35
+ # OWNER VIEW
36
+ with gr.Tab("Manage"):
37
+ gr.Markdown("### πŸ”‘ Quick Update")
38
+ status = gr.Radio(["Available", "Occupied"], label="Set Status")
39
+ price = gr.Number(label="Update Price (MVR)")
40
+ update_btn = gr.Button("Save Changes", variant="primary")
41
+
42
+ demo.launch()