WatchOutForMike commited on
Commit
539c969
·
1 Parent(s): bc077a4

CSS D&D MAP

Browse files
Files changed (1) hide show
  1. app.py +52 -34
app.py CHANGED
@@ -234,14 +234,14 @@ def infer(
234
 
235
  # Example prompts
236
  examples = [
237
- ["A 10x8 battle map located in Ravenloft", "D&D MAP"],
238
  ["A heroic adventurer wielding a flaming sword standing on a cliff", "D&D Art"],
239
  ["A mystical library with ancient scrolls and glowing runes", "Dark Fantasy"],
240
  ["A ferocious dragon breathing fire in a dark cavern", "Epic Battle"],
241
  ]
242
 
243
- # Custom CSS for a Dungeons & Dragons theme
244
  css = """
 
245
  body {
246
  background-color: #1b1b1b;
247
  font-family: 'Cinzel', serif;
@@ -251,42 +251,48 @@ body {
251
  padding: 0;
252
  }
253
 
 
254
  #col-container {
255
  margin: 0 auto;
256
  max-width: 550px;
257
- padding: 15px;
258
- border: 4px solid #8b4513;
259
- background: linear-gradient(145deg, #2e2b2a, #3a3433);
260
- border-radius: 15px;
261
- box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
262
- transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
263
  }
264
 
265
- /* Hover effect for #col-container */
266
  #col-container:hover {
267
- transform: scale(1.02);
268
- box-shadow: 0 0 30px rgba(139, 69, 19, 0.9);
269
  }
270
 
 
271
  #col-container h1, #col-container h2, #col-container h3 {
272
- color: #e6e6e6;
273
- text-shadow: 2px 2px 8px rgba(139, 69, 19, 0.8);
 
 
 
 
 
274
  }
275
 
276
- /* Markdown links customization */
277
  #col-container a {
278
- color: #b8860b;
279
  text-decoration: none;
280
  font-weight: bold;
281
  transition: color 0.3s ease-in-out, text-shadow 0.3s ease-in-out;
282
  }
283
 
284
  #col-container a:hover {
285
- color: #e6ac00;
286
- text-shadow: 0 0 8px #e6ac00, 0 0 15px #e6ac00;
287
  }
288
 
289
- /* Button styling */
290
  .gr-button {
291
  background-color: #8b4513;
292
  color: #f5f5f5;
@@ -295,56 +301,68 @@ body {
295
  border: 2px solid #b8860b;
296
  border-radius: 8px;
297
  cursor: pointer;
298
- transition: background-color 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
299
  }
300
 
301
  .gr-button:hover {
302
  background-color: #b8860b;
303
- box-shadow: 0 0 10px rgba(255, 165, 0, 0.8);
 
304
  }
305
 
306
- /* Inputs and dropdowns */
307
  input, select, .gr-input, .gr-slider {
308
- background-color: #2e2b2a;
309
  color: #f5f5f5;
310
  border: 2px solid #8b4513;
311
  border-radius: 5px;
312
- padding: 5px 10px;
313
  font-family: 'Cinzel', serif;
314
- transition: border 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
315
  }
316
 
317
  input:focus, select:focus, .gr-input:focus, .gr-slider:focus {
318
  outline: none;
319
- border-color: #b8860b;
320
- box-shadow: 0 0 10px #b8860b;
321
  }
322
 
323
- /* Slider and checkbox */
324
  .gr-slider > div {
325
  background-color: #8b4513 !important;
326
  }
327
 
328
- .gr-checkbox {
329
- color: #f5f5f5;
330
- }
331
-
332
  .gr-checkbox-label {
333
  font-weight: bold;
334
  color: #f5f5f5;
 
335
  }
336
 
337
- /* Accordion */
338
  .gr-accordion {
339
  background: linear-gradient(145deg, #302d2b, #3b3634);
340
  color: #f5f5f5;
341
  border: 2px solid #8b4513;
342
- border-radius: 8px;
 
343
  transition: all 0.3s ease;
344
  }
345
 
346
  .gr-accordion:hover {
347
- box-shadow: 0 0 10px rgba(139, 69, 19, 0.8);
 
 
 
 
 
 
 
 
 
 
 
 
348
  }
349
  """
350
 
 
234
 
235
  # Example prompts
236
  examples = [
237
+ ["A 10x8 battle map located in Ravenloft", "D&D Map"],
238
  ["A heroic adventurer wielding a flaming sword standing on a cliff", "D&D Art"],
239
  ["A mystical library with ancient scrolls and glowing runes", "Dark Fantasy"],
240
  ["A ferocious dragon breathing fire in a dark cavern", "Epic Battle"],
241
  ]
242
 
 
243
  css = """
244
+ /* General body styling */
245
  body {
246
  background-color: #1b1b1b;
247
  font-family: 'Cinzel', serif;
 
251
  padding: 0;
252
  }
253
 
254
+ /* Container */
255
  #col-container {
256
  margin: 0 auto;
257
  max-width: 550px;
258
+ padding: 20px;
259
+ border: 6px solid #8b4513;
260
+ background: radial-gradient(circle, #302d2b 0%, #3b3634 60%, #1b1b1b 100%);
261
+ border-radius: 20px;
262
+ box-shadow: 0 0 30px rgba(0, 0, 0, 0.9), 0 0 15px rgba(139, 69, 19, 0.7);
263
+ transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
264
  }
265
 
 
266
  #col-container:hover {
267
+ transform: scale(1.03);
268
+ box-shadow: 0 0 40px rgba(255, 223, 0, 0.8), 0 0 20px rgba(255, 140, 0, 0.8);
269
  }
270
 
271
+ /* Fancy title and text effects */
272
  #col-container h1, #col-container h2, #col-container h3 {
273
+ color: #ffebcc;
274
+ text-shadow: 0 0 10px #8b4513, 0 0 20px #ffd700;
275
+ }
276
+
277
+ #col-container p {
278
+ color: #dcdcdc;
279
+ text-shadow: 0 0 6px rgba(139, 69, 19, 0.8);
280
  }
281
 
282
+ /* Markdown links */
283
  #col-container a {
284
+ color: #e6ac00;
285
  text-decoration: none;
286
  font-weight: bold;
287
  transition: color 0.3s ease-in-out, text-shadow 0.3s ease-in-out;
288
  }
289
 
290
  #col-container a:hover {
291
+ color: #fff700;
292
+ text-shadow: 0 0 10px #fff700, 0 0 20px #ffebcc;
293
  }
294
 
295
+ /* Buttons with D&D glowing effect */
296
  .gr-button {
297
  background-color: #8b4513;
298
  color: #f5f5f5;
 
301
  border: 2px solid #b8860b;
302
  border-radius: 8px;
303
  cursor: pointer;
304
+ transition: background-color 0.4s ease-in-out, box-shadow 0.4s ease-in-out, transform 0.2s ease-in-out;
305
  }
306
 
307
  .gr-button:hover {
308
  background-color: #b8860b;
309
+ transform: scale(1.05);
310
+ box-shadow: 0 0 12px rgba(255, 223, 0, 0.9), 0 0 24px rgba(255, 140, 0, 0.7);
311
  }
312
 
313
+ /* Input and Dropdown styling */
314
  input, select, .gr-input, .gr-slider {
315
+ background-color: #302d2b;
316
  color: #f5f5f5;
317
  border: 2px solid #8b4513;
318
  border-radius: 5px;
319
+ padding: 8px 12px;
320
  font-family: 'Cinzel', serif;
321
+ transition: border-color 0.3s ease, box-shadow 0.3s ease;
322
  }
323
 
324
  input:focus, select:focus, .gr-input:focus, .gr-slider:focus {
325
  outline: none;
326
+ border-color: #ffd700;
327
+ box-shadow: 0 0 8px #ffd700;
328
  }
329
 
330
+ /* Slider styling */
331
  .gr-slider > div {
332
  background-color: #8b4513 !important;
333
  }
334
 
335
+ /* Checkbox customization */
 
 
 
336
  .gr-checkbox-label {
337
  font-weight: bold;
338
  color: #f5f5f5;
339
+ text-shadow: 0 0 5px rgba(139, 69, 19, 0.7);
340
  }
341
 
342
+ /* Accordion effects */
343
  .gr-accordion {
344
  background: linear-gradient(145deg, #302d2b, #3b3634);
345
  color: #f5f5f5;
346
  border: 2px solid #8b4513;
347
+ border-radius: 10px;
348
+ padding: 8px;
349
  transition: all 0.3s ease;
350
  }
351
 
352
  .gr-accordion:hover {
353
+ box-shadow: 0 0 12px rgba(255, 223, 0, 0.7), 0 0 20px rgba(255, 140, 0, 0.5);
354
+ }
355
+
356
+ /* Image glow effect */
357
+ .gr-image {
358
+ border: 4px solid #8b4513;
359
+ border-radius: 10px;
360
+ box-shadow: 0 0 10px #8b4513, 0 0 20px #ffd700;
361
+ }
362
+
363
+ /* Add glow on hover for images */
364
+ .gr-image:hover {
365
+ box-shadow: 0 0 20px rgba(255, 140, 0, 0.7), 0 0 40px rgba(255, 223, 0, 0.9);
366
  }
367
  """
368