JDhruv14 commited on
Commit
7d12e27
·
verified ·
1 Parent(s): c17be4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -17
app.py CHANGED
@@ -98,40 +98,40 @@ def gradio_fn(message, history):
98
  )
99
 
100
  with gr.Blocks(css="""
101
- :root { --corner-h: min(65vh, 820px); } /* bigger images, size caps to viewport */
 
102
 
103
- html, body { overflow-y: hidden; } /* no vertical scroll */
104
  .gradio-container {
105
  max-width: 600px;
106
  margin: auto;
107
  padding: 20px;
108
  font-family: sans-serif;
109
  position: relative;
 
 
110
  }
111
 
112
  .chatbot { height: 500px !important; overflow-y: auto; }
113
 
114
- .corner {
115
- position: fixed;
116
- z-index: 9999;
117
- pointer-events: none;
118
- }
119
- #left { left: 8px; bottom: 8px; } /* Arjuna pinned to bottom-left */
120
- #right { right: 8px; bottom: 88px; } /* Krishna lifted ~80–90px */
121
 
122
  .corner img {
123
- height: var(--corner-h);
124
  width: auto;
125
  display: block;
126
  }
127
-
128
- /* safety on short screens: scale down a bit so nothing gets cramped */
129
- @media (max-height: 740px) {
130
- :root { --corner-h: 50vh; }
131
- #right { bottom: 72px; }
132
- }
133
  """) as demo:
134
- ...
 
 
 
 
 
 
135
  gr.HTML("""
136
  <div id="left" class="corner">
137
  <img src="https://huggingface.co/spaces/JDhruv14/gita/resolve/main/arjuna.png" alt="Arjun">
 
98
  )
99
 
100
  with gr.Blocks(css="""
101
+ /* page */
102
+ html, body { height: 100%; overflow-y: hidden; }
103
 
104
+ /* app container should always be visible & above images */
105
  .gradio-container {
106
  max-width: 600px;
107
  margin: auto;
108
  padding: 20px;
109
  font-family: sans-serif;
110
  position: relative;
111
+ min-height: 100vh; /* ensures layout space */
112
+ z-index: 10; /* sit above corner images */
113
  }
114
 
115
  .chatbot { height: 500px !important; overflow-y: auto; }
116
 
117
+ /* corner images */
118
+ .corner { position: fixed; pointer-events: none; z-index: 5; } /* < z-index of container */
119
+ #left { left: 8px; bottom: 8px; }
120
+ #right { right: 8px; bottom: 100px; } /* lift Krishna a bit */
 
 
 
121
 
122
  .corner img {
123
+ height: min(70vh, 900px); /* bigger but responsive */
124
  width: auto;
125
  display: block;
126
  }
 
 
 
 
 
 
127
  """) as demo:
128
+ gr.Markdown(...)
129
+ chat = gr.ChatInterface(
130
+ fn=gradio_fn,
131
+ examples=[...],
132
+ chatbot=gr.Chatbot(type="messages", elem_classes="chatbot"),
133
+ type="messages",
134
+ )
135
  gr.HTML("""
136
  <div id="left" class="corner">
137
  <img src="https://huggingface.co/spaces/JDhruv14/gita/resolve/main/arjuna.png" alt="Arjun">