diff --git a/BondageClub/Scripts/lib/country-flag-emoji-polyfill/LICENSE.md b/BondageClub/Scripts/lib/country-flag-emoji-polyfill/LICENSE.md new file mode 100644 index 0000000000..daa5cff74f --- /dev/null +++ b/BondageClub/Scripts/lib/country-flag-emoji-polyfill/LICENSE.md @@ -0,0 +1,54 @@ +## License for the Code (MIT) + +Copyright (c) 2022 TalkJS + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +## License for the Visual Design + +The Emoji art in the "Twemoji Country Flags" font comes from [Twemoji](https://twitter.github.io/twemoji), +and is used and redistributed under the CC-BY-4.0 [license terms](https://github.com/twitter/twemoji#license) +offered by the Twemoji project. + +### Creative Commons Attribution 4.0 International (CC BY 4.0) +https://creativecommons.org/licenses/by/4.0/legalcode +or for the human readable summary: https://creativecommons.org/licenses/by/4.0/ + + +#### You are free to: +**Share** — copy and redistribute the material in any medium or format + +**Adapt** — remix, transform, and build upon the material for any purpose, even commercially. + +The licensor cannot revoke these freedoms as long as you follow the license terms. + + +#### Under the following terms: +**Attribution** — You must give appropriate credit, provide a link to the license, +and indicate if changes were made. +You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use. + +**No additional restrictions** — You may not apply legal terms or **technological measures** +that legally restrict others from doing anything the license permits. + +#### Notices: +You do not have to comply with the license for elements of the material in the public domain +or where your use is permitted by an applicable exception or limitation. No warranties are given. +The license may not give you all of the permissions necessary for your intended use. +For example, other rights such as publicity, privacy, or moral rights may limit how you use the material. diff --git a/BondageClub/Scripts/lib/country-flag-emoji-polyfill/index.d.ts b/BondageClub/Scripts/lib/country-flag-emoji-polyfill/index.d.ts new file mode 100644 index 0000000000..584ec7b726 --- /dev/null +++ b/BondageClub/Scripts/lib/country-flag-emoji-polyfill/index.d.ts @@ -0,0 +1,10 @@ +/** + * Injects a style element into the HEAD with a web font with country flags, + * iff the browser does support emojis but not country flags. + * + * @param fontName - Override the default font name ("Twemoji Country Flags") + * @param fontUrl - Override the font URL (defaults to a jsdeliver-hosted) + * + * @returns true if the web font was loaded (ie the browser does not support country flags) + */ +declare function polyfillCountryFlagEmojis(fontName?: string, fontUrl?: string): boolean; diff --git a/BondageClub/Scripts/lib/country-flag-emoji-polyfill/index.min.js b/BondageClub/Scripts/lib/country-flag-emoji-polyfill/index.min.js new file mode 100644 index 0000000000..57bf45f914 --- /dev/null +++ b/BondageClub/Scripts/lib/country-flag-emoji-polyfill/index.min.js @@ -0,0 +1,10 @@ +"use strict"; +const s='"Twemoji Mozilla","Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji","EmojiOne Color","Android Emoji",sans-serif';function r(){const o=document.createElement("canvas");o.width=o.height=1;const t=o.getContext("2d",{willReadFrequently:!0});return t.textBaseline="top",t.font=`100px ${s}`,t.scale(.01,.01),t}function i(o,t,e){return o.clearRect(0,0,100,100),o.fillStyle=e,o.fillText(t,0,0),o.getImageData(0,0,1,1).data.join(",")}function supportsEmoji(o){const t=r(),e=i(t,o,"#fff"),n=i(t,o,"#000");return n===e&&!n.startsWith("0,0,0,")}function polyfillCountryFlagEmojis(o="Twemoji Country Flags",t="https://cdn.jsdelivr.net/npm/country-flag-emoji-polyfill@0.1/dist/TwemojiCountryFlags.woff2"){if(typeof window<"u"&&supportsEmoji("\u{1F60A}")&&!supportsEmoji("\u{1F1E8}\u{1F1ED}")){const e=document.createElement("style");return e.textContent=`@font-face { + font-family: "${o}"; + unicode-range: U+1F1E6-1F1FF, U+1F3F4, U+E0062-E0063, U+E0065, U+E0067, + U+E006C, U+E006E, U+E0073-E0074, U+E0077, U+E007F; + src: url('${t}') format('woff2'); + font-display: swap; + }`,document.head.appendChild(e),!0}return!1}; + +polyfillCountryFlagEmojis(); diff --git a/BondageClub/Scripts/lib/country-flag-emoji-polyfill/package.json b/BondageClub/Scripts/lib/country-flag-emoji-polyfill/package.json new file mode 100644 index 0000000000..d58f101221 --- /dev/null +++ b/BondageClub/Scripts/lib/country-flag-emoji-polyfill/package.json @@ -0,0 +1,29 @@ +{ + "name": "country-flag-emoji-polyfill", + "version": "0.1.8", + "description": "Add country flag emojis to Chromium-based browsers on Windows", + "repository": "https://github.com/talkjs/country-flag-emoji-polyfill", + "author": "Egbert Teeselink", + "license": "MIT", + "type": "module", + "exports": { + ".": { + "import": "./dist/index.mjs", + "require": "./dist/index.cjs" + } + }, + "main": "./dist/index.cjs", + "types": "./dist/index.d.ts", + "files": [ + "dist" + ], + "scripts": { + "build": "unbuild --minify", + "dev": "nodemon -w src -e ts -x 'npm run build'", + "make-font": "cd build && ./make-font.sh" + }, + "devDependencies": { + "nodemon": "^3.0.2", + "unbuild": "^2.0.0" + } +} diff --git a/BondageClub/index.html b/BondageClub/index.html index 7db3d8be75..7371ea6187 100644 --- a/BondageClub/index.html +++ b/BondageClub/index.html @@ -28,6 +28,7 @@ <script src="Scripts/lib/webgl/resources/m4.js"></script> <script src="Scripts/lib/LZString.js"></script> <script src="Scripts/lib/socket.io/socket.io.min.js"></script> + <script src="Scripts/lib/country-flag-emoji-polyfill/index.min.js"></script> <script async src="Scripts/lib/chess.min.js"></script> <script async src="Scripts/lib/chessboard-4.3.9.min.js"></script> </head>