Spaces:
Running
Running
Update app.py
Browse filesupdate copy button
app.py
CHANGED
@@ -44,35 +44,6 @@ with col2:
|
|
44 |
with st.spinner("Generating prompt..."):
|
45 |
prompt = get_gemini_response(image)
|
46 |
st.code(prompt, language="markdown")
|
47 |
-
|
48 |
-
# Inject JavaScript untuk notifikasi klik tombol copy
|
49 |
-
st.markdown("""
|
50 |
-
<script>
|
51 |
-
setTimeout(() => {
|
52 |
-
const copyBtns = document.querySelectorAll('button[data-testid="stCopyButton"]');
|
53 |
-
copyBtns.forEach(btn => {
|
54 |
-
btn.addEventListener('click', () => {
|
55 |
-
const notice = document.createElement("div");
|
56 |
-
notice.innerText = "✅ Prompt copied to clipboard!";
|
57 |
-
notice.style.position = "fixed";
|
58 |
-
notice.style.bottom = "30px";
|
59 |
-
notice.style.right = "30px";
|
60 |
-
notice.style.backgroundColor = "#4CAF50";
|
61 |
-
notice.style.color = "white";
|
62 |
-
notice.style.padding = "10px 16px";
|
63 |
-
notice.style.borderRadius = "8px";
|
64 |
-
notice.style.boxShadow = "0 4px 6px rgba(0,0,0,0.2)";
|
65 |
-
notice.style.zIndex = "9999";
|
66 |
-
notice.style.fontSize = "14px";
|
67 |
-
document.body.appendChild(notice);
|
68 |
-
setTimeout(() => {
|
69 |
-
notice.remove();
|
70 |
-
}, 2000);
|
71 |
-
});
|
72 |
-
});
|
73 |
-
}, 1000);
|
74 |
-
</script>
|
75 |
-
""", unsafe_allow_html=True)
|
76 |
-
|
77 |
else:
|
78 |
st.info("Please upload an image to generate a prompt.")
|
|
|
44 |
with st.spinner("Generating prompt..."):
|
45 |
prompt = get_gemini_response(image)
|
46 |
st.code(prompt, language="markdown")
|
47 |
+
st.success("Prompt generated. Use the copy button on the top-right of the code box.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
else:
|
49 |
st.info("Please upload an image to generate a prompt.")
|