Skip to content

Instantly share code, notes, and snippets.

@cbenz
Last active May 12, 2016 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cbenz/5dd4305034f4008c758ca22269347088 to your computer and use it in GitHub Desktop.
Save cbenz/5dd4305034f4008c758ca22269347088 to your computer and use it in GitHub Desktop.
esnextbin sketch
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>ESNextbin Sketch</title>
<!-- put additional styles and scripts here -->
</head>
<body>
<h1>Bruno simulator</h1>
<p>Type some text then read the version of Bruno!</p>
<label>Text: <input id="text" type="text"></label>
<p id="result"></p>
</body>
</html>
const cedilla = "̧"
const input = document.getElementById("text")
const result = document.getElementById("result")
input.addEventListener('input', (event) => {
const text = event.target.value
const newText = text.split('').map(
(char) => Math.random() > 0.2 ? char + cedilla : char
).join('').normalize('NFC')
result.innerHTML = newText
})
{
"name": "esnextbin-sketch",
"version": "0.0.0"
}
"use strict";
var cedilla = "̧";
var input = document.getElementById("text");
var result = document.getElementById("result");
input.addEventListener('input', function (event) {
var text = event.target.value;
var newText = text.split('').map(function (char) {
return Math.random() > 0.2 ? char + cedilla : char;
}).join('').normalize('NFC');
result.innerHTML = newText;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment