Codex Claude Sonnet 4.6 commited on
Commit
e49e280
Β·
1 Parent(s): 9ff3a4b

Move book pages below audio: audio always visible first

Browse files

Audio player + download buttons stay in right column at eye level.
Illustrated storybook pages move to a full-width row below both columns,
so users see and use the narration before scrolling to the book pages.
Added a subtle scroll hint arrow between the two sections.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (1) hide show
  1. ui/layout.py +27 -13
ui/layout.py CHANGED
@@ -370,6 +370,12 @@ body, gradio-app {
370
  .book-empty { text-align: center; padding: 54px 24px; font-family: 'Gaegu', cursive; color: var(--ink-soft); }
371
  .book-empty .big { font-size: 30px; color: var(--ink); }
372
  .book-empty .arrow { font-size: 42px; display:block; margin-bottom: 8px; animation: bob 1.6s ease-in-out infinite; }
 
 
 
 
 
 
373
  @keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
374
  .engine-badge {
375
  display:inline-block; margin: 0 auto 4px; padding: 3px 12px;
@@ -552,10 +558,10 @@ def create_layout(load_sample_fn=None, create_book_fn=None):
552
  label="Try an example",
553
  )
554
 
555
- # OUTPUT CARD
556
  with gr.Column(scale=2, elem_classes=["output-card"]):
557
  audio_narration = gr.Audio(
558
- label="Listen to your story",
559
  autoplay=False,
560
  elem_classes=["audio-player"],
561
  )
@@ -566,17 +572,25 @@ def create_layout(load_sample_fn=None, create_book_fn=None):
566
  coloring_pdf_download = gr.DownloadButton(
567
  "⬇ Coloring PDF", visible=False, elem_classes=["btn-pdf"],
568
  )
569
- book_display = gr.HTML(
570
- elem_classes=["book-stage"],
571
- value="""
572
- <div class="book-empty">
573
- <span class="arrow">↑</span>
574
- <p class="big">Your storybook appears here</p>
575
- <p>Add a drawing, pick a theme, and tap <b>Make my book!</b></p>
576
- </div>
577
- """,
578
- )
579
- coloring_display = gr.HTML(visible=False, elem_classes=["book-stage"])
 
 
 
 
 
 
 
 
580
 
581
  # Behind the magic accordion
582
  with gr.Accordion("Behind the magic ✨", open=False, elem_classes=["behind-magic"]):
 
370
  .book-empty { text-align: center; padding: 54px 24px; font-family: 'Gaegu', cursive; color: var(--ink-soft); }
371
  .book-empty .big { font-size: 30px; color: var(--ink); }
372
  .book-empty .arrow { font-size: 42px; display:block; margin-bottom: 8px; animation: bob 1.6s ease-in-out infinite; }
373
+ .book-scroll-hint {
374
+ display: flex; align-items: center; justify-content: center; gap: 8px;
375
+ padding: 14px 0 4px; font-family: 'Caveat', cursive; font-size: 20px;
376
+ color: var(--ink-soft); opacity: 0.7;
377
+ }
378
+ .book-scroll-hint .hint-arrow { font-size: 26px; animation: bob 1.8s ease-in-out infinite; }
379
  @keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-7px) } }
380
  .engine-badge {
381
  display:inline-block; margin: 0 auto 4px; padding: 3px 12px;
 
558
  label="Try an example",
559
  )
560
 
561
+ # AUDIO + DOWNLOADS β€” right column, always at eye level
562
  with gr.Column(scale=2, elem_classes=["output-card"]):
563
  audio_narration = gr.Audio(
564
+ label="🎧 Listen to your story",
565
  autoplay=False,
566
  elem_classes=["audio-player"],
567
  )
 
572
  coloring_pdf_download = gr.DownloadButton(
573
  "⬇ Coloring PDF", visible=False, elem_classes=["btn-pdf"],
574
  )
575
+ gr.HTML("""
576
+ <div class="book-scroll-hint">
577
+ <span class="hint-arrow">↓</span>
578
+ <span>Your illustrated storybook appears below</span>
579
+ </div>
580
+ """)
581
+
582
+ # STORYBOOK PAGES β€” full width below both columns so audio is seen first
583
+ book_display = gr.HTML(
584
+ elem_classes=["book-stage"],
585
+ value="""
586
+ <div class="book-empty">
587
+ <span class="arrow">↑</span>
588
+ <p class="big">Your storybook appears here</p>
589
+ <p>Add a drawing, pick a theme, and tap <b>Make my book!</b></p>
590
+ </div>
591
+ """,
592
+ )
593
+ coloring_display = gr.HTML(visible=False, elem_classes=["book-stage"])
594
 
595
  # Behind the magic accordion
596
  with gr.Accordion("Behind the magic ✨", open=False, elem_classes=["behind-magic"]):