0.3.95 • Published 9 months ago

@ne1410s/popup v0.3.95

Weekly downloads
7
License
MIT
Repository
github
Last release
9 months ago

@ne1410s/popup

A lightweight & configurable modal popup.

<ne14-pop>
  <p>Hello world</p>
</ne14-pop>
  • Use: <script src="PATH_TO_UMD_SCRIPT"></script>
  • Extend: npm i @ne1410s/popup

Attributes

<ne14-pop move resize>YO' STUFF<ne14-pop></ne14-pop></ne14-pop>
  • move: User can drag the popup around
  • resize: User can alter the size of the popup
  • shrink: (Requires resize: User can reduce size below that initially presented)
  • open: The popup is opened immediately
  • no-close: The close icon is not made available
  • style: If supplied inline, the following styles are propagated to the element. They are fairly self-explanatory
    • background-color
    • border-radius
    • box-shadow

Events

const pop = document.querySelector('ne14-pop');

pop.addEventListener('open', () => {
  console.log('Just opened!');
});
  • open: Fired when the popup is opened
  • close: Fired when the popup is closed
  • confirmaccept: Fired when the confirm callback allowed the popup to close
  • confirmreject: Fired when the confirm callback prevented the popup from closing
  • dismissaccept: Fired when the dismiss callback allowed the popup to close
  • dismissreject: Fired when the dismiss callback prevented the popup from closing

Methods

  • open(): Opens the popup
  • close(): Closes the popup
  • wrap(): Wraps existing html element(s) in a new popup
  • confirm(): Closes the popup, unless confirmCallback is provided and returns false
  • dismiss(): Closes the popup, unless dismissCallback is provided and returns false.

Properties

  • confirmCallback: () => boolean: Return false to prevent a call to confirm from closing the popup
  • dismissCallback: () => boolean: Return false to prevent a call to dismiss from closing the popup

CSS Variables

Some degree of custom styling can be provided, by way of css variables:

ne14-pop {
  --background: rgba(0, 0, 0, 0.5);
  --border-radius: 5px;
  --box-shadow: 5px 5px 20px black;
}
  • --background Background behind the popup. Defaults to: rgba(0, 0, 0, .85)
  • --border-radius Border radius for the popup.
  • --box-shadow Box shadow for the popup (when stationary).
0.3.95

9 months ago

0.3.94

9 months ago

0.3.93

9 months ago

0.3.92

10 months ago

0.3.91

10 months ago

0.3.90

10 months ago

0.3.89

10 months ago

0.3.88

10 months ago

0.3.87

10 months ago

0.3.86

10 months ago

0.3.85

10 months ago

0.3.84

10 months ago

0.3.83

11 months ago

0.3.75

12 months ago

0.3.74

12 months ago

0.3.73

1 year ago

0.3.72

1 year ago

0.3.71

1 year ago

0.3.70

1 year ago

0.3.79

12 months ago

0.3.78

12 months ago

0.3.77

12 months ago

0.3.76

12 months ago

0.3.64

1 year ago

0.3.69

1 year ago

0.3.68

1 year ago

0.3.67

1 year ago

0.3.66

1 year ago

0.3.65

1 year ago

0.3.82

11 months ago

0.3.81

11 months ago

0.3.80

11 months ago

0.3.63

1 year ago

0.3.62

1 year ago

0.3.61

1 year ago

0.3.60

1 year ago

0.3.59

1 year ago

0.3.58

1 year ago

0.3.57

1 year ago

0.3.56

1 year ago

0.3.55

1 year ago

0.3.54

1 year ago

0.3.53

1 year ago

0.3.52

1 year ago

0.3.51

1 year ago

0.3.50

1 year ago

0.3.49

1 year ago

0.3.48

1 year ago

0.3.47

1 year ago

0.3.46

1 year ago

0.3.45

1 year ago

0.3.44

1 year ago

0.3.43

1 year ago

0.3.42

1 year ago

0.3.41

1 year ago

0.3.40

1 year ago

0.3.39

1 year ago

0.3.38

1 year ago

0.3.37

1 year ago

0.3.36

1 year ago

0.3.35

2 years ago

0.3.34

2 years ago

0.3.33

2 years ago

0.3.32

2 years ago

0.3.31

2 years ago

0.3.30

2 years ago

0.3.29

2 years ago

0.3.28

2 years ago

0.3.27

2 years ago

0.3.26

2 years ago

0.3.25

2 years ago

0.3.24

2 years ago

0.3.23

2 years ago

0.3.20

2 years ago

0.3.22

2 years ago

0.3.21

2 years ago

0.3.19

2 years ago

0.3.18

2 years ago

0.3.6

2 years ago

0.3.5

2 years ago

0.3.8

2 years ago

0.3.7

2 years ago

0.3.9

2 years ago

0.3.17

2 years ago

0.3.16

2 years ago

0.3.15

2 years ago

0.3.14

2 years ago

0.3.13

2 years ago

0.3.12

2 years ago

0.3.11

2 years ago

0.3.10

2 years ago

0.3.4

2 years ago

0.3.3

2 years ago

0.3.2

2 years ago

0.3.1

2 years ago

0.3.0

3 years ago

0.2.39

3 years ago

0.2.38

3 years ago

0.2.37

4 years ago

0.2.36

4 years ago

0.2.35

4 years ago

0.2.34

4 years ago

0.2.33

4 years ago

0.2.32

4 years ago

0.2.31

4 years ago

0.2.30

4 years ago

0.2.29

4 years ago

0.2.28

4 years ago

0.2.27

4 years ago

0.2.26

4 years ago

0.2.25

4 years ago

0.2.24

4 years ago

0.2.23

4 years ago

0.2.22

4 years ago

0.2.21

4 years ago

0.2.20

4 years ago

0.2.19

4 years ago

0.2.18

4 years ago

0.2.17

4 years ago

0.2.16

4 years ago

0.2.15

4 years ago

0.2.14

4 years ago

0.2.13

4 years ago

0.2.12

4 years ago

0.2.11

4 years ago

0.2.10

4 years ago

0.2.9

5 years ago

0.2.8

5 years ago

0.2.7

5 years ago

0.2.6

5 years ago

0.2.5

5 years ago

0.2.4

5 years ago

0.2.3

5 years ago

0.2.2

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.5

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago