drakosfire commited on
Commit
7e57aff
1 Parent(s): 426ac10

add css for image-textarea and generate-image-button to set display:none when in page-container, updated block_builder.py and template_update.html to include image-textarea

Browse files
Files changed (3) hide show
  1. block_builder.py +2 -2
  2. storeUI.css +35 -0
  3. template_update.html +1 -1
block_builder.py CHANGED
@@ -163,8 +163,8 @@ def build_title_block(title,description,backstory,reputation):
163
  def build_image_block(sd_prompt, block_id):
164
  image_block_html = f"""
165
  <div class="block-item" data-block-id="{block_id}">
166
- <textarea class="string-action-description-textarea" id="user-storefront-prompt-{block_id}"
167
- hx-post="/update-stats" hx-trigger="change" hx-target="#user-sd-prompt" hx-swap="outerHTML"
168
  title="Storefront image description">{sd_prompt}</textarea>
169
  <button class="generate-image-button" data-block-id="{block_id}">Generate Image</button>
170
  <img id="generated-image-{block_id}" alt="" style="display: none; cursor: pointer;">
 
163
  def build_image_block(sd_prompt, block_id):
164
  image_block_html = f"""
165
  <div class="block-item" data-block-id="{block_id}">
166
+ <textarea class="image-textarea" id="sdprompt-{block_id}"
167
+ hx-post="/update-stats" hx-trigger="change" hx-target="#sd-prompt-{block_id}" hx-swap="outerHTML"
168
  title="Storefront image description">{sd_prompt}</textarea>
169
  <button class="generate-image-button" data-block-id="{block_id}">Generate Image</button>
170
  <img id="generated-image-{block_id}" alt="" style="display: none; cursor: pointer;">
storeUI.css CHANGED
@@ -470,6 +470,41 @@
470
  resize: none; /* Prevents the textarea from being manually resizable */
471
  overflow: hidden; /* Hide scrollbars */
472
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
473
 
474
  .block.monster.frame.wide {
475
  column-count: inherit;
 
470
  resize: none; /* Prevents the textarea from being manually resizable */
471
  overflow: hidden; /* Hide scrollbars */
472
  }
473
+
474
+ .image-textarea {
475
+ width: 100%;
476
+ height: 16px;
477
+ font-size: 14px;
478
+ font-weight: 400;
479
+ line-height: 16px;
480
+ margin-bottom: 0;
481
+ box-sizing: border-box;
482
+ border: 0;
483
+ font-family: "ScalySansRemake";
484
+ vertical-align: baseline;
485
+ margin: 0;
486
+ padding: 0;
487
+ overflow-wrap: break-word;
488
+ text-rendering: optimizeLegibility;
489
+ background: none;
490
+ resize: none; /* Prevents the textarea from being manually resizable */
491
+ overflow: hidden; /* Hide scrollbars */
492
+ }
493
+
494
+ .page-container .image-textarea {
495
+ display: none; /* Hidden by default when in .page-container */
496
+ }
497
+
498
+ .page-container .block-content:hover .image-textarea {
499
+ display: block; /* Show when hovering over .block-content */
500
+ }
501
+ .page-container .generate-image-button {
502
+ display: none; /* Hidden by default when in .page-container */
503
+ }
504
+
505
+ .page-container .block-content:hover .generate-image-button {
506
+ display: inline-block; /* Show the button on hover */
507
+ }
508
 
509
  .block.monster.frame.wide {
510
  column-count: inherit;
template_update.html CHANGED
@@ -9,7 +9,7 @@
9
  </div>
10
 
11
  <div class="block-item" data-block-id="1" data-page-id="block-container" draggable="true">
12
- <textarea class="string-action-description-textarea" id="user-storefront-prompt-1" hx-post="/update-stats" hx-trigger="change" hx-target="#user-sd-prompt" hx-swap="outerHTML" title="Storefront image description" style="height: 80px;">A highly detailed fantasy painting of a curious sentient potted plant in a vibrant gear shop. The plant has phosphorescent leaves and delicate, intricate roots. The shop is filled with glowing flora, magical tools, and adventure gear. The background shows enchanted trees intertwined with the walls and ceiling.</textarea>
13
  <button class="generate-image-button" data-block-id="1">Generate Image</button>
14
  <img id="generated-image-1" alt="" style="display: none; cursor: pointer;">
15
  </div>
 
9
  </div>
10
 
11
  <div class="block-item" data-block-id="1" data-page-id="block-container" draggable="true">
12
+ <textarea class="image-textarea" id="user-storefront-prompt-1" hx-post="/update-stats" hx-trigger="change" hx-target="#user-sd-prompt" hx-swap="outerHTML" title="Storefront image description" style="height: 80px;">A highly detailed fantasy painting of a curious sentient potted plant in a vibrant gear shop. The plant has phosphorescent leaves and delicate, intricate roots. The shop is filled with glowing flora, magical tools, and adventure gear. The background shows enchanted trees intertwined with the walls and ceiling.</textarea>
13
  <button class="generate-image-button" data-block-id="1">Generate Image</button>
14
  <img id="generated-image-1" alt="" style="display: none; cursor: pointer;">
15
  </div>