-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
534 lines (524 loc) · 28.9 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta property="og:title" content="Poem Generator | sarasjodin.com">
<meta property="og:description" content="My first AI portfolio app with a Poem bot called Sara Bot. Here you can create your Christmas poem gifts or explore different kinds of poem styles. Improving and refining your input with each submission is crucial for obtaining accurate and helpful results.">
<meta property="og:image" content="src/images/logo_bot_sara.svg">
<meta property="og:url" content="https://ai-poems-generator.netlify.app/">
<script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
<script src="https://unpkg.com/typewriter-effect@latest/dist/core.js"></script>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ"
crossorigin="anonymous"
/>
<link rel="stylesheet" href="src/styles.css" />
<title>Poem Generator | sarasjodin.com</title>
</head>
<body>
<div id="app-container">
<header>
<div class="container">
<div class="row">
<div class="col-1"></div>
<div class="col-4 d-flex flex-column align-items-center">
<img
src="src/images/logo_bot_sara.svg"
width="130px"
alt="A bot"
title='My name is "Sara Bot"'
/>
<p id="introduction mt-8">My name is Sara Bot</p>
</div>
<div class="col-6 d-flex align-items-center">
<h1>
<span class="ai-poem-h1">AI Poem</span>
<span class="typewriter" id="typewriter"></span>
</h1>
</div>
<div class="col-1"></div>
</div>
</div>
</header>
<main>
<div class="row justify-content-center">
<div class="col-10">
<div id="poem-container">
<form id="poem-form-element" action="">
<div id="inner-form-element">
<fieldset id="choose-poem-convention">
<legend title="Choose poem convention">Choose poem convention</legend>
<!-- Radio Button 1 -->
<label
class="more-space-in-between"
title="This option generates poems with rhymes"
>
<input
type="radio"
id="with-rhymes"
name="choose-poem-convention"
value="with-rhymes"
custom-data="Please, help me to create a poem with rhymes."
required
checked
/>
With rhymes</label
>
<!-- Radio Button 2 -->
<label
class="more-space-in-between"
title="This option generates poems without rhymes"
>
<input
type="radio"
id="no-rhymes"
name="choose-poem-convention"
value="no-rhymes"
custom-data="Please, help me to create a poem without rhymes."
/>
No rhymes</label
>
<!-- Radio Button 3 -->
<!-- <label
class="more-space-in-between"
title="This option does not give any input about the poem convention or style when generating the poem."
>
<input
type="radio"
id="no-input"
name="choose-poem-convention"
value="no-input"
custom-data="Please, help me to create a poem."
/>
No input</label
> -->
<!-- Radio Button 4 -->
<!-- <label
class="more-space-in-between"
title="This option will generate a random rhyme style and / or poem style, but you could still add your poem topic input in the text box below, to personalise the generated poem."
>
<input
type="radio"
id="random"
name="choose-poem-convention"
value="random"
custom-data="Please, create a random poem."
/>
Random</label
> -->
</fieldset>
<fieldset id="choose-poem-rhymes" >
<legend title="Choose poem rhymes">Choose poem rhymes</legend>
<div>
<!-- Checkbox 1 -->
<label
class="more-space-in-between"
title='Correct rhymes, also known as perfect rhymes, occur when the stressed vowel sounds and the sounds that follow them are identical in both words. This includes the vowel sound and any consonant sounds that follow it. Example: "cat" and "bat" are correct rhymes because both words end with the same vowel sound /æ/ and the same consonant sound /t/.'
>
<input
type="checkbox"
id="correct-rhyme choose-poem-rhymes-check-boxes"
name="choose-poem-rhymes"
value="correct-rhyme"
custom-data="Use correct rhymes and"
/>
Correct rhymes</label
>
<!-- Checkbox 2 -->
<label
class="more-space-in-between"
title='Slant rhymes, also called near rhymes, occur when the correspondence between sounds is close but not exact. This includes words with similar, but not identical, vowel or consonant sounds. Example: "lake" and "luck" are slant rhymes. While the ending consonant sounds are different, the vowel sounds are similar (long "a" in "lake" and short "u" in "luck").'
>
<input
type="checkbox"
id="slanted-rhyme choose-poem-rhymes-check-boxes"
name="choose-poem-rhymes"
value="slanted-rhyme"
custom-data="Allow slanted rhymes and"
/>
Slanted rhymes</label
>
<!-- Checkbox 3 -->
<label
class="more-space-in-between"
title='Eye rhymes refer to words that look like they should rhyme because their spellings are similar, but they don't actually rhyme when pronounced. In other words, the rhyme is based on the visual appearance rather than the sound. Example: "love" and "move" are eye rhymes. They have a similar ending visually but do not rhyme when pronounced.'
>
<input
type="checkbox"
id="eye-rhyme choose-poem-rhymes-check-boxes"
name="choose-poem-rhymes"
value="eye-rhyme"
custom-data="Allow eye rhymes and"
/>
Eye rhymes</label
>
</div>
<div>
<!-- Checkbox 4 -->
<label
class="more-space-in-between"
title='Assonant rhymes involve the repetition of vowel sounds in stressed syllables. The consonant sounds may differ. Example: "make" and "late" are assonant rhymes because they share a similar vowel sound (/eɪ/).'
>
<input
type="checkbox"
id="assonant-rhyme choose-poem-rhymes-check-boxes"
name="choose-poem-rhymes"
value="assonant-rhyme"
custom-data="Allow assonant rhymes and"
/>
Assonant rhymes</label
>
<!-- Checkbox 5 -->
<label
class="more-space-in-between"
title='Consonant rhymes involve the repetition of consonant sounds, including both the initial and ending consonants, with differing vowel sounds. Example: "milk" and "walk" are consonant rhymes because they share similar ending consonant sounds (/k/).'
>
<input
type="checkbox"
id="consonant-rhyme choose-poem-rhymes-check-boxes"
name="choose-poem-rhymes"
value="consonant-rhyme"
custom-data="Allow consonant rhymes and"
/>
Consonant rhymes</label
>
<!-- Checkbox 6 -->
<label
class="more-space-in-between"
title='Internal rhymes occur when rhyming words appear within the same line of poetry. Example: "Once upon a midnight dreary, while I pondered, weak and weary...'
>
<input
type="checkbox"
id="internal-rhyme choose-poem-rhymes-check-boxes"
name="choose-poem-rhymes"
value="inernal-rhyme"
custom-data="Allow inernal rhymes and"
/>
Internal rhymes</label
>
</div>
</fieldset>
<fieldset id="choose-poem-style" >
<legend title="Choose poem style">Choose poem style</legend>
<div>
<!-- Radio Button 5 -->
<label
class="more-space-in-between"
title='This option does not have any specific instructions or constraints on the poem style, you could refer to it as an "Open Form" or "Open Verse" poem. This term implies a lack of specific structure or rules, allowing for greater freedom and creativity on the part of the poet.'
visible-when="with-rhymes no-rhymes"
>
<input
type="radio"
id="open-form choose-poem-styles-radios"
name="choose-poem-style"
value="open-form"
custom-data="Utilise the open form poem style, which does not have any specific instructions or constraints on the poem style. This term implies a lack of specific structure or rules, allowing for greater freedom and creativity on the part of the poet..."
visible-when="with-rhymes no-rhymes"
/>
Open form</label
>
<!-- Radio Button 6 -->
<label
class="more-space-in-between"
title="This option does not have a regular meter or rhyme scheme, but it also does not look like a free verse poem. It uses unconventional punctuation, spacing, and line breaks."
visible-when="no-rhymes"
>
<input
type="radio"
id="no-style choose-poem-styles-radios"
name="choose-poem-style"
value="no-style"
custom-data="Utilise the no style poem style, which does not have a regular meter or rhyme scheme, but it also does not look like a free verse poem. It uses unconventional punctuation, spacing, and line breaks."
visible-when="with-rhymes no-rhymes"
/>
No style</label
>
<!-- Radio Button 7 -->
<label
class="more-space-in-between"
title="This option will generate a type of poem that does not follow any rules of rhyme, meter, or form. Free verse poems can have any number of lines, stanzas, or syllables, and can express any topic or emotion."
visible-when="no-rhymes"
>
<input
type="radio"
id="free-verse choose-poem-styles-radios"
name="choose-poem-style"
value="free-verse"
custom-data="Utilise the free-verse poem style, which does not follow any rules of rhyme, meter, or form. Free verse poems can have any number of lines, stanzas, or syllables, and can express any topic or emotion."
visible-when="no-rhymes"
/>
Free verse</label
>
</div>
<div>
<!-- Radio Button 13 -->
<label
class="more-space-in-between"
title="This option will generate a humorous poem that consists of five lines, with a rhyme scheme of AABBA and a meter of three stressed syllables in the first, second, and fifth lines, and two stressed syllables in the third and fourth lines."
visible-when="with-rhymes"
>
<input
type="radio"
id="limerick choose-poem-styles-radios"
name="choose-poem-style"
value="limerick"
custom-data="Utilise the limerick poem style that will generate a humorous poem that consists of five lines, with a rhyme scheme of AABBA and a meter of three stressed syllables in the first, second, and fifth lines, and two stressed syllables in the third and fourth lines."
visible-when="with-rhymes"
/>
Limerick</label
>
<!-- Radio Button 14 -->
<label
class="more-space-in-between"
title="This option will generate a narrative poem that tells a story, often in a musical or lyrical way. Ballads usually have a rhyme scheme of ABAB or ABCB and a meter of four or three stressed syllables per line."
visible-when="with-rhymes"
>
<input
type="radio"
id="ballad choose-poem-styles-radios"
name="choose-poem-style"
value="ballad"
custom-data="Utilise the ballad poem style that will generate a narrative poem that tells a story, often in a musical or lyrical way. Ballads usually have a rhyme scheme of ABAB or ABCB and a meter of four or three stressed syllables per line."
visible-when="with-rhymes"
/>
Ballad</label
>
<!-- Radio Button 15 -->
<label
class="more-space-in-between"
title="This option will generate a type of poem that spells out a word or phrase using the first letter of each line. The lines can be full sentences or single words, and the word or phrase can be the title or a hidden message."
visible-when="with-rhymes no-rhymes"
>
<input
type="radio"
id="acrostic choose-poem-styles-radios"
name="choose-poem-style"
value="Acrostic"
custom-data="Utilise the acrostic poem style that will generate a type of poem that spells out a word or phrase using the first letter of each line. The lines can be full sentences or single words, and the word or phrase can be the title or a hidden message."
visible-when="with-rhymes no-rhymes"
/>
Acrostic</label
>
<!-- Radio Button 16 -->
<label
class="more-space-in-between"
title="This option will generate a 19-line poem that consists of five tercets (three-line stanzas) and a final quatrain (four-line stanza), with two repeating lines throughout the poem."
visible-when="with-rhymes"
>
<input
type="radio"
id="villanelle choose-poem-styles-radios"
name="choose-poem-style"
value="villanelle"
custom-data="Utilise the villanelle poem style that will generate a 19-line poem that consists of five tercets (three-line stanzas) and a final quatrain (four-line stanza), with two repeating lines throughout the poem."
visible-when="with-rhymes"
/>
Villanelle</label
>
<!-- Radio Button 17 -->
<label
class="more-space-in-between"
title="This option will generate a five-line poem that follows a syllable pattern of 2-4-6-8-2. Cinquains can describe a person, place, thing, or idea, and can have different variations of form and rhyme."
visible-when="no-rhymes"
>
<input
type="radio"
id="cinquain choose-poem-styles-radios"
name="choose-poem-style"
value="cinquain"
custom-data="Utilise the cinquain poem style that will generate a five-line poem that follows a syllable pattern of 2-4-6-8-2. Cinquains can describe a person, place, thing, or idea, and can have different variations of form and rhyme."
visible-when="no-rhymes"
/>
Cinquain</label
>
<!-- Radio Button 18 -->
<label
class="more-space-in-between"
title="This option will generate a long narrative poem that tells the adventures of a hero, often involving mythology, history, or legend. Epics usually have a formal style, a grand scope, and a serious tone."
visible-when="with-rhymes no-rhymes"
>
<input
type="radio"
id="epic choose-poem-styles-radios"
name="choose-poem-style"
value="epic"
custom-data="Utilise the epic poem style that will generate a long narrative poem that tells the adventures of a hero, often involving mythology, history, or legend. Epics usually have a formal style, a grand scope, and a serious tone."
visible-when="with-rhymes no-rhymes"
/>
Epic</label
>
</div>
<div>
<!-- Just a label 1 -->
<span
class="labels"
title="The following options will generate a three-line poem that originated in Japan and follows a syllable pattern of 5-7-5. Haikus usually refer to nature or a moment of beauty. In the smaller textbox you can add a personalised Haiku topic."
>Haiku:</span
visible-when="no-rhymes"
>
<!-- Radio Button 8 -->
<label
class="more-space-in-between"
title="This option will generate a haiku poem about nature."
visible-when="no-rhymes"
>
<input
type="radio"
id="haiku-nature choose-poem-styles-radios"
name="choose-poem-style"
value="haiku-nature"
custom-data="Utilise the haiku poem style about nature, which is a short poetic form that consists of three lines with 17 syllables arranged in a 5-7-5 pattern. It should be based on the careful observation of nature and emotions, that depicts the essence of a specific moment in time."
visible-when="no-rhymes"
/>
nature</label
>
<!-- Radio Button 9 -->
<label
class="more-space-in-between"
title="This option will generate a haiku poem about season."
visible-when="no-rhymes"
>
<input
type="radio"
id="haiku-season choose-poem-styles-radios"
name="choose-poem-style"
value="haiku-season"
custom-data="Utilise the haiku poem style about the season, which is a short poetic form that consists of three lines with 17 syllables arranged in a 5-7-5 pattern. It should be based on the careful observation of the season and emotions, that depicts the essence of a specific moment in time."
visible-when="no-rhymes"
/>
season</label
>
<!-- Radio Button 10 -->
<label
class="more-space-in-between"
title="This option will generate a haiku poem about a moment of beauty."
visible-when="no-rhymes"
>
<input
type="radio"
id="haiku-moment-of-beauty choose-poem-styles-radios"
name="choose-poem-style"
value="haiku-moment-of-beauty"
custom-data="Utilise the haiku poem style about the moment of beauty, which is a short poetic form that consists of three lines with 17 syllables arranged in a 5-7-5 pattern. It should be based on a careful observation of a moment of beauty and emotions, that depicts the essence of a specific moment in time."
visible-when="no-rhymes"
/>
moment of beauty</label
>
</div>
<div>
<!-- Just a label 2 -->
<span
class="labels"
title="Sonnet is a 14-line poem that usually deals with love and has a specific rhyme scheme and meter. There are two main types of sonnets: Petrarchan and Shakespearean."
visible-when="with-rhymes"
>Sonnet:</span
>
<!-- Radio Button 11 -->
<label
class="more-space-in-between"
title="This option will generate a 14-line poem that usually deals with love and has a specific rhyme scheme and meter."
visible-when="with-rhymes"
>
<input
type="radio"
id="sonnet-petrarchan choose-poem-styles-radios"
name="choose-poem-style"
value="sonnet-petrarchan"
custom-data="Utilise the sonnet petrarchan poem style that has 14 lines, divided into two parts: an octave (the first eight lines) and a sestet (the last six lines). The octave usually presents a problem or a question, and the sestet provides a solution or an answer. The rhyme scheme of the octave is ABBA ABBA, and the rhyme scheme of the sestet can vary, but the most common are CDE CDE or CDC CDC."
visible-when="with-rhymes"
/>
Petrarchan</label
>
<!-- Radio Button 12 -->
<label
class="more-space-in-between"
title="This option will generate a 14-line poem that usually deals with love and has a specific rhyme scheme and meter."
visible-when="with-rhymes"
>
<input
type="radio"
id="sonnet-shakespearean choose-poem-styles-radios"
name="choose-poem-style"
value="sonnet-shakespearean"
custom-data="Utilise the sonnet shakespearean poem style that has 14 lines, divided into three quatrains and a couplet. The rhyme scheme is ABAB CDCD EFEF GG, and the meter is iambic pentameter, which means each line has 10 syllables with alternating stress. The Shakespearean sonnet usually expresses a single theme or idea, often related to love, beauty, or mortality. The first 12 lines present a problem or a question, and the last two lines provide a resolution or an answer."
visible-when="with-rhymes"
/>
Shakespearean</label
>
</div>
</fieldset>
<p id="poem-prompt-collection"></p>
<fieldset id="add-poem-topic">
<legend title="Add poem topic">Add poem topic</legend>
<textarea
id="poem-topic-box"
autocomplete="off"
autofocus
cols="100%"
rows="5"
title="Please, be nice and clear, give enough details, & don’t repeat yourself. Improving and refining your input with each submission is crucial for obtaining accurate and helpful results."
></textarea>
</fieldset>
<div id="waiting-message" hidden><em>Please wait for your poem to come to life...</em></div>
</div>
<div class="typewriter generated-poem" id="author-signature" hidden><span><strong>Your AI Poem generator,</strong></span><br /><span class="typewriter generated-poem" id="author-name" hidden><span>Sara Bot</span></div>
<div id="button-placeholder">
<input type="submit" id="submit-button" value="Submit" title="Submit button" />
</div>
<div id="default-value-message"></div>
</form>
</div>
</div>
</main>
<footer>
<div>
Coded by
<a
href="https://saras-portfolio.netlify.app/"
target="_blank"
rel="noreferrer"
>
<img
class="sara small-logo"
src="src/images/sarasjodinLogo.svg"
width="140"
alt="Logo sarasjodin.com"
title="sarasjodin.com"
/>
</a>
</div>
<div class="group">
Source code on
<a
href="https://github.com/sarasjodin/PoemGenerator"
target="_blank"
rel="noreferrer"
>
<img
class="github"
src="src/images/github-mark.svg"
width="25"
alt="Logo GitHub"
title="GitHub"
/>
</a>
</div>
<div class="group">
Deployed with
<a href="https://www.netlify.com/" target="_blank" rel="noreferrer">
<img
class="netlify"
src="src/images/netlifyLogo.png"
width="60"
alt="Logo Netlify.com"
title="Netlify"
/>
</a>
</div>
</footer>
<script src="src/script.js"></script>
</body>
</html>