@dkvz/img-lightbox 1.1.0 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/example_preview.6877a52a.jpg +0 -0
- package/dist/index.html +45 -0
- package/dist/shadow.aa007e53.js +899 -0
- package/dist/shadow.aa007e53.js.map +1 -0
- package/dist/up_/up_/assets/example.jpg +0 -0
- package/package.json +1 -1
- package/src/shadow/img-lightbox.js +3 -1
- package/dist/img-lightbox.js +0 -204
- package/dist/img-lightbox.js.map +0 -1
- package/dist/img-lightbox.mjs +0 -193
- package/dist/img-lightbox.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAI,WAAW;AAAK,IAAI,WAAW;AAAK,IAAI,kBAAkB;AAAK,IAAI,aAAa;AAAM,IAAI,eAAe;AAAmB,IAAI,cAAc;AAAM,OAAO,MAAM,CAAC,aAAa,GAAG;AAAmB;AAEzM,+KAA+K,GAC/K;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+CA,GACA,IAAI,aAAa;AACjB,IAAI,YAAY,OAAO,MAAM,CAAC,MAAM;AACpC,SAAS,OAAO,UAAU;IACxB,UAAU,IAAI,CAAC,IAAI,EAAE;IACrB,IAAI,CAAC,GAAG,GAAG;QACT,MAAM,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW;QACvC,kBAAkB,EAAE;QACpB,mBAAmB,EAAE;QACrB,QAAQ,SAAU,EAAE;YAClB,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,YAAa;QAChD;QACA,SAAS,SAAU,EAAE;YACn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AG,UAAU,GAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkE7B,CAAC;AACD,YAAY,SAAS,CAAC,QAAQ,GAAG;kBAElB;;;AC/Mf,OAAO,OAAO,GAAG;;;ACAjB,QAAQ,cAAc,GAAG,SAAU,CAAC;IAClC,OAAO,KAAK,EAAE,UAAU,GAAG,IAAI;QAAC,SAAS;IAAC;AAC5C;AAEA,QAAQ,iBAAiB,GAAG,SAAU,CAAC;IACrC,OAAO,cAAc,CAAC,GAAG,cAAc;QAAC,OAAO;IAAI;AACrD;AAEA,QAAQ,SAAS,GAAG,SAAU,MAAM,EAAE,IAAI;IACxC,OAAO,IAAI,CAAC,QAAQ,OAAO,CAAC,SAAU,GAAG;QACvC,IACE,QAAQ,aACR,QAAQ,gBACR,OAAO,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,MAE3C;QAGF,OAAO,cAAc,CAAC,MAAM,KAAK;YAC/B,YAAY;YACZ,KAAK;gBACH,OAAO,MAAM,CAAC,IAAI;YACpB;QACF;IACF;IAEA,OAAO;AACT;AAEA,QAAQ,MAAM,GAAG,SAAU,IAAI,EAAE,QAAQ,EAAE,GAAG;IAC5C,OAAO,cAAc,CAAC,MAAM,UAAU;QACpC,YAAY;QACZ,KAAK;IACP;AACF","sources":["node_modules/@parcel/runtime-browser-hmr/lib/runtime-2ee7167e570a7e6b.js","src/shadow/example.js","src/shadow/img-lightbox.js","node_modules/@parcel/runtime-js/lib/bundles/runtime-a27b63f374a207e2.js","node_modules/@parcel/transformer-js/src/esmodule-helpers.js"],"sourcesContent":["var HMR_HOST = null;var HMR_PORT = null;var HMR_SERVER_PORT = 1234;var HMR_SECURE = false;var HMR_ENV_HASH = \"439701173a9199ea\";var HMR_USE_SSE = false;module.bundle.HMR_BUNDLE_ID = \"bcbe6553aa007e53\";\"use strict\";\n\n/* global HMR_HOST, HMR_PORT, HMR_SERVER_PORT, HMR_ENV_HASH, HMR_SECURE, HMR_USE_SSE, chrome, browser, __parcel__import__, __parcel__importScripts__, ServiceWorkerGlobalScope */\n/*::\nimport type {\n HMRAsset,\n HMRMessage,\n} from '@parcel/reporter-dev-server/src/HMRServer.js';\ninterface ParcelRequire {\n (string): mixed;\n cache: {|[string]: ParcelModule|};\n hotData: {|[string]: mixed|};\n Module: any;\n parent: ?ParcelRequire;\n isParcelRequire: true;\n modules: {|[string]: [Function, {|[string]: string|}]|};\n HMR_BUNDLE_ID: string;\n root: ParcelRequire;\n}\ninterface ParcelModule {\n hot: {|\n data: mixed,\n accept(cb: (Function) => void): void,\n dispose(cb: (mixed) => void): void,\n // accept(deps: Array<string> | string, cb: (Function) => void): void,\n // decline(): void,\n _acceptCallbacks: Array<(Function) => void>,\n _disposeCallbacks: Array<(mixed) => void>,\n |};\n}\ninterface ExtensionContext {\n runtime: {|\n reload(): void,\n getURL(url: string): string;\n getManifest(): {manifest_version: number, ...};\n |};\n}\ndeclare var module: {bundle: ParcelRequire, ...};\ndeclare var HMR_HOST: string;\ndeclare var HMR_PORT: string;\ndeclare var HMR_SERVER_PORT: string;\ndeclare var HMR_ENV_HASH: string;\ndeclare var HMR_SECURE: boolean;\ndeclare var HMR_USE_SSE: boolean;\ndeclare var chrome: ExtensionContext;\ndeclare var browser: ExtensionContext;\ndeclare var __parcel__import__: (string) => Promise<void>;\ndeclare var __parcel__importScripts__: (string) => Promise<void>;\ndeclare var globalThis: typeof self;\ndeclare var ServiceWorkerGlobalScope: Object;\n*/\nvar OVERLAY_ID = '__parcel__error__overlay__';\nvar OldModule = module.bundle.Module;\nfunction Module(moduleName) {\n OldModule.call(this, moduleName);\n this.hot = {\n data: module.bundle.hotData[moduleName],\n _acceptCallbacks: [],\n _disposeCallbacks: [],\n accept: function (fn) {\n this._acceptCallbacks.push(fn || function () {});\n },\n dispose: function (fn) {\n this._disposeCallbacks.push(fn);\n }\n };\n module.bundle.hotData[moduleName] = undefined;\n}\nmodule.bundle.Module = Module;\nmodule.bundle.hotData = {};\nvar checkedAssets /*: {|[string]: boolean|} */,\n disposedAssets /*: {|[string]: boolean|} */,\n assetsToDispose /*: Array<[ParcelRequire, string]> */,\n assetsToAccept /*: Array<[ParcelRequire, string]> */,\n bundleNotFound = false;\nfunction getHostname() {\n return HMR_HOST || (typeof location !== 'undefined' && location.protocol.indexOf('http') === 0 ? location.hostname : 'localhost');\n}\nfunction getPort() {\n return HMR_PORT || (typeof location !== 'undefined' ? location.port : HMR_SERVER_PORT);\n}\n\n// eslint-disable-next-line no-redeclare\nlet WebSocket = globalThis.WebSocket;\nif (!WebSocket && typeof module.bundle.root === 'function') {\n try {\n // eslint-disable-next-line no-global-assign\n WebSocket = module.bundle.root('ws');\n } catch {\n // ignore.\n }\n}\nvar hostname = getHostname();\nvar port = getPort();\nvar protocol = HMR_SECURE || typeof location !== 'undefined' && location.protocol === 'https:' && !['localhost', '127.0.0.1', '0.0.0.0'].includes(hostname) ? 'wss' : 'ws';\n\n// eslint-disable-next-line no-redeclare\nvar parent = module.bundle.parent;\nif (!parent || !parent.isParcelRequire) {\n // Web extension context\n var extCtx = typeof browser === 'undefined' ? typeof chrome === 'undefined' ? null : chrome : browser;\n\n // Safari doesn't support sourceURL in error stacks.\n // eval may also be disabled via CSP, so do a quick check.\n var supportsSourceURL = false;\n try {\n (0, eval)('throw new Error(\"test\"); //# sourceURL=test.js');\n } catch (err) {\n supportsSourceURL = err.stack.includes('test.js');\n }\n var ws;\n if (HMR_USE_SSE) {\n ws = new EventSource('/__parcel_hmr');\n } else {\n try {\n // If we're running in the dev server's node runner, listen for messages on the parent port.\n let {\n workerData,\n parentPort\n } = module.bundle.root('node:worker_threads') /*: any*/;\n if (workerData !== null && workerData !== void 0 && workerData.__parcel) {\n parentPort.on('message', async message => {\n try {\n await handleMessage(message);\n parentPort.postMessage('updated');\n } catch {\n parentPort.postMessage('restart');\n }\n });\n\n // After the bundle has finished running, notify the dev server that the HMR update is complete.\n queueMicrotask(() => parentPort.postMessage('ready'));\n }\n } catch {\n if (typeof WebSocket !== 'undefined') {\n try {\n ws = new WebSocket(protocol + '://' + hostname + (port ? ':' + port : '') + '/');\n } catch (err) {\n // Ignore cloudflare workers error.\n if (err.message && !err.message.includes('Disallowed operation called within global scope')) {\n console.error(err.message);\n }\n }\n }\n }\n }\n if (ws) {\n // $FlowFixMe\n ws.onmessage = async function (event /*: {data: string, ...} */) {\n var data /*: HMRMessage */ = JSON.parse(event.data);\n await handleMessage(data);\n };\n if (ws instanceof WebSocket) {\n ws.onerror = function (e) {\n if (e.message) {\n console.error(e.message);\n }\n };\n ws.onclose = function () {\n console.warn('[parcel] 🚨 Connection to the HMR server was lost');\n };\n }\n }\n}\nasync function handleMessage(data /*: HMRMessage */) {\n checkedAssets = {} /*: {|[string]: boolean|} */;\n disposedAssets = {} /*: {|[string]: boolean|} */;\n assetsToAccept = [];\n assetsToDispose = [];\n bundleNotFound = false;\n if (data.type === 'reload') {\n fullReload();\n } else if (data.type === 'update') {\n // Remove error overlay if there is one\n if (typeof document !== 'undefined') {\n removeErrorOverlay();\n }\n let assets = data.assets;\n\n // Handle HMR Update\n let handled = assets.every(asset => {\n return asset.type === 'css' || asset.type === 'js' && hmrAcceptCheck(module.bundle.root, asset.id, asset.depsByBundle);\n });\n\n // Dispatch a custom event in case a bundle was not found. This might mean\n // an asset on the server changed and we should reload the page. This event\n // gives the client an opportunity to refresh without losing state\n // (e.g. via React Server Components). If e.preventDefault() is not called,\n // we will trigger a full page reload.\n if (handled && bundleNotFound && assets.some(a => a.envHash !== HMR_ENV_HASH) && typeof window !== 'undefined' && typeof CustomEvent !== 'undefined') {\n handled = !window.dispatchEvent(new CustomEvent('parcelhmrreload', {\n cancelable: true\n }));\n }\n if (handled) {\n console.clear();\n\n // Dispatch custom event so other runtimes (e.g React Refresh) are aware.\n if (typeof window !== 'undefined' && typeof CustomEvent !== 'undefined') {\n window.dispatchEvent(new CustomEvent('parcelhmraccept'));\n }\n await hmrApplyUpdates(assets);\n hmrDisposeQueue();\n\n // Run accept callbacks. This will also re-execute other disposed assets in topological order.\n let processedAssets = {};\n for (let i = 0; i < assetsToAccept.length; i++) {\n let id = assetsToAccept[i][1];\n if (!processedAssets[id]) {\n hmrAccept(assetsToAccept[i][0], id);\n processedAssets[id] = true;\n }\n }\n } else fullReload();\n }\n if (data.type === 'error') {\n // Log parcel errors to console\n for (let ansiDiagnostic of data.diagnostics.ansi) {\n let stack = ansiDiagnostic.codeframe ? ansiDiagnostic.codeframe : ansiDiagnostic.stack;\n console.error('🚨 [parcel]: ' + ansiDiagnostic.message + '\\n' + stack + '\\n\\n' + ansiDiagnostic.hints.join('\\n'));\n }\n if (typeof document !== 'undefined') {\n // Render the fancy html overlay\n removeErrorOverlay();\n var overlay = createErrorOverlay(data.diagnostics.html);\n // $FlowFixMe\n document.body.appendChild(overlay);\n }\n }\n}\nfunction removeErrorOverlay() {\n var overlay = document.getElementById(OVERLAY_ID);\n if (overlay) {\n overlay.remove();\n console.log('[parcel] ✨ Error resolved');\n }\n}\nfunction createErrorOverlay(diagnostics) {\n var overlay = document.createElement('div');\n overlay.id = OVERLAY_ID;\n let errorHTML = '<div style=\"background: black; opacity: 0.85; font-size: 16px; color: white; position: fixed; height: 100%; width: 100%; top: 0px; left: 0px; padding: 30px; font-family: Menlo, Consolas, monospace; z-index: 9999;\">';\n for (let diagnostic of diagnostics) {\n let stack = diagnostic.frames.length ? diagnostic.frames.reduce((p, frame) => {\n return `${p}\n<a href=\"${protocol === 'wss' ? 'https' : 'http'}://${hostname}:${port}/__parcel_launch_editor?file=${encodeURIComponent(frame.location)}\" style=\"text-decoration: underline; color: #888\" onclick=\"fetch(this.href); return false\">${frame.location}</a>\n${frame.code}`;\n }, '') : diagnostic.stack;\n errorHTML += `\n <div>\n <div style=\"font-size: 18px; font-weight: bold; margin-top: 20px;\">\n 🚨 ${diagnostic.message}\n </div>\n <pre>${stack}</pre>\n <div>\n ${diagnostic.hints.map(hint => '<div>💡 ' + hint + '</div>').join('')}\n </div>\n ${diagnostic.documentation ? `<div>📝 <a style=\"color: violet\" href=\"${diagnostic.documentation}\" target=\"_blank\">Learn more</a></div>` : ''}\n </div>\n `;\n }\n errorHTML += '</div>';\n overlay.innerHTML = errorHTML;\n return overlay;\n}\nfunction fullReload() {\n if (typeof location !== 'undefined' && 'reload' in location) {\n location.reload();\n } else if (typeof extCtx !== 'undefined' && extCtx && extCtx.runtime && extCtx.runtime.reload) {\n extCtx.runtime.reload();\n } else {\n try {\n let {\n workerData,\n parentPort\n } = module.bundle.root('node:worker_threads') /*: any*/;\n if (workerData !== null && workerData !== void 0 && workerData.__parcel) {\n parentPort.postMessage('restart');\n }\n } catch (err) {\n console.error('[parcel] ⚠️ An HMR update was not accepted. Please restart the process.');\n }\n }\n}\nfunction getParents(bundle, id) /*: Array<[ParcelRequire, string]> */{\n var modules = bundle.modules;\n if (!modules) {\n return [];\n }\n var parents = [];\n var k, d, dep;\n for (k in modules) {\n for (d in modules[k][1]) {\n dep = modules[k][1][d];\n if (dep === id || Array.isArray(dep) && dep[dep.length - 1] === id) {\n parents.push([bundle, k]);\n }\n }\n }\n if (bundle.parent) {\n parents = parents.concat(getParents(bundle.parent, id));\n }\n return parents;\n}\nfunction updateLink(link) {\n var href = link.getAttribute('href');\n if (!href) {\n return;\n }\n var newLink = link.cloneNode();\n newLink.onload = function () {\n if (link.parentNode !== null) {\n // $FlowFixMe\n link.parentNode.removeChild(link);\n }\n };\n newLink.setAttribute('href',\n // $FlowFixMe\n href.split('?')[0] + '?' + Date.now());\n // $FlowFixMe\n link.parentNode.insertBefore(newLink, link.nextSibling);\n}\nvar cssTimeout = null;\nfunction reloadCSS() {\n if (cssTimeout || typeof document === 'undefined') {\n return;\n }\n cssTimeout = setTimeout(function () {\n var links = document.querySelectorAll('link[rel=\"stylesheet\"]');\n for (var i = 0; i < links.length; i++) {\n // $FlowFixMe[incompatible-type]\n var href /*: string */ = links[i].getAttribute('href');\n var hostname = getHostname();\n var servedFromHMRServer = hostname === 'localhost' ? new RegExp('^(https?:\\\\/\\\\/(0.0.0.0|127.0.0.1)|localhost):' + getPort()).test(href) : href.indexOf(hostname + ':' + getPort());\n var absolute = /^https?:\\/\\//i.test(href) && href.indexOf(location.origin) !== 0 && !servedFromHMRServer;\n if (!absolute) {\n updateLink(links[i]);\n }\n }\n cssTimeout = null;\n }, 50);\n}\nfunction hmrDownload(asset) {\n if (asset.type === 'js') {\n if (typeof document !== 'undefined') {\n let script = document.createElement('script');\n script.src = asset.url + '?t=' + Date.now();\n if (asset.outputFormat === 'esmodule') {\n script.type = 'module';\n }\n return new Promise((resolve, reject) => {\n var _document$head;\n script.onload = () => resolve(script);\n script.onerror = reject;\n (_document$head = document.head) === null || _document$head === void 0 || _document$head.appendChild(script);\n });\n } else if (typeof importScripts === 'function') {\n // Worker scripts\n if (asset.outputFormat === 'esmodule') {\n return __parcel__import__(asset.url + '?t=' + Date.now());\n } else {\n return new Promise((resolve, reject) => {\n try {\n __parcel__importScripts__(asset.url + '?t=' + Date.now());\n resolve();\n } catch (err) {\n reject(err);\n }\n });\n }\n }\n }\n}\nasync function hmrApplyUpdates(assets) {\n global.parcelHotUpdate = Object.create(null);\n let scriptsToRemove;\n try {\n // If sourceURL comments aren't supported in eval, we need to load\n // the update from the dev server over HTTP so that stack traces\n // are correct in errors/logs. This is much slower than eval, so\n // we only do it if needed (currently just Safari).\n // https://bugs.webkit.org/show_bug.cgi?id=137297\n // This path is also taken if a CSP disallows eval.\n if (!supportsSourceURL) {\n let promises = assets.map(asset => {\n var _hmrDownload;\n return (_hmrDownload = hmrDownload(asset)) === null || _hmrDownload === void 0 ? void 0 : _hmrDownload.catch(err => {\n // Web extension fix\n if (extCtx && extCtx.runtime && extCtx.runtime.getManifest().manifest_version == 3 && typeof ServiceWorkerGlobalScope != 'undefined' && global instanceof ServiceWorkerGlobalScope) {\n extCtx.runtime.reload();\n return;\n }\n throw err;\n });\n });\n scriptsToRemove = await Promise.all(promises);\n }\n assets.forEach(function (asset) {\n hmrApply(module.bundle.root, asset);\n });\n } finally {\n delete global.parcelHotUpdate;\n if (scriptsToRemove) {\n scriptsToRemove.forEach(script => {\n if (script) {\n var _document$head2;\n (_document$head2 = document.head) === null || _document$head2 === void 0 || _document$head2.removeChild(script);\n }\n });\n }\n }\n}\nfunction hmrApply(bundle /*: ParcelRequire */, asset /*: HMRAsset */) {\n var modules = bundle.modules;\n if (!modules) {\n return;\n }\n if (asset.type === 'css') {\n reloadCSS();\n } else if (asset.type === 'js') {\n let deps = asset.depsByBundle[bundle.HMR_BUNDLE_ID];\n if (deps) {\n if (modules[asset.id]) {\n // Remove dependencies that are removed and will become orphaned.\n // This is necessary so that if the asset is added back again, the cache is gone, and we prevent a full page reload.\n let oldDeps = modules[asset.id][1];\n for (let dep in oldDeps) {\n if (!deps[dep] || deps[dep] !== oldDeps[dep]) {\n let id = oldDeps[dep];\n let parents = getParents(module.bundle.root, id);\n if (parents.length === 1) {\n hmrDelete(module.bundle.root, id);\n }\n }\n }\n }\n if (supportsSourceURL) {\n // Global eval. We would use `new Function` here but browser\n // support for source maps is better with eval.\n (0, eval)(asset.output);\n }\n\n // $FlowFixMe\n let fn = global.parcelHotUpdate[asset.id];\n modules[asset.id] = [fn, deps];\n }\n\n // Always traverse to the parent bundle, even if we already replaced the asset in this bundle.\n // This is required in case modules are duplicated. We need to ensure all instances have the updated code.\n if (bundle.parent) {\n hmrApply(bundle.parent, asset);\n }\n }\n}\nfunction hmrDelete(bundle, id) {\n let modules = bundle.modules;\n if (!modules) {\n return;\n }\n if (modules[id]) {\n // Collect dependencies that will become orphaned when this module is deleted.\n let deps = modules[id][1];\n let orphans = [];\n for (let dep in deps) {\n let parents = getParents(module.bundle.root, deps[dep]);\n if (parents.length === 1) {\n orphans.push(deps[dep]);\n }\n }\n\n // Delete the module. This must be done before deleting dependencies in case of circular dependencies.\n delete modules[id];\n delete bundle.cache[id];\n\n // Now delete the orphans.\n orphans.forEach(id => {\n hmrDelete(module.bundle.root, id);\n });\n } else if (bundle.parent) {\n hmrDelete(bundle.parent, id);\n }\n}\nfunction hmrAcceptCheck(bundle /*: ParcelRequire */, id /*: string */, depsByBundle /*: ?{ [string]: { [string]: string } }*/) {\n checkedAssets = {};\n if (hmrAcceptCheckOne(bundle, id, depsByBundle)) {\n return true;\n }\n\n // Traverse parents breadth first. All possible ancestries must accept the HMR update, or we'll reload.\n let parents = getParents(module.bundle.root, id);\n let accepted = false;\n while (parents.length > 0) {\n let v = parents.shift();\n let a = hmrAcceptCheckOne(v[0], v[1], null);\n if (a) {\n // If this parent accepts, stop traversing upward, but still consider siblings.\n accepted = true;\n } else if (a !== null) {\n // Otherwise, queue the parents in the next level upward.\n let p = getParents(module.bundle.root, v[1]);\n if (p.length === 0) {\n // If there are no parents, then we've reached an entry without accepting. Reload.\n accepted = false;\n break;\n }\n parents.push(...p);\n }\n }\n return accepted;\n}\nfunction hmrAcceptCheckOne(bundle /*: ParcelRequire */, id /*: string */, depsByBundle /*: ?{ [string]: { [string]: string } }*/) {\n var modules = bundle.modules;\n if (!modules) {\n return;\n }\n if (depsByBundle && !depsByBundle[bundle.HMR_BUNDLE_ID]) {\n // If we reached the root bundle without finding where the asset should go,\n // there's nothing to do. Mark as \"accepted\" so we don't reload the page.\n if (!bundle.parent) {\n bundleNotFound = true;\n return true;\n }\n return hmrAcceptCheckOne(bundle.parent, id, depsByBundle);\n }\n if (checkedAssets[id]) {\n return null;\n }\n checkedAssets[id] = true;\n var cached = bundle.cache[id];\n if (!cached) {\n return true;\n }\n assetsToDispose.push([bundle, id]);\n if (cached && cached.hot && cached.hot._acceptCallbacks.length) {\n assetsToAccept.push([bundle, id]);\n return true;\n }\n return false;\n}\nfunction hmrDisposeQueue() {\n // Dispose all old assets.\n for (let i = 0; i < assetsToDispose.length; i++) {\n let id = assetsToDispose[i][1];\n if (!disposedAssets[id]) {\n hmrDispose(assetsToDispose[i][0], id);\n disposedAssets[id] = true;\n }\n }\n assetsToDispose = [];\n}\nfunction hmrDispose(bundle /*: ParcelRequire */, id /*: string */) {\n var cached = bundle.cache[id];\n bundle.hotData[id] = {};\n if (cached && cached.hot) {\n cached.hot.data = bundle.hotData[id];\n }\n if (cached && cached.hot && cached.hot._disposeCallbacks.length) {\n cached.hot._disposeCallbacks.forEach(function (cb) {\n cb(bundle.hotData[id]);\n });\n }\n delete bundle.cache[id];\n}\nfunction hmrAccept(bundle /*: ParcelRequire */, id /*: string */) {\n // Execute the module.\n bundle(id);\n\n // Run the accept callbacks in the new version of the module.\n var cached = bundle.cache[id];\n if (cached && cached.hot && cached.hot._acceptCallbacks.length) {\n let assetsToAlsoAccept = [];\n cached.hot._acceptCallbacks.forEach(function (cb) {\n let additionalAssets = cb(function () {\n return getParents(module.bundle.root, id);\n });\n if (Array.isArray(additionalAssets) && additionalAssets.length) {\n assetsToAlsoAccept.push(...additionalAssets);\n }\n });\n if (assetsToAlsoAccept.length) {\n let handled = assetsToAlsoAccept.every(function (a) {\n return hmrAcceptCheck(a[0], a[1]);\n });\n if (!handled) {\n return fullReload();\n }\n hmrDisposeQueue();\n }\n }\n}","import ImgLightbox from './img-lightbox';\n\ncustomElements.define('img-lightbox', ImgLightbox);","// const loaderSvgUrl = require('../../assets/hourglass.svg');\nimport loaderSvg from 'bundle-text:../../assets/hourglass.svg';\n\nclass ImgLightbox extends HTMLElement {\n\n constructor() {\n super();\n this.loading = false;\n this.attachShadow({ mode: 'open' });\n }\n\n connectedCallback() {\n // Template is added to prototype below the \n // class definition.\n // It's from a template tag because it's \n // supposed to be faster this way.\n this.shadowRoot.appendChild(\n this.template.content.cloneNode(true)\n );\n // Get some element references from shadow DOM:\n this.overlay = this.shadowRoot.querySelector('#overlay');\n this.loadingOverlay = this.shadowRoot.querySelector('#loader');\n // Add the loading SVG to that element:\n this.loadingOverlay.innerHTML = loaderSvg;\n // Component needs a tabIndex to be focusable.\n this.tabIndex = 0;\n // The slotted elements are actually not in \n // the shadow DOM so we can get them like so:\n const link = this.querySelector('a');\n const img = this.querySelector('img');\n if (link !== null) {\n // Store the URL as the full image URL:\n this.fullImage = link.getAttribute('href');\n // Register a click event that has to \n // prevent default:\n //this._addListeners(link);\n // Prevent ability to focus the link:\n link.tabIndex = -1;\n } else if (img !== null) {\n this.fullImage = img.getAttribute('src');\n // Nothing wrong with giving the same tabIndex\n // to things, they're ordered by position.\n // I think.\n //img.tabIndex = 0;\n //this._addListeners(img);\n }\n this.fullImage && this._addListeners();\n }\n\n _addListeners() {\n this.addEventListener('click', this.showLightbox.bind(this), true);\n this.addEventListener('keydown', (e) => {\n // It's common to ignore anything with alt\n // modifiers. I've copied this from Google\n // people.\n if (e.altKey) return;\n // Catch enter and space:\n switch (e.keyCode) {\n case 13:\n case 32:\n this.showLightbox(e);\n default:\n return;\n }\n }, true);\n }\n\n showLightbox(e) {\n // This is required so that the link element does not get \n // followed:\n e.preventDefault();\n\n // Implement some kind of lock:\n if (!this.loading) {\n this.loading = true;\n // Preload the full image.\n // Show the spinner overlay:\n this._showOverlay(this.loadingOverlay);\n if (!this.img) {\n this.img = document.createElement('img');\n // For the moment we just do nothing on error with\n // the link target.\n this.img.addEventListener('error', () => {\n this._hideOverlay(this.loadingOverlay);\n this.loading = false;\n });\n // this.img.addEventListener('load', () => this.showImage());\n this.img.src = this.fullImage;\n this.img.tabIndex = 1;\n // Prepare the events to close the overlay.\n // I'm doing this here to light up what's\n // happening in connectedCallback.\n // I'm not doing a check for which key was\n // called on purpose, but maybe I should do\n // that alt key check?\n ['click', 'keydown'].forEach(\n (type) =>\n this.overlay.addEventListener(\n type,\n (e) => this._hideOverlay(e.currentTarget)\n )\n );\n this.overlay.appendChild(this.img);\n } else {\n this.showImage();\n }\n }\n }\n\n showImage() {\n this.img.style.transform = 'scale(0.1)';\n // Hide the loading overlay:\n this._hideOverlay(this.loadingOverlay);\n this._showOverlay(this.overlay);\n // Focus the overlay (requires it to have a tabIndex):\n this.overlay.focus();\n // Start the CSS transition:\n this.img.style.transform = 'scale(1)';\n // Don't forget to unlock the click event:\n this.loading = false;\n }\n\n _showOverlay(overlay) {\n overlay.style.display = 'flex';\n }\n\n _hideOverlay(overlay) {\n overlay.style.display = '';\n }\n\n}\n\n// I'm using a true template tag because the Chrome\n// team says it's faster. The template tag has \n// better browser support than web components anyway.\n// The strange comment here is needed for syntax\n// highlighting with a VS Code extension I'm using.\nconst tpl = document.createElement('template');\ntpl.innerHTML = /*template*/`\n<style>\n :host {\n display: inline-block;\n cursor: pointer;\n position: relative;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n :host(:focus), :host(:active) {\n outline: 2px solid #77b;\n }\n\n #loader {\n position: absolute;\n z-index: 1;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0,0,0,.2);\n display: none;\n align-items: center;\n justify-content: center;\n }\n\n #overlay {\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n z-index: 999;\n background-color: rgba(0,0,0,.5);\n display: none;\n align-items: center;\n justify-content: center;\n }\n\n #loader svg {\n height: auto;\n max-height: 99%;\n max-width: 50%;\n opacity: 0.6;\n animation: lightbox-loader 2s infinite;\n }\n\n #overlay img {\n max-width: 100%;\n max-height: 100%;\n transition: transform 0.8s;\n }\n\n @keyframes lightbox-loader {\n 0% {transform: rotate(0deg);}\n 100% {transform: rotate(360deg);}\n }\n</style>\n<slot></slot>\n<div id=\"overlay\" tabindex=\"0\"></div>\n<div id=\"loader\">\n</div>\n`;\nImgLightbox.prototype.template = tpl;\n\nexport default ImgLightbox;\n","module.exports = \"e111495db2014e08\";","exports.interopDefault = function (a) {\n return a && a.__esModule ? a : {default: a};\n};\n\nexports.defineInteropFlag = function (a) {\n Object.defineProperty(a, '__esModule', {value: true});\n};\n\nexports.exportAll = function (source, dest) {\n Object.keys(source).forEach(function (key) {\n if (\n key === 'default' ||\n key === '__esModule' ||\n Object.prototype.hasOwnProperty.call(dest, key)\n ) {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function () {\n return source[key];\n },\n });\n });\n\n return dest;\n};\n\nexports.export = function (dest, destName, get) {\n Object.defineProperty(dest, destName, {\n enumerable: true,\n get: get,\n });\n};\n"],"names":[],"version":3,"file":"shadow.aa007e53.js.map","sourceRoot":"/__parcel_source_root/"}
|
|
Binary file
|
package/package.json
CHANGED
package/dist/img-lightbox.js
DELETED
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
function $parcel$interopDefault(a) {
|
|
3
|
-
return a && a.__esModule ? a.default : a;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
function $parcel$defineInteropFlag(a) {
|
|
7
|
-
Object.defineProperty(a, '__esModule', {value: true, configurable: true});
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
function $parcel$export(e, n, v, s) {
|
|
11
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
$parcel$defineInteropFlag(module.exports);
|
|
15
|
-
|
|
16
|
-
$parcel$export(module.exports, "default", () => $a6ba83244539002c$export$2e2bcd8739ae039);
|
|
17
|
-
// const loaderSvgUrl = require('../../assets/hourglass.svg');
|
|
18
|
-
var $735957c3b581425f$exports = {};
|
|
19
|
-
$735957c3b581425f$exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" enable-background=\"new 0 0 64 64\" version=\"1.1\" viewBox=\"0 0 64 64\" xml:space=\"preserve\"><metadata><rdf:RDF><cc:Work rdf:about=\"\"><dc:format>image/svg+xml</dc:format><dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/><dc:title/></cc:Work></rdf:RDF></metadata>\n<g>\n\t\t<circle class=\"st0\" cx=\"32\" cy=\"32\" r=\"32\"/>\n\t</g><g class=\"st1\" opacity=\".2\">\n\t\t<path class=\"st2\" d=\"m46 50h-2v-4c0-4.5-3-7.4-3-7.4s-3-2.8-3.9-3.7 0-1.8 0-1.8 1.3-1.3 4.2-4c2.8-2.7 2.7-6.7 2.7-6.7v-5.1l-12-1-12 1v5.1s-0.1 3.9 2.7 6.7c2.8 2.7 4.2 4 4.2 4s0.9 0.9 0 1.8-3.9 3.7-3.9 3.7-3 2.8-3 7.4v4h-2c-1.1 0-2 0.9-2 2s0.9 2 2 2h28c1.1 0 2-0.9 2-2s-0.9-2-2-2z\" fill=\"#231f20\"/>\n\t</g>\n\t\t<path class=\"st3\" d=\"m41 36.6s-3-2.8-3.9-3.7 0-1.8 0-1.8 1.3-1.3 4.2-4c2.8-2.7 2.7-6.7 2.7-6.7v-5.1l-12-1-12 1v5.1s-0.1 3.9 2.7 6.7c2.8 2.7 4.2 4 4.2 4s0.9 0.9 0 1.8-3.9 3.7-3.9 3.7-3 2.8-3 7.4v5.1h24v-5.1c0-4.5-3-7.4-3-7.4z\" fill=\"#fff\"/>\n\t\n\t\t<path class=\"st4\" d=\"m31 43v-11c0-2.1-1-3.4-1.3-3.7l-4.2-4c-1.5-1.4-1.5-3.7-1.5-3.7h16s0 2.3-1.5 3.7l-4.2 4c-0.4 0.3-1.3 1.6-1.3 3.7v11z\"/>\n\t<g class=\"st5\" opacity=\".3\">\n\t\t<path class=\"st2\" d=\"m48 16c0 1.1-0.9 2-2 2h-28c-1.1 0-2-0.9-2-2s0.9-2 2-2h28c1.1 0 2 0.9 2 2z\" fill=\"#231f20\"/>\n\t</g><g fill=\"#fff\">\n\t\t<path class=\"st6\" d=\"m48 14c0 1.1-0.9 2-2 2h-28c-1.1 0-2-0.9-2-2s0.9-2 2-2h28c1.1 0 2 0.9 2 2z\" fill=\"#fff\"/>\n\t</g><g fill=\"#fff\">\n\t\t<path class=\"st6\" d=\"m48 50c0 1.1-0.9 2-2 2h-28c-1.1 0-2-0.9-2-2s0.9-2 2-2h28c1.1 0 2 0.9 2 2z\" fill=\"#fff\"/>\n\t</g><g>\n\t\t<polygon class=\"st4\" points=\"23 48 23 48 32 40 41 48\"/>\n\t</g>\n\n</svg>";
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
class $a6ba83244539002c$var$ImgLightbox extends HTMLElement {
|
|
23
|
-
constructor(){
|
|
24
|
-
super();
|
|
25
|
-
this.loading = false;
|
|
26
|
-
this.attachShadow({
|
|
27
|
-
mode: 'open'
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
connectedCallback() {
|
|
31
|
-
// Template is added to prototype below the
|
|
32
|
-
// class definition.
|
|
33
|
-
// It's from a template tag because it's
|
|
34
|
-
// supposed to be faster this way.
|
|
35
|
-
this.shadowRoot.appendChild(this.template.content.cloneNode(true));
|
|
36
|
-
// Get some element references from shadow DOM:
|
|
37
|
-
this.overlay = this.shadowRoot.querySelector('#overlay');
|
|
38
|
-
this.loadingOverlay = this.shadowRoot.querySelector('#loader');
|
|
39
|
-
// Add the loading SVG to that element:
|
|
40
|
-
this.loadingOverlay.innerHTML = (0, (/*@__PURE__*/$parcel$interopDefault($735957c3b581425f$exports)));
|
|
41
|
-
// Component needs a tabIndex to be focusable.
|
|
42
|
-
this.tabIndex = 0;
|
|
43
|
-
// The slotted elements are actually not in
|
|
44
|
-
// the shadow DOM so we can get them like so:
|
|
45
|
-
const link = this.querySelector('a');
|
|
46
|
-
const img = this.querySelector('img');
|
|
47
|
-
if (link !== null) {
|
|
48
|
-
// Store the URL as the full image URL:
|
|
49
|
-
this.fullImage = link.getAttribute('href');
|
|
50
|
-
// Register a click event that has to
|
|
51
|
-
// prevent default:
|
|
52
|
-
//this._addListeners(link);
|
|
53
|
-
// Prevent ability to focus the link:
|
|
54
|
-
link.tabIndex = -1;
|
|
55
|
-
} else if (img !== null) this.fullImage = img.getAttribute('src');
|
|
56
|
-
this.fullImage && this._addListeners();
|
|
57
|
-
}
|
|
58
|
-
_addListeners() {
|
|
59
|
-
this.addEventListener('click', this.showLightbox.bind(this), true);
|
|
60
|
-
this.addEventListener('keydown', (e)=>{
|
|
61
|
-
// It's common to ignore anything with alt
|
|
62
|
-
// modifiers. I've copied this from Google
|
|
63
|
-
// people.
|
|
64
|
-
if (e.altKey) return;
|
|
65
|
-
// Catch enter and space:
|
|
66
|
-
switch(e.keyCode){
|
|
67
|
-
case 13:
|
|
68
|
-
case 32:
|
|
69
|
-
this.showLightbox(e);
|
|
70
|
-
default:
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
}, true);
|
|
74
|
-
}
|
|
75
|
-
showLightbox(e) {
|
|
76
|
-
// This is required so that the link element does not get
|
|
77
|
-
// followed:
|
|
78
|
-
e.preventDefault();
|
|
79
|
-
// Implement some kind of lock:
|
|
80
|
-
if (!this.loading) {
|
|
81
|
-
this.loading = true;
|
|
82
|
-
// Preload the full image.
|
|
83
|
-
// Show the spinner overlay:
|
|
84
|
-
this._showOverlay(this.loadingOverlay);
|
|
85
|
-
if (!this.img) {
|
|
86
|
-
this.img = document.createElement('img');
|
|
87
|
-
// For the moment we just do nothing on error with
|
|
88
|
-
// the link target.
|
|
89
|
-
this.img.addEventListener('error', ()=>{
|
|
90
|
-
this._hideOverlay(this.loadingOverlay);
|
|
91
|
-
this.loading = false;
|
|
92
|
-
});
|
|
93
|
-
this.img.addEventListener('load', ()=>this.showImage());
|
|
94
|
-
this.img.src = this.fullImage;
|
|
95
|
-
this.img.tabIndex = 1;
|
|
96
|
-
// Prepare the events to close the overlay.
|
|
97
|
-
// I'm doing this here to light up what's
|
|
98
|
-
// happening in connectedCallback.
|
|
99
|
-
// I'm not doing a check for which key was
|
|
100
|
-
// called on purpose, but maybe I should do
|
|
101
|
-
// that alt key check?
|
|
102
|
-
[
|
|
103
|
-
'click',
|
|
104
|
-
'keydown'
|
|
105
|
-
].forEach((type)=>this.overlay.addEventListener(type, (e)=>this._hideOverlay(e.currentTarget)));
|
|
106
|
-
this.overlay.appendChild(this.img);
|
|
107
|
-
} else this.showImage();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
showImage() {
|
|
111
|
-
this.img.style.transform = 'scale(0.1)';
|
|
112
|
-
// Hide the loading overlay:
|
|
113
|
-
this._hideOverlay(this.loadingOverlay);
|
|
114
|
-
this._showOverlay(this.overlay);
|
|
115
|
-
// Focus the overlay (requires it to have a tabIndex):
|
|
116
|
-
this.overlay.focus();
|
|
117
|
-
// Start the CSS transition:
|
|
118
|
-
this.img.style.transform = 'scale(1)';
|
|
119
|
-
// Don't forget to unlock the click event:
|
|
120
|
-
this.loading = false;
|
|
121
|
-
}
|
|
122
|
-
_showOverlay(overlay) {
|
|
123
|
-
overlay.style.display = 'flex';
|
|
124
|
-
}
|
|
125
|
-
_hideOverlay(overlay) {
|
|
126
|
-
overlay.style.display = '';
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
// I'm using a true template tag because the Chrome
|
|
130
|
-
// team says it's faster. The template tag has
|
|
131
|
-
// better browser support than web components anyway.
|
|
132
|
-
// The strange comment here is needed for syntax
|
|
133
|
-
// highlighting with a VS Code extension I'm using.
|
|
134
|
-
const $a6ba83244539002c$var$tpl = document.createElement('template');
|
|
135
|
-
$a6ba83244539002c$var$tpl.innerHTML = /*template*/ `
|
|
136
|
-
<style>
|
|
137
|
-
:host {
|
|
138
|
-
display: inline-block;
|
|
139
|
-
cursor: pointer;
|
|
140
|
-
position: relative;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
:host([hidden]) {
|
|
144
|
-
display: none;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
:host(:focus), :host(:active) {
|
|
148
|
-
outline: 2px solid #77b;
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
#loader {
|
|
152
|
-
position: absolute;
|
|
153
|
-
z-index: 1;
|
|
154
|
-
top: 0;
|
|
155
|
-
left: 0;
|
|
156
|
-
width: 100%;
|
|
157
|
-
height: 100%;
|
|
158
|
-
background-color: rgba(0,0,0,.2);
|
|
159
|
-
display: none;
|
|
160
|
-
align-items: center;
|
|
161
|
-
justify-content: center;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
#overlay {
|
|
165
|
-
position: fixed;
|
|
166
|
-
top: 0;
|
|
167
|
-
left: 0;
|
|
168
|
-
bottom: 0;
|
|
169
|
-
right: 0;
|
|
170
|
-
overflow: hidden;
|
|
171
|
-
z-index: 999;
|
|
172
|
-
background-color: rgba(0,0,0,.5);
|
|
173
|
-
display: none;
|
|
174
|
-
align-items: center;
|
|
175
|
-
justify-content: center;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
#loader svg {
|
|
179
|
-
width: 50%;
|
|
180
|
-
opacity: 0.6;
|
|
181
|
-
animation: lightbox-loader 2s infinite;
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
#overlay img {
|
|
185
|
-
max-width: 100%;
|
|
186
|
-
max-height: 100%;
|
|
187
|
-
transition: transform 0.8s;
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
@keyframes lightbox-loader {
|
|
191
|
-
0% {transform: rotate(0deg);}
|
|
192
|
-
100% {transform: rotate(360deg);}
|
|
193
|
-
}
|
|
194
|
-
</style>
|
|
195
|
-
<slot></slot>
|
|
196
|
-
<div id="overlay" tabindex="0"></div>
|
|
197
|
-
<div id="loader">
|
|
198
|
-
</div>
|
|
199
|
-
`;
|
|
200
|
-
$a6ba83244539002c$var$ImgLightbox.prototype.template = $a6ba83244539002c$var$tpl;
|
|
201
|
-
var $a6ba83244539002c$export$2e2bcd8739ae039 = $a6ba83244539002c$var$ImgLightbox;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
//# sourceMappingURL=img-lightbox.js.map
|
package/dist/img-lightbox.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAAA,8DAA8D;;ACA9D,4BAAiB;;;ADGjB,MAAM,0CAAoB;IAExB,aAAc;QACZ,KAAK;QACL,IAAI,CAAC,OAAO,GAAG;QACf,IA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AAsD;QACtD,IAAI,CAAC,OAAO,CAAC,KAAK;QAClB,4BAA4B;QAC5B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,GAAG;QAC3B,0CAA0C;QAC1C,IAAI,CAAC,OAAO,GAAG;IACjB;IAEA,aAAa,OAAO,EAAE;QACpB,QAAQ,KAAK,CAAC,OAAO,GAAG;IAC1B;IAEA,aAAa,OAAO,EAAE;QACpB,QAAQ,KAAK,CAAC,OAAO,GAAG;IAC1B;AAEF;AAEA,mDAAmD;AACnD,+CAA+C;AAC/C,qDAAqD;AACrD,gDAAgD;AAChD,mDAAmD;AACnD,MAAM,4BAAM,SAAS,aAAa,CAAC;AACnC,0BAAI,SAAS,GAAG,UAAU,GAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgE7B,CAAC;AACD,kCAAY,SAAS,CAAC,QAAQ,GAAG;IAEjC,2CAAe","sources":["src/shadow/img-lightbox.js","node_modules/@parcel/runtime-js/lib/bundles/runtime-4f432e39aae9d60a.js"],"sourcesContent":["// const loaderSvgUrl = require('../../assets/hourglass.svg');\nimport loaderSvg from 'bundle-text:../../assets/hourglass.svg';\n\nclass ImgLightbox extends HTMLElement {\n\n constructor() {\n super();\n this.loading = false;\n this.attachShadow({ mode: 'open' });\n }\n\n connectedCallback() {\n // Template is added to prototype below the \n // class definition.\n // It's from a template tag because it's \n // supposed to be faster this way.\n this.shadowRoot.appendChild(\n this.template.content.cloneNode(true)\n );\n // Get some element references from shadow DOM:\n this.overlay = this.shadowRoot.querySelector('#overlay');\n this.loadingOverlay = this.shadowRoot.querySelector('#loader');\n // Add the loading SVG to that element:\n this.loadingOverlay.innerHTML = loaderSvg;\n // Component needs a tabIndex to be focusable.\n this.tabIndex = 0;\n // The slotted elements are actually not in \n // the shadow DOM so we can get them like so:\n const link = this.querySelector('a');\n const img = this.querySelector('img');\n if (link !== null) {\n // Store the URL as the full image URL:\n this.fullImage = link.getAttribute('href');\n // Register a click event that has to \n // prevent default:\n //this._addListeners(link);\n // Prevent ability to focus the link:\n link.tabIndex = -1;\n } else if (img !== null) {\n this.fullImage = img.getAttribute('src');\n // Nothing wrong with giving the same tabIndex\n // to things, they're ordered by position.\n // I think.\n //img.tabIndex = 0;\n //this._addListeners(img);\n }\n this.fullImage && this._addListeners();\n }\n\n _addListeners() {\n this.addEventListener('click', this.showLightbox.bind(this), true);\n this.addEventListener('keydown', (e) => {\n // It's common to ignore anything with alt\n // modifiers. I've copied this from Google\n // people.\n if (e.altKey) return;\n // Catch enter and space:\n switch (e.keyCode) {\n case 13:\n case 32:\n this.showLightbox(e);\n default:\n return;\n }\n }, true);\n }\n\n showLightbox(e) {\n // This is required so that the link element does not get \n // followed:\n e.preventDefault();\n\n // Implement some kind of lock:\n if (!this.loading) {\n this.loading = true;\n // Preload the full image.\n // Show the spinner overlay:\n this._showOverlay(this.loadingOverlay);\n if (!this.img) {\n this.img = document.createElement('img');\n // For the moment we just do nothing on error with\n // the link target.\n this.img.addEventListener('error', () => {\n this._hideOverlay(this.loadingOverlay);\n this.loading = false;\n });\n this.img.addEventListener('load', () => this.showImage());\n this.img.src = this.fullImage;\n this.img.tabIndex = 1;\n // Prepare the events to close the overlay.\n // I'm doing this here to light up what's\n // happening in connectedCallback.\n // I'm not doing a check for which key was\n // called on purpose, but maybe I should do\n // that alt key check?\n ['click', 'keydown'].forEach(\n (type) =>\n this.overlay.addEventListener(\n type,\n (e) => this._hideOverlay(e.currentTarget)\n )\n );\n this.overlay.appendChild(this.img);\n } else {\n this.showImage();\n }\n }\n }\n\n showImage() {\n this.img.style.transform = 'scale(0.1)';\n // Hide the loading overlay:\n this._hideOverlay(this.loadingOverlay);\n this._showOverlay(this.overlay);\n // Focus the overlay (requires it to have a tabIndex):\n this.overlay.focus();\n // Start the CSS transition:\n this.img.style.transform = 'scale(1)';\n // Don't forget to unlock the click event:\n this.loading = false;\n }\n\n _showOverlay(overlay) {\n overlay.style.display = 'flex';\n }\n\n _hideOverlay(overlay) {\n overlay.style.display = '';\n }\n\n}\n\n// I'm using a true template tag because the Chrome\n// team says it's faster. The template tag has \n// better browser support than web components anyway.\n// The strange comment here is needed for syntax\n// highlighting with a VS Code extension I'm using.\nconst tpl = document.createElement('template');\ntpl.innerHTML = /*template*/`\n<style>\n :host {\n display: inline-block;\n cursor: pointer;\n position: relative;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n :host(:focus), :host(:active) {\n outline: 2px solid #77b;\n }\n\n #loader {\n position: absolute;\n z-index: 1;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0,0,0,.2);\n display: none;\n align-items: center;\n justify-content: center;\n }\n\n #overlay {\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n z-index: 999;\n background-color: rgba(0,0,0,.5);\n display: none;\n align-items: center;\n justify-content: center;\n }\n\n #loader svg {\n width: 50%;\n opacity: 0.6;\n animation: lightbox-loader 2s infinite;\n }\n\n #overlay img {\n max-width: 100%;\n max-height: 100%;\n transition: transform 0.8s;\n }\n\n @keyframes lightbox-loader {\n 0% {transform: rotate(0deg);}\n 100% {transform: rotate(360deg);}\n }\n</style>\n<slot></slot>\n<div id=\"overlay\" tabindex=\"0\"></div>\n<div id=\"loader\">\n</div>\n`;\nImgLightbox.prototype.template = tpl;\n\nexport default ImgLightbox;\n","module.exports = \"1f3d06fcd1df419a\";"],"names":[],"version":3,"file":"img-lightbox.js.map"}
|
package/dist/img-lightbox.mjs
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
function $parcel$interopDefault(a) {
|
|
3
|
-
return a && a.__esModule ? a.default : a;
|
|
4
|
-
}
|
|
5
|
-
// const loaderSvgUrl = require('../../assets/hourglass.svg');
|
|
6
|
-
var $6ba1613a1599b26d$exports = {};
|
|
7
|
-
$6ba1613a1599b26d$exports = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" enable-background=\"new 0 0 64 64\" version=\"1.1\" viewBox=\"0 0 64 64\" xml:space=\"preserve\"><metadata><rdf:RDF><cc:Work rdf:about=\"\"><dc:format>image/svg+xml</dc:format><dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/><dc:title/></cc:Work></rdf:RDF></metadata>\n<g>\n\t\t<circle class=\"st0\" cx=\"32\" cy=\"32\" r=\"32\"/>\n\t</g><g class=\"st1\" opacity=\".2\">\n\t\t<path class=\"st2\" d=\"m46 50h-2v-4c0-4.5-3-7.4-3-7.4s-3-2.8-3.9-3.7 0-1.8 0-1.8 1.3-1.3 4.2-4c2.8-2.7 2.7-6.7 2.7-6.7v-5.1l-12-1-12 1v5.1s-0.1 3.9 2.7 6.7c2.8 2.7 4.2 4 4.2 4s0.9 0.9 0 1.8-3.9 3.7-3.9 3.7-3 2.8-3 7.4v4h-2c-1.1 0-2 0.9-2 2s0.9 2 2 2h28c1.1 0 2-0.9 2-2s-0.9-2-2-2z\" fill=\"#231f20\"/>\n\t</g>\n\t\t<path class=\"st3\" d=\"m41 36.6s-3-2.8-3.9-3.7 0-1.8 0-1.8 1.3-1.3 4.2-4c2.8-2.7 2.7-6.7 2.7-6.7v-5.1l-12-1-12 1v5.1s-0.1 3.9 2.7 6.7c2.8 2.7 4.2 4 4.2 4s0.9 0.9 0 1.8-3.9 3.7-3.9 3.7-3 2.8-3 7.4v5.1h24v-5.1c0-4.5-3-7.4-3-7.4z\" fill=\"#fff\"/>\n\t\n\t\t<path class=\"st4\" d=\"m31 43v-11c0-2.1-1-3.4-1.3-3.7l-4.2-4c-1.5-1.4-1.5-3.7-1.5-3.7h16s0 2.3-1.5 3.7l-4.2 4c-0.4 0.3-1.3 1.6-1.3 3.7v11z\"/>\n\t<g class=\"st5\" opacity=\".3\">\n\t\t<path class=\"st2\" d=\"m48 16c0 1.1-0.9 2-2 2h-28c-1.1 0-2-0.9-2-2s0.9-2 2-2h28c1.1 0 2 0.9 2 2z\" fill=\"#231f20\"/>\n\t</g><g fill=\"#fff\">\n\t\t<path class=\"st6\" d=\"m48 14c0 1.1-0.9 2-2 2h-28c-1.1 0-2-0.9-2-2s0.9-2 2-2h28c1.1 0 2 0.9 2 2z\" fill=\"#fff\"/>\n\t</g><g fill=\"#fff\">\n\t\t<path class=\"st6\" d=\"m48 50c0 1.1-0.9 2-2 2h-28c-1.1 0-2-0.9-2-2s0.9-2 2-2h28c1.1 0 2 0.9 2 2z\" fill=\"#fff\"/>\n\t</g><g>\n\t\t<polygon class=\"st4\" points=\"23 48 23 48 32 40 41 48\"/>\n\t</g>\n\n</svg>";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class $ef17987508a11d23$var$ImgLightbox extends HTMLElement {
|
|
11
|
-
constructor(){
|
|
12
|
-
super();
|
|
13
|
-
this.loading = false;
|
|
14
|
-
this.attachShadow({
|
|
15
|
-
mode: 'open'
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
connectedCallback() {
|
|
19
|
-
// Template is added to prototype below the
|
|
20
|
-
// class definition.
|
|
21
|
-
// It's from a template tag because it's
|
|
22
|
-
// supposed to be faster this way.
|
|
23
|
-
this.shadowRoot.appendChild(this.template.content.cloneNode(true));
|
|
24
|
-
// Get some element references from shadow DOM:
|
|
25
|
-
this.overlay = this.shadowRoot.querySelector('#overlay');
|
|
26
|
-
this.loadingOverlay = this.shadowRoot.querySelector('#loader');
|
|
27
|
-
// Add the loading SVG to that element:
|
|
28
|
-
this.loadingOverlay.innerHTML = (0, (/*@__PURE__*/$parcel$interopDefault($6ba1613a1599b26d$exports)));
|
|
29
|
-
// Component needs a tabIndex to be focusable.
|
|
30
|
-
this.tabIndex = 0;
|
|
31
|
-
// The slotted elements are actually not in
|
|
32
|
-
// the shadow DOM so we can get them like so:
|
|
33
|
-
const link = this.querySelector('a');
|
|
34
|
-
const img = this.querySelector('img');
|
|
35
|
-
if (link !== null) {
|
|
36
|
-
// Store the URL as the full image URL:
|
|
37
|
-
this.fullImage = link.getAttribute('href');
|
|
38
|
-
// Register a click event that has to
|
|
39
|
-
// prevent default:
|
|
40
|
-
//this._addListeners(link);
|
|
41
|
-
// Prevent ability to focus the link:
|
|
42
|
-
link.tabIndex = -1;
|
|
43
|
-
} else if (img !== null) this.fullImage = img.getAttribute('src');
|
|
44
|
-
this.fullImage && this._addListeners();
|
|
45
|
-
}
|
|
46
|
-
_addListeners() {
|
|
47
|
-
this.addEventListener('click', this.showLightbox.bind(this), true);
|
|
48
|
-
this.addEventListener('keydown', (e)=>{
|
|
49
|
-
// It's common to ignore anything with alt
|
|
50
|
-
// modifiers. I've copied this from Google
|
|
51
|
-
// people.
|
|
52
|
-
if (e.altKey) return;
|
|
53
|
-
// Catch enter and space:
|
|
54
|
-
switch(e.keyCode){
|
|
55
|
-
case 13:
|
|
56
|
-
case 32:
|
|
57
|
-
this.showLightbox(e);
|
|
58
|
-
default:
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
}, true);
|
|
62
|
-
}
|
|
63
|
-
showLightbox(e) {
|
|
64
|
-
// This is required so that the link element does not get
|
|
65
|
-
// followed:
|
|
66
|
-
e.preventDefault();
|
|
67
|
-
// Implement some kind of lock:
|
|
68
|
-
if (!this.loading) {
|
|
69
|
-
this.loading = true;
|
|
70
|
-
// Preload the full image.
|
|
71
|
-
// Show the spinner overlay:
|
|
72
|
-
this._showOverlay(this.loadingOverlay);
|
|
73
|
-
if (!this.img) {
|
|
74
|
-
this.img = document.createElement('img');
|
|
75
|
-
// For the moment we just do nothing on error with
|
|
76
|
-
// the link target.
|
|
77
|
-
this.img.addEventListener('error', ()=>{
|
|
78
|
-
this._hideOverlay(this.loadingOverlay);
|
|
79
|
-
this.loading = false;
|
|
80
|
-
});
|
|
81
|
-
this.img.addEventListener('load', ()=>this.showImage());
|
|
82
|
-
this.img.src = this.fullImage;
|
|
83
|
-
this.img.tabIndex = 1;
|
|
84
|
-
// Prepare the events to close the overlay.
|
|
85
|
-
// I'm doing this here to light up what's
|
|
86
|
-
// happening in connectedCallback.
|
|
87
|
-
// I'm not doing a check for which key was
|
|
88
|
-
// called on purpose, but maybe I should do
|
|
89
|
-
// that alt key check?
|
|
90
|
-
[
|
|
91
|
-
'click',
|
|
92
|
-
'keydown'
|
|
93
|
-
].forEach((type)=>this.overlay.addEventListener(type, (e)=>this._hideOverlay(e.currentTarget)));
|
|
94
|
-
this.overlay.appendChild(this.img);
|
|
95
|
-
} else this.showImage();
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
showImage() {
|
|
99
|
-
this.img.style.transform = 'scale(0.1)';
|
|
100
|
-
// Hide the loading overlay:
|
|
101
|
-
this._hideOverlay(this.loadingOverlay);
|
|
102
|
-
this._showOverlay(this.overlay);
|
|
103
|
-
// Focus the overlay (requires it to have a tabIndex):
|
|
104
|
-
this.overlay.focus();
|
|
105
|
-
// Start the CSS transition:
|
|
106
|
-
this.img.style.transform = 'scale(1)';
|
|
107
|
-
// Don't forget to unlock the click event:
|
|
108
|
-
this.loading = false;
|
|
109
|
-
}
|
|
110
|
-
_showOverlay(overlay) {
|
|
111
|
-
overlay.style.display = 'flex';
|
|
112
|
-
}
|
|
113
|
-
_hideOverlay(overlay) {
|
|
114
|
-
overlay.style.display = '';
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
// I'm using a true template tag because the Chrome
|
|
118
|
-
// team says it's faster. The template tag has
|
|
119
|
-
// better browser support than web components anyway.
|
|
120
|
-
// The strange comment here is needed for syntax
|
|
121
|
-
// highlighting with a VS Code extension I'm using.
|
|
122
|
-
const $ef17987508a11d23$var$tpl = document.createElement('template');
|
|
123
|
-
$ef17987508a11d23$var$tpl.innerHTML = /*template*/ `
|
|
124
|
-
<style>
|
|
125
|
-
:host {
|
|
126
|
-
display: inline-block;
|
|
127
|
-
cursor: pointer;
|
|
128
|
-
position: relative;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
:host([hidden]) {
|
|
132
|
-
display: none;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
:host(:focus), :host(:active) {
|
|
136
|
-
outline: 2px solid #77b;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
#loader {
|
|
140
|
-
position: absolute;
|
|
141
|
-
z-index: 1;
|
|
142
|
-
top: 0;
|
|
143
|
-
left: 0;
|
|
144
|
-
width: 100%;
|
|
145
|
-
height: 100%;
|
|
146
|
-
background-color: rgba(0,0,0,.2);
|
|
147
|
-
display: none;
|
|
148
|
-
align-items: center;
|
|
149
|
-
justify-content: center;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
#overlay {
|
|
153
|
-
position: fixed;
|
|
154
|
-
top: 0;
|
|
155
|
-
left: 0;
|
|
156
|
-
bottom: 0;
|
|
157
|
-
right: 0;
|
|
158
|
-
overflow: hidden;
|
|
159
|
-
z-index: 999;
|
|
160
|
-
background-color: rgba(0,0,0,.5);
|
|
161
|
-
display: none;
|
|
162
|
-
align-items: center;
|
|
163
|
-
justify-content: center;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
#loader svg {
|
|
167
|
-
width: 50%;
|
|
168
|
-
opacity: 0.6;
|
|
169
|
-
animation: lightbox-loader 2s infinite;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
#overlay img {
|
|
173
|
-
max-width: 100%;
|
|
174
|
-
max-height: 100%;
|
|
175
|
-
transition: transform 0.8s;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
@keyframes lightbox-loader {
|
|
179
|
-
0% {transform: rotate(0deg);}
|
|
180
|
-
100% {transform: rotate(360deg);}
|
|
181
|
-
}
|
|
182
|
-
</style>
|
|
183
|
-
<slot></slot>
|
|
184
|
-
<div id="overlay" tabindex="0"></div>
|
|
185
|
-
<div id="loader">
|
|
186
|
-
</div>
|
|
187
|
-
`;
|
|
188
|
-
$ef17987508a11d23$var$ImgLightbox.prototype.template = $ef17987508a11d23$var$tpl;
|
|
189
|
-
var $ef17987508a11d23$export$2e2bcd8739ae039 = $ef17987508a11d23$var$ImgLightbox;
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
export {$ef17987508a11d23$export$2e2bcd8739ae039 as default};
|
|
193
|
-
//# sourceMappingURL=img-lightbox.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;AAAA,8DAA8D;;ACA9D,4BAAiB;;;ADGjB,MAAM,0CAAoB;IAExB,aAAc;QACZ,KAAK;QACL,IAAI,CAAC,OAAO,GAAG;QACf,IAAI,CAAC,YAAY,CAAC;YAAE,MAAM;QAAO;IACnC;IAEA,oBAAoB;QAClB,4CAA4C;QAC5C,oBAAoB;QACpB,yCAAyC;QACzC,kCAAkC;QAClC,IAAI,CAAC,UAAU,CAAC,WAAW,CACzB,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC;QAElC,+CAA+C;QAC/C,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QAC7C,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;QACpD,uCAAuC;QACvC,IAAI,CAAC,cAAc,CAAC,SAAS,GAAG,CAAA,GAAA,gEAAQ;QACxC,8CAA8C;QAC9C,IAAI,CAAC,QAAQ,GAAG;QAChB,4CAA4C;QAC5C,6CAA6C;QAC7C,MAAM,OAAO,IAAI,CAAC,aAAa,CAAC;QAChC,MAAM,MAAM,IAAI,CAAC,aAAa,CAAC;QAC/B,IAAI,SAAS,MAAM;YACjB,uCAAuC;YACvC,IAAI,CAAC,SAAS,GAAG,KAAK,YAAY,CAAC;YACnC,sCAAsC;YACtC,mBAAmB;YACnB,2BAA2B;YAC3B,qCAAqC;YACrC,KAAK,QAAQ,GAAG;QAClB,OAAO,IAAI,QAAQ,MACjB,IAAI,C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S;iBAAU,CAAC,OAAO,CAC1B,CAAC,OACC,IAAI,CAAC,OAAO,CAAC,gBAAgB,CAC3B,MACA,CAAC,IAAM,IAAI,CAAC,YAAY,CAAC,EAAE,aAAa;gBAG9C,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG;YACnC,OACE,IAAI,CAAC,SAAS;QAElB;IACF;IAEA,YAAY;QACV,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,GAAG;QAC3B,4BAA4B;QAC5B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,cAAc;QACrC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO;QAC9B,sDAAsD;QACtD,IAAI,CAAC,OAAO,CAAC,KAAK;QAClB,4BAA4B;QAC5B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,SAAS,GAAG;QAC3B,0CAA0C;QAC1C,IAAI,CAAC,OAAO,GAAG;IACjB;IAEA,aAAa,OAAO,EAAE;QACpB,QAAQ,KAAK,CAAC,OAAO,GAAG;IAC1B;IAEA,aAAa,OAAO,EAAE;QACpB,QAAQ,KAAK,CAAC,OAAO,GAAG;IAC1B;AAEF;AAEA,mDAAmD;AACnD,+CAA+C;AAC/C,qDAAqD;AACrD,gDAAgD;AAChD,mDAAmD;AACnD,MAAM,4BAAM,SAAS,aAAa,CAAC;AACnC,0BAAI,SAAS,GAAG,UAAU,GAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgE7B,CAAC;AACD,kCAAY,SAAS,CAAC,QAAQ,GAAG;IAEjC,2CAAe","sources":["src/shadow/img-lightbox.js","node_modules/@parcel/runtime-js/lib/bundles/runtime-7833d3a46095a7f4.js"],"sourcesContent":["// const loaderSvgUrl = require('../../assets/hourglass.svg');\nimport loaderSvg from 'bundle-text:../../assets/hourglass.svg';\n\nclass ImgLightbox extends HTMLElement {\n\n constructor() {\n super();\n this.loading = false;\n this.attachShadow({ mode: 'open' });\n }\n\n connectedCallback() {\n // Template is added to prototype below the \n // class definition.\n // It's from a template tag because it's \n // supposed to be faster this way.\n this.shadowRoot.appendChild(\n this.template.content.cloneNode(true)\n );\n // Get some element references from shadow DOM:\n this.overlay = this.shadowRoot.querySelector('#overlay');\n this.loadingOverlay = this.shadowRoot.querySelector('#loader');\n // Add the loading SVG to that element:\n this.loadingOverlay.innerHTML = loaderSvg;\n // Component needs a tabIndex to be focusable.\n this.tabIndex = 0;\n // The slotted elements are actually not in \n // the shadow DOM so we can get them like so:\n const link = this.querySelector('a');\n const img = this.querySelector('img');\n if (link !== null) {\n // Store the URL as the full image URL:\n this.fullImage = link.getAttribute('href');\n // Register a click event that has to \n // prevent default:\n //this._addListeners(link);\n // Prevent ability to focus the link:\n link.tabIndex = -1;\n } else if (img !== null) {\n this.fullImage = img.getAttribute('src');\n // Nothing wrong with giving the same tabIndex\n // to things, they're ordered by position.\n // I think.\n //img.tabIndex = 0;\n //this._addListeners(img);\n }\n this.fullImage && this._addListeners();\n }\n\n _addListeners() {\n this.addEventListener('click', this.showLightbox.bind(this), true);\n this.addEventListener('keydown', (e) => {\n // It's common to ignore anything with alt\n // modifiers. I've copied this from Google\n // people.\n if (e.altKey) return;\n // Catch enter and space:\n switch (e.keyCode) {\n case 13:\n case 32:\n this.showLightbox(e);\n default:\n return;\n }\n }, true);\n }\n\n showLightbox(e) {\n // This is required so that the link element does not get \n // followed:\n e.preventDefault();\n\n // Implement some kind of lock:\n if (!this.loading) {\n this.loading = true;\n // Preload the full image.\n // Show the spinner overlay:\n this._showOverlay(this.loadingOverlay);\n if (!this.img) {\n this.img = document.createElement('img');\n // For the moment we just do nothing on error with\n // the link target.\n this.img.addEventListener('error', () => {\n this._hideOverlay(this.loadingOverlay);\n this.loading = false;\n });\n this.img.addEventListener('load', () => this.showImage());\n this.img.src = this.fullImage;\n this.img.tabIndex = 1;\n // Prepare the events to close the overlay.\n // I'm doing this here to light up what's\n // happening in connectedCallback.\n // I'm not doing a check for which key was\n // called on purpose, but maybe I should do\n // that alt key check?\n ['click', 'keydown'].forEach(\n (type) =>\n this.overlay.addEventListener(\n type,\n (e) => this._hideOverlay(e.currentTarget)\n )\n );\n this.overlay.appendChild(this.img);\n } else {\n this.showImage();\n }\n }\n }\n\n showImage() {\n this.img.style.transform = 'scale(0.1)';\n // Hide the loading overlay:\n this._hideOverlay(this.loadingOverlay);\n this._showOverlay(this.overlay);\n // Focus the overlay (requires it to have a tabIndex):\n this.overlay.focus();\n // Start the CSS transition:\n this.img.style.transform = 'scale(1)';\n // Don't forget to unlock the click event:\n this.loading = false;\n }\n\n _showOverlay(overlay) {\n overlay.style.display = 'flex';\n }\n\n _hideOverlay(overlay) {\n overlay.style.display = '';\n }\n\n}\n\n// I'm using a true template tag because the Chrome\n// team says it's faster. The template tag has \n// better browser support than web components anyway.\n// The strange comment here is needed for syntax\n// highlighting with a VS Code extension I'm using.\nconst tpl = document.createElement('template');\ntpl.innerHTML = /*template*/`\n<style>\n :host {\n display: inline-block;\n cursor: pointer;\n position: relative;\n }\n\n :host([hidden]) {\n display: none;\n }\n\n :host(:focus), :host(:active) {\n outline: 2px solid #77b;\n }\n\n #loader {\n position: absolute;\n z-index: 1;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-color: rgba(0,0,0,.2);\n display: none;\n align-items: center;\n justify-content: center;\n }\n\n #overlay {\n position: fixed;\n top: 0;\n left: 0;\n bottom: 0;\n right: 0;\n overflow: hidden;\n z-index: 999;\n background-color: rgba(0,0,0,.5);\n display: none;\n align-items: center;\n justify-content: center;\n }\n\n #loader svg {\n width: 50%;\n opacity: 0.6;\n animation: lightbox-loader 2s infinite;\n }\n\n #overlay img {\n max-width: 100%;\n max-height: 100%;\n transition: transform 0.8s;\n }\n\n @keyframes lightbox-loader {\n 0% {transform: rotate(0deg);}\n 100% {transform: rotate(360deg);}\n }\n</style>\n<slot></slot>\n<div id=\"overlay\" tabindex=\"0\"></div>\n<div id=\"loader\">\n</div>\n`;\nImgLightbox.prototype.template = tpl;\n\nexport default ImgLightbox;\n","module.exports = \"0470ae78683fa4f4\";"],"names":[],"version":3,"file":"img-lightbox.mjs.map"}
|