├── 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 | 5 | 6 | 7 | 8 | Clap Emoji Generator 9 | 10 | 11 | 12 | 13 | 14 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 27 | 28 | 29 | 30 | 31 | 32 | 43 | 76 | 77 |
78 | 79 |
80 |

CLAP 👏 EMOJI 👏🏿 GENERATOR

81 |

Don't 👏 stop 👏🏻 emphasizing 👏🏼 your 👏🏽 point 👏🏾 by 👏🏿 putting 👏 clap 👏🏻 emojis 82 | 👏🏼 after 👏🏽 83 | every 👏🏾 word

84 | 85 |
86 |
87 | 89 |
90 | 91 | 102 |
103 | 104 |
105 |

Multicultural Clap

106 |
107 | 110 |
111 |
112 | 113 | 114 | 118 |
119 |
120 | 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /style.css: -------------------------------------------------------------------------------- 1 | @import url('https://fonts.googleapis.com/css?family=Varela+Round'); 2 | 3 | html { 4 | -webkit-box-sizing: border-box; 5 | -moz-box-sizing: border-box; 6 | box-sizing: border-box; 7 | } 8 | 9 | *, 10 | *:before, 11 | *:after { 12 | -webkit-box-sizing: inherit; 13 | -moz-box-sizing: inherit; 14 | box-sizing: inherit; 15 | padding: 0; 16 | margin: 0; 17 | } 18 | 19 | body, 20 | html { 21 | width: 100%; 22 | height: 100%; 23 | } 24 | 25 | body { 26 | font-family: 'Varela Round', sans-serif; 27 | padding: 10px; 28 | } 29 | 30 | ::selection { 31 | background: #d7c6cf; 32 | } 33 | 34 | ::-moz-selection { 35 | background: #d7c6cf; 36 | } 37 | 38 | .page-wrapper { 39 | display: -webkit-box; 40 | display: -ms-flexbox; 41 | display: flex; 42 | justify-content: center; 43 | height: 100%; 44 | } 45 | 46 | .page-container { 47 | -webkit-box-flex: 1; 48 | -ms-flex: 1; 49 | flex: 1; 50 | } 51 | 52 | h1 { 53 | max-width: 580px; 54 | margin-left: auto; 55 | margin-right: auto; 56 | text-align: center; 57 | font-size: 32px; 58 | margin-bottom: 15px; 59 | } 60 | 61 | @media screen and (max-width: 1200px) { 62 | h1 { 63 | font-size: 30px; 64 | } 65 | } 66 | 67 | p { 68 | color: #717f86; 69 | font-size: 16px; 70 | } 71 | 72 | h1 a { 73 | text-decoration: none; 74 | color: #d7c6cf; 75 | } 76 | 77 | @media screen and (max-width: 480px) { 78 | h1 { 79 | width: 250px; 80 | font-size: 34px; 81 | } 82 | } 83 | 84 | .page-container>p { 85 | color: #717f86; 86 | font-size: 16px; 87 | max-width: 400px; 88 | text-align: center; 89 | margin-left: auto; 90 | margin-right: auto; 91 | margin-bottom: 75px; 92 | } 93 | 94 | .textarea-wrapper { 95 | display: -webkit-box; 96 | display: -ms-flexbox; 97 | display: flex; 98 | max-width: 750px; 99 | height: 300px; 100 | margin: 0 auto; 101 | } 102 | 103 | .container { 104 | width: 100%; 105 | height: 300px; 106 | } 107 | 108 | .container:first-child { 109 | margin-right: 25px; 110 | } 111 | 112 | .textarea { 113 | width: 100%; 114 | height: 300px; 115 | padding: 10px 10px; 116 | color: #444; 117 | font-size: 16px; 118 | background: rgba(255, 255, 255, .2); 119 | border: 1px solid rgba(215, 198, 207, .75); 120 | border-radius: 4px; 121 | outline: none; 122 | resize: none; 123 | } 124 | 125 | .textarea:focus { 126 | border: 1px solid rgba(215, 198, 207, 1); 127 | } 128 | 129 | @media screen and (max-width: 650px) { 130 | .textarea-wrapper { 131 | flex-direction: column; 132 | height: 625px; 133 | } 134 | 135 | .container { 136 | height: 600px; 137 | } 138 | 139 | .container:first-child { 140 | margin-right: 0px; 141 | margin-bottom: 25px; 142 | } 143 | 144 | .page-wrapper { 145 | display: block; 146 | } 147 | 148 | h1 { 149 | max-width: 400px; 150 | font-size: 28px; 151 | } 152 | } 153 | 154 | #clap_emoji_text_container { 155 | position: relative; 156 | } 157 | 158 | .tweet-button { 159 | position: absolute; 160 | left: 50%; 161 | transform: translate(-50%, -5px); 162 | top: -25px; 163 | color: #fff; 164 | background: rgba(29, 161, 242, .5); 165 | font-size: 15px; 166 | width: 90px; 167 | height: 24px; 168 | line-height: 24px; 169 | text-align: center; 170 | padding: 3px 6px; 171 | border-radius: 5px; 172 | text-decoration: none; 173 | padding: 0; 174 | margin: 0; 175 | transition: all .2s; 176 | opacity: 0; 177 | visibility: hidden; 178 | } 179 | 180 | .tweet-button :hover { 181 | background: rgba(29, 161, 242, .75); 182 | } 183 | 184 | .tweet-button svg { 185 | width: 16px; 186 | height: 16px; 187 | position: relative; 188 | top: 3px; 189 | } 190 | 191 | .tweet-button.active { 192 | opacity: 1; 193 | visibility: visible; 194 | transform: translate(-50%, 0px); 195 | } 196 | 197 | .multicultural { 198 | margin: 20px auto; 199 | text-align: center; 200 | } 201 | 202 | .multicultural .switch { 203 | margin: 5px auto; 204 | text-align: center; 205 | } 206 | 207 | footer { 208 | margin-top: 75px; 209 | text-align: center; 210 | color: #717f86; 211 | font-size: 13px; 212 | margin-bottom: 10px; 213 | } 214 | 215 | footer a { 216 | color: #717f86; 217 | text-decoration: none; 218 | } 219 | 220 | footer a:hover { 221 | text-decoration: underline; 222 | } 223 | 224 | 225 | /* switch css */ 226 | .switch { 227 | width: 50px; 228 | height: 30px; 229 | } 230 | 231 | .switch .switch__label { 232 | position: relative; 233 | display: inline-block; 234 | width: 50px; 235 | height: 30px; 236 | } 237 | 238 | .switch .switch__label input { 239 | display: none; 240 | } 241 | 242 | .switch .switch__label .switch__slider { 243 | position: absolute; 244 | cursor: pointer; 245 | top: 0; 246 | left: 0; 247 | right: 0; 248 | bottom: 0; 249 | background-color: #fff; 250 | transition: 0.3s; 251 | border: 2px solid #ebebeb; 252 | border-radius: 34px; 253 | } 254 | 255 | .switch .switch__label .switch__slider:before { 256 | position: absolute; 257 | content: ""; 258 | height: 22px; 259 | width: 22px; 260 | left: 2px; 261 | bottom: 2px; 262 | background-color: #ebebeb; 263 | transition: 0.3s; 264 | border-radius: 100%; 265 | } 266 | 267 | input:checked+.switch__slider { 268 | background-color: #d7c6cf !important; 269 | border: 2px solid transparent !important; 270 | } 271 | 272 | input:checked+.switch__slider:before { 273 | background-color: #fff !important; 274 | } 275 | 276 | input:checked+.switch__slider:before { 277 | transform: translateX(22px); 278 | } --------------------------------------------------------------------------------