shukdevdatta123 commited on
Commit
8ae65df
·
verified ·
1 Parent(s): f9647c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +48 -37
app.py CHANGED
@@ -74,6 +74,53 @@ def classic_mbti_weighted(responses):
74
  def show_mbti_quiz():
75
  st.title('FlexTemp Personality Test')
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  # Step 1: Input name
78
  participant_name = st.text_input("Enter your name")
79
 
@@ -107,7 +154,7 @@ def show_mbti_quiz():
107
  """
108
  try:
109
  response = openai.ChatCompletion.create(
110
- model="gpt-4",
111
  messages=[{"role": "system", "content": "You are a helpful assistant."},
112
  {"role": "user", "content": prompt}]
113
  )
@@ -125,41 +172,5 @@ def main():
125
  else:
126
  st.info("Please enter your OpenAI API Key to begin the quiz.")
127
 
128
- # Custom CSS styling for the app
129
- def add_custom_css():
130
- st.markdown("""
131
- <style>
132
- body {
133
- background-image: url('https://images.unsplash.com/photo-1501487526377-c63d4e41556e?crop=entropy&cs=tinysrgb&fit=max&ixid=MnwzNjUyOXwwfDF8c2VhcmNofDJ8fGxlZ2VuZGVyfGVufDB8fHx8fDE2NzkzNzY3Njg&ixlib=rb-1.2.1&q=80&w=1080');
134
- background-size: cover;
135
- font-family: 'Helvetica', sans-serif;
136
- color: white;
137
- }
138
- .css-18e3b3s {
139
- background: rgba(0, 0, 0, 0.5);
140
- }
141
- .stButton>button {
142
- background-color: #2f7ed0;
143
- color: white;
144
- font-size: 16px;
145
- border-radius: 12px;
146
- border: none;
147
- padding: 12px 24px;
148
- cursor: pointer;
149
- transition: background-color 0.3s;
150
- }
151
- .stButton>button:hover {
152
- background-color: #4c9bd0;
153
- }
154
- .stRadio>div>label {
155
- font-size: 16px;
156
- }
157
- .stTextInput>div>label {
158
- font-size: 18px;
159
- }
160
- </style>
161
- """, unsafe_allow_html=True)
162
-
163
  if __name__ == "__main__":
164
- add_custom_css()
165
  main()
 
74
  def show_mbti_quiz():
75
  st.title('FlexTemp Personality Test')
76
 
77
+ # Add custom CSS for the app styling
78
+ st.markdown("""
79
+ <style>
80
+ body {
81
+ background-image: url('https://www.w3schools.com/w3images/forestbridge.jpg');
82
+ background-size: cover;
83
+ font-family: 'Arial', sans-serif;
84
+ color: #fff;
85
+ }
86
+ .stButton>button {
87
+ background-color: #007bff;
88
+ color: white;
89
+ font-weight: bold;
90
+ border-radius: 12px;
91
+ padding: 10px 20px;
92
+ cursor: pointer;
93
+ }
94
+ .stButton>button:hover {
95
+ background-color: #0056b3;
96
+ }
97
+ .stRadio>div>label {
98
+ font-size: 18px;
99
+ }
100
+ .stTextInput>div>label {
101
+ font-size: 18px;
102
+ }
103
+ .stWarning {
104
+ background-color: #f39c12;
105
+ color: white;
106
+ font-weight: bold;
107
+ padding: 10px;
108
+ }
109
+ h1 {
110
+ color: #fff;
111
+ text-align: center;
112
+ font-size: 50px;
113
+ }
114
+ .stSubheader {
115
+ font-size: 22px;
116
+ color: #ffcc00;
117
+ }
118
+ .stMarkdown {
119
+ text-align: center;
120
+ }
121
+ </style>
122
+ """, unsafe_allow_html=True)
123
+
124
  # Step 1: Input name
125
  participant_name = st.text_input("Enter your name")
126
 
 
154
  """
155
  try:
156
  response = openai.ChatCompletion.create(
157
+ model="gpt-4o",
158
  messages=[{"role": "system", "content": "You are a helpful assistant."},
159
  {"role": "user", "content": prompt}]
160
  )
 
172
  else:
173
  st.info("Please enter your OpenAI API Key to begin the quiz.")
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  if __name__ == "__main__":
 
176
  main()