New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

center_popup

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

center_popup - npm Package Compare versions

Comparing version 1.0.1 to 1.0.3

2

index.js

@@ -1,1 +0,1 @@

class Popup{constructor(e,t){this.dom=e,this.opts=t,Popup.template='<div class="popup_out_wrapper"><div class="popup_in_wrapper"></div></div>',Popup.initiate(t)}open(){const e=this;Popup.layout(e.dom,e.opts),document.querySelectorAll(".popup_out_wrapper")[0].style.opacity="1.0"}fadeIn(e=.3){const t=this;Popup.layout(t.dom,t.opts),document.querySelectorAll(".popup_out_wrapper")[0].style.transition=e+"s ",setTimeout(function(){document.querySelectorAll(".popup_out_wrapper")[0].style.opacity="1.0"},0)}close(){let e=document.querySelectorAll(".popup_out_wrapper")[0];e.parentNode.removeChild(e)}fadeOut(e=.3){let t=document.querySelectorAll(".popup_out_wrapper")[0];document.querySelectorAll(".popup_out_wrapper")[0].style.transition=e+"s ",setTimeout(function(){document.querySelectorAll(".popup_out_wrapper")[0].style.opacity="0"},0),setTimeout(function(){t.parentNode.removeChild(t)},1e3*e)}static initiate(e){var t=".popup_out_wrapper{opacity:0;position:fixed;top:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.4)}.popup_out_wrapper .popup_in_wrapper{text-align:center;height:100%}.popup_out_wrapper .popup_in_wrapper::before{content:'';display:inline-block;height:100%;width:0;vertical-align:middle}.popup_out_wrapper .popup_in_wrapper .popup_image_wrapper{width:auto;height:auto;display:inline-block;vertical-align:middle;padding:20px;}.popup_image_wrapper .popup_image{display: block;max-height:600px;object-fit:scale-down;box-sizing:border-box;}",p=document.createElement("style");"custom"===e.type&&(t+=e.target+" {width:500px;height:400px;background:#fff;text-align:left;display:inline-block;vertical-align:middle;}"),p.styleSheet?p.styleSheet.cssText=t:p.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(p)}static layout(e,t){"image"===t.type?Popup.image(e):"custom"===t.type&&Popup.custom(e)}static image(e){let t='<div class="popup_image_wrapper"><img class="popup_image" src="#" alt="#"></div>';document.body.insertAdjacentHTML("beforeend",Popup.template),document.querySelectorAll(".popup_in_wrapper")[0].insertAdjacentHTML("beforeend",t);let p=document.querySelectorAll(".popup_image")[0];p.src=e.dataset.src,p.addEventListener("load",function(){this.style.maxWidth=this.width+"px",this.style.width="100%"})}static custom(e){document.body.insertAdjacentHTML("beforeend",Popup.template),document.querySelectorAll(".popup_in_wrapper")[0].insertAdjacentElement("beforeend",e)}}
module.exports = class Popup{constructor(e,t){this.dom=e,this.opts=t,Popup.template='<div class="popup_out_wrapper"><div class="popup_in_wrapper"></div></div>',Popup.initiate(t)}open(){const e=this;Popup.layout(e.dom,e.opts),document.querySelectorAll(".popup_out_wrapper")[0].style.opacity="1.0"}fadeIn(e=.3){const t=this;Popup.layout(t.dom,t.opts),document.querySelectorAll(".popup_out_wrapper")[0].style.transition=e+"s ",setTimeout(function(){document.querySelectorAll(".popup_out_wrapper")[0].style.opacity="1.0"},0)}close(){let e=document.querySelectorAll(".popup_out_wrapper")[0];e.parentNode.removeChild(e)}fadeOut(e=.3){let t=document.querySelectorAll(".popup_out_wrapper")[0];document.querySelectorAll(".popup_out_wrapper")[0].style.transition=e+"s ",setTimeout(function(){document.querySelectorAll(".popup_out_wrapper")[0].style.opacity="0"},0),setTimeout(function(){t.parentNode.removeChild(t)},1e3*e)}static initiate(e){var t=".popup_out_wrapper{opacity:0;position:fixed;top:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.4)}.popup_out_wrapper .popup_in_wrapper{text-align:center;height:100%}.popup_out_wrapper .popup_in_wrapper::before{content:'';display:inline-block;height:100%;width:0;vertical-align:middle}.popup_out_wrapper .popup_in_wrapper .popup_image_wrapper{width:auto;height:auto;display:inline-block;vertical-align:middle;padding:20px;}.popup_image_wrapper .popup_image{display: block;max-height:600px;object-fit:scale-down;box-sizing:border-box;}",p=document.createElement("style");"custom"===e.type&&(t+=e.target+" {width:500px;height:400px;background:#fff;text-align:left;display:inline-block;vertical-align:middle;}"),p.styleSheet?p.styleSheet.cssText=t:p.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(p)}static layout(e,t){"image"===t.type?Popup.image(e):"custom"===t.type&&Popup.custom(e)}static image(e){let t='<div class="popup_image_wrapper"><img class="popup_image" src="#" alt="#"></div>';document.body.insertAdjacentHTML("beforeend",Popup.template),document.querySelectorAll(".popup_in_wrapper")[0].insertAdjacentHTML("beforeend",t);let p=document.querySelectorAll(".popup_image")[0];p.src=e.dataset.src,p.addEventListener("load",function(){this.style.maxWidth=this.width+"px",this.style.width="100%"})}static custom(e){document.body.insertAdjacentHTML("beforeend",Popup.template),document.querySelectorAll(".popup_in_wrapper")[0].insertAdjacentElement("beforeend",e)}}

@@ -6,3 +6,3 @@ /*!

*/
class Popup {
module.exports = class Popup {
constructor(dom, opts) {

@@ -9,0 +9,0 @@ this.dom = dom;

@@ -1,1 +0,1 @@

class Popup{constructor(e,t){this.dom=e,this.opts=t,Popup.template='<div class="popup_out_wrapper"><div class="popup_in_wrapper"></div></div>',Popup.initiate(t)}open(){const e=this;Popup.layout(e.dom,e.opts),document.querySelectorAll(".popup_out_wrapper")[0].style.opacity="1.0"}fadeIn(e=.3){const t=this;Popup.layout(t.dom,t.opts),document.querySelectorAll(".popup_out_wrapper")[0].style.transition=e+"s ",setTimeout(function(){document.querySelectorAll(".popup_out_wrapper")[0].style.opacity="1.0"},0)}close(){let e=document.querySelectorAll(".popup_out_wrapper")[0];e.parentNode.removeChild(e)}fadeOut(e=.3){let t=document.querySelectorAll(".popup_out_wrapper")[0];document.querySelectorAll(".popup_out_wrapper")[0].style.transition=e+"s ",setTimeout(function(){document.querySelectorAll(".popup_out_wrapper")[0].style.opacity="0"},0),setTimeout(function(){t.parentNode.removeChild(t)},1e3*e)}static initiate(e){var t=".popup_out_wrapper{opacity:0;position:fixed;top:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.4)}.popup_out_wrapper .popup_in_wrapper{text-align:center;height:100%}.popup_out_wrapper .popup_in_wrapper::before{content:'';display:inline-block;height:100%;width:0;vertical-align:middle}.popup_out_wrapper .popup_in_wrapper .popup_image_wrapper{width:auto;height:auto;display:inline-block;vertical-align:middle;padding:20px;}.popup_image_wrapper .popup_image{display: block;max-height:600px;object-fit:scale-down;box-sizing:border-box;}",p=document.createElement("style");"custom"===e.type&&(t+=e.target+" {width:500px;height:400px;background:#fff;text-align:left;display:inline-block;vertical-align:middle;}"),p.styleSheet?p.styleSheet.cssText=t:p.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(p)}static layout(e,t){"image"===t.type?Popup.image(e):"custom"===t.type&&Popup.custom(e)}static image(e){let t='<div class="popup_image_wrapper"><img class="popup_image" src="#" alt="#"></div>';document.body.insertAdjacentHTML("beforeend",Popup.template),document.querySelectorAll(".popup_in_wrapper")[0].insertAdjacentHTML("beforeend",t);let p=document.querySelectorAll(".popup_image")[0];p.src=e.dataset.src,p.addEventListener("load",function(){this.style.maxWidth=this.width+"px",this.style.width="100%"})}static custom(e){document.body.insertAdjacentHTML("beforeend",Popup.template),document.querySelectorAll(".popup_in_wrapper")[0].insertAdjacentElement("beforeend",e)}}
module.exports = class Popup{constructor(e,t){this.dom=e,this.opts=t,Popup.template='<div class="popup_out_wrapper"><div class="popup_in_wrapper"></div></div>',Popup.initiate(t)}open(){const e=this;Popup.layout(e.dom,e.opts),document.querySelectorAll(".popup_out_wrapper")[0].style.opacity="1.0"}fadeIn(e=.3){const t=this;Popup.layout(t.dom,t.opts),document.querySelectorAll(".popup_out_wrapper")[0].style.transition=e+"s ",setTimeout(function(){document.querySelectorAll(".popup_out_wrapper")[0].style.opacity="1.0"},0)}close(){let e=document.querySelectorAll(".popup_out_wrapper")[0];e.parentNode.removeChild(e)}fadeOut(e=.3){let t=document.querySelectorAll(".popup_out_wrapper")[0];document.querySelectorAll(".popup_out_wrapper")[0].style.transition=e+"s ",setTimeout(function(){document.querySelectorAll(".popup_out_wrapper")[0].style.opacity="0"},0),setTimeout(function(){t.parentNode.removeChild(t)},1e3*e)}static initiate(e){var t=".popup_out_wrapper{opacity:0;position:fixed;top:0;width:100%;height:100%;background:rgba(0, 0, 0, 0.4)}.popup_out_wrapper .popup_in_wrapper{text-align:center;height:100%}.popup_out_wrapper .popup_in_wrapper::before{content:'';display:inline-block;height:100%;width:0;vertical-align:middle}.popup_out_wrapper .popup_in_wrapper .popup_image_wrapper{width:auto;height:auto;display:inline-block;vertical-align:middle;padding:20px;}.popup_image_wrapper .popup_image{display: block;max-height:600px;object-fit:scale-down;box-sizing:border-box;}",p=document.createElement("style");"custom"===e.type&&(t+=e.target+" {width:500px;height:400px;background:#fff;text-align:left;display:inline-block;vertical-align:middle;}"),p.styleSheet?p.styleSheet.cssText=t:p.appendChild(document.createTextNode(t)),document.getElementsByTagName("head")[0].appendChild(p)}static layout(e,t){"image"===t.type?Popup.image(e):"custom"===t.type&&Popup.custom(e)}static image(e){let t='<div class="popup_image_wrapper"><img class="popup_image" src="#" alt="#"></div>';document.body.insertAdjacentHTML("beforeend",Popup.template),document.querySelectorAll(".popup_in_wrapper")[0].insertAdjacentHTML("beforeend",t);let p=document.querySelectorAll(".popup_image")[0];p.src=e.dataset.src,p.addEventListener("load",function(){this.style.maxWidth=this.width+"px",this.style.width="100%"})}static custom(e){document.body.insertAdjacentHTML("beforeend",Popup.template),document.querySelectorAll(".popup_in_wrapper")[0].insertAdjacentElement("beforeend",e)}}
{
"name": "center_popup",
"version": "1.0.1",
"version": "1.0.3",
"description": "A library for creating a centered popup window",

@@ -5,0 +5,0 @@ "main": "index.js",

# center-popup.js
A library for creating a centered popup window
## Install
```
npm i center_popup
```
```js
import Popup from 'center_popup';
const Popup = require('center_popup');
```
## Usage

@@ -5,0 +16,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc