mgbam commited on
Commit
43bf547
·
verified ·
1 Parent(s): d5ca822

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +78 -2
app.py CHANGED
@@ -21,6 +21,82 @@ from ux_components import create_top_demo_cards
21
  logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
22
 
23
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  def demo_card_click(evt: gr.EventData):
25
  """Handles clicks on the demo cards to populate the input textbox."""
26
  # This function seems complex for its purpose. Gradio's event data can be tricky.
@@ -64,9 +140,9 @@ with gr.Blocks(
64
  radius_size=gr.themes.sizes.radius_md
65
  ),
66
  title="AnyCoder - AI Code Generator",
67
- css="style.css" # Load the custom CSS
68
  ) as demo:
69
- gr.HTML("<h1 align='center'>AnyCoder - AI Code Generator</h1>")
70
  history = gr.State([])
71
  setting = gr.State({
72
  "system": HTML_SYSTEM_PROMPT,
 
21
  logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
22
 
23
 
24
+ CSS = """
25
+ /* General App Styling & Font */
26
+ @import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
27
+ body, .gradio-container {
28
+ font-family: 'Inter', sans-serif;
29
+ background-color: #f8f9fa; /* Light gray background */
30
+ color: #212529;
31
+ }
32
+
33
+ /* Main Title */
34
+ h1 {
35
+ color: #0d6efd; /* A more vibrant blue */
36
+ font-weight: 700;
37
+ letter-spacing: -1.5px;
38
+ text-align: center;
39
+ padding: 1rem 0;
40
+ }
41
+
42
+ /* Column Headers */
43
+ .col-header {
44
+ color: #495057;
45
+ font-weight: 600;
46
+ text-transform: uppercase;
47
+ font-size: 0.85rem;
48
+ letter-spacing: 0.75px;
49
+ border-bottom: 2px solid #e9ecef;
50
+ padding-bottom: 10px;
51
+ margin-bottom: 20px;
52
+ text-align: left;
53
+ }
54
+
55
+ /* Consistent Label Styling */
56
+ .gradio-container .label {
57
+ font-weight: 500;
58
+ color: #343a40;
59
+ }
60
+
61
+ /* Custom Button Styling */
62
+ .gradio-container .gr-button {
63
+ border-radius: 8px !important;
64
+ font-size: 1rem !important;
65
+ font-weight: 500;
66
+ transition: all 0.2s ease-in-out;
67
+ box-shadow: 0 2px 4px rgba(0,0,0,0.05);
68
+ }
69
+ .gradio-container .gr-button-primary {
70
+ background: linear-gradient(45deg, #0d6efd, #0dcaf0) !important;
71
+ color: white !important;
72
+ border: none !important;
73
+ }
74
+ .gradio-container .gr-button-primary:hover {
75
+ transform: translateY(-2px);
76
+ box-shadow: 0 4px 8px rgba(0,0,0,0.1);
77
+ }
78
+
79
+ /* Input Textbox Styling */
80
+ .gradio-container textarea {
81
+ border-radius: 8px !important;
82
+ border: 1px solid #ced4da !important;
83
+ }
84
+ .gradio-container textarea:focus {
85
+ border-color: #80bdff !important;
86
+ box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25) !important;
87
+ }
88
+
89
+ /* Tabs Styling */
90
+ .gradio-container .tabs > .tab-nav > button {
91
+ font-weight: 600;
92
+ color: #6c757d;
93
+ }
94
+ .gradio-container .tabs > .tab-nav > button.selected {
95
+ color: #0d6efd;
96
+ border-bottom: 3px solid #0d6efd;
97
+ }
98
+ """
99
+
100
  def demo_card_click(evt: gr.EventData):
101
  """Handles clicks on the demo cards to populate the input textbox."""
102
  # This function seems complex for its purpose. Gradio's event data can be tricky.
 
140
  radius_size=gr.themes.sizes.radius_md
141
  ),
142
  title="AnyCoder - AI Code Generator",
143
+ css=CSS # Embed CSS directly
144
  ) as demo:
145
+ gr.HTML("<h1 align='center'>Shasha - AI Code Generator</h1>")
146
  history = gr.State([])
147
  setting = gr.State({
148
  "system": HTML_SYSTEM_PROMPT,