@hyper.fun/fa-fantasy-flight-games
Version:
👉 https://hyper.fun/c/fa-fantasy-flight-games/1.3.0
93 lines (87 loc) • 4.09 kB
JavaScript
/******/ // The require scope
/******/ var __wp_require__ = {};
/******/
/************************************************************************/
/******/ /* webpack/runtime/define property getters */
/******/ (() => {
/******/ // define getter functions for harmony exports
/******/ __wp_require__.d = (exports, definition) => {
/******/ for(var key in definition) {
/******/ if(__wp_require__.o(definition, key) && !__wp_require__.o(exports, key)) {
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ }
/******/ }
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */
/******/ (() => {
/******/ __wp_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
/******/ })();
/******/
/************************************************************************/
var __wp_exports__ = {};
// EXPORTS
__wp_require__.d(__wp_exports__, {
"Z": () => (/* binding */ AwesomeHfc)
});
;// CONCATENATED MODULE: ./.hfc/propnames.js
/* harmony default export */ const propnames = ([["size","class","color"],[],[]]);
;// CONCATENATED MODULE: ./src/index.ts
const svgAttrs = [["xmlns","http://www.w3.org/2000/svg"],["viewBox","0 0 512 512"]];
const svgHtml = "<path d=\"M256 32.86L32.86 256L256 479.14L479.14 256L256 32.86zM88.34 255.83c1.96-2 11.92-12.3 96.49-97.48c41.45-41.75 86.19-43.77 119.77-18.69c24.63 18.4 62.06 58.9 62.15 59c.68.74 1.07 2.86.58 3.38c-11.27 11.84-22.68 23.54-33.5 34.69c-34.21-32.31-40.52-38.24-48.51-43.95c-17.77-12.69-41.4-10.13-56.98 5.1c-2.17 2.13-1.79 3.43.12 5.35c2.94 2.95 28.1 28.33 35.09 35.78c-11.95 11.6-23.66 22.97-35.69 34.66c-12.02-12.54-24.48-25.53-36.54-38.11c-21.39 21.09-41.69 41.11-61.85 60.99a42569.01 42569.01 0 0 1-41.13-40.72zm234.82 101.6c-35.49 35.43-78.09 38.14-106.99 20.47c-22.08-13.5-39.38-32.08-72.93-66.84c12.05-12.37 23.79-24.42 35.37-36.31c33.02 31.91 37.06 36.01 44.68 42.09c18.48 14.74 42.52 13.67 59.32-1.8c3.68-3.39 3.69-3.64.14-7.24c-10.59-10.73-21.19-21.44-31.77-32.18c-1.32-1.34-3.03-2.48-.8-4.69c10.79-10.71 21.48-21.52 32.21-32.29c.26-.26.65-.38 1.91-1.07c12.37 12.87 24.92 25.92 37.25 38.75c21.01-20.73 41.24-40.68 61.25-60.42c13.68 13.4 27.13 26.58 40.86 40.03c-20.17 20.86-81.68 82.71-100.5 101.5zM256 0L0 256l256 256l256-256L256 0zM16 256L256 16l240 240l-240 240L16 256z\" fill=\"currentColor\"></path>";
class AwesomeHfc {
constructor(container, props) {
this.container = container;
for (let i = 0; i < svgAttrs.length; i++) {
container.setAttribute(svgAttrs[i][0], svgAttrs[i][1]);
}
this.render(props);
container.innerHTML = svgHtml;
}
changed(props) {
this.render(props);
}
disconnected() { }
render(props) {
if (props.attrs.size) {
this.container.setAttribute("width", props.attrs.size);
this.container.setAttribute("height", props.attrs.size);
}
if (props.attrs.class) {
this.container.setAttributeNS(null, "class", props.attrs.class);
}
if (props.attrs.color) {
this.container.style.fill = props.attrs.color;
this.container.style.color = props.attrs.color;
}
bindToElement(this.container, props.others);
}
}
AwesomeHfc.tag = "svg";
AwesomeHfc.props = propnames;
function bindToElement(elem, obj) {
for (let i = 0, keys = Object.keys(obj); i < keys.length; i++) {
const key = keys[i];
const value = obj[key];
if (key === "style") {
if (typeof value === "object") {
Object.assign(elem.style, value);
}
else {
elem.style.cssText += value;
}
continue;
}
if (typeof value === "function") {
elem[key] = function (event) {
value(event);
};
}
else {
elem.setAttribute(key, value);
}
}
}
var __wp_exports__default = __wp_exports__.Z;
export { __wp_exports__default as default };