UNPKG

@cocreate/modal

Version:

A draggable, movable and resizable modal. customizable via attributes, great for popups, alerts, multitasking and displaying multiple views.

150 lines (128 loc) 2.6 kB
#modal-viewport { /*position: relative;*/ z-index: 8; height: -moz-available; height: calc(100vh - 50px); height: -webkit-fill-available; height: fill-available; width: -moz-available; width: -webkit-fill-available; width: fill-available; pointer-events: none; top: 0; } .hide-nav + #modal-viewport{ margin-top:0px; height: 100vh; max-height: -moz-available; max-height: -webkit-fill-available; max-height: fill-available; } .modal { position: absolute; width: 300px; height: 100%; margin: 0; padding: 0; z-index: 99; border: 2px solid grey; background: #fff; z-index: 2; /* overflow: auto; */ /* user-select: none; */ pointer-events: auto; } .modal.selected { z-index: 10; border-color: purple; pointer-events: auto; } /** modal title **/ .modal-header{ display: flex; justify-content: flex-end; padding-top: 5px; padding-bottom: 5px; list-style-type: none; } .modal-header > li { padding-right: 10px; padding-left: 5px; font-size: 20px; } .modal-ghost { display: none; background: #999; opacity: 0; /*pointer-events: none;*/ /* width: 300px;*/ /*height: 200px;*/ top: 0px; left: 0px; z-index: 20; position: absolute; margin: 0; padding: 0; -webkit-transition: all 0.25s ease-in-out; -moz-transition: all 0.25s ease-in-out; -ms-transition: all 0.25s ease-in-out; -o-transition: all 0.25s ease-in-out; transition: all 0.25s ease-in-out; } .modal iframe { width: 100%; height: 100%; border:none; } .modal modal-container { display: block; height: 100vh; overflow: auto } .modal .has-modal-header { height: calc(100% - 45px) } [drag-handle] { position: absolute; background-color: transparent; min-height: 10px; z-index: 10; left: 0; top: 0; right: 0; height: 20px; cursor: move; } .modal [resize=right] { right: -5px!important; } .modal-parked { width: 50px !important; height: 50px !important; border-radius: 50px; z-index: 100 !important; } .modal-parked * { display: none; } .parked-closeBtn { width: 20px; height: 20px; border-radius: 20px; position: absolute; background-color: #ddd; right: -3px; top: -3px; display: none; } .modal-parked:hover > .parked-closeBtn{ display: flex!important; align-items: center; justify-content: center; cursor: pointer; } @media (prefers-color-scheme: dark) { .modal { background-color: #222; } }