UNPKG

poe-custom-elements

Version:

Path of Exile custom elements

68 lines (66 loc) 2.51 kB
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; import { LitElement, html, css } from 'lit'; import { customElement, property } from 'lit/decorators.js'; let JsonIconElement = class JsonIconElement extends LitElement { constructor() { super(...arguments); this.showing = false; } showWithAutohide() { this.showing = true; setTimeout(() => { this.showing = false; }, 2000); } render() { return html ` <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 32 32"> <path fill="#d6d024" d="M4 20v2h4.586L2 28.586L3.414 30L10 23.414V28h2v-8zm25-8l-2-6h-2v10h2v-6l2 6h2V6h-2zm-7.666-6h-2.667A1.67 1.67 0 0 0 17 7.667v6.667A1.67 1.67 0 0 0 18.666 16h2.667A1.67 1.67 0 0 0 23 14.334V7.667A1.67 1.67 0 0 0 21.334 6M21 14h-2V8h2zM9 7.667V10a2 2 0 0 0 2 2h2v2H9v2h4.334A1.67 1.67 0 0 0 15 14.334V12a2 2 0 0 0-2-2h-2V8h4V6h-4.334A1.67 1.67 0 0 0 9 7.667M5 14H3v-2H1v2.334A1.67 1.67 0 0 0 2.667 16h2.667A1.67 1.67 0 0 0 7 14.334V6H5z" /> </svg> `; } static { this.styles = css ` * { padding: 0; margin: 0; box-sizing: border-box; } :host { position: absolute; top: 100px; right: 0px; color: yellow; opacity: 0; transform: scale(0.75); z-index: 20; pointer-events: none; transition: opacity, transform, top; transition-duration: 0.2s; } :host([showing]) { opacity: 1; transform: scale(1); top: 0px; } `; } }; __decorate([ property({ type: Boolean, reflect: true }), __metadata("design:type", Object) ], JsonIconElement.prototype, "showing", void 0); JsonIconElement = __decorate([ customElement('tooltip-json-icon') ], JsonIconElement); export { JsonIconElement }; //# sourceMappingURL=tooltip-json-icon.js.map