Spaces:
Sleeping
Sleeping
File size: 2,876 Bytes
1d81467 1d163df 16f1caa ab80863 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 |
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)
|