jhh6576 commited on
Commit
3deaa68
·
verified ·
1 Parent(s): 8b6151d

Update app_enhanced.py

Browse files
Files changed (1) hide show
  1. app_enhanced.py +56 -60
app_enhanced.py CHANGED
@@ -543,102 +543,98 @@ class EnhancedComicGenerator:
543
  .speech-bubble.selected { outline: 2px dashed #4CAF50; }
544
  .speech-bubble textarea { position: absolute; top: 0; left: 0; width: 100%; height: 100%; box-sizing: border-box; border: 1px solid #4CAF50; background: rgba(255,255,255,0.95); font: inherit; text-align: center; resize: none; padding: 8px; z-index: 102; }
545
 
546
- /* <<< FIXED BUBBLE CSS WITH DYNAMIC TAIL SLIDER >>> */
547
  .speech-bubble.speech {
548
  background: var(--bubble-fill-color, white);
549
  color: var(--bubble-text-color, #333);
550
  border: 2px solid var(--bubble-border-color, #333);
551
  border-radius: 10px;
552
  padding: 0;
553
- --tail-pos: 50%; /* Default centered tail */
554
  }
555
 
556
  .speech-bubble.speech:after, .speech-bubble.speech:before {
557
- content: '';
558
- position: absolute;
559
- display: block;
560
- width: 0;
561
  pointer-events: none;
562
  }
563
 
564
  /* BOTTOM TAIL */
565
  .speech-bubble.speech.tail-bottom:after {
566
- border-style: solid;
567
- border-width: 15px 15px 0 0;
568
- border-color: var(--bubble-fill-color, white) transparent transparent transparent;
569
- bottom: -15px;
570
- left: var(--tail-pos);
571
  transform: translateX(-50%);
572
- z-index: 1;
573
  }
574
  .speech-bubble.speech.tail-bottom:before {
575
- border-style: solid;
576
- border-width: 17px 17px 0 0;
577
- border-color: var(--bubble-border-color, #333) transparent transparent transparent;
578
- bottom: -19px;
579
- left: var(--tail-pos);
580
  transform: translateX(-50%);
581
- z-index: 0;
582
  }
583
 
584
  /* TOP TAIL */
585
  .speech-bubble.speech.tail-top:after {
586
- border-style: solid;
587
- border-width: 0 15px 15px 0;
588
- border-color: transparent var(--bubble-fill-color, white) transparent transparent;
589
- top: -15px;
590
- left: var(--tail-pos);
591
- transform: translateX(-50%) rotate(180deg);
592
- z-index: 1;
593
  }
594
  .speech-bubble.speech.tail-top:before {
595
- border-style: solid;
596
- border-width: 0 17px 17px 0;
597
- border-color: transparent var(--bubble-border-color, #333) transparent transparent;
598
- top: -19px;
599
- left: var(--tail-pos);
600
- transform: translateX(-50%) rotate(180deg);
601
- z-index: 0;
602
  }
603
 
604
  /* RIGHT TAIL */
605
  .speech-bubble.speech.tail-right:after {
606
- border-style: solid;
607
- border-width: 15px 15px 0 0;
608
- border-color: var(--bubble-fill-color, white) transparent transparent transparent;
609
- top: var(--tail-pos);
610
- right: -15px;
611
- transform: translateY(-50%) rotate(90deg);
612
- z-index: 1;
613
  }
614
  .speech-bubble.speech.tail-right:before {
615
- border-style: solid;
616
- border-width: 17px 17px 0 0;
617
- border-color: var(--bubble-border-color, #333) transparent transparent transparent;
618
- top: var(--tail-pos);
619
- right: -19px;
620
- transform: translateY(-50%) rotate(90deg);
621
- z-index: 0;
622
  }
623
 
624
  /* LEFT TAIL */
625
  .speech-bubble.speech.tail-left:after {
626
- border-style: solid;
627
- border-width: 15px 15px 0 0;
628
- border-color: var(--bubble-fill-color, white) transparent transparent transparent;
629
- top: var(--tail-pos);
630
- left: -15px;
631
- transform: translateY(-50%) rotate(-90deg);
632
- z-index: 1;
633
  }
634
  .speech-bubble.speech.tail-left:before {
635
- border-style: solid;
636
- border-width: 17px 17px 0 0;
637
- border-color: var(--bubble-border-color, #333) transparent transparent transparent;
638
- top: var(--tail-pos);
639
- left: -19px;
640
- transform: translateY(-50%) rotate(-90deg);
641
- z-index: 0;
642
  }
643
 
644
  .speech-bubble.thought { background: white; border: 2px dashed #555; color: #333; border-radius: 50%; }
 
543
  .speech-bubble.selected { outline: 2px dashed #4CAF50; }
544
  .speech-bubble textarea { position: absolute; top: 0; left: 0; width: 100%; height: 100%; box-sizing: border-box; border: 1px solid #4CAF50; background: rgba(255,255,255,0.95); font: inherit; text-align: center; resize: none; padding: 8px; z-index: 102; }
545
 
546
+ /* <<< FIXED BUBBLE CSS: ROBUST DIRECTIONAL TAILS >>> */
547
  .speech-bubble.speech {
548
  background: var(--bubble-fill-color, white);
549
  color: var(--bubble-text-color, #333);
550
  border: 2px solid var(--bubble-border-color, #333);
551
  border-radius: 10px;
552
  padding: 0;
553
+ --tail-pos: 50%; /* Default centered */
554
  }
555
 
556
  .speech-bubble.speech:after, .speech-bubble.speech:before {
 
 
 
 
557
  pointer-events: none;
558
  }
559
 
560
  /* BOTTOM TAIL */
561
  .speech-bubble.speech.tail-bottom:after {
562
+ content: ''; position: absolute; width: 0; height: 0;
563
+ border: 15px solid transparent;
564
+ border-top-color: var(--bubble-fill-color, white);
565
+ border-bottom: 0;
566
+ bottom: -15px; left: var(--tail-pos);
567
  transform: translateX(-50%);
568
+ z-index: 2;
569
  }
570
  .speech-bubble.speech.tail-bottom:before {
571
+ content: ''; position: absolute; width: 0; height: 0;
572
+ border: 17px solid transparent;
573
+ border-top-color: var(--bubble-border-color, #333);
574
+ border-bottom: 0;
575
+ bottom: -19px; left: var(--tail-pos);
576
  transform: translateX(-50%);
577
+ z-index: 1;
578
  }
579
 
580
  /* TOP TAIL */
581
  .speech-bubble.speech.tail-top:after {
582
+ content: ''; position: absolute; width: 0; height: 0;
583
+ border: 15px solid transparent;
584
+ border-bottom-color: var(--bubble-fill-color, white);
585
+ border-top: 0;
586
+ top: -15px; left: var(--tail-pos);
587
+ transform: translateX(-50%);
588
+ z-index: 2;
589
  }
590
  .speech-bubble.speech.tail-top:before {
591
+ content: ''; position: absolute; width: 0; height: 0;
592
+ border: 17px solid transparent;
593
+ border-bottom-color: var(--bubble-border-color, #333);
594
+ border-top: 0;
595
+ top: -19px; left: var(--tail-pos);
596
+ transform: translateX(-50%);
597
+ z-index: 1;
598
  }
599
 
600
  /* RIGHT TAIL */
601
  .speech-bubble.speech.tail-right:after {
602
+ content: ''; position: absolute; width: 0; height: 0;
603
+ border: 15px solid transparent;
604
+ border-left-color: var(--bubble-fill-color, white);
605
+ border-right: 0;
606
+ right: -15px; top: var(--tail-pos);
607
+ transform: translateY(-50%);
608
+ z-index: 2;
609
  }
610
  .speech-bubble.speech.tail-right:before {
611
+ content: ''; position: absolute; width: 0; height: 0;
612
+ border: 17px solid transparent;
613
+ border-left-color: var(--bubble-border-color, #333);
614
+ border-right: 0;
615
+ right: -19px; top: var(--tail-pos);
616
+ transform: translateY(-50%);
617
+ z-index: 1;
618
  }
619
 
620
  /* LEFT TAIL */
621
  .speech-bubble.speech.tail-left:after {
622
+ content: ''; position: absolute; width: 0; height: 0;
623
+ border: 15px solid transparent;
624
+ border-right-color: var(--bubble-fill-color, white);
625
+ border-left: 0;
626
+ left: -15px; top: var(--tail-pos);
627
+ transform: translateY(-50%);
628
+ z-index: 2;
629
  }
630
  .speech-bubble.speech.tail-left:before {
631
+ content: ''; position: absolute; width: 0; height: 0;
632
+ border: 17px solid transparent;
633
+ border-right-color: var(--bubble-border-color, #333);
634
+ border-left: 0;
635
+ left: -19px; top: var(--tail-pos);
636
+ transform: translateY(-50%);
637
+ z-index: 1;
638
  }
639
 
640
  .speech-bubble.thought { background: white; border: 2px dashed #555; color: #333; border-radius: 50%; }