drguilhermeapolinario commited on
Commit
b17c672
·
verified ·
1 Parent(s): 9079fcb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -1
app.py CHANGED
@@ -128,8 +128,30 @@ def apply_neumorphic_style():
128
  apply_neumorphic_style()
129
 
130
 
 
131
  def copy_to_clipboard(text):
132
- pyperclip.copy(text)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
133
 
134
 
135
  def create_copy_button(text, button_text="Copiar para o Prontuário"):
 
128
  apply_neumorphic_style()
129
 
130
 
131
+
132
  def copy_to_clipboard(text):
133
+ component = f"""
134
+ <textarea id="textarea" style="position: absolute; left: -9999px;">{text}</textarea>
135
+ <button id="copy_button" onclick="copyText()">Copiar</button>
136
+ <p id="copy_status" style="display: none;">Texto copiado!</p>
137
+
138
+ <script>
139
+ function copyText() {{
140
+ var textarea = document.getElementById('textarea');
141
+ textarea.select();
142
+ document.execCommand('copy');
143
+ document.getElementById('copy_status').style.display = 'inline';
144
+ setTimeout(function() {{
145
+ document.getElementById('copy_status').style.display = 'none';
146
+ }}, 2000);
147
+ }}
148
+ </script>
149
+ """
150
+ components.html(component, height=50)
151
+
152
+
153
+ # def copy_to_clipboard(text):
154
+ # pyperclip.copy(text)
155
 
156
 
157
  def create_copy_button(text, button_text="Copiar para o Prontuário"):