Spaces:
Sleeping
Sleeping
| import streamlit as st | |
| import time | |
| # Animated text function | |
| def animated_text(text, speed=0.05): | |
| placeholder = st.empty() | |
| displayed_text = "" | |
| for letter in text: | |
| displayed_text += letter | |
| placeholder.markdown(f""" | |
| <h1 style="text-align:center; color: #FF4500;">{displayed_text} π</h1> | |
| """, unsafe_allow_html=True) # Corrected f-string formatting | |
| time.sleep(speed) | |
| # Display animated text | |
| animated_text("Welcome to GenAI App - AI Code Reviewer!", speed=0.1) | |
| import google.generativeai as genai | |
| st.header('π AI-Powered Code Debugging π: ') | |
| st.subheader('π Buggy Code::') | |
| st.write('Enter your code here:') | |
| # Text Area for User Input | |
| code = st.text_area("Paste your code here:", height=200) | |
| # Display the Code with Syntax Highlighting | |
| if code: | |
| st.code(code, language="python") # Adjust language as needed | |
| # Copy Code Button | |
| st.markdown( | |
| f""" | |
| <button onclick="navigator.clipboard.writeText(`{code}`)">Debug Code</button> | |
| """, | |
| unsafe_allow_html=True | |
| ) | |
| st.subheader('π Bug Found in:') | |
| st.subheader('β Fixed Code:') | |
| st.subheader('π‘ Suggestion:') | |