Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -46,10 +46,11 @@ custom_css = """
|
|
46 |
width: 100%; height: 100%;
|
47 |
background: rgba(0,0,0,0.6);
|
48 |
z-index: 9999;
|
49 |
-
display:
|
50 |
flex-direction: column;
|
51 |
justify-content: center;
|
52 |
align-items: center;
|
|
|
53 |
}
|
54 |
#nps-box {
|
55 |
position: relative;
|
@@ -59,6 +60,7 @@ custom_css = """
|
|
59 |
width: 400px;
|
60 |
max-width: 90%;
|
61 |
text-align: center;
|
|
|
62 |
}
|
63 |
#nps-close {
|
64 |
position: absolute;
|
@@ -117,14 +119,12 @@ with gr.Blocks() as interface:
|
|
117 |
# nps_submit = gr.Button("Submit")
|
118 |
# nps_close = gr.Button("X", elem_id="nps-close")
|
119 |
with gr.Group(visible=False, elem_id="nps-overlay") as nps_modal:
|
120 |
-
with gr.Column(elem_id="nps-box"):
|
121 |
-
gr.HTML('<span id="nps-close">✕</span>') #
|
122 |
gr.Markdown("### How likely are you to recommend this tool to a colleague or peer?")
|
123 |
nps_slider = gr.Slider(minimum=0, maximum=10, step=1, label="Your NPS Score (0-10)")
|
124 |
-
#nps_text = gr.Textbox(label="Any feedback?", lines=3)
|
125 |
nps_submit = gr.Button("Submit")
|
126 |
-
|
127 |
-
|
128 |
with gr.Group(visible=False) as results_group:
|
129 |
# with gr.Accordion("Open to See the Result", open=False) as results:
|
130 |
# with gr.Row():
|
@@ -1249,14 +1249,14 @@ with gr.Blocks() as interface:
|
|
1249 |
|
1250 |
with gr.Tab("PRICING"):
|
1251 |
gr.HTML(value=pricing_html)
|
1252 |
-
interface.load(
|
1253 |
-
js="""
|
1254 |
() => {
|
|
|
1255 |
document.getElementById('nps-close').onclick = function() {
|
1256 |
-
document.
|
1257 |
};
|
1258 |
}
|
1259 |
-
|
1260 |
-
|
1261 |
|
1262 |
interface.launch(share=True,debug=True)
|
|
|
46 |
width: 100%; height: 100%;
|
47 |
background: rgba(0,0,0,0.6);
|
48 |
z-index: 9999;
|
49 |
+
display: none; /* Hidden by default */
|
50 |
flex-direction: column;
|
51 |
justify-content: center;
|
52 |
align-items: center;
|
53 |
+
backdrop-filter: blur(5px);
|
54 |
}
|
55 |
#nps-box {
|
56 |
position: relative;
|
|
|
60 |
width: 400px;
|
61 |
max-width: 90%;
|
62 |
text-align: center;
|
63 |
+
box-shadow: 0px 5px 20px rgba(0,0,0,0.3);
|
64 |
}
|
65 |
#nps-close {
|
66 |
position: absolute;
|
|
|
119 |
# nps_submit = gr.Button("Submit")
|
120 |
# nps_close = gr.Button("X", elem_id="nps-close")
|
121 |
with gr.Group(visible=False, elem_id="nps-overlay") as nps_modal:
|
122 |
+
with gr.Column(elem_id="nps-box", interactive=True):
|
123 |
+
gr.HTML('<span id="nps-close">✕</span>') # Close button
|
124 |
gr.Markdown("### How likely are you to recommend this tool to a colleague or peer?")
|
125 |
nps_slider = gr.Slider(minimum=0, maximum=10, step=1, label="Your NPS Score (0-10)")
|
|
|
126 |
nps_submit = gr.Button("Submit")
|
127 |
+
|
|
|
128 |
with gr.Group(visible=False) as results_group:
|
129 |
# with gr.Accordion("Open to See the Result", open=False) as results:
|
130 |
# with gr.Row():
|
|
|
1249 |
|
1250 |
with gr.Tab("PRICING"):
|
1251 |
gr.HTML(value=pricing_html)
|
1252 |
+
interface.load(js="""
|
|
|
1253 |
() => {
|
1254 |
+
// Close button
|
1255 |
document.getElementById('nps-close').onclick = function() {
|
1256 |
+
document.getElementById('nps-overlay').style.display = 'none';
|
1257 |
};
|
1258 |
}
|
1259 |
+
""")
|
1260 |
+
|
1261 |
|
1262 |
interface.launch(share=True,debug=True)
|