ciaochris commited on
Commit
ea342d7
·
verified ·
1 Parent(s): 4024bea

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +25 -40
app.py CHANGED
@@ -73,13 +73,10 @@ class HumanTouchApp:
73
  def create_interface():
74
  app = HumanTouchApp()
75
 
76
- # CSS with aggressive legibility fixes
77
  custom_css = """
78
  /* --- Main Background and Font --- */
79
- body, #main_container {
80
- background: linear-gradient(135deg, #6DD5FA, #FF758C);
81
- font-family: 'SF Pro Display', 'Helvetica Neue', 'Arial', sans-serif;
82
- }
83
  /* --- Header Styling --- */
84
  #header { text-align: center; margin: 2rem auto; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
85
  #header h1 { font-size: 3rem; font-weight: 700; }
@@ -92,53 +89,43 @@ def create_interface():
92
  border-radius: 20px !important; box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.25);
93
  padding: 1rem;
94
  }
95
- .tab-buttons button {
96
- background-color: transparent !important; color: #37474F !important;
97
- border: none !important; border-bottom: 3px solid transparent !important;
98
- border-radius: 0 !important; font-size: 1.1rem; font-weight: 500;
99
- }
100
  .tab-buttons button.selected { color: #d81b60 !important; border-bottom-color: #d81b60 !important; }
101
 
102
  /* --- Humanizer Tab Styles --- */
103
- #humanizer_input, #humanizer_output {
104
- border: 2px solid #E0E0E0; border-radius: 12px;
105
- background: #fff; min-height: 45vh; color: #263238; font-size: 16px;
106
- }
107
- #humanize_btn {
108
- background: linear-gradient(45deg, #F06292, #4FC3F7); color: white;
109
- padding: 15px 24px; border-radius: 9999px; font-size: 1.2rem;
110
- transition: all 0.3s ease; border: none;
111
- }
112
  #humanize_btn:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); transform: translateY(-3px); }
113
 
114
  /* --- Co-Creative Canvas Tab Styles --- */
115
  #symbiotic_canvas { background: #fff; border-radius: 12px; height: 60vh !important; border: 2px solid #E0E0E0; }
 
 
 
 
 
 
 
116
 
117
- /* === FIX 2.0 FOR TEXT LEGIBILITY (AGGRESSIVE) === */
118
- #symbiotic_canvas .message-wrap { padding: 4px !important; }
119
- #symbiotic_canvas .user, #symbiotic_canvas .bot {
120
- padding: 12px 16px !important;
121
- border-radius: 18px !important;
122
- font-size: 16px !important;
123
- line-height: 1.5 !important;
124
- }
125
- #symbiotic_canvas .user {
126
- background-color: #F3F4F6 !important; /* Neutral light grey for user */
127
- color: #111827 !important; /* Dark charcoal text for user */
128
- }
129
  #symbiotic_canvas .bot {
130
- background-color: #EFF6FF !important; /* Very light, clean blue background */
131
- color: #1E3A8A !important; /* VERY DARK blue text for maximum contrast */
132
- font-weight: 500 !important;
133
  border: 1px solid #DBEAFE !important;
134
  animation: bloom 0.5s ease-out;
135
  }
 
 
 
 
 
 
 
136
  @keyframes bloom { 0% { opacity: 0; transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } }
137
 
138
- #chat_input textarea { border-radius: 9999px !important; border: 2px solid #E0E0E0; }
139
- #compose_btn { background: linear-gradient(45deg, #4FC3F7, #F06292); border: none; }
140
- #compose_btn:hover { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); transform: translateY(-2px); }
141
-
142
  /* --- Responsive Fix for Mobile --- */
143
  @media (max-width: 768px) {
144
  #header h1 { font-size: 2rem; }
@@ -155,7 +142,6 @@ def create_interface():
155
 
156
  with gr.Tabs() as tabs:
157
  with gr.Tab("Humanizer", id="humanizer_tab"):
158
- # ... Humanizer tab layout ...
159
  with gr.Column(variant="panel"):
160
  gr.Markdown("### Transform Existing AI Text")
161
  with gr.Row():
@@ -168,7 +154,6 @@ def create_interface():
168
  gr.Examples([["The system's analysis concluded optimal parameters were achieved."]], inputs=[input_text_humanizer], label="Try an Example")
169
 
170
  with gr.Tab("Co-Creative Canvas", id="canvas_tab"):
171
- # ... Canvas tab layout ...
172
  with gr.Row(equal_height=False):
173
  with gr.Column(scale=3):
174
  chatbot = gr.Chatbot([], label="Symbiotic Canvas", elem_id="symbiotic_canvas", bubble_full_width=True, avatar_images=(None, "https://i.imgur.com/Q6Zz3Jz.png"))
 
73
  def create_interface():
74
  app = HumanTouchApp()
75
 
76
+ # CSS with DEFINITIVE legibility fixes
77
  custom_css = """
78
  /* --- Main Background and Font --- */
79
+ body, #main_container { background: linear-gradient(135deg, #6DD5FA, #FF758C); font-family: 'SF Pro Display', 'Helvetica Neue', 'Arial', sans-serif; }
 
 
 
80
  /* --- Header Styling --- */
81
  #header { text-align: center; margin: 2rem auto; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,0.2); }
82
  #header h1 { font-size: 3rem; font-weight: 700; }
 
89
  border-radius: 20px !important; box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.25);
90
  padding: 1rem;
91
  }
92
+ .tab-buttons button { background-color: transparent !important; color: #37474F !important; border: none !important; border-bottom: 3px solid transparent !important; border-radius: 0 !important; font-size: 1.1rem; font-weight: 500; }
 
 
 
 
93
  .tab-buttons button.selected { color: #d81b60 !important; border-bottom-color: #d81b60 !important; }
94
 
95
  /* --- Humanizer Tab Styles --- */
96
+ #humanizer_input, #humanizer_output { border: 2px solid #E0E0E0; border-radius: 12px; background: #fff; min-height: 45vh; color: #263238; font-size: 16px; }
97
+ #humanize_btn { background: linear-gradient(45deg, #F06292, #4FC3F7); color: white; padding: 15px 24px; border-radius: 9999px; font-size: 1.2rem; transition: all 0.3s ease; border: none; }
 
 
 
 
 
 
 
98
  #humanize_btn:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2); transform: translateY(-3px); }
99
 
100
  /* --- Co-Creative Canvas Tab Styles --- */
101
  #symbiotic_canvas { background: #fff; border-radius: 12px; height: 60vh !important; border: 2px solid #E0E0E0; }
102
+ #chat_input textarea { border-radius: 9999px !important; border: 2px solid #E0E0E0; }
103
+ #compose_btn { background: linear-gradient(45deg, #4FC3F7, #F06292); border: none; }
104
+ #compose_btn:hover { box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); transform: translateY(-2px); }
105
+
106
+ /* === FIX 3.0 FOR TEXT LEGIBILITY (DEFINITIVE) === */
107
+ /* --- Styling for the Chat Bubbles --- */
108
+ #symbiotic_canvas .user, #symbiotic_canvas .bot { border-radius: 18px !important; padding: 12px 16px !important; }
109
 
110
+ /* --- User's Bubble --- */
111
+ #symbiotic_canvas .user { background-color: #F3F4F6 !important; }
112
+ #symbiotic_canvas .user p { color: #111827 !important; font-size: 16px !important; line-height: 1.5 !important; }
113
+
114
+ /* --- AI's Bubble (The Fix) --- */
 
 
 
 
 
 
 
115
  #symbiotic_canvas .bot {
116
+ background-color: #EFF6FF !important; /* A very light, clean blue */
 
 
117
  border: 1px solid #DBEAFE !important;
118
  animation: bloom 0.5s ease-out;
119
  }
120
+ /* THIS IS THE CRITICAL FIX: Targeting the <p> tag inside the bot bubble */
121
+ #symbiotic_canvas .bot p {
122
+ color: #1E3A8A !important; /* A very dark, legible navy blue */
123
+ font-weight: 500 !important;
124
+ font-size: 16px !important;
125
+ line-height: 1.5 !important;
126
+ }
127
  @keyframes bloom { 0% { opacity: 0; transform: scale(0.95); } 100% { opacity: 1; transform: scale(1); } }
128
 
 
 
 
 
129
  /* --- Responsive Fix for Mobile --- */
130
  @media (max-width: 768px) {
131
  #header h1 { font-size: 2rem; }
 
142
 
143
  with gr.Tabs() as tabs:
144
  with gr.Tab("Humanizer", id="humanizer_tab"):
 
145
  with gr.Column(variant="panel"):
146
  gr.Markdown("### Transform Existing AI Text")
147
  with gr.Row():
 
154
  gr.Examples([["The system's analysis concluded optimal parameters were achieved."]], inputs=[input_text_humanizer], label="Try an Example")
155
 
156
  with gr.Tab("Co-Creative Canvas", id="canvas_tab"):
 
157
  with gr.Row(equal_height=False):
158
  with gr.Column(scale=3):
159
  chatbot = gr.Chatbot([], label="Symbiotic Canvas", elem_id="symbiotic_canvas", bubble_full_width=True, avatar_images=(None, "https://i.imgur.com/Q6Zz3Jz.png"))