<!DOCTYPE html> Bree Serif Fun Page /* Base Styles */ body { font-family: Arial, sans-serif; background-color: #f0f8ff; color: #333; margin: 0; padding: 0; overflow: hidden; position: relative; height: 100vh; }</p> <pre class="language-nolang"><code> h1 { font-size: 3rem; text-align: center; color: #2c3e50; margin-top: 30px; } /* Paragraph Input Area */ .input-container { display: flex; justify-content: center; margin-top: 30px; padding: 0 20px; } textarea { font-family: &#39;Bree Serif&#39;, serif; font-size: 1.5rem; padding: 20px; border: 2px solid #2c3e50; border-radius: 10px; width: 80%; max-width: 800px; min-height: 150px; outline: none; resize: none; transition: border-color 0.3s ease; } textarea:focus { border-color: #2980b9; } /* Bubble with &quot;Bree Serif&quot; Text */ .bubble { font-family: &#39;Bree Serif&#39;, serif; font-size: 2rem; color: #fff; background-color: #2980b9; border-radius: 50%; padding: 20px 40px; position: absolute; opacity: 0; animation: bubbleAnimation 1s forwards; } /* Animation for the bubbles */ @keyframes bubbleAnimation { 0% { opacity: 0; transform: scale(0); } 50% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0; transform: scale(0); } } /* Styles when the background color changes */ .message { font-size: 1.5rem; text-align: center; color: #2c3e50; margin-top: 20px; } &lt;/style&gt; </code></pre> <p></head> <body> <h1>Type Your Paragraph Below!</h1></p> <pre class="language-nolang"><code>&lt;div class=&quot;input-container&quot;&gt; &lt;textarea id=&quot;userInput&quot; placeholder=&quot;Type something including &#39;Bree&#39; or &#39;Serif&#39;...&quot; oninput=&quot;checkInput()&quot;&gt;&lt;/textarea&gt; &lt;/div&gt; &lt;div class=&quot;message&quot; id=&quot;message&quot;&gt;&lt;/div&gt; &lt;script&gt; // Array of random colors for background change const colors = [ &quot;#f39c12&quot;, &quot;#e74c3c&quot;, &quot;#8e44ad&quot;, &quot;#3498db&quot;, &quot;#2ecc71&quot;, &quot;#1abc9c&quot;, &quot;#d35400&quot;, &quot;#9b59b6&quot;, &quot;#34495e&quot;, &quot;#16a085&quot; ]; // Function to generate a random color from the colors array function getRandomColor() { const randomIndex = Math.floor(Math.random() * colors.length); return colors[randomIndex]; } // Function to create a new &quot;Bree Serif&quot; bubble function createBubble(text) { const bubble = document.createElement(&#39;div&#39;); bubble.classList.add(&#39;bubble&#39;); bubble.textContent = text; document.body.appendChild(bubble); // Position the bubble randomly on the screen const x = Math.random() * window.innerWidth; const y = Math.random() * window.innerHeight; bubble.style.left = `${x}px`; bubble.style.top = `${y}px`; // Remove bubble after animation setTimeout(() =&gt; { bubble.remove(); }, 2000); } // Function to change the background color when a keyword is typed function changeBackgroundColor() { document.body.style.backgroundColor = getRandomColor(); } // Function to scan input and check for &quot;Bree&quot; or &quot;Serif&quot; function checkInput() { const inputText = document.getElementById(&#39;userInput&#39;).value.toLowerCase(); const messageElement = document.getElementById(&#39;message&#39;); // Check if &quot;Bree&quot; or &quot;Serif&quot; are present in the input if (inputText.includes(&#39;bree&#39;) &amp;&amp; !inputText.includes(&#39;serif&#39;)) { changeBackgroundColor(); createBubble(&quot;Bree Serif&quot;); messageElement.textContent = &quot;You typed &#39;Bree&#39;! Background changed and bubble added!&quot;; } else if (inputText.includes(&#39;serif&#39;) &amp;&amp; !inputText.includes(&#39;bree&#39;)) { changeBackgroundColor(); createBubble(&quot;Bree Serif&quot;); messageElement.textContent = &quot;You typed &#39;Serif&#39;! Background changed and bubble added!&quot;; } else if (inputText.includes(&#39;bree&#39;) &amp;&amp; inputText.includes(&#39;serif&#39;)) { changeBackgroundColor(); createBubble(&quot;Bree Serif&quot;); messageElement.textContent = &quot;You typed both &#39;Bree&#39; and &#39;Serif&#39;! Background changed and bubble added!&quot;; } else { // Reset the message when no keywords are found messageElement.textContent = &quot;&quot;; } } &lt;/script&gt; &lt;!-- Link to Bree Serif font from Google Fonts --&gt; &lt;link href=&quot;https://fonts.googleapis.com/css2?family=Bree+Serif&amp;display=swap&quot; rel=&quot;stylesheet&quot;&gt; </code></pre> <p></body> </html></p>

Built With

Share this project:

Updates