PageSourceSearch

https://hollyspoemgenerator.netlify.app/src/script.js

js hollyspoemgenerator.netlify.app collected 2026-10-03 10:52:26 UTC 1,259 bytes, 33 lines download raw bytes

1function displayPoem(response) {
2  let poemOutput = document.querySelector("#poem-output");
3  poemOutput.classList.remove("blink");
4  new Typewriter("#poem-output", {
5    strings: response.data.answer,
6    autoStart: true,
7    delay: 1,
8    cursor: "",
9  });
10}
11
12function generatePoem(event) {
13  event.preventDefault();
14
15  let textInput = document.querySelector("#text-input");
16  let apiKey = "754b84e4ec96a5481tfao024db3b3aff";
17  let context =
18    "You are an intelligent AI assistant who creates short quatrain poems, seperate each line with a <br /> and sign the end of the poem with Generated by your AI Poet💻 in an <em> element";
19  let prompt = `Generate a poem about ${textInput.value}`;
20  let apiUrl = `https://api.shecodes.io/ai/v1/generate?prompt=${prompt}&context=${context}&key=${apiKey}`;
21
22  console.log(`Prompt: ${prompt}`);
23  console.log(`Context: ${context}`);
24
25  axios.get(apiUrl).then(displayPoem);
26  let poemOutput = document.querySelector("#poem-output");
27  poemOutput.classList.add("blink");
28  poemOutput.classList.remove("hidden");
29  poemOutput.innerHTML = `⏳ Generating Your Poem about ${textInput.value}!`;
30}
31
32let formSubmitElement = document.querySelector("#poem-form");
33formSubmitElement.addEventListener("submit", generatePoem);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.