|
import streamlit as st |
|
from streamlit.components.v1 import html |
|
|
|
def main(): |
|
|
|
st.set_page_config(layout="wide", page_title="HTML Viewer") |
|
|
|
|
|
with st.sidebar: |
|
|
|
with st.expander("Passwords and Link"): |
|
|
|
password1 = st.text_input("Password 1", type="password") |
|
password2 = st.text_input("Password 2", type="password") |
|
password3 = st.text_input("Password 3", type="password") |
|
password4 = st.text_input("Password 4", type="password") |
|
link = st.text_input("Link") |
|
|
|
|
|
st.header("HTML Viewer") |
|
|
|
|
|
html_input = st.text_area("Input HTML:", height=100) |
|
|
|
|
|
if html_input: |
|
|
|
viewer_container = st.container() |
|
with viewer_container: |
|
|
|
st.markdown(""" |
|
<style> |
|
.html-viewer { |
|
border: 1px solid #ccc; |
|
padding: 20px; |
|
background: white; |
|
min-height: 300px; |
|
margin-bottom: 20px; |
|
} |
|
.stTextInput { |
|
margin-bottom: 10px; |
|
} |
|
</style> |
|
""", unsafe_allow_html=True) |
|
|
|
|
|
st.markdown('<div class="html-viewer">', unsafe_allow_html=True) |
|
html(html_input, height=400) |
|
st.markdown('</div>', unsafe_allow_html=True) |
|
|
|
if __name__ == "__main__": |
|
main() |