Browse Source

fix: the Home toast sits at the window's right corner and rises in and slides out as the design's message does

pull/16848/head
Igor Kulikov 2 weeks ago
parent
commit
73ffbb9e0c
  1. 2
      ui-ngx/src/app/modules/home/pages/home-links/home/components/home-card.component.ts
  2. 46
      ui-ngx/src/app/modules/home/pages/home-links/home/components/home-toast.scss
  3. 8
      ui-ngx/src/app/modules/home/pages/home-links/home/pages/home-page.component.scss
  4. 5
      ui-ngx/src/app/modules/home/pages/home-links/home/pages/home-page.component.ts

2
ui-ngx/src/app/modules/home/pages/home-links/home/components/home-card.component.ts

@ -41,7 +41,7 @@ const UNDO_MS = 6000;
<ng-content></ng-content>
</section>
`,
styleUrls: ['./home-card.component.scss', './home-toast.scss'],
styleUrls: ['./home-card.component.scss'],
standalone: false,
changeDetection: ChangeDetectionStrategy.OnPush
})

46
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);
}
}

8
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:

5
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: {

Loading…
Cancel
Save