Spaces:
Sleeping
Sleeping
Commit ·
c591592
1
Parent(s): efecf31
Finished store properties table block, adjusted title textarea size
Browse files- block_builder.py +2 -0
- storeUI.html +12 -19
block_builder.py
CHANGED
|
@@ -11,6 +11,7 @@ def build_blocks(user_input, block_id):
|
|
| 11 |
block_id = block_id + 1
|
| 12 |
list_of_blocks.append(title_block)
|
| 13 |
store_image_block = build_image_block(user_input['storefront_sd_prompt'], block_id)
|
|
|
|
| 14 |
list_of_blocks.append(store_image_block)
|
| 15 |
store_properties_block = build_store_properties_block(store_type= user_input['store_type'],
|
| 16 |
store_size= user_input['store_size'],
|
|
@@ -23,6 +24,7 @@ def build_blocks(user_input, block_id):
|
|
| 23 |
store_reputation= user_input['store_reputation'],
|
| 24 |
store_rumors= user_input['store_rumors'],
|
| 25 |
block_id= block_id)
|
|
|
|
| 26 |
list_of_blocks.append(store_properties_block)
|
| 27 |
|
| 28 |
|
|
|
|
| 11 |
block_id = block_id + 1
|
| 12 |
list_of_blocks.append(title_block)
|
| 13 |
store_image_block = build_image_block(user_input['storefront_sd_prompt'], block_id)
|
| 14 |
+
block_id = block_id + 1
|
| 15 |
list_of_blocks.append(store_image_block)
|
| 16 |
store_properties_block = build_store_properties_block(store_type= user_input['store_type'],
|
| 17 |
store_size= user_input['store_size'],
|
|
|
|
| 24 |
store_reputation= user_input['store_reputation'],
|
| 25 |
store_rumors= user_input['store_rumors'],
|
| 26 |
block_id= block_id)
|
| 27 |
+
block_id = block_id + 1
|
| 28 |
list_of_blocks.append(store_properties_block)
|
| 29 |
|
| 30 |
|
storeUI.html
CHANGED
|
@@ -123,6 +123,10 @@
|
|
| 123 |
height: auto;
|
| 124 |
cursor: pointer;
|
| 125 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 126 |
|
| 127 |
/* Ensure the h1 tag is constrained within its column */
|
| 128 |
.block-content h1 {
|
|
@@ -248,6 +252,7 @@ input[type="text"]:focus, textarea:focus {
|
|
| 248 |
|
| 249 |
}
|
| 250 |
.title-textarea{
|
|
|
|
| 251 |
margin-bottom: .19cm;
|
| 252 |
column-span: all;
|
| 253 |
font-size: .89cm;
|
|
@@ -275,7 +280,7 @@ div[contenteditable="true"] p::first-letter {
|
|
| 275 |
float: left;
|
| 276 |
padding-bottom: 2px;
|
| 277 |
padding-left: 40px;
|
| 278 |
-
margin-top:
|
| 279 |
margin-bottom: -20px;
|
| 280 |
margin-left: -40px;
|
| 281 |
font-family: "SolberaImitationRemake";
|
|
@@ -875,6 +880,12 @@ div[contenteditable="true"] p::first-letter {
|
|
| 875 |
const originalPageId = e.dataTransfer.getData('data-page-id');
|
| 876 |
const innerHTML = e.dataTransfer.getData('text/plain');
|
| 877 |
console.log(`Drop event for block ID: ${blockId} from page ID: ${originalPageId}`);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 878 |
|
| 879 |
if (blockId && originalPageId) {
|
| 880 |
const originalBlock = document.querySelector(`[data-block-id="${blockId}"]`);
|
|
@@ -1120,24 +1131,6 @@ div[contenteditable="true"] p::first-letter {
|
|
| 1120 |
return document.querySelector(`[data-page-id="page-${nextPageId}"]`);
|
| 1121 |
}
|
| 1122 |
|
| 1123 |
-
|
| 1124 |
-
let blockCounter = 1;
|
| 1125 |
-
|
| 1126 |
-
function createNewBlock(pageId, content) {
|
| 1127 |
-
const newBlock = document.createElement('div');
|
| 1128 |
-
newBlock.classList.add('block-item');
|
| 1129 |
-
newBlock.setAttribute('data-block-id', `block-${blockCounter}`);
|
| 1130 |
-
newBlock.setAttribute('data-page-id', pageId);
|
| 1131 |
-
newBlock.innerHTML = content; // Add the content to the block
|
| 1132 |
-
|
| 1133 |
-
newBlock.setAttribute('draggable', true);
|
| 1134 |
-
newBlock.addEventListener('dragstart', handleDragStart);
|
| 1135 |
-
newBlock.addEventListener('dragend', handleDragEnd);
|
| 1136 |
-
|
| 1137 |
-
blockCounter++;
|
| 1138 |
-
return newBlock;
|
| 1139 |
-
}
|
| 1140 |
-
|
| 1141 |
function moveBlockToPage(block, newPageId) {
|
| 1142 |
block.setAttribute('data-page-id', newPageId);
|
| 1143 |
const newPage = document.querySelector(`[data-page-id="${newPageId}"] .block-container`);
|
|
|
|
| 123 |
height: auto;
|
| 124 |
cursor: pointer;
|
| 125 |
}
|
| 126 |
+
.page .classTable.frame{
|
| 127 |
+
margin-right:0.1cm;
|
| 128 |
+
margin-left: 0.1cm;
|
| 129 |
+
}
|
| 130 |
|
| 131 |
/* Ensure the h1 tag is constrained within its column */
|
| 132 |
.block-content h1 {
|
|
|
|
| 252 |
|
| 253 |
}
|
| 254 |
.title-textarea{
|
| 255 |
+
height:30px;
|
| 256 |
margin-bottom: .19cm;
|
| 257 |
column-span: all;
|
| 258 |
font-size: .89cm;
|
|
|
|
| 280 |
float: left;
|
| 281 |
padding-bottom: 2px;
|
| 282 |
padding-left: 40px;
|
| 283 |
+
margin-top: 0cm;
|
| 284 |
margin-bottom: -20px;
|
| 285 |
margin-left: -40px;
|
| 286 |
font-family: "SolberaImitationRemake";
|
|
|
|
| 880 |
const originalPageId = e.dataTransfer.getData('data-page-id');
|
| 881 |
const innerHTML = e.dataTransfer.getData('text/plain');
|
| 882 |
console.log(`Drop event for block ID: ${blockId} from page ID: ${originalPageId}`);
|
| 883 |
+
|
| 884 |
+
// Ensure we are not dropping into a textarea or another block
|
| 885 |
+
if (event.target.classList.contains('block-item', 'block-content') || event.target.tagName === 'TEXTAREA') {
|
| 886 |
+
console.log('Cannot drop block inside another block or textarea');
|
| 887 |
+
return;
|
| 888 |
+
}
|
| 889 |
|
| 890 |
if (blockId && originalPageId) {
|
| 891 |
const originalBlock = document.querySelector(`[data-block-id="${blockId}"]`);
|
|
|
|
| 1131 |
return document.querySelector(`[data-page-id="page-${nextPageId}"]`);
|
| 1132 |
}
|
| 1133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1134 |
function moveBlockToPage(block, newPageId) {
|
| 1135 |
block.setAttribute('data-page-id', newPageId);
|
| 1136 |
const newPage = document.querySelector(`[data-page-id="${newPageId}"] .block-container`);
|