diff --git a/ui-ngx/src/app/modules/home/pages/home-links/home/components/home-card.component.ts b/ui-ngx/src/app/modules/home/pages/home-links/home/components/home-card.component.ts index d677b4606a..86045aa494 100644 --- a/ui-ngx/src/app/modules/home/pages/home-links/home/components/home-card.component.ts +++ b/ui-ngx/src/app/modules/home/pages/home-links/home/components/home-card.component.ts @@ -41,7 +41,7 @@ const UNDO_MS = 6000; `, - styleUrls: ['./home-card.component.scss', './home-toast.scss'], + styleUrls: ['./home-card.component.scss'], standalone: false, changeDetection: ChangeDetectionStrategy.OnPush }) diff --git a/ui-ngx/src/app/modules/home/pages/home-links/home/components/home-toast.scss b/ui-ngx/src/app/modules/home/pages/home-links/home/components/home-toast.scss index 5b903a528e..d160ff6edc 100644 --- a/ui-ngx/src/app/modules/home/pages/home-links/home/components/home-toast.scss +++ b/ui-ngx/src/app/modules/home/pages/home-links/home/components/home-toast.scss @@ -1,6 +1,6 @@ // SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. // SPDX-License-Identifier: BUSL-1.1 -::ng-deep .mat-mdc-snack-bar-container.tb-home-toast.tb-home-toast { +.mat-mdc-snack-bar-container.tb-home-toast.tb-home-toast { .tb-toast.tb-toast.tb-toast { gap: 4px; box-sizing: border-box; @@ -46,4 +46,48 @@ outline-offset: -2px; } } + + .mdc-snackbar__surface.mdc-snackbar__surface { + min-width: 0; + padding: 0; + } + + &.mat-snack-bar-container-animations-enabled { + &.mat-snack-bar-container-enter { + animation-duration: 1ms; + + .mdc-snackbar__surface { + animation: tb-home-toast-in .2s ease both; + } + } + + &.mat-snack-bar-container-exit { + animation-duration: .2s; + animation-timing-function: ease; + + .mdc-snackbar__surface { + animation: tb-home-toast-out .2s ease both; + } + } + } + + @media (prefers-reduced-motion: reduce) { + &.mat-snack-bar-container-animations-enabled .mdc-snackbar__surface { + animation: none; + } + } +} + +@keyframes tb-home-toast-in { + from { + opacity: 0; + transform: translateY(16px); + } +} + +@keyframes tb-home-toast-out { + to { + opacity: 0; + transform: translateY(16px); + } } diff --git a/ui-ngx/src/app/modules/home/pages/home-links/home/pages/home-page.component.scss b/ui-ngx/src/app/modules/home/pages/home-links/home/pages/home-page.component.scss index 33cb168644..d7c5621549 100644 --- a/ui-ngx/src/app/modules/home/pages/home-links/home/pages/home-page.component.scss +++ b/ui-ngx/src/app/modules/home/pages/home-links/home/pages/home-page.component.scss @@ -1,6 +1,6 @@ // SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. // SPDX-License-Identifier: BUSL-1.1 -:host { +tb-home-page { --tb-home-page: #f4f6f7; --tb-home-ai-glow: oklch(0.80 0.11 182); --tb-home-card-shadow: 0 1px 1px rgba(20, 52, 58, 0.06), 0 2px 6px -1px rgba(20, 52, 58, 0.08); @@ -18,7 +18,7 @@ background-repeat: no-repeat; } -.tb-home-sky { +tb-home-page .tb-home-sky { position: absolute; top: 0; left: 0; @@ -44,7 +44,7 @@ } @supports (color: oklch(from red l c h)) { - :host(.tenant-brand) { + tb-home-page.tenant-brand { --tb-home-tenant-glow: oklch(from var(--tb-primary-500) 0.80 min(c, 0.11) h); background-image: radial-gradient(820px 520px at 6% -120px, color-mix(in oklab, var(--tb-home-tenant-glow) 34%, transparent) 0%, @@ -54,7 +54,7 @@ linear-gradient(180deg, #eaedef 0px, var(--tb-home-page) 360px); } - :host(.tenant-brand) .tb-home-sky { + tb-home-page.tenant-brand .tb-home-sky { --tb-home-sky-field: oklch(from var(--tb-primary-500) 0.86 min(c, 0.08) h); --tb-home-sky-soft: oklch(from var(--tb-primary-500) 0.89 min(c, 0.05) h); background: diff --git a/ui-ngx/src/app/modules/home/pages/home-links/home/pages/home-page.component.ts b/ui-ngx/src/app/modules/home/pages/home-links/home/pages/home-page.component.ts index 4565a37d04..74edcd2f36 100644 --- a/ui-ngx/src/app/modules/home/pages/home-links/home/pages/home-page.component.ts +++ b/ui-ngx/src/app/modules/home/pages/home-links/home/pages/home-page.component.ts @@ -1,6 +1,6 @@ // SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. // SPDX-License-Identifier: BUSL-1.1 -import { ChangeDetectionStrategy, Component, inject } from '@angular/core'; +import { ChangeDetectionStrategy, Component, inject, ViewEncapsulation } from '@angular/core'; import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { getCurrentAuthUser } from '@core/auth/auth.selectors'; @@ -27,7 +27,8 @@ const DEFAULT_PRIMARY = '#00695c'; } } `, - styleUrls: ['./home-page.component.scss'], + styleUrls: ['./home-page.component.scss', '../components/home-toast.scss'], + encapsulation: ViewEncapsulation.None, standalone: false, changeDetection: ChangeDetectionStrategy.OnPush, host: {