diff --git a/changelog.md b/changelog.md index 666e5e3..ce2075c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2025-01-14 - 1.3.0 - feat(elements) +Enhance consent management components with advanced styling and interaction + +- Added delayed animation effect to 'consentsoftware-toggle' when required. +- Improved styling for better visual feedback on selections and requirements. +- Enhanced modal transition and visibility settings for the 'consentsoftware-cookieconsent'. + ## 2025-01-13 - 1.2.0 - feat(pages) Add initial structure for pages with page1 component diff --git a/ts_web/00_commitinfo_data.ts b/ts_web/00_commitinfo_data.ts index 6492c1a..07a33fc 100644 --- a/ts_web/00_commitinfo_data.ts +++ b/ts_web/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@consent.software/catalog', - version: '1.2.0', + version: '1.3.0', description: 'A library of web components designed to integrate robust consent management capabilities into web applications, ensuring compliance with privacy regulations.' } diff --git a/ts_web/elements/consentsoftware-cookieconsent.ts b/ts_web/elements/consentsoftware-cookieconsent.ts index 2832c5c..ec3fe31 100644 --- a/ts_web/elements/consentsoftware-cookieconsent.ts +++ b/ts_web/elements/consentsoftware-cookieconsent.ts @@ -18,9 +18,6 @@ export class ConsentsoftwareCookieconsent extends LitElement { @property({ type: String, reflect: true }) public theme: 'light' | 'dark' = 'light'; - @property({ type: Number }) - public heightPixels = 60; - /** * We bind `heightPixels` to a CSS variable (--cookieconsent-height). * Then we can do margin-bottom animations in CSS. @@ -69,6 +66,9 @@ export class ConsentsoftwareCookieconsent extends LitElement { align-items: center; justify-content: center; z-index: 1000; /* standard z-index for fixed elements */ + background: rgba(0, 0, 0, 0); + backdrop-filter: blur(0px); + transition: all 0.2s; } .modalBox { @@ -88,7 +88,9 @@ export class ConsentsoftwareCookieconsent extends LitElement { * The animation occurs when we toggle the gotIt/show attributes. */ will-change: transform; /* ensure efficient rendering */ - transition: all 0.2s; + transition: all 0.3s; + transform: scale(0.95); + opacity: 0; } /* @@ -208,14 +210,14 @@ export class ConsentsoftwareCookieconsent extends LitElement {
@@ -261,9 +263,20 @@ export class ConsentsoftwareCookieconsent extends LitElement { const cookieLevel = await this.csWebclientInstance.getCookieLevels(); if (!cookieLevel) { - delayFor(300).then(() => { - this.setAttribute('show', 'true'); - this.setAttribute('gotIt', 'false'); + this.setAttribute('show', 'true'); + this.setAttribute('gotIt', 'false'); + requestAnimationFrame(async () => { + await this.updated(); + const pageOverlay: HTMLDivElement = this.shadowRoot?.querySelector('.pageOverlay'); + if (pageOverlay) { + pageOverlay.style.background = 'rgba(0, 0, 0, 0.5)'; + pageOverlay.style.backdropFilter = 'blur(2px)'; + } + const modalBox: HTMLDivElement = this.shadowRoot?.querySelector('.modalBox'); + if (modalBox) { + modalBox.style.transform = `scale(1)`; + modalBox.style.opacity = '1'; + } }); } else { this.setAttribute('show', 'false'); @@ -275,7 +288,7 @@ export class ConsentsoftwareCookieconsent extends LitElement { * Called after the first render of the component. * We measure the actual height of the banner and update the CSS variable. */ - public firstUpdated() {} + public async firstUpdated() {} /** * Called whenever the element is updated or re-rendered. diff --git a/ts_web/elements/consentsoftware-mainselection.ts b/ts_web/elements/consentsoftware-mainselection.ts index 0b5c881..7d28cbf 100644 --- a/ts_web/elements/consentsoftware-mainselection.ts +++ b/ts_web/elements/consentsoftware-mainselection.ts @@ -43,7 +43,7 @@ export class ConsentsoftwareMainSelection extends LitElement { return html`