diff --git a/dist/mailgo.js b/dist/mailgo.js index 6a31737..a4ebd2a 100644 --- a/dist/mailgo.js +++ b/dist/mailgo.js @@ -2,6 +2,15 @@ let mailgos = document.querySelectorAll('a[href^="mailto:"]:not(.no-mailgo)'); let styles = ` + .mailgo-modal-background { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: black; + opacity: 0.8; + } .mailgo-modal { position: fixed; top: 0; @@ -10,20 +19,15 @@ let styles = ` left: 0; display: none; } - .mailgo-modal-background { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - background-color: black; - } .mailgo-modal.is-active { display: flex; justify-content: center; align-items: center; } .mailgo-modal-content { + z-index: 1000; + border-radius: 8px; + background: white; padding: 24px; margin: 24px; } diff --git a/dist/mailgo.min.js b/dist/mailgo.min.js index a5478e2..1fb4e33 100644 --- a/dist/mailgo.min.js +++ b/dist/mailgo.min.js @@ -1 +1 @@ -let mailgos=document.querySelectorAll('a[href^="mailto:"]:not(.no-mailgo)'),styles="\n .mailgo-modal {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: none;\n }\n .mailgo-modal-background {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: black;\n }\n .mailgo-modal.is-active {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .mailgo-modal-content {\n padding: 24px;\n margin: 24px;\n }\n",styleSheet=document.createElement("style");styleSheet.type="text/css",styleSheet.innerText=styles,document.head.appendChild(styleSheet),console.log("mailgo is WIP!"),mailgos.forEach((e,t)=>{let n=document.createElement("div");n.className="mailgo-modal",n.id="mailgo-modal-"+t;let l=document.createElement("div");l.className="mailgo-modal-background",n.appendChild(l);let o=document.createElement("div");o.className="mailgo-modal-content",n.appendChild(o);let a=document.createTextNode("mailgo");o.appendChild(a),e.parentNode.insertBefore(n,e.nextSibling),e.addEventListener("click",t=>{t.preventDefault(),e.nextElementSibling.classList.add("is-active")},!1)}); \ No newline at end of file +let mailgos=document.querySelectorAll('a[href^="mailto:"]:not(.no-mailgo)'),styles="\n .mailgo-modal-background {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n background-color: black;\n opacity: 0.8;\n }\n .mailgo-modal {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n display: none;\n }\n .mailgo-modal.is-active {\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .mailgo-modal-content {\n z-index: 1000;\n border-radius: 8px;\n background: white;\n padding: 24px;\n margin: 24px;\n }\n",styleSheet=document.createElement("style");styleSheet.type="text/css",styleSheet.innerText=styles,document.head.appendChild(styleSheet),console.log("mailgo is WIP!"),mailgos.forEach((e,n)=>{let t=document.createElement("div");t.className="mailgo-modal",t.id="mailgo-modal-"+n;let l=document.createElement("div");l.className="mailgo-modal-background",t.appendChild(l);let o=document.createElement("div");o.className="mailgo-modal-content",t.appendChild(o);let a=document.createTextNode("mailgo");o.appendChild(a),e.parentNode.insertBefore(t,e.nextSibling),e.addEventListener("click",n=>{n.preventDefault(),e.nextElementSibling.classList.add("is-active")},!1)}); \ No newline at end of file diff --git a/src/mailgo.js b/src/mailgo.js index 6a31737..a4ebd2a 100644 --- a/src/mailgo.js +++ b/src/mailgo.js @@ -2,6 +2,15 @@ let mailgos = document.querySelectorAll('a[href^="mailto:"]:not(.no-mailgo)'); let styles = ` + .mailgo-modal-background { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + background-color: black; + opacity: 0.8; + } .mailgo-modal { position: fixed; top: 0; @@ -10,20 +19,15 @@ let styles = ` left: 0; display: none; } - .mailgo-modal-background { - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - background-color: black; - } .mailgo-modal.is-active { display: flex; justify-content: center; align-items: center; } .mailgo-modal-content { + z-index: 1000; + border-radius: 8px; + background: white; padding: 24px; margin: 24px; }