/** * This file must not be changed or exchanged. * * @see http://bpmn.io/license for more information. */ import { assignStyle, domify, delegate as domDelegate, query as domQuery } from 'min-dom'; // inlined ../../resources/logo.svg var BPMNIO_LOGO_SVG = ''; export var BPMNIO_IMG = BPMNIO_LOGO_SVG; export var LOGO_STYLES = { verticalAlign: 'middle' }; export var LINK_STYLES = { 'color': '#404040' }; var LIGHTBOX_STYLES = { 'zIndex': '1001', 'position': 'fixed', 'top': '0', 'left': '0', 'right': '0', 'bottom': '0' }; var BACKDROP_STYLES = { 'width': '100%', 'height': '100%', 'background': 'rgba(40,40,40,0.2)' }; var NOTICE_STYLES = { 'position': 'absolute', 'left': '50%', 'top': '40%', 'transform': 'translate(-50%)', 'width': '260px', 'padding': '10px', 'background': 'white', 'boxShadow': '0 1px 4px rgba(0,0,0,0.3)', 'fontFamily': 'Helvetica, Arial, sans-serif', 'fontSize': '14px', 'display': 'flex', 'lineHeight': '1.3' }; var LIGHTBOX_MARKUP = '
' + '
' + '
' + '' + BPMNIO_IMG + '' + '' + 'Web-based tooling for BPMN, DMN and CMMN diagrams ' + 'powered by bpmn.io.' + '' + '
' + '
'; var lightbox; function createLightbox() { lightbox = domify(LIGHTBOX_MARKUP); assignStyle(lightbox, LIGHTBOX_STYLES); assignStyle(domQuery('svg', lightbox), LOGO_STYLES); assignStyle(domQuery('.backdrop', lightbox), BACKDROP_STYLES); assignStyle(domQuery('.notice', lightbox), NOTICE_STYLES); assignStyle(domQuery('.link', lightbox), LINK_STYLES, { 'margin': '15px 20px 15px 10px', 'alignSelf': 'center' }); } export function open() { if (!lightbox) { createLightbox(); domDelegate.bind(lightbox, '.backdrop', 'click', function(event) { document.body.removeChild(lightbox); }); } document.body.appendChild(lightbox); }