Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from streamlit.components.v1 import html
|
3 |
+
|
4 |
+
def main():
|
5 |
+
# Set page config
|
6 |
+
st.set_page_config(layout="wide", page_title="HTML Viewer")
|
7 |
+
|
8 |
+
# Create sidebar
|
9 |
+
with st.sidebar:
|
10 |
+
# Create an expander for the password inputs
|
11 |
+
with st.expander("Passwords and Link"):
|
12 |
+
# Add password inputs to the expander
|
13 |
+
password1 = st.text_input("Password 1", type="password")
|
14 |
+
password2 = st.text_input("Password 2", type="password")
|
15 |
+
password3 = st.text_input("Password 3", type="password")
|
16 |
+
password4 = st.text_input("Password 4", type="password")
|
17 |
+
link = st.text_input("Link")
|
18 |
+
|
19 |
+
# Main content area
|
20 |
+
st.header("HTML Viewer")
|
21 |
+
|
22 |
+
# Create a text area for HTML input
|
23 |
+
html_input = st.text_area("Input HTML:", height=100)
|
24 |
+
|
25 |
+
# Display HTML content if there's input
|
26 |
+
if html_input:
|
27 |
+
# Create a container for the HTML viewer
|
28 |
+
viewer_container = st.container()
|
29 |
+
with viewer_container:
|
30 |
+
# Use custom CSS to style the viewer
|
31 |
+
st.markdown("""
|
32 |
+
<style>
|
33 |
+
.html-viewer {
|
34 |
+
border: 1px solid #ccc;
|
35 |
+
padding: 20px;
|
36 |
+
background: white;
|
37 |
+
min-height: 300px;
|
38 |
+
margin-bottom: 20px;
|
39 |
+
}
|
40 |
+
.stTextInput {
|
41 |
+
margin-bottom: 10px;
|
42 |
+
}
|
43 |
+
</style>
|
44 |
+
""", unsafe_allow_html=True)
|
45 |
+
|
46 |
+
# Display the HTML content
|
47 |
+
st.markdown('<div class="html-viewer">', unsafe_allow_html=True)
|
48 |
+
html(html_input, height=400)
|
49 |
+
st.markdown('</div>', unsafe_allow_html=True)
|
50 |
+
|
51 |
+
if __name__ == "__main__":
|
52 |
+
main()
|