bozza di modal in centro alla pagina
This commit is contained in:
parent
8bb0a796a4
commit
4950af8359
20
dist/mailgo.js
vendored
20
dist/mailgo.js
vendored
@ -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;
|
||||
}
|
||||
|
2
dist/mailgo.min.js
vendored
2
dist/mailgo.min.js
vendored
@ -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)});
|
||||
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)});
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user