Kamran Zulfiqar commited on
Commit
1d81467
·
verified ·
1 Parent(s): 1227b62

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +30 -68
app.py CHANGED
@@ -1,70 +1,32 @@
1
- try:
2
- import streamlit as st
3
- except ImportError:
4
- import subprocess
5
- subprocess.run(["pip", "install", "streamlit"])
6
- import streamlit as st
7
-
8
- import random
9
-
10
- # Set up the Streamlit page
11
- st.set_page_config(page_title="AutoCAD Commands Explorer", layout="wide")
12
-
13
- # Custom CSS
14
- st.markdown("""
15
- <style>
16
- body {
17
- background-color: #e6f0ff;
18
- }
19
- .stApp {
20
- background-color: #e6f0ff;
21
- }
22
- .title {
23
- font-size: 3em;
24
- text-align: center;
25
- color: #003366;
26
- margin-bottom: 20px;
27
- font-weight: bold;
28
- }
29
- .command-card {
30
- background-color: #ffffff;
31
- padding: 15px;
32
- border-radius: 10px;
33
- margin-bottom: 15px;
34
- box-shadow: 0px 2px 8px rgba(0,0,0,0.1);
35
- }
36
- .command-name {
37
- font-weight: bold;
38
- font-size: 20px;
39
- color: #003366;
40
- }
41
- .command-desc {
42
- font-size: 15px;
43
- color: #333333;
44
- }
45
- </style>
46
- """, unsafe_allow_html=True)
47
-
48
- st.markdown('<div class="title">📘 AutoCAD Commands Reference (200)</div>', unsafe_allow_html=True)
49
-
50
- # Generate 200 sample commands
51
- commands = []
52
- for i in range(1, 201):
53
- commands.append({
54
- "Command": f"CMD{i}",
55
- "Description": f"This is a description for AutoCAD command CMD{i} used to perform operation {random.choice(['drawing', 'editing', 'modifying', 'viewing'])}."
56
- })
57
-
58
- # Layout in two columns
59
- col1, col2 = st.columns(2)
60
-
61
- for idx, cmd in enumerate(commands):
62
- with (col1 if idx % 2 == 0 else col2):
63
- st.markdown(f"""
64
- <div class="command-card">
65
- <div class="command-name">🛠️ {cmd['Command']}</div>
66
- <div class="command-desc">{cmd['Description']}</div>
67
- </div>
68
- """, unsafe_allow_html=True)
69
 
70
 
 
1
+ import streamlit as st
2
+
3
+ # Sample command data (replace or expand with real commands later)
4
+ commands = {
5
+ "LINE": {
6
+ "description": "Creates straight line segments between two points.",
7
+ "link": "https://www.youtube.com/watch?v=4Hsb5j5JH7A"
8
+ },
9
+ "CIRCLE": {
10
+ "description": "Creates a circle based on a center point and radius.",
11
+ "link": "https://www.youtube.com/watch?v=ZFbP13bU5Ck"
12
+ },
13
+ "TRIM": {
14
+ "description": "Trims objects to meet the edges of other objects.",
15
+ "link": "https://www.youtube.com/watch?v=8QULwXuHEjM"
16
+ },
17
+ "OFFSET": {
18
+ "description": "Creates concentric circles, parallel lines, and curves at specified distances.",
19
+ "link": "https://www.youtube.com/watch?v=3AwYIjvQqek"
20
+ },
21
+ "MOVE": {
22
+ "description": "Moves objects a specified distance in a specified direction.",
23
+ "link": "https://www.youtube.com/watch?v=gzS4h3rzFeM"
24
+ },
25
+ "ROTATE": {
26
+ "description": "Rotates objects around a base point.",
27
+ "link": "https://www.youtube.com/watch?v=s7KAMdUHz4E"
28
+ }
29
+ # You can add up to 200 commands here
30
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
 
32