Advertisement
Guest User

Untitled

a guest
May 24th, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title></title>
  5. <style>
  6. #output {
  7. font-size: 3rem;
  8. margin: 0;
  9. padding: 0.5rem;
  10. line-height: 1.2;
  11. white-space: pre;
  12. word-wrap: break-word;
  13. word-break: break-all;
  14. width: 100vw;
  15. }
  16. </style>
  17. </head>
  18. <body>
  19.  
  20. <h1 id="output">compositing...</h1>
  21.  
  22. <script>
  23. const skinTones = ["1F3FB", "1F3FC", "1F3FD", "1F3FE", "1F3FF"];
  24. const adults = ["1F468", "1F469"];
  25. const kids = ["1F466", "1F467", "1F476"];
  26. const professions = ["2695 FE0F", "1F393", "1F3EB", "1F33E", "1F373", "1F3ED", "1F4BC", "1F52C", "1F4BB", "1F3A4", "1F3A8", "2708 FE0F", "1F680", "1F692"];
  27. const zwj = "200D";
  28. const newline = "0A";
  29.  
  30. const get = (arr) => arr[Math.round(Math.random() * (arr.length - 1))];
  31. const getSkinTone = () => get(skinTones);
  32. const getAdult = () => get(adults);
  33. const getKid = () => get(kids);
  34. const getProfession = () => get(professions);
  35. const getFamily = () => `${ getAdult() } ${ getSkinTone() } ${ zwj } ${ getProfession() } ${ zwj } ${ getAdult() } ${ getSkinTone() } ${ zwj } ${ getKid() } ${ getSkinTone() } ${ zwj } ${ getKid() } ${ getSkinTone() }`;
  36. const getCommunity = () => `${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() } ${ zwj } ${ getFamily() }`;
  37.  
  38. const entries = [];
  39. for (let i = 1; i < 100; i++) {
  40. entries.push(getCommunity());
  41. }
  42.  
  43. const result = entries
  44. .join(` ${ newline } `)
  45. .split(" ")
  46. .map(str => parseInt(str, 16))
  47. .map(code => String.fromCodePoint(code))
  48. .reduce((value, accum) => value + accum, "");
  49.  
  50. console.log(result.length);
  51.  
  52. document.getElementById("output").innerHTML = result;
  53. </script>
  54.  
  55. </body>
  56. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement