File size: 32,758 Bytes
d5fb696
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="./dependencies/all.css" rel="stylesheet" />
    <link href="./dependencies/css.css?family=Open+Sans:400,300,600,700" rel="stylesheet" type="text/css" />
    <link href='./dependencies/bundle.css' rel='stylesheet' />
    <link href="./dependencies/style.css" rel='stylesheet' />
    <link href="./dependencies/5ePHBstyle.css" rel='stylesheet' />
    <title>Template</title>
    <link rel="stylesheet" href="styles.css">
    <script src="https://unpkg.com/[email protected]/dist/htmx.min.js"></script>
</head>
<style>
    :root {
  --HB_Color_Background: #EEE5CE;
  --HB_Color_Accent: #E0E5C1;
  --HB_Color_HeaderUnderline: #C0AD6A;
  --HB_Color_HorizontalRule: #9C2B1B;
  --HB_Color_HeaderText: #58180D;
  --HB_Color_MonsterStatBackground: #F2E5B5;
  --HB_Color_CaptionText: #766649;
  --HB_Color_WatercolorStain: #BBAD82;
  --HB_Color_Footnotes: #C9AD6A;
    }
    input[type="text"], textarea {
    width: auto;
    padding: 8px;
    margin: 5px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    background-color: #f9f9f9;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}
.grid-container {
            display: grid;
            grid-template-columns: 1fr 3fr; /* Two columns with the second column being three times as wide */
            grid-gap: 20px;
            padding: 20px;
            height: 100vh;
        }
        .block-container {
            display: flex;
            flex-direction: column;
            gap: 20px;
            overflow-y: auto;
            border-right: 1px solid #ccc;
            padding-right: 20px;
        }
        .block-item {
            border: 1px solid #ccc;
            border-radius: 8px;
            background-color: #f9f9f9;
            padding: 15px;
            box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
            transition: transform 0.3s;
        }
        .block-item:hover {
            transform: translateY(-5px);
        }
.page .monster hr:last-of-type + * {
  margin-top: .1cm;
}
.page * + h4 {
  margin-top: .1cm;
}
.page h4 + * {
  margin-top: .1cm;
}
.page dl + * {
  margin-top: .1cm;
}
.page p + * {
    margin-top: .1cm;
}
.columnWrapper {
    column-gap: inherit;
    max-height: 100%;
    column-span: all;
    columns: inherit;
    height: 100%; /* Ensure it takes full height of the parent */
    box-sizing: border-box; /* Ensures padding and border are included in the element's total width and height */
}
input[type="text"]:focus, textarea:focus {
    background-color: #e9e9e9;
    border-color: #aaa;
    outline: none;
}

/* Specific styles for different textboxes */

.user-description-textarea {
    width: 400px;
    height: 40px; /* Adjust as needed for 3 lines */
    resize: vertical;
    background: none;
    font-family: "ScalySansRemake";
    font-weight: 800;
    
}
/* Focus styles for description textbox */
.user-description-textarea:focus {
    background-color: #e9e9e9;
    border-color: #aaa;
    outline: none;
}

.heading-textarea {
    width: 100%;
    font-size: .458cm; /* Matches the font size of an h4 heading */
    line-height: .7em;
    font-weight: 800;
    border: none;
    background: none;
    margin: 0;
    padding: 0;
    resize: none; /* Prevents the textarea from being resizable */
    overflow: hidden; /* Prevents scrollbars */
    outline: none; /* Removes the focus outline */
    font-family: "MrEavesRemake"; /* Ensures font family is inherited */
    color: var(--HB_Color_HeaderText)
}
.properties-textarea {
    width: 100%;
    font-size: 12px;
    font-weight: 400;
    line-height: .7em;
    margin-bottom: 0;
    font-style: italic;
    box-sizing: border-box;
    border: 0;
    font-family: "ScalySansRemake";
    vertical-align: baseline;
    margin: 0;
    padding: 0;
    overflow-wrap: break-word;
    text-rendering: optimizeLegibility;
    background: none;
    resize: none; /* Prevents the textarea from being resizable */

}

.description-textarea {
    width: 100%;
    height: 125px; 
    font-size: .318cm;
    font-weight: 400;
    line-height: .9em;
    margin-bottom: 0;
    font-style: italic;
    box-sizing: border-box;
    border: 0;
    font-family: "ScalySansSmallCapsRemake";
    vertical-align: baseline;
    margin: 0;
    padding: 0;
    overflow-wrap: break-word;
    text-rendering: optimizeLegibility;
    background: none;
    resize: none; /* Prevents the textarea from being manually resizable */
    overflow: hidden; /* Hide scrollbars */
}

.red-integer-stat-textarea {
    width: 20px;
    height:13px;
    font-size: .318cm;
    font-weight: 400;
    line-height: 1.2em;
    margin-bottom: 0;
    font-style: italic;
    box-sizing: border-box;
    border: 0;
    font-family: "ScalySansSmallCapsRemake";
    vertical-align: baseline;
    margin: 0;
    padding: 0;
    overflow-wrap: break-word;
    text-rendering: optimizeLegibility;
    background: none;
    resize: none; /* Prevents the textarea from being manually resizable */
    overflow: hidden; /* Hide scrollbars */
    color: var(--HB_Color_HeaderText);
    white-space: pre-line;
}

.integer-stat-textarea {
    width: 20px;
    height:13px;
    font-size: .318cm;
    font-weight: 400;
    line-height: 1.2em;
    margin-bottom: 0;
    font-style: italic;
    box-sizing: border-box;
    border: 0;
    font-family: "ScalySansRemake";
    vertical-align: baseline;
    margin: 0;
    padding: 0;
    overflow-wrap: break-word;
    text-rendering: optimizeLegibility;
    background: none;
    resize: none; /* Prevents the textarea from being manually resizable */
    overflow: hidden; /* Hide scrollbars */
    white-space: pre-line;
}

.string-stat-textarea {
    width: 200px;
    height:13px;
    font-size: .318cm;
    font-weight: 400;
    line-height: 1.2em;
    margin-bottom: 0;
    font-style: italic;
    box-sizing: border-box;
    border: 0;
    font-family: "ScalySansRemake";
    vertical-align: baseline;
    margin: 0;
    padding: 0;
    overflow-wrap: break-word;
    text-rendering: optimizeLegibility;
    background: none;
    resize: none; /* Prevents the textarea from being manually resizable */
    overflow: hidden; /* Hide scrollbars */
    white-space: pre-wrap;
}

.string-action-name-textarea {
    width: 100%;
    height:13px;
    font-size: .318cm;
    font-style: italic;
    font-weight: bold;
    line-height: 1.2em;
    margin-bottom: 0;
    font-style: italic;
    box-sizing: border-box;
    border: 0;
    font-family: "ScalySansRemake";
    vertical-align: baseline;
    margin: 0;
    padding: 0;
    overflow-wrap: break-word;
    text-rendering: optimizeLegibility;
    background: none;
    resize: none; /* Prevents the textarea from being manually resizable */
    overflow: hidden; /* Hide scrollbars */
    
}

.string-action-description-textarea {
    width: 100%;
    height:30px;
    font-size: .318cm;
    font-weight: 400;
    line-height: 1.2em;
    margin-bottom: 0;
    box-sizing: border-box;
    border: 0;
    font-family: "ScalySansRemake";
    vertical-align: baseline;
    margin: 0;
    padding: 0;
    overflow-wrap: break-word;
    text-rendering: optimizeLegibility;
    background: none;
    resize: none; /* Prevents the textarea from being manually resizable */
    overflow: hidden; /* Hide scrollbars */
    white-space: pre-wrap;

    
}

.name-textbox {
    width: 50px;
    font-size: 1.5em;
    padding: 10px;
}

.stat-textbox {
    width: 50px;
    text-align: center;
    font-size: 1em;
    padding: 5px;
}
</style>
<body>
    <div class="brewRenderer">
        <div class="pages">
            <div class="page" id="p1" key="0">
                <div class="columnWrapper">
                    <div class="block monster frame wide">
                        <div class="Block_1">
                            <textarea class="heading-textarea" id="user-monster-name" hx-post="/update-stats" hx-trigger="change" hx-target="#user-monster-name" hx-swap="outerHTML" title=" Name of creature">Ebony, the Twisted Fairy</textarea>
                        </div>
                        <div class="Block_2">
                            <p>
                                <textarea class="properties-textarea" id="user-monster-properties" hx-post="/update-stats" hx-trigger="change" 
                            hx-target="#user-monster-properties" hx-swap="outerHTML" title=" Size, Type, Alignment">Tiny, Fey, Chaotic Evil</textarea>
                            </p> 
                        </div>
                        <div class="Block_3">
                            <p>
                                <img class="monster-image" id="monster-image" style="width:300px; height:300px; mix-blend-mode:multiply; border:3px solid black;" 
                                src="Ebony,%20the%20Twisted%20Fairy_files/out.png" alt="image" 
                                hx-get="/get-new-image" hx-trigger="load" hx-target="#monster-image" hx-swap="outerHTML">
                            </p>
                        </div>
                        <div class="Block_4">
                            <div class="block descriptive">
                                <textarea class="description-textarea" id="user-monster-description" hx-post="/update-stats" hx-trigger="change" 
                                hx-target="#user-monster-description" hx-swap="outerHTML" title="Any amount or style of description">Once a cheerful and benign spirit of the forest, Ebony has been corrupted by dark magic, transforming her into a sinister force of malevolence. Despite her tiny stature, her powers have grown exponentially. Her once fairy-like aura now radiates dread, and she is capable of casting deadly spells that can reduce any foe to dust. Ebony delights in tormenting the innocent and disrupting the natural balance of the world.</textarea></h5>
                            </div>
                        </div>  
                        <div class="Block_5"><hr>
                            <dl><strong>Armor Class : </strong><textarea class="integer-stat-textarea" id="user-monster-armor-class" hx-post="/update-stats" hx-trigger="change" 
                                    hx-target="#user-monster-armor-class" hx-swap="outerHTML" title="Integer">14</textarea>
                                <strong>Hit Points : </strong><textarea class="integer-stat-textarea" id="user-monster-hit-points" hx-post="/update-stats" hx-trigger="change" 
                                    hx-target="#user-monster-hit-points" hx-swap="outerHTML" title="Integer">75</textarea>
                                <strong>Speed : </strong> Walk: <textarea class="integer-stat-textarea" id="user-monster-speed-walk" hx-post="/update-stats" hx-trigger="change" 
                                    hx-target="#user-monster-speed" hx-swap="outerHTML" title="Integer">10</textarea> Fly :<textarea class="integer-stat-textarea" id="user-monster-speed-fly" hx-post="/update-stats" hx-trigger="change" 
                                    hx-target="#user-monster-speed" hx-swap="outerHTML" title="Integer">60</textarea>
                            </dl>
                            </div>   
                        <div class="Block_6"><hr>
                            <table>
                                <thead>
                                    <tr>
                                        <th align="center">STR</th>
                                        <th align="center">DEX</th>
                                        <th align="center">CON</th>
                                        <th align="center">INT</th>
                                        <th align="center">WIS</th>
                                        <th align="center">CHA</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <tr>
                                        <td align="center"><textarea class="red-integer-stat-textarea" id="user-monster-strength" hx-post="/update-stats" hx-trigger="change" 
                                            hx-target="#user-monster-strength" hx-swap="outerHTML" title="Integer">5</textarea></td>
                                        <td align="center"><textarea class="red-integer-stat-textarea" id="user-monster-dexterity" hx-post="/update-stats" hx-trigger="change" 
                                            hx-target="#user-monster-dexterity" hx-swap="outerHTML" title="Integer">18</textarea></td>
                                        <td align="center"><textarea class="red-integer-stat-textarea" id="user-monster-constitution" hx-post="/update-stats" hx-trigger="change" 
                                            hx-target="#user-monster-constitution" hx-swap="outerHTML" title="Integer">14</textarea></td>
                                        <td align="center"><textarea class="red-integer-stat-textarea" id="user-monster-intellgience" hx-post="/update-stats" hx-trigger="change" 
                                            hx-target="#user-monster-intelligence" hx-swap="outerHTML" title="Integer">16</textarea></td>
                                        <td align="center"><textarea class="red-integer-stat-textarea" id="user-monster-wisdom" hx-post="/update-stats" hx-trigger="change" 
                                            hx-target="#user-monster-wisdom" hx-swap="outerHTML" title="Integer">12</textarea></td>
                                        <td align="center"><textarea class="red-integer-stat-textarea" id="user-monster-charisma" hx-post="/update-stats" hx-trigger="change" 
                                            hx-target="#user-monster-charisma" hx-swap="outerHTML" title="Integer">20</textarea></td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                        <div class="Block_7">
                            <hr>
                            <strong>Saving Throws</strong> 
                            <textarea class="string-stat-textarea" id="user-monster-saves" hx-post="/update-stats" hx-trigger="change" 
                            hx-target="#user-monster-saves" hx-swap="outerHTML" title="[Stat colon integer 2x space] STR: 2  DEX: 7">STR: 2   DEX: 7   WIS: 5</textarea> 
                            <br><strong>Resistances :</strong> <textarea class="string-stat-textarea" id="user-monster-wis-save" hx-post="/update-stats" hx-trigger="change" 
                            hx-target="#user-monster-wis-save" hx-swap="outerHTML" title="Integer">None</textarea> 
                            <br><strong>Senses :</strong><textarea class="string-stat-textarea" id="user-monster-senses" hx-post="/update-stats" hx-trigger="change" 
                            hx-target="#user-monster-senses" hx-swap="outerHTML" title="[Sense colon integer] Darkvision: 60">Darkvision: 60</textarea> 
                            <br><strong>Languages :</strong><textarea class="string-stat-textarea" id="user-monster-languages" hx-post="/update-stats" hx-trigger="change" 
                            hx-target="#user-monster-languages" hx-swap="outerHTML" title="[language comma space] Common, Sylvan">Common, Sylvan</textarea> 
                            <br><strong>Challenge Rating :</strong><textarea class="string-stat-textarea" id="user-monster-languages" hx-post="/update-stats" hx-trigger="change" 
                            hx-target="#user-monster-cr" hx-swap="outerHTML" title="[CR space parenthesis XP parenthesis] 6 (2300)">6 (2300)</textarea>   
                        </div> 
                        <div class="Block_8">
                            <hr>
                            <h4 id="actions">Actions</h4>                        
                            <strong>
                                <textarea class="string-action-name-textarea" 
                                id="user-monster-action_name_1" 
                                hx-post="/update-stats" 
                                hx-trigger="change" 
                                hx-target="#user-monster-action_name_1" 
                                hx-swap="outerHTML" 
                                title="[Action Name colon] Fairy Bolt:">Fairy Bolt: </textarea> 
                            </strong>
                                <textarea class="string-action-description-textarea"
                                    id="user-monster-action_details_1" 
                                    hx-post="/update-stats" 
                                    hx-trigger="change" 
                                    hx-target="#user-monster-action_details_1" 
                                    hx-swap="outerHTML" 
                                    title="[Action Type colon to hit bonus comma range comma number of targets space Hit colon damage parenthesis damage dice parenthesis damage type] Ranged Spell Attack: +7 to hit, range 60 ft., one target. Hit: 21 (3d10 + 4) radiant damage.">Ranged Spell Attack: +7 to hit, range 60 ft., one target. Hit: 21 (3d10 + 4) radiant damage.</textarea>      
                            <strong>
                                <textarea class="string-action-name-textarea" 
                                    id="user-monster-action_name_2" 
                                    hx-post="/update-stats" hx-trigger="change" 
                                    hx-target="#user-monster-action_name_2" 
                                    hx-swap="outerHTML" 
                                    title="[Action Name colon] Fairy Bolt:">Poison Dust: </textarea> 
                            </strong>
                            <textarea class="string-action-description-textarea"
                                id="user-monster-action_details_1" 
                                hx-post="/update-stats" 
                                hx-trigger="change" 
                                hx-target="#user-monster-action_details_1" 
                                hx-swap="outerHTML" 
                                title="[Action Type colon to hit bonus comma range comma number of targets space Hit colon damage parenthesis damage dice parenthesis damage type] Ranged Spell Attack: +7 to hit, range 60 ft., one target. Hit: 21 (3d10 + 4) radiant damage.">Ebony releases a cloud of toxic dust in a 10-foot radius. Each creature within the area must succeed on a DC 15 Constitution saving throw or take 15 (3d8) poison damage and become poisoned for 1 minute. The poisoned creature can repeat the saving throw at the end of each of its turns, ending the effect on itself on a success.</textarea>   
                        </div>                     
                        <div class="Block_9">
                            <h4 id="cantrips">Cantrips</h4>
                            <strong>
                                <textarea class="string-action-name-textarea" 
                                    id="user-monster-action_name_2" 
                                    hx-post="/update-stats" hx-trigger="change" 
                                    hx-target="#user-monster-action_name_2" 
                                    hx-swap="outerHTML" 
                                    title="[Action Name colon] Fairy Bolt:">Eldritch Blast: </textarea> 
                            </strong>
                            <textarea class="string-action-description-textarea"
                                id="user-monster-action_details_1" 
                                hx-post="/update-stats" 
                                hx-trigger="change" 
                                hx-target="#user-monster-action_details_1" 
                                hx-swap="outerHTML" 
                                title="[Action description range mechanics effect] Ranged Spell Attack: +7 to hit, range 60 ft., one target. Hit: 21 (3d10 + 4) radiant damage.">A beam of crackling energy streaks toward a creature within range. Make a ranged spell attack against the target. On a hit, the target takes 1d10 force damage.</textarea>
                        </div>                     
                        <div class="Block_10">
                            <h4 id="spell slots">Spell Slots</h4>
                        <dl><dt><em><strong>1st level</strong></em>:</dt><dd><textarea class="integer-stat-textarea" id="level-1-slots" hx-post="/update-stats" hx-trigger="change" 
                            hx-target="#user-monster-armor-class" hx-swap="outerHTML" title="Integer">4</textarea></dd></dl>
                            <dl><dt><em><strong>2nd level</strong></em>:</dt><dd><textarea class="integer-stat-textarea" id="level-2-slots" hx-post="/update-stats" hx-trigger="change" 
                                hx-target="#user-monster-armor-class" hx-swap="outerHTML" title="Integer">4</textarea></dd></dl>
                                <dl><dt><em><strong>3rd level</strong></em>:</dt><dd><textarea class="integer-stat-textarea" id="level-3-slots" hx-post="/update-stats" hx-trigger="change" 
                                    hx-target="#user-monster-armor-class" hx-swap="outerHTML" title="Integer">4</textarea></dd></dl>
                        <h4 id="known spells">Known Spells</h4>
                        <strong>
                            <textarea class="string-action-name-textarea" 
                                id="user-monster-action_name_2" 
                                hx-post="/update-stats" hx-trigger="change" 
                                hx-target="#user-monster-action_name_2" 
                                hx-swap="outerHTML" 
                                title="[Action Name colon] Fairy Bolt:">Charm Person: </textarea> 
                        </strong>
                        <textarea class="string-action-description-textarea"
                            id="user-monster-action_details_1" 
                            hx-post="/update-stats" 
                            hx-trigger="change" 
                            hx-target="#user-monster-action_details_1" 
                            hx-swap="outerHTML" 
                            title="[Level colon description range mechanics effect] Level: 2nd. A creature you touch becomes invisible until the spell ends. Anything the target is wearing or carrying is invisible as long as it is on the target's person..">Level: 1st. You attempt to charm a humanoid you can see within range. It must make a Wisdom saving throw, and does so with advantage if you or your companions are fighting it. If it fails the saving throw, it is charmed by you until the spell ends or until you or your companions do anything harmful to it.</textarea> 
                        <strong>
                            <textarea class="string-action-name-textarea" 
                                id="user-monster-action_name_2" 
                                hx-post="/update-stats" hx-trigger="change" 
                                hx-target="#user-monster-action_name_2" 
                                hx-swap="outerHTML" 
                                title="[Action Name colon] Fairy Bolt:">Invisibility: </textarea> 
                        </strong>
                        <textarea class="string-action-description-textarea"
                            id="user-monster-action_details_1" 
                            hx-post="/update-stats" 
                            hx-trigger="change" 
                            hx-target="#user-monster-action_details_1" 
                            hx-swap="outerHTML" 
                            title="[Level colon description range mechanics effect] Level: 2nd. A creature you touch becomes invisible until the spell ends. Anything the target is wearing or carrying is invisible as long as it is on the target's person.">Level: 2nd. A creature you touch becomes invisible until the spell ends. Anything the target is wearing or carrying is invisible as long as it is on the target's person.</textarea> 
                        <strong>
                            <textarea class="string-action-name-textarea" 
                                id="user-monster-action_name_2" 
                                hx-post="/update-stats" hx-trigger="change" 
                                hx-target="#user-monster-action_name_2" 
                                hx-swap="outerHTML" 
                                title="[Action Name colon] Fairy Bolt:">Fireball: </textarea> 
                        </strong>
                        <textarea class="string-action-description-textarea"
                            id="user-monster-action_details_1" 
                            hx-post="/update-stats" 
                            hx-trigger="change" 
                            hx-target="#user-monster-action_details_1" 
                            hx-swap="outerHTML" 
                            title="[Level colon description range mechanics effect] Level: 2nd. A creature you touch becomes invisible until the spell ends. Anything the target is wearing or carrying is invisible as long as it is on the target's person.">Level: 3rd. A bright streak flashes from your pointing finger to a point you choose within range and then blossoms with a low roar into an explosion of flame. Each creature in a 20-foot radius sphere centered on that point must make a Dexterity saving throw. A target takes 8d6 fire damage on a failed save, or half as much damage on a successful one.</textarea>
                    </div>
                    <div class="Block_9">
                        <h4 id="legendary actions">Legendary Actions</h4>
                        <textarea class="string-action-description-textarea"
                            id="user-monster-action_details_1" 
                            hx-post="/update-stats" 
                            hx-trigger="change" 
                            hx-target="#user-monster-action_details_1" 
                            hx-swap="outerHTML" 
                            title="[Number of legendary actions period How many actions per turn and when to play period Action regain rules] Ebony can take 3 legendary actions, choosing from the options below. Only one legendary action can be used at a time and only at the end of another creature's turn. Ebony regains spent legendary actions at the start of her turn.">Ebony can take 3 legendary actions, choosing from the options below. Only one legendary action can be used at a time and only at the end of another creature's turn. Ebony regains spent legendary actions at the start of her turn.</textarea>
                            <strong>
                                <textarea class="string-action-name-textarea" 
                                    id="user-monster-action_name_2" 
                                    hx-post="/update-stats" hx-trigger="change" 
                                    hx-target="#user-monster-action_name_2" 
                                    hx-swap="outerHTML" 
                                    title="[Action Name colon] Fairy Bolt:">Dark Whispers: </textarea> 
                            </strong>
                            <textarea class="string-action-description-textarea"
                                id="user-monster-action_details_1" 
                                hx-post="/update-stats" 
                                hx-trigger="change" 
                                hx-target="#user-monster-action_details_1" 
                                hx-swap="outerHTML" 
                                title="[Level colon description range mechanics effect] Level: 2nd. A creature you touch becomes invisible until the spell ends. Anything the target is wearing or carrying is invisible as long as it is on the target's person.">Ebony whispers insidiously to a target within 30 feet. The target must succeed on a DC 16 Wisdom saving throw or take 10 (3d6) psychic damage and become frightened until the end of its next turn.</textarea> 
                            <strong>
                                <textarea class="string-action-name-textarea" 
                                    id="user-monster-action_name_2" 
                                    hx-post="/update-stats" hx-trigger="change" 
                                    hx-target="#user-monster-action_name_2" 
                                    hx-swap="outerHTML" 
                                    title="[Action Name colon] Fairy Bolt:">Teleport: </textarea> 
                            </strong>
                            <textarea class="string-action-description-textarea"
                                id="user-monster-action_details_1" 
                                hx-post="/update-stats" 
                                hx-trigger="change" 
                                hx-target="#user-monster-action_details_1" 
                                hx-swap="outerHTML" 
                                title="[Level colon description range mechanics effect] Level: 2nd. A creature you touch becomes invisible until the spell ends. Anything the target is wearing or carrying is invisible as long as it is on the target's person.">Ebony magically teleports, along with any equipment she is wearing or carrying, up to 60 feet to an unoccupied space she can see.</textarea> 
                            <strong>
                                <textarea class="string-action-name-textarea" 
                                    id="user-monster-action_name_2" 
                                    hx-post="/update-stats" hx-trigger="change" 
                                    hx-target="#user-monster-action_name_2" 
                                    hx-swap="outerHTML" 
                                    title="[Action Name colon] Fairy Bolt:">Fairy Glow: </textarea> 
                            </strong>
                            <textarea class="string-action-description-textarea"
                                id="user-monster-action_details_1" 
                                hx-post="/update-stats" 
                                hx-trigger="change" 
                                hx-target="#user-monster-action_details_1" 
                                hx-swap="outerHTML" 
                                title="[Level colon description range mechanics effect] Level: 2nd. A creature you touch becomes invisible until the spell ends. Anything the target is wearing or carrying is invisible as long as it is on the target's person.">Ebony emits a burst of glowing lights. Each creature of her choice within 20 feet of her must succeed on a DC 16 Dexterity saving throw or be blinded until the end of Ebony's next turn.</textarea> 
                    </div> 
                    </div>
                </div>
            </div>
        </div>
    </div>
        
    <script>
        document.addEventListener("DOMContentLoaded", function() {
            function adjustTextareaHeight(el) {
                console.log('Start height:', el.scrollHeight);
                if (el.scrollHeight > 16) {
                    el.style.height = 'auto'; // Reset the height
                    console.log('Auto height:', el.scrollHeight);
                    console.log('Adjusting height for:', el.id); // Debugging line
                    el.style.height = (el.scrollHeight) + 'px'; // Set it to the scroll height
                    console.log('New height:', el.style.height);
                }
            }
        
            const classes = [
                'description-textarea',
                'user-description-textarea',
                'heading-textarea', 
                'properties-textarea', 
                'string-stat-textarea',
                'string-action-description-textarea'
            ];
        
            classes.forEach(className => {
                const textareas = document.querySelectorAll(`.${className}`);
                console.log(`Textareas found for ${className}:`, textareas.length); // Debugging line
                textareas.forEach(textarea => {
                    // Adjust height on page load
                    adjustTextareaHeight(textarea);
                    // Adjust height on input
                    textarea.addEventListener('input', function() {
                        adjustTextareaHeight(textarea);
                        console.log('Input event triggered for:', textarea.id); // Debugging line
                    });
                });
            });
        });
    </script>
</body>
</html>