02-06-2018, 06:25 PM
(This post was last modified: 02-06-2018, 08:59 PM by tommiehansen.)
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.
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.