Interact with the UI
#1
Any way to post things to ui; any way to hook into it and perform stuff?

I'm thinking like this (this will not work, but example...):

var strat = {

 end: function()
 {
   alert('Finished in in X time');
 }

}

This could further be expanded and do more useful things such as this:

var strat = {

  say: function( text )
  {
    if ('speechSynthesis' in window)
    {
      let utterance = new SpeechSynthesisUtterance(text);
      utterance.lang = 'en-US';
      speechSynthesis.speak(utterance);
    }
  },

  end: function()
  {
    this.say('Finished in X time');
  }


} // strat{}


Codepen demo:
https://codepen.io/tommiehansen/pen/NyRgBP

Input something into input and press return.
If your browser has support for speechSynthisis it will say what you wrote.
  Reply


Messages In This Thread
Interact with the UI - by tommiehansen - 02-06-2018, 06:25 PM
RE: Interact with the UI - by askmike - 02-07-2018, 04:04 AM
RE: Interact with the UI - by tommiehansen - 02-07-2018, 10:02 AM
RE: Interact with the UI - by askmike - 02-07-2018, 11:16 AM
RE: Interact with the UI - by tommiehansen - 02-07-2018, 10:26 PM
RE: Interact with the UI - by askmike - 02-08-2018, 04:28 AM
RE: Interact with the UI - by tommiehansen - 02-09-2018, 12:43 PM

Forum Jump:


Users browsing this thread: