Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
61f646743a | |||
e3babde7e8 | |||
c389e43e93 | |||
1511db4eea | |||
d713756034 | |||
17d224332d | |||
32dd5e769b | |||
12ace00a90 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@design.estate/dees-catalog",
|
"name": "@design.estate/dees-catalog",
|
||||||
"version": "1.0.193",
|
"version": "1.0.197",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "website for lossless.com",
|
"description": "website for lossless.com",
|
||||||
"main": "dist_ts_web/index.js",
|
"main": "dist_ts_web/index.js",
|
||||||
|
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@design.estate/dees-catalog',
|
name: '@design.estate/dees-catalog',
|
||||||
version: '1.0.193',
|
version: '1.0.197',
|
||||||
description: 'website for lossless.com'
|
description: 'website for lossless.com'
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,9 @@ export class DeesModal extends DeesElement {
|
|||||||
modal.heading = optionsArg.heading;
|
modal.heading = optionsArg.heading;
|
||||||
modal.content = optionsArg.content;
|
modal.content = optionsArg.content;
|
||||||
modal.menuOptions = optionsArg.menuOptions;
|
modal.menuOptions = optionsArg.menuOptions;
|
||||||
modal.windowLayer = await DeesWindowLayer.createAndShow();
|
modal.windowLayer = await DeesWindowLayer.createAndShow({
|
||||||
|
blur: true,
|
||||||
|
});
|
||||||
modal.windowLayer.addEventListener('click', async () => {
|
modal.windowLayer.addEventListener('click', async () => {
|
||||||
await modal.destroy();
|
await modal.destroy();
|
||||||
});
|
});
|
||||||
@ -73,6 +75,8 @@ export class DeesModal extends DeesElement {
|
|||||||
.modalContainer {
|
.modalContainer {
|
||||||
display: flex;
|
display: flex;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
top: 0px;
|
||||||
|
left: 0px;
|
||||||
width: 100vw;
|
width: 100vw;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@ -82,7 +86,7 @@ export class DeesModal extends DeesElement {
|
|||||||
}
|
}
|
||||||
.modal {
|
.modal {
|
||||||
will-change: transform;
|
will-change: transform;
|
||||||
transform: translateY(10px);
|
transform: translateY(0px) scale(0.95);
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
width: 480px;
|
width: 480px;
|
||||||
min-height: 120px;
|
min-height: 120px;
|
||||||
@ -91,11 +95,17 @@ export class DeesModal extends DeesElement {
|
|||||||
border: 1px solid #222;
|
border: 1px solid #222;
|
||||||
transition: all 0.2s;
|
transition: all 0.2s;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
box-shadow: 0px 2px 5px #00000080;
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal.show {
|
.modal.show {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
transform: translateY(0px);
|
transform: translateY(0px) scale(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.modal.show.predestroy {
|
||||||
|
opacity: 0;
|
||||||
|
transform: translateY(10px) scale(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal .heading {
|
.modal .heading {
|
||||||
@ -178,7 +188,7 @@ export class DeesModal extends DeesElement {
|
|||||||
public async destroy() {
|
public async destroy() {
|
||||||
const domtools = await this.domtoolsPromise;
|
const domtools = await this.domtoolsPromise;
|
||||||
const modal = this.shadowRoot.querySelector('.modal');
|
const modal = this.shadowRoot.querySelector('.modal');
|
||||||
modal.classList.remove('show');
|
modal.classList.add('predestroy');
|
||||||
await domtools.convenience.smartdelay.delayFor(200);
|
await domtools.convenience.smartdelay.delayFor(200);
|
||||||
document.body.removeChild(this);
|
document.body.removeChild(this);
|
||||||
await this.windowLayer.destroy();
|
await this.windowLayer.destroy();
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { customElement, DeesElement, type TemplateResult, html, property, type CSSResult, } from '@design.estate/dees-element';
|
import { customElement, DeesElement, type TemplateResult, html, property, type CSSResult, state, } from '@design.estate/dees-element';
|
||||||
|
|
||||||
import * as domtools from '@design.estate/dees-domtools';
|
import * as domtools from '@design.estate/dees-domtools';
|
||||||
|
|
||||||
@ -8,20 +8,33 @@ declare global {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface IOptions_DeesWindowLayer {
|
||||||
|
blur: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
@customElement('dees-windowlayer')
|
@customElement('dees-windowlayer')
|
||||||
export class DeesWindowLayer extends DeesElement {
|
export class DeesWindowLayer extends DeesElement {
|
||||||
// STATIC
|
// STATIC
|
||||||
public static demo = () => html`<dees-windowlayer></dees-windowlayer>`;
|
public static demo = () => html`<dees-windowlayer></dees-windowlayer>`;
|
||||||
|
|
||||||
public static async createAndShow() {
|
public static async createAndShow(optionsArg?: IOptions_DeesWindowLayer) {
|
||||||
const domtoolsInstance = domtools.DomTools.getGlobalDomToolsSync();
|
const domtoolsInstance = domtools.DomTools.getGlobalDomToolsSync();
|
||||||
const windowLayer = new DeesWindowLayer();
|
const windowLayer = new DeesWindowLayer();
|
||||||
|
windowLayer.options = {
|
||||||
|
...windowLayer.options,
|
||||||
|
...optionsArg,
|
||||||
|
}
|
||||||
document.body.append(windowLayer);
|
document.body.append(windowLayer);
|
||||||
await domtoolsInstance.convenience.smartdelay.delayFor(0);
|
await domtoolsInstance.convenience.smartdelay.delayFor(0);
|
||||||
windowLayer.show();
|
windowLayer.show();
|
||||||
return windowLayer;
|
return windowLayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@state()
|
||||||
|
public options: IOptions_DeesWindowLayer = {
|
||||||
|
blur: false
|
||||||
|
};
|
||||||
|
|
||||||
// INSTANCE
|
// INSTANCE
|
||||||
@property({
|
@property({
|
||||||
type: Boolean
|
type: Boolean
|
||||||
@ -49,14 +62,14 @@ export class DeesWindowLayer extends DeesElement {
|
|||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
background: rgba(0, 0, 0, 0.0);
|
background: rgba(0, 0, 0, 0.0);
|
||||||
backdrop-filter: brightness(1);
|
backdrop-filter: brightness(1) ${this.options.blur ? 'blur(0px)' : ''};
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
z-index: 200;
|
z-index: 200;
|
||||||
}
|
}
|
||||||
|
|
||||||
.visible {
|
.visible {
|
||||||
background: rgba(0, 0, 0, 0.2);
|
background: rgba(0, 0, 0, 0.2);
|
||||||
backdrop-filter: brightness(0.3);
|
backdrop-filter: brightness(0.9) ${this.options.blur ? 'blur(2px)' : ''};
|
||||||
pointer-events: all;
|
pointer-events: all;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Reference in New Issue
Block a user