Spaces:
Sleeping
Sleeping
try: | |
import streamlit as st | |
except ImportError: | |
import subprocess | |
subprocess.run(["pip", "install", "streamlit"]) | |
import streamlit as st | |
import random | |
# Set up the Streamlit page | |
st.set_page_config(page_title="AutoCAD Commands Explorer", layout="wide") | |
# Custom CSS | |
st.markdown(""" | |
<style> | |
body { | |
background-color: #e6f0ff; | |
} | |
.stApp { | |
background-color: #e6f0ff; | |
} | |
.title { | |
font-size: 3em; | |
text-align: center; | |
color: #003366; | |
margin-bottom: 20px; | |
font-weight: bold; | |
} | |
.command-card { | |
background-color: #ffffff; | |
padding: 15px; | |
border-radius: 10px; | |
margin-bottom: 15px; | |
box-shadow: 0px 2px 8px rgba(0,0,0,0.1); | |
} | |
.command-name { | |
font-weight: bold; | |
font-size: 20px; | |
color: #003366; | |
} | |
.command-desc { | |
font-size: 15px; | |
color: #333333; | |
} | |
</style> | |
""", unsafe_allow_html=True) | |
st.markdown('<div class="title">π AutoCAD Commands Reference (200)</div>', unsafe_allow_html=True) | |
# Generate 200 sample commands | |
commands = [] | |
for i in range(1, 201): | |
commands.append({ | |
"Command": f"CMD{i}", | |
"Description": f"This is a description for AutoCAD command CMD{i} used to perform operation {random.choice(['drawing', 'editing', 'modifying', 'viewing'])}." | |
}) | |
# Layout in two columns | |
col1, col2 = st.columns(2) | |
for idx, cmd in enumerate(commands): | |
with (col1 if idx % 2 == 0 else col2): | |
st.markdown(f""" | |
<div class="command-card"> | |
<div class="command-name">π οΈ {cmd['Command']}</div> | |
<div class="command-desc">{cmd['Description']}</div> | |
</div> | |
""", unsafe_allow_html=True) | |