ginipick commited on
Commit
afa06a0
·
verified ·
1 Parent(s): f55b9b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +49 -13
app.py CHANGED
@@ -331,12 +331,15 @@ HTML_TEMPLATE = '''
331
  background: white;
332
  border: 2px solid black;
333
  border-radius: 20px;
334
- padding: 30px 15px 15px 15px;
335
  min-width: 100px;
336
  min-height: 50px;
337
  position: relative;
338
  width: 100%;
339
  height: 100%;
 
 
 
340
  }
341
 
342
  .speech-bubble-tail {
@@ -366,12 +369,15 @@ HTML_TEMPLATE = '''
366
  background: white;
367
  border: 2px solid black;
368
  border-radius: 50%;
369
- padding: 40px 20px 20px 20px;
370
  min-width: 120px;
371
  min-height: 80px;
372
  position: relative;
373
  width: 100%;
374
  height: 100%;
 
 
 
375
  }
376
 
377
  .thought-bubble-dots {
@@ -402,23 +408,29 @@ HTML_TEMPLATE = '''
402
  .shout-bubble {
403
  background: white;
404
  border: 3px solid black;
405
- padding: 30px 15px 15px 15px;
406
  min-width: 100px;
407
  min-height: 50px;
408
  position: relative;
409
  width: 100%;
410
  height: 100%;
411
  clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
 
 
 
412
  }
413
 
414
  .narration-box {
415
  background: rgba(0, 0, 0, 0.85);
416
  border: 2px solid white;
417
- padding: 30px 15px 15px 15px;
418
  min-width: 150px;
419
  min-height: 40px;
420
  width: 100%;
421
  height: 100%;
 
 
 
422
  }
423
 
424
  .narration-box .component-text {
@@ -428,67 +440,85 @@ HTML_TEMPLATE = '''
428
  .text-box {
429
  background: white;
430
  border: 2px solid black;
431
- padding: 20px 10px 10px 10px;
432
  min-width: 100px;
433
  min-height: 40px;
434
  width: 100%;
435
  height: 100%;
 
 
 
436
  }
437
 
438
  .transparent-box {
439
  background: rgba(255, 255, 255, 0.8);
440
  border: 1px dashed #999;
441
- padding: 20px 10px 10px 10px;
442
  min-width: 100px;
443
  min-height: 40px;
444
  width: 100%;
445
  height: 100%;
 
 
 
446
  }
447
 
448
  .action-effect {
449
  background: transparent;
450
  border: none;
451
- padding: 20px 10px 10px 10px;
452
  min-width: 80px;
453
  min-height: 40px;
454
  width: 100%;
455
  height: 100%;
456
  font-weight: bold;
457
  text-shadow: 2px 2px 0 white, -2px -2px 0 white, 2px -2px 0 white, -2px 2px 0 white;
 
 
 
458
  }
459
 
460
  .emotion-bubble {
461
  background: #ffeb3b;
462
  border: 2px solid black;
463
  border-radius: 15px;
464
- padding: 20px 10px 10px 10px;
465
  min-width: 80px;
466
  min-height: 40px;
467
  width: 100%;
468
  height: 100%;
 
 
 
469
  }
470
 
471
  .whisper-bubble {
472
  background: #f0f0f0;
473
  border: 1px dashed #666;
474
  border-radius: 15px;
475
- padding: 20px 10px 10px 10px;
476
  min-width: 100px;
477
  min-height: 40px;
478
  width: 100%;
479
  height: 100%;
480
  opacity: 0.9;
 
 
 
481
  }
482
 
483
  .gradient-box {
484
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
485
  border: 2px solid white;
486
  border-radius: 10px;
487
- padding: 30px 15px 15px 15px;
488
  min-width: 100px;
489
  min-height: 40px;
490
  width: 100%;
491
  height: 100%;
 
 
 
492
  }
493
 
494
  .gradient-box .component-text {
@@ -507,8 +537,11 @@ HTML_TEMPLATE = '''
507
  color: black;
508
  text-align: center;
509
  padding: 5px;
510
- overflow: visible;
511
- line-height: 1.4;
 
 
 
512
  }
513
 
514
  /* 로딩 인디케이터 */
@@ -1304,4 +1337,7 @@ def index():
1304
  return render_template_string(HTML_TEMPLATE)
1305
 
1306
  if __name__ == '__main__':
1307
- app.run(debug=True, port=5000)
 
 
 
 
331
  background: white;
332
  border: 2px solid black;
333
  border-radius: 20px;
334
+ padding: 15px;
335
  min-width: 100px;
336
  min-height: 50px;
337
  position: relative;
338
  width: 100%;
339
  height: 100%;
340
+ display: flex;
341
+ align-items: center;
342
+ justify-content: center;
343
  }
344
 
345
  .speech-bubble-tail {
 
369
  background: white;
370
  border: 2px solid black;
371
  border-radius: 50%;
372
+ padding: 20px;
373
  min-width: 120px;
374
  min-height: 80px;
375
  position: relative;
376
  width: 100%;
377
  height: 100%;
378
+ display: flex;
379
+ align-items: center;
380
+ justify-content: center;
381
  }
382
 
383
  .thought-bubble-dots {
 
408
  .shout-bubble {
409
  background: white;
410
  border: 3px solid black;
411
+ padding: 15px;
412
  min-width: 100px;
413
  min-height: 50px;
414
  position: relative;
415
  width: 100%;
416
  height: 100%;
417
  clip-path: polygon(10% 0%, 90% 0%, 100% 10%, 100% 90%, 90% 100%, 10% 100%, 0% 90%, 0% 10%);
418
+ display: flex;
419
+ align-items: center;
420
+ justify-content: center;
421
  }
422
 
423
  .narration-box {
424
  background: rgba(0, 0, 0, 0.85);
425
  border: 2px solid white;
426
+ padding: 15px;
427
  min-width: 150px;
428
  min-height: 40px;
429
  width: 100%;
430
  height: 100%;
431
+ display: flex;
432
+ align-items: center;
433
+ justify-content: center;
434
  }
435
 
436
  .narration-box .component-text {
 
440
  .text-box {
441
  background: white;
442
  border: 2px solid black;
443
+ padding: 10px;
444
  min-width: 100px;
445
  min-height: 40px;
446
  width: 100%;
447
  height: 100%;
448
+ display: flex;
449
+ align-items: center;
450
+ justify-content: center;
451
  }
452
 
453
  .transparent-box {
454
  background: rgba(255, 255, 255, 0.8);
455
  border: 1px dashed #999;
456
+ padding: 10px;
457
  min-width: 100px;
458
  min-height: 40px;
459
  width: 100%;
460
  height: 100%;
461
+ display: flex;
462
+ align-items: center;
463
+ justify-content: center;
464
  }
465
 
466
  .action-effect {
467
  background: transparent;
468
  border: none;
469
+ padding: 10px;
470
  min-width: 80px;
471
  min-height: 40px;
472
  width: 100%;
473
  height: 100%;
474
  font-weight: bold;
475
  text-shadow: 2px 2px 0 white, -2px -2px 0 white, 2px -2px 0 white, -2px 2px 0 white;
476
+ display: flex;
477
+ align-items: center;
478
+ justify-content: center;
479
  }
480
 
481
  .emotion-bubble {
482
  background: #ffeb3b;
483
  border: 2px solid black;
484
  border-radius: 15px;
485
+ padding: 10px;
486
  min-width: 80px;
487
  min-height: 40px;
488
  width: 100%;
489
  height: 100%;
490
+ display: flex;
491
+ align-items: center;
492
+ justify-content: center;
493
  }
494
 
495
  .whisper-bubble {
496
  background: #f0f0f0;
497
  border: 1px dashed #666;
498
  border-radius: 15px;
499
+ padding: 10px;
500
  min-width: 100px;
501
  min-height: 40px;
502
  width: 100%;
503
  height: 100%;
504
  opacity: 0.9;
505
+ display: flex;
506
+ align-items: center;
507
+ justify-content: center;
508
  }
509
 
510
  .gradient-box {
511
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
512
  border: 2px solid white;
513
  border-radius: 10px;
514
+ padding: 15px;
515
  min-width: 100px;
516
  min-height: 40px;
517
  width: 100%;
518
  height: 100%;
519
+ display: flex;
520
+ align-items: center;
521
+ justify-content: center;
522
  }
523
 
524
  .gradient-box .component-text {
 
537
  color: black;
538
  text-align: center;
539
  padding: 5px;
540
+ overflow: hidden;
541
+ line-height: 1.5;
542
+ display: flex;
543
+ align-items: center;
544
+ justify-content: center;
545
  }
546
 
547
  /* 로딩 인디케이터 */
 
1337
  return render_template_string(HTML_TEMPLATE)
1338
 
1339
  if __name__ == '__main__':
1340
+ import os
1341
+ # Hugging Face Spaces는 PORT 환경 변수를 사용합니다
1342
+ port = int(os.environ.get('PORT', 7860))
1343
+ app.run(host='0.0.0.0', port=port, debug=False)