PlayPhraseMe

From PKC
Revision as of 02:43, 17 January 2024 by Bkoo2 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search


<HTML>

Please type in a phrase that you want to see it spoken in a movie:

<input type="text" id="phraseInput" placeholder="Enter phrase">

<button onclick="searchPhrase()">Search</button>

A window will open and videos to be played by PlayPhase.me

<script> searchInput.addEventListener('keyup', (e) => {

 if (e.keyCode === 13) {
   searchPhrase();
 }

});

function searchPhrase() {

 const phrase = document.getElementById('phraseInput').value;
 
 // Remove spaces and replace with +
 const searchTerm = phrase.replace(/\s/g, '+'); 
 const srcPrefix = 'http://playphrase.me/#/search?q='
 // Open new tab with search url
 window.open(srcPrefix + searchTerm); 

} </script> </html>