Skip to content

Commit 177b73e

Browse files
committed
Added Theme
1 parent 49ba70f commit 177b73e

File tree

4 files changed

+86
-0
lines changed

4 files changed

+86
-0
lines changed

script.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,15 @@ def initialize_session_state():
8585
"naming_conventions": False
8686
}
8787

88+
89+
def load_css(file_name):
90+
with open(file_name) as f:
91+
st.markdown(f'<style>{f.read()}</style>', unsafe_allow_html=True)
92+
8893
def main():
94+
# Load the CSS files
95+
load_css('static/css/styles.css')
96+
8997
# initialize session state
9098
initialize_session_state()
9199

static/css/styles.css

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/* Target the main Streamlit app */
2+
.streamlit-app {
3+
font-family: 'Arial', sans-serif;
4+
font-size: 16px;
5+
}
6+
7+
/* Target the main content area */
8+
.main {
9+
background-color: #add8e6; /* Light Blue */
10+
padding: 20px;
11+
}
12+
13+
/* Target the Streamlit expander header */
14+
div.st-expander-header {
15+
background-color: #add8e6; /* Light Blue */
16+
color: #808080; /* Gray */
17+
padding: 10px;
18+
border-radius: 5px;
19+
}
20+
21+
/* Target buttons */
22+
button.stButton.run-button,
23+
button.stButton.share-button {
24+
background-color: #00008b; /* Dark Blue */
25+
color: #808080; /* Gray */
26+
padding: 10px 20px;
27+
border: 2px solid #00008b; /* Dark Blue */
28+
border-radius: 5px;
29+
cursor: pointer;
30+
}
31+
32+
button.stButton.run-button:hover,
33+
button.stButton.share-button:hover {
34+
background-color: #00008b; /* Dark Blue */
35+
color: #808080; /* Gray */
36+
}
37+
38+
/* Target textareas and inputs */
39+
textarea.stTextArea,
40+
input.stTextInput,
41+
div.stAlert div {
42+
background-color: #808080; /* Gray */
43+
color: #808080; /* Gray */
44+
padding: 2px;
45+
font-size: 10px;
46+
}
47+
48+
/* Target headings */
49+
h1 {
50+
font-family: 'Pacifico', cursive;
51+
font-size: 40px;
52+
color: #333333;
53+
}

static/js/app.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const Streamlit = window.Streamlit
2+
3+
Streamlit.init = function() {
4+
Streamlit.setComponentReady()
5+
Streamlit.events.addEventListener(Streamlit.RENDER_EVENT, event => {
6+
const data = event.detail
7+
Streamlit.setComponentValue(data)
8+
})
9+
}
10+
11+
Streamlit.onRender = function() {
12+
Streamlit.setFrameHeight()
13+
}

templates/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<title>LangChain Coder - AI</title>
5+
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='css/styles.css') }}">
6+
</head>
7+
<body>
8+
<div id="app"></div>
9+
<script src="https://cdn.jsdelivr.net/npm/streamlit-component-lib@1.2.0/dist/streamlit-component-lib.js"></script>
10+
<script src="{{ url_for('static', filename='js/app.js') }}"></script>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)