JDhruv14 commited on
Commit
c17be4a
·
verified ·
1 Parent(s): 2e4dc66

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -38
app.py CHANGED
@@ -98,52 +98,41 @@ def gradio_fn(message, history):
98
  )
99
 
100
  with gr.Blocks(css="""
 
 
 
101
  .gradio-container {
102
  max-width: 600px;
103
  margin: auto;
104
  padding: 20px;
105
  font-family: sans-serif;
106
  position: relative;
107
- }
108
- .chatbot {
109
- height: 500px !important;
110
- overflow-y: auto;
111
- }
112
  .corner {
113
- position: fixed;
114
- bottom: 2px;
115
- z-index: 9999;
116
- pointer-events: none;
117
- }
118
- #left { left: 2px; }
119
- #right { right: 2px; }
120
  .corner img {
121
- height: 500px; /* fixed height */
122
- width: auto; /* auto to keep aspect ratio */
123
- }
124
-
125
- """) as demo:
126
- gr.Markdown(
127
- """
128
- <div style='text-align: center; padding: 10px;'>
129
- <h1 style='font-size: 2.2em; margin-bottom: 0.2em;'><span style='color: #4F46E5;'>kRISHNA.ai</span></h1>
130
- <p style='font-size: 1.1em; color: #555;'>5000-Years of Ancient WISDOM with Modern AI ✨</p>
131
- </div>
132
- """,
133
- elem_id="header"
134
- )
135
- chat = gr.ChatInterface(
136
- fn=gradio_fn,
137
- examples=[
138
- "Hello!",
139
- "How can I overcome fear of failure?",
140
- "How do I forgive someone who hurt me deeply?",
141
- "What can I do to stop overthinking?"
142
- ],
143
- chatbot=gr.Chatbot(type="messages", elem_classes="chatbot"),
144
- type="messages",
145
- )
146
- gr.HTML(f"""
147
  <div id="left" class="corner">
148
  <img src="https://huggingface.co/spaces/JDhruv14/gita/resolve/main/arjuna.png" alt="Arjun">
149
  </div>
@@ -152,5 +141,6 @@ with gr.Blocks(css="""
152
  </div>
153
  """)
154
 
 
155
  if __name__ == "__main__":
156
  demo.launch()
 
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">
138
  </div>
 
141
  </div>
142
  """)
143
 
144
+
145
  if __name__ == "__main__":
146
  demo.launch()