Spaces:
Sleeping
Sleeping
import streamlit as st | |
# Sample command data (replace or expand with real commands later) | |
commands = { | |
"LINE": { | |
"description": "Creates straight line segments between two points.", | |
"link": "https://www.youtube.com/watch?v=4Hsb5j5JH7A" | |
}, | |
"CIRCLE": { | |
"description": "Creates a circle based on a center point and radius.", | |
"link": "https://www.youtube.com/watch?v=ZFbP13bU5Ck" | |
}, | |
"TRIM": { | |
"description": "Trims objects to meet the edges of other objects.", | |
"link": "https://www.youtube.com/watch?v=8QULwXuHEjM" | |
}, | |
"OFFSET": { | |
"description": "Creates concentric circles, parallel lines, and curves at specified distances.", | |
"link": "https://www.youtube.com/watch?v=3AwYIjvQqek" | |
}, | |
"MOVE": { | |
"description": "Moves objects a specified distance in a specified direction.", | |
"link": "https://www.youtube.com/watch?v=gzS4h3rzFeM" | |
}, | |
"ROTATE": { | |
"description": "Rotates objects around a base point.", | |
"link": "https://www.youtube.com/watch?v=s7KAMdUHz4E" | |
} | |
# You can add up to 200 commands here | |
} | |
# App config | |
st.set_page_config(page_title="AutoCAD Command Helper", layout="wide") | |
# Custom style | |
st.markdown(""" | |
<style> | |
.stApp { | |
background-color: #e6f0ff; | |
} | |
.title { | |
font-size: 36px; | |
color: #003366; | |
text-align: center; | |
font-weight: bold; | |
margin-bottom: 30px; | |
} | |
.desc-box { | |
background-color: white; | |
padding: 20px; | |
border-radius: 10px; | |
box-shadow: 0 4px 10px rgba(0,0,0,0.1); | |
margin-top: 20px; | |
} | |
.desc-title { | |
font-size: 24px; | |
color: #003366; | |
font-weight: bold; | |
margin-bottom: 10px; | |
} | |
.desc-text { | |
font-size: 16px; | |
color: #333333; | |
} | |
.desc-link a { | |
font-size: 15px; | |
color: #0077cc; | |
text-decoration: none; | |
font-weight: bold; | |
} | |
</style> | |
""", unsafe_allow_html=True) | |
# Title | |
st.markdown('<div class="title">π AutoCAD Command Explorer</div>', unsafe_allow_html=True) | |
# Layout: Dropdown on left, Description on right | |
col1, col2 = st.columns([1, 2]) | |
with col1: | |
selected_cmd = st.selectbox("Choose an AutoCAD Command:", list(commands.keys()), index=0) | |
with col2: | |
cmd_data = commands[selected_cmd] | |
st.markdown(f""" | |
<div class="desc-box"> | |
<div class="desc-title">π οΈ {selected_cmd}</div> | |
<div class="desc-text">{cmd_data['description']}</div> | |
<div class="desc-link"> | |
πΊ <a href="{cmd_data['link']}" target="_blank">Watch Tutorial</a> | |
</div> | |
</div> | |
""", unsafe_allow_html=True) | |