More actions
No edit summary |
No edit summary |
||
| Line 37: | Line 37: | ||
tokens = text.split(' '); | tokens = text.split(' '); | ||
result = ''; | result = ''; | ||
for (var | for (var i = 0; i < tokens.length; i++) { | ||
if (tokens[i].trim() === '') { | |||
continue; | |||
} | |||
const shouldAddStyle = ratio > Math.random(); | |||
if (shouldAddStyle) { | |||
tokens[i] = `<span class="${className}" data-timestamp="${Date.now()}">${tokens[i]}</span>` | |||
} | |||
result += `${tokens[i]} `; | |||
} | } | ||
return result; | return result; | ||