@codedoc/core
Version:
Create beautiful modern documentation websites.
25 lines • 1.48 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Overlay = void 0;
var style = /*#__PURE__*/ "\n position: fixed;\n z-index: 1000;\n left: 0; right: 0; top: 0; bottom: 0;\n cursor: pointer;\n background: rgba(64, 64, 64, .65);\n display: flex;\n justify-content: center;\n align-items: center;\n font-size: 48px;\n color: white;\n opacity: 0;\n transition: opacity .1s;\n backdrop-filter: blur(16px);\n -webkit-backdrop-filter: blur(16px);\n";
function Overlay(options, renderer, content) {
var container$ = renderer.create("div", { style: style, onclick: function () { if (!(options === null || options === void 0 ? void 0 : options.sticky))
hide(); } },
renderer.create("div", { style: 'text-align: center; max-width: calc(75vw - 32px);max-height: calc(75vh - 32px); overflow: auto; padding: 16px' }, content));
var show = function () { return container$.style.opacity = '1'; };
var hide = function () {
container$.style.opacity = '0';
setTimeout(function () { return container$.remove(); }, 100);
};
this.track({
bind: function () {
setTimeout(show, 10);
if (!('backdropFilter' in container$.style) && !('-webkit-backdrop-filter' in container$.style)) {
container$.style.background = 'rgba(64, 64, 64, .95)';
}
}
});
return container$;
}
exports.Overlay = Overlay;
//# sourceMappingURL=index.js.map