vsj0702 commited on
Commit
67a88a2
·
verified ·
1 Parent(s): d22106a

fixing bug

Browse files
Files changed (1) hide show
  1. layout.py +64 -63
layout.py CHANGED
@@ -30,73 +30,74 @@ def apply_theme():
30
  "accent": "#ff5252",
31
  "border": "#2a3240" if dm else "#dddddd",
32
  "shadow": "rgba(0,0,0,0.3)" if dm else "rgba(0,0,0,0.1)",
33
- "ace_theme": "monokai" if dm else "chrome",
34
  }
35
 
 
 
36
  st.markdown(
37
  f"""
38
- <style>
39
- .stApp {{
40
- background-color: {colors["bg"]};
41
- color: {colors["text"]};
42
- }}
43
- [data-testid="stSidebar"] {{
44
- background-color: {colors["panel_bg"]} !important;
45
- }}
46
- .ace_editor, .ace_scroller {{
47
- background: {colors["panel_bg"]} !important;
48
- box-shadow: 0 4px 8px {colors["shadow"]} !important;
49
- border-radius: 8px !important;
50
- }}
51
- textarea, input, .stTextArea textarea {{
52
- background: {colors["panel_bg"]} !important;
53
- color: {colors["text"]} !important;
54
- border: 1px solid {colors["border"]} !important;
55
- border-radius: 4px !important;
56
- }}
57
- label, .stTextLabel, .stTextArea label {{
58
- color: {colors["text"]} !important;
59
- }}
60
- button, .stDownloadButton > button {{
61
- background-color: {colors["accent"]} !important;
62
- color: #fff !important;
63
- border-radius: 6px !important;
64
- transition: transform 0.1s;
65
- }}
66
- button:hover {{
67
- transform: scale(1.02) !important;
68
- }}
69
- .chat-container {{
70
- background: {colors["panel_bg"]} !important;
71
- border: 1px solid {colors["border"]} !important;
72
- border-radius: 8px !important;
73
- padding: 1rem;
74
- max-height: 480px;
75
- overflow-y: auto;
76
- }}
77
- .chat-message {{
78
- margin-bottom: 1rem;
79
- padding: 0.75rem 1rem;
80
- border-radius: 12px;
81
- }}
82
- .user-message {{
83
- background: rgba(100,149,237,0.2);
84
- align-self: flex-end;
85
- }}
86
- .bot-message {{
87
- background: rgba(200,200,200,0.2);
88
- align-self: flex-start;
89
- }}
90
- pre code {{
91
- display: block;
92
- padding: 0.5rem;
93
- background: rgba(0,0,0,0.1);
94
- border-radius: 4px;
95
- overflow-x: auto;
96
- }}
97
- </style>
98
- """,
99
  unsafe_allow_html=True,
100
  )
101
 
102
- return colors
 
30
  "accent": "#ff5252",
31
  "border": "#2a3240" if dm else "#dddddd",
32
  "shadow": "rgba(0,0,0,0.3)" if dm else "rgba(0,0,0,0.1)",
 
33
  }
34
 
35
+ ace_theme = "monokai" if dm else "chrome"
36
+
37
  st.markdown(
38
  f"""
39
+ <style>
40
+ .stApp {{
41
+ background-color: {colors["bg"]};
42
+ color: {colors["text"]};
43
+ }}
44
+ [data-testid="stSidebar"] {{
45
+ background-color: {colors["panel_bg"]} !important;
46
+ }}
47
+ .ace_editor, .ace_scroller {{
48
+ background: {colors["panel_bg"]} !important;
49
+ box-shadow: 0 4px 8px {colors["shadow"]} !important;
50
+ border-radius: 8px !important;
51
+ }}
52
+ textarea, input, .stTextArea textarea {{
53
+ background: {colors["panel_bg"]} !important;
54
+ color: {colors["text"]} !important;
55
+ border: 1px solid {colors["border"]} !important;
56
+ border-radius: 4px !important;
57
+ }}
58
+ label, .stTextLabel, .stTextArea label {{
59
+ color: {colors["text"]} !important;
60
+ }}
61
+ button, .stDownloadButton > button {{
62
+ background-color: {colors["accent"]} !important;
63
+ color: #fff !important;
64
+ border-radius: 6px !important;
65
+ transition: transform 0.1s;
66
+ }}
67
+ button:hover {{
68
+ transform: scale(1.02) !important;
69
+ }}
70
+ .chat-container {{
71
+ background: {colors["panel_bg"]} !important;
72
+ border: 1px solid {colors["border"]} !important;
73
+ border-radius: 8px !important;
74
+ padding: 1rem;
75
+ max-height: 480px;
76
+ overflow-y: auto;
77
+ }}
78
+ .chat-message {{
79
+ margin-bottom: 1rem;
80
+ padding: 0.75rem 1rem;
81
+ border-radius: 12px;
82
+ }}
83
+ .user-message {{
84
+ background: rgba(100,149,237,0.2);
85
+ align-self: flex-end;
86
+ }}
87
+ .bot-message {{
88
+ background: rgba(200,200,200,0.2);
89
+ align-self: flex-start;
90
+ }}
91
+ pre code {{
92
+ display: block;
93
+ padding: 0.5rem;
94
+ background: rgba(0,0,0,0.1);
95
+ border-radius: 4px;
96
+ overflow-x: auto;
97
+ }}
98
+ </style>
99
+ """,
100
  unsafe_allow_html=True,
101
  )
102
 
103
+ return colors, ace_theme