chaurAr commited on
Commit
de181d4
Β·
verified Β·
1 Parent(s): 263c041

Update index.html

Browse files
Files changed (1) hide show
  1. index.html +66 -55
index.html CHANGED
@@ -207,48 +207,6 @@
207
  white-space: nowrap;
208
  }
209
 
210
- /* Option / radio groups */
211
- .option-group {
212
- margin-bottom: 1.25rem;
213
- }
214
-
215
- .option-label {
216
- font-size: 0.9rem;
217
- font-weight: 500;
218
- color: #374151;
219
- margin-bottom: 0.6rem;
220
- }
221
-
222
- .option-group label {
223
- display: flex;
224
- align-items: center;
225
- gap: 0.6rem;
226
- padding: 0.55rem 0.75rem;
227
- border: 1.5px solid #e5e7eb;
228
- border-radius: 8px;
229
- cursor: pointer;
230
- font-size: 0.9rem;
231
- font-weight: 400;
232
- color: #374151;
233
- margin-bottom: 0.4rem;
234
- transition:
235
- border-color 0.15s,
236
- background 0.15s;
237
- }
238
-
239
- .option-group label:hover {
240
- border-color: #a78bfa;
241
- background: #faf5ff;
242
- }
243
-
244
- .option-group input[type="radio"] {
245
- accent-color: #7c3aed;
246
- width: 1rem;
247
- height: 1rem;
248
- flex-shrink: 0;
249
- margin: 0;
250
- }
251
-
252
  /* ── Action row ───────────────────────────────────── */
253
  .action-row {
254
  margin-top: 1.75rem;
@@ -407,6 +365,48 @@
407
  cursor: pointer;
408
  }
409
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
410
  /* ── Disclaimer ──────────────────────────────────── */
411
  .disclaimer-section {
412
  padding-bottom: 1.5rem;
@@ -787,10 +787,9 @@
787
  if (!input) return;
788
  input.value = audioUrl;
789
  input.disabled = true;
790
- input.title = audioUrl;
791
  const label = input.previousElementSibling;
792
- if (label?.tagName === "LABEL")
793
- label.style.cssText = "color:#9ca3af;font-size:0.8rem;";
794
  });
795
  }
796
 
@@ -821,7 +820,7 @@
821
  (r, index) => {
822
  let rowLabel = r.label;
823
  // Add named entity to the 4th row (index 3)
824
- if (index === 3 && namedEntity) {
825
  rowLabel += ` <em>"<strong style="color:#6b7280;">${namedEntity}</strong>"</em>?`;
826
  }
827
  return `
@@ -887,7 +886,7 @@
887
  </button>
888
  </div>
889
  <div class="form-footer">
890
- Powered by <a href="https://formstr.app/" target="_blank" rel="noopener">form*</a>
891
  </div>
892
  `;
893
 
@@ -930,17 +929,29 @@
930
  // Inject custom grid fields in their correct fieldOrder positions.
931
  // The SDK rendered them as empty strings; find their placeholders and replace.
932
  const extras = formDef._rawFieldExtras ?? {};
 
 
 
 
 
 
933
  Object.entries(extras).forEach(([fieldId, raw]) => {
934
- // The SDK emits nothing for unknown types, so we append grids into the
935
- // last form-section (the default section that holds all fields).
936
- const formBody = document.querySelector(
937
- `#form-${formDef.id} .form-body`,
938
- );
939
- if (!formBody) return;
940
  const namedEntity = getNamedEntity();
941
- const gridHtml = renderGridField(fieldId, raw, namedEntity);
942
- formBody.insertAdjacentHTML("beforeend", gridHtml);
943
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
944
 
945
  document
946
  .getElementById("next-btn")
 
207
  white-space: nowrap;
208
  }
209
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  /* ── Action row ───────────────────────────────────── */
211
  .action-row {
212
  margin-top: 1.75rem;
 
365
  cursor: pointer;
366
  }
367
 
368
+ /* Option / radio groups */
369
+ .option-group {
370
+ margin-bottom: 1.25rem;
371
+ }
372
+
373
+ .option-label {
374
+ font-size: 0.9rem;
375
+ font-weight: 500;
376
+ color: #374151;
377
+ margin-bottom: 0.6rem;
378
+ }
379
+
380
+ .option-group label {
381
+ display: flex;
382
+ align-items: center;
383
+ gap: 0.6rem;
384
+ padding: 0.55rem 0.75rem;
385
+ border: 1.5px solid #e5e7eb;
386
+ border-radius: 8px;
387
+ cursor: pointer;
388
+ font-size: 0.9rem;
389
+ font-weight: 400;
390
+ color: #374151;
391
+ margin-bottom: 0.4rem;
392
+ transition:
393
+ border-color 0.15s,
394
+ background 0.15s;
395
+ }
396
+
397
+ .option-group label:hover {
398
+ border-color: #a78bfa;
399
+ background: #faf5ff;
400
+ }
401
+
402
+ .option-group input[type="radio"] {
403
+ accent-color: #7c3aed;
404
+ width: 1rem;
405
+ height: 1rem;
406
+ flex-shrink: 0;
407
+ margin: 0;
408
+ }
409
+
410
  /* ── Disclaimer ──────────────────────────────────── */
411
  .disclaimer-section {
412
  padding-bottom: 1.5rem;
 
787
  if (!input) return;
788
  input.value = audioUrl;
789
  input.disabled = true;
790
+ input.type = "hidden";
791
  const label = input.previousElementSibling;
792
+ if (label?.tagName === "LABEL") label.style.display = "none";
 
793
  });
794
  }
795
 
 
820
  (r, index) => {
821
  let rowLabel = r.label;
822
  // Add named entity to the 4th row (index 3)
823
+ if (index === 2 && namedEntity) {
824
  rowLabel += ` <em>"<strong style="color:#6b7280;">${namedEntity}</strong>"</em>?`;
825
  }
826
  return `
 
886
  </button>
887
  </div>
888
  <div class="form-footer">
889
+ Powered by <a href="https://about.formstr.app/" target="_blank" rel="noopener">form*</a>
890
  </div>
891
  `;
892
 
 
929
  // Inject custom grid fields in their correct fieldOrder positions.
930
  // The SDK rendered them as empty strings; find their placeholders and replace.
931
  const extras = formDef._rawFieldExtras ?? {};
932
+ const formBody = document.querySelector(
933
+ `#form-${formDef.id} .form-body`,
934
+ );
935
+
936
+ // First, collect all grid field HTML
937
+ let gridFieldsHtml = '';
938
  Object.entries(extras).forEach(([fieldId, raw]) => {
 
 
 
 
 
 
939
  const namedEntity = getNamedEntity();
940
+ gridFieldsHtml += renderGridField(fieldId, raw, namedEntity);
 
941
  });
942
+
943
+ // Find all option-group elements and move them after grid fields
944
+ if (formBody) {
945
+ const optionGroups = formBody.querySelectorAll('.option-group');
946
+ const optionGroupsArray = Array.from(optionGroups);
947
+
948
+ // Remove option-groups from their current position
949
+ optionGroupsArray.forEach(og => og.remove());
950
+
951
+ // Insert grid fields first, then option-groups
952
+ formBody.insertAdjacentHTML("beforeend", gridFieldsHtml);
953
+ optionGroupsArray.forEach(og => formBody.appendChild(og));
954
+ }
955
 
956
  document
957
  .getElementById("next-btn")