Zaiiida commited on
Commit
b3d2790
·
verified ·
1 Parent(s): cf1f355

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +37 -14
app.py CHANGED
@@ -66,7 +66,7 @@ class CustomTheme(gr.themes.Base):
66
  self.input_background_fill = "#17181B" # Set input background color
67
  self.input_text_color = "#AEB3B8" # Set input text color
68
 
69
- # Custom CSS to hide the footer and set fonts
70
  css = """
71
  /* Hide the footer */
72
  footer {
@@ -76,31 +76,50 @@ footer {
76
  padding: 0;
77
  overflow: hidden;
78
  }
79
- /* Target only the Generate button */
80
- #generate-button, #generate-button .gr-button {
81
- font-weight: normal !important;
82
- }
83
 
84
  /* Import Google Fonts */
85
  @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Montserrat:wght@500;700&display=swap');
86
 
87
- /* Target only the Prompt text */
88
- #prompt-text {
89
- font-weight: bold;
90
- }
91
-
92
  /* Apply fonts to different elements */
93
  body, input, button, textarea, select, .gr-button {
94
  font-family: 'Roboto', sans-serif;
95
  }
 
 
 
 
 
 
 
96
  h1, h2, h3, h4, h5, h6 {
97
  font-family: 'Montserrat', sans-serif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  }
99
  """
100
 
101
  with gr.Blocks(theme=CustomTheme(), css=css) as demo:
102
  with gr.Column(elem_id="col-container"):
103
- gr.Markdown("**Prompt**", elem_id="prompt-text")
 
104
 
105
  with gr.Row():
106
  prompt = gr.Text(
@@ -111,8 +130,12 @@ with gr.Blocks(theme=CustomTheme(), css=css) as demo:
111
  container=False,
112
  )
113
 
114
- run_button = gr.Button("Generate", scale=0, variant="primary", elem_id="generate-button")
115
-
 
 
 
 
116
 
117
  result = gr.Image(label="Result", show_label=False)
118
 
@@ -213,4 +236,4 @@ if __name__ == "__main__":
213
  server_port=7860,
214
  share=True,
215
  show_api=False
216
- )
 
66
  self.input_background_fill = "#17181B" # Set input background color
67
  self.input_text_color = "#AEB3B8" # Set input text color
68
 
69
+ # Custom CSS to hide the footer, set fonts, and adjust font weights
70
  css = """
71
  /* Hide the footer */
72
  footer {
 
76
  padding: 0;
77
  overflow: hidden;
78
  }
 
 
 
 
79
 
80
  /* Import Google Fonts */
81
  @import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&family=Montserrat:wght@500;700&display=swap');
82
 
 
 
 
 
 
83
  /* Apply fonts to different elements */
84
  body, input, button, textarea, select, .gr-button {
85
  font-family: 'Roboto', sans-serif;
86
  }
87
+
88
+ /* Make button text normal weight */
89
+ .generate-button, .generate-button .gr-button {
90
+ font-weight: normal !important;
91
+ }
92
+
93
+ /* Ensure headings use Montserrat */
94
  h1, h2, h3, h4, h5, h6 {
95
  font-family: 'Montserrat', sans-serif;
96
+ font-weight: 700;
97
+ }
98
+
99
+ /* Additional styling for sliders and checkboxes if needed */
100
+ input[type="range"]::-webkit-slider-thumb {
101
+ background: #5271FF;
102
+ }
103
+ input[type="range"]::-moz-range-thumb {
104
+ background: #5271FF;
105
+ }
106
+ input[type="range"]::-ms-thumb {
107
+ background: #5271FF;
108
+ }
109
+ input[type="checkbox"]:checked {
110
+ background-color: #5271FF;
111
+ }
112
+
113
+ /* Make Prompt text bold */
114
+ .prompt-text {
115
+ font-weight: bold;
116
  }
117
  """
118
 
119
  with gr.Blocks(theme=CustomTheme(), css=css) as demo:
120
  with gr.Column(elem_id="col-container"):
121
+ # Make "Prompt" bold using Markdown syntax and assign a class
122
+ gr.Markdown("**Prompt**", elem_classes="prompt-text")
123
 
124
  with gr.Row():
125
  prompt = gr.Text(
 
130
  container=False,
131
  )
132
 
133
+ run_button = gr.Button(
134
+ "Generate",
135
+ scale=0,
136
+ variant="primary",
137
+ elem_classes="generate-button"
138
+ )
139
 
140
  result = gr.Image(label="Result", show_label=False)
141
 
 
236
  server_port=7860,
237
  share=True,
238
  show_api=False
239
+ )