├── favicon.png
├── README.md
├── License.txt
├── clap-emoji-generator.js
├── index.html
└── style.css
/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/mburakerman/clap-emoji-generator/HEAD/favicon.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Clap Emoji Generator
2 |
3 | > Don't 👏 stop 👏🏻 emphasizing 👏🏼 your 👏🏽 point 👏🏾 by 👏🏿 putting 👏 clap 👏🏻 emojis 👏🏼 after 👏🏽 every 👏🏾 word
4 |
5 |
6 |
7 | ## Thanks
8 | Added 👏🏻 multicultural 👏 feature with 👏🏾 [@donatj](https://github.com/donatj)
9 |
10 | ## License
11 |
12 | Licensed under the MIT License.
13 |
--------------------------------------------------------------------------------
/License.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2020 Mehmet Burak Erman
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/clap-emoji-generator.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | var ClapEmojiGenerator = {
4 |
5 | init: function start() {
6 | var claps = ["👏", "👏🏻", "👏🏼", "👏🏽", "👏🏾", "👏🏿"];
7 | var userTextarea = document.getElementById("userTextarea");
8 | var clapEmojiTextarea = document.getElementById("clapEmojiTextarea");
9 | var multiculturalCheckbox = document.getElementById("multiculturalCheckbox");
10 | var tweetButton = document.getElementById("tweetButton");
11 |
12 | // events
13 | ["keypress", "paste", "input"].forEach(function (event) {
14 | document.addEventListener(event, function () {
15 |
16 | userTextarea.value = userTextarea.value.replace(/\s/gi, " ");
17 | tweetButton.classList.remove("active");
18 |
19 | setTimeout(function () {
20 | clapEmojiTextarea.value = multiculturalCheckbox.checked ? multiculturalOutput(userTextarea) : defaultOutput(userTextarea);
21 | }, 100);
22 | }, false);
23 | });
24 |
25 |
26 | // clapped texts
27 | function defaultOutput(text) {
28 | return text.value.replace(/\s/g, " 👏 ");
29 | }
30 | function multiculturalOutput(text) {
31 | return text.value.split(/\s/).reduce(function (a, c, i) {
32 | return (a === "" ? "" : a + " " + claps[i % claps.length] + " ") + c;
33 | }, "");
34 | }
35 | /*
36 | function multiculturalOutputAlternative(text) {
37 | var output = "";
38 | text.value.trim().split(/\s/).forEach(function (item, index) {
39 | output += (item + " " + claps[index % claps.length] + " ");
40 | });
41 | // sliced -5 because it's clap emoji and js thinks it is 5 character long
42 | output = output.slice(0, -5);
43 | return output;
44 | }
45 | */
46 |
47 | // clicpboard
48 | function copyToClipboard() {
49 | var textField = document.createElement("textarea");
50 | textField.innerText = document.querySelector("#clapEmojiTextarea").value;
51 | document.body.appendChild(textField);
52 | textField.select();
53 | document.execCommand("copy");
54 | textField.remove();
55 |
56 | if (clapEmojiTextarea.value.length > 0) {
57 | tweetButton.classList.add("active");
58 | }
59 |
60 | tweetButton.setAttribute("href", "https://twitter.com/share?url=https://mburakerman.github.io/clap-emoji-generator/&text=" + clapEmojiTextarea.value);
61 | }
62 |
63 | clapEmojiTextarea.addEventListener("click", function () {
64 | copyToClipboard();
65 | this.select();
66 | });
67 | }
68 |
69 | };
70 |
71 | ClapEmojiGenerator.init();
72 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
Don't 👏 stop 👏🏻 emphasizing 👏🏼 your 👏🏽 point 👏🏾 by 👏🏿 putting 👏 clap 👏🏻 emojis 82 | 👏🏼 after 👏🏽 83 | every 👏🏾 word
84 | 85 |Multicultural Clap
106 |