imorcillo commited on
Commit
a9d86d8
·
verified ·
1 Parent(s): e73f349

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -15
app.py CHANGED
@@ -89,22 +89,20 @@ css_content = """
89
  width: 100vw !important;
90
  height: 100vh !important;
91
  background: rgba(0, 0, 0, 0.5) !important;
 
92
  display: flex !important;
93
  justify-content: center !important;
94
  align-items: center !important;
95
- z-index: 9999 !important;
96
- pointer-events: auto !important;
97
  }
98
 
99
  .popup-box {
100
  background-color: white !important;
101
  padding: 20px !important;
102
  border-radius: 10px !important;
103
- width: 300px !important;
104
- text-align: center !important;
105
- position: relative !important;
106
- pointer-events: auto !important;
107
  box-shadow: 0 0 20px rgba(0,0,0,0.3) !important;
 
 
 
108
  }
109
 
110
  .popup-button {
@@ -112,14 +110,15 @@ css_content = """
112
  color: white !important;
113
  padding: 10px 20px !important;
114
  border-radius: 8px !important;
 
115
  border: none !important;
116
  cursor: pointer !important;
117
- pointer-events: auto !important;
118
  }
119
-
120
  .popup-button:hover {
121
  background-color: #3c4687 !important;
122
  }
 
123
 
124
  /*
125
  .gradio-container{
@@ -206,14 +205,19 @@ button.selected::after{
206
 
207
 
208
  with gr.Blocks(css=css_content) as demo:
209
- btn_show = gr.Button("Show Popup")
210
- popup = gr.Column(visible=False, elem_classes="popup-overlay")
 
211
  with popup:
212
- with gr.Column(elem_classes="popup-box"):
213
- gr.Markdown("### This is a popup!")
214
- btn_close = gr.Button("Close")
215
- btn_show.click(fn=show_popup, outputs=popup)
216
- btn_close.click(fn=hide_popup, outputs=popup)
 
 
 
 
217
 
218
  demo.launch()
219
 
 
89
  width: 100vw !important;
90
  height: 100vh !important;
91
  background: rgba(0, 0, 0, 0.5) !important;
92
+ z-index: 9999 !important;
93
  display: flex !important;
94
  justify-content: center !important;
95
  align-items: center !important;
 
 
96
  }
97
 
98
  .popup-box {
99
  background-color: white !important;
100
  padding: 20px !important;
101
  border-radius: 10px !important;
 
 
 
 
102
  box-shadow: 0 0 20px rgba(0,0,0,0.3) !important;
103
+ width: 340px !important;
104
+ text-align: center !important;
105
+ z-index: 10000 !important;
106
  }
107
 
108
  .popup-button {
 
110
  color: white !important;
111
  padding: 10px 20px !important;
112
  border-radius: 8px !important;
113
+ margin-top: 10px !important;
114
  border: none !important;
115
  cursor: pointer !important;
 
116
  }
117
+ /*
118
  .popup-button:hover {
119
  background-color: #3c4687 !important;
120
  }
121
+ /*
122
 
123
  /*
124
  .gradio-container{
 
205
 
206
 
207
  with gr.Blocks(css=css_content) as demo:
208
+ show_btn = gr.Button("Show Popup")
209
+
210
+ popup = gr.Column(visible=False, elem_classes=["popup-overlay"])
211
  with popup:
212
+ with gr.Column(elem_classes=["popup-box"]):
213
+ gr.Markdown("""
214
+ ### ℹ️ Notice
215
+ The recordings are not saved and are automatically removed.
216
+ """)
217
+ close_btn = gr.Button("OK", elem_classes=["popup-button"])
218
+
219
+ show_btn.click(show_popup, outputs=popup)
220
+ close_btn.click(hide_popup, outputs=popup)
221
 
222
  demo.launch()
223