tywei08 commited on
Commit
04e6d96
·
verified ·
1 Parent(s): e204292

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +61 -21
app.py CHANGED
@@ -112,24 +112,50 @@ with gr.Blocks(css='''
112
  .gradio-container {
113
  background: url('https://images.unsplash.com/photo-1514361726087-38371321b5cd?q=80&w=2370&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
114
  }
115
- .gradio-textbox {
116
- opacity: 0.5; /* Change the opacity of the textbox */
117
- }
118
  .generate-button {
119
- background: linear-gradient(to right, #F0E68C, #E0FFFF, #FF6347);
120
- color: black;
121
- padding: 10px 20px;
122
- border: none;
123
- border-radius: 5px;
124
- cursor: pointer;
125
- font-weight: bold;
126
- text-transform: uppercase;
127
- box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
128
- transition: all 0.3s ease;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  }
 
130
  .generate-button:hover {
131
- background: linear-gradient(to right, #E0FFFF, #FF6347, #F0E68C);
132
- box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
 
 
 
 
 
 
 
 
 
 
 
 
133
  }
134
  .mood-input {
135
  background: linear-gradient(21deg, #10abff, #1beabd);
@@ -139,7 +165,6 @@ with gr.Blocks(css='''
139
  position: relative;
140
  font-size: 1.5em;
141
  }
142
-
143
  .mood-input input {
144
  position: relative;
145
  display: inherit;
@@ -150,12 +175,10 @@ with gr.Blocks(css='''
150
  padding: 0 .325em;
151
  z-index: 1;
152
  }
153
-
154
  .mood-input input:focus + span {
155
  opacity: 1;
156
  transform: scale(1);
157
  }
158
-
159
  .mood-input span {
160
  transform: scale(.993, .94);
161
  transition: transform .5s, opacity .25s;
@@ -188,10 +211,10 @@ with gr.Blocks(css='''
188
  <input type="text" class="gradio-textbox" label="Mood">
189
  <span></span>
190
  </div>
191
- ''')
192
  # mood = gr.Textbox(label="Mood", elem_classes=["mood-input"])
193
- flavor_association = gr.CheckboxGroup(label="Flavor Association", choices=["Fruity", "Herbal", "Spicy", "Floral", "Nutty", "Woody", "Earthy"])
194
- drinking_experience = gr.CheckboxGroup(label="Drinking Experience", choices=["Refreshing", "Warming", "Comforting", "Energizing", "Relaxing"])
195
 
196
  with gr.Row():
197
  sweetness = gr.Slider(label="Sweetness", minimum=0, maximum=10, elem_id="slider-sweetness")
@@ -263,6 +286,23 @@ with gr.Blocks(css='''
263
  # )
264
 
265
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
266
  if __name__ == "__main__":
267
  demo.launch(#enable_queue=False,
268
  # Creates an auth screen
 
112
  .gradio-container {
113
  background: url('https://images.unsplash.com/photo-1514361726087-38371321b5cd?q=80&w=2370&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D');
114
  }
 
 
 
115
  .generate-button {
116
+ background: linear-gradient(to right, #F0E68C, #E0FFFF, #FF6347);
117
+ color: black;
118
+ padding: 10px 20px;
119
+ border: none;
120
+ border-radius: 5px;
121
+ cursor: pointer;
122
+ font-weight: bold;
123
+ text-transform: uppercase;
124
+ box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
125
+ transition: all 0.3s ease;
126
+ position: relative; /* add this */
127
+ overflow: hidden; /* add this */
128
+ }
129
+
130
+ .generate-button:before {
131
+ content: "";
132
+ position: absolute;
133
+ top: 0;
134
+ left: 0;
135
+ width: 100%;
136
+ height: 100%;
137
+ background: linear-gradient(to right, #F0E68C, #E0FFFF, #FF6347);
138
+ transform: scaleX(0);
139
+ transform-origin: right;
140
+ transition: transform 0.3s ease;
141
+ z-index: -1; /* add this */
142
  }
143
+
144
  .generate-button:hover {
145
+ background: linear-gradient(to right, #E0FFFF, #FF6347, #F0E68C);
146
+ box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
147
+ }
148
+
149
+ .generate-button:hover:before {
150
+ transform: scaleX(1);
151
+ }
152
+
153
+ .generate-button:active {
154
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
155
+ }
156
+
157
+ .generate-button:active:before {
158
+ transform: scaleX(0.9);
159
  }
160
  .mood-input {
161
  background: linear-gradient(21deg, #10abff, #1beabd);
 
165
  position: relative;
166
  font-size: 1.5em;
167
  }
 
168
  .mood-input input {
169
  position: relative;
170
  display: inherit;
 
175
  padding: 0 .325em;
176
  z-index: 1;
177
  }
 
178
  .mood-input input:focus + span {
179
  opacity: 1;
180
  transform: scale(1);
181
  }
 
182
  .mood-input span {
183
  transform: scale(.993, .94);
184
  transition: transform .5s, opacity .25s;
 
211
  <input type="text" class="gradio-textbox" label="Mood">
212
  <span></span>
213
  </div>
214
+ ''', scale=1)
215
  # mood = gr.Textbox(label="Mood", elem_classes=["mood-input"])
216
+ flavor_association = gr.CheckboxGroup(label="Flavor Association", choices=["Fruity", "Herbal", "Spicy", "Floral", "Nutty", "Woody", "Earthy"], scale=1)
217
+ drinking_experience = gr.CheckboxGroup(label="Drinking Experience", choices=["Refreshing", "Warming", "Comforting", "Energizing", "Relaxing"], scale=1)
218
 
219
  with gr.Row():
220
  sweetness = gr.Slider(label="Sweetness", minimum=0, maximum=10, elem_id="slider-sweetness")
 
286
  # )
287
 
288
 
289
+ # .generate-button {
290
+ # background: linear-gradient(to right, #F0E68C, #E0FFFF, #FF6347);
291
+ # color: black;
292
+ # padding: 10px 20px;
293
+ # border: none;
294
+ # border-radius: 5px;
295
+ # cursor: pointer;
296
+ # font-weight: bold;
297
+ # text-transform: uppercase;
298
+ # box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
299
+ # transition: all 0.3s ease;
300
+ # }
301
+ # .generate-button:hover {
302
+ # background: linear-gradient(to right, #E0FFFF, #FF6347, #F0E68C);
303
+ # box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
304
+ # }
305
+
306
  if __name__ == "__main__":
307
  demo.launch(#enable_queue=False,
308
  # Creates an auth screen