Skip to content

Commit e0a6e62

Browse files
committed
refactor(launchpad): improve animations
1 parent 643f66c commit e0a6e62

File tree

4 files changed

+44
-5
lines changed

4 files changed

+44
-5
lines changed

projects/element-ng/application-header/launchpad/si-launchpad-factory.component.scss

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
@use '@siemens/element-theme/src/styles/all-variables';
44

55
.app-switcher {
6-
position: fixed;
6+
position: absolute;
7+
pointer-events: all;
78
inset-block-start: calc(
89
variables.$si-application-header-height + 1px /* header border compensation */ +
910
variables.$si-titlebar-spacing + variables.$si-system-banner-spacing
@@ -17,7 +18,6 @@
1718
padding: map.get(variables.$spacers, 6);
1819
display: flex;
1920
flex-direction: column;
20-
z-index: variables.$zindex-launchpad;
2121
background-color: variables.$element-base-1;
2222

2323
@include all-variables.media-breakpoint-up(lg) {

projects/element-ng/application-header/si-application-header.component.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,16 @@
5151
</header>
5252

5353
@if (launchpadOpen() && launchpad()) {
54-
<div [id]="id + '-launchpad'">
55-
<ng-template [ngTemplateOutlet]="launchpad()!" [ngTemplateOutletInjector]="injector" />
54+
<div class="launchpad-container" animate.leave="expand-leave">
55+
<div [id]="id + '-launchpad'">
56+
<ng-template [ngTemplateOutlet]="launchpad()!" [ngTemplateOutletInjector]="injector" />
57+
</div>
5658
</div>
5759
}
5860

5961
@if (openDropdownCount() || launchpadOpen()) {
6062
<div
63+
animate.leave="backdrop-leave"
6164
[class]="`modal-backdrop ${launchpadOpen() ? 'd-block' : `d-${expandBreakpoint()}-none`}`"
6265
(click)="backdropClicked()"
6366
></div>

projects/element-ng/application-header/si-application-header.component.scss

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,40 @@
22

33
.modal-backdrop {
44
z-index: variables.$zindex-application-header-backdrop;
5+
opacity: 1;
6+
transition: opacity 0.15s linear;
7+
8+
@starting-style {
9+
opacity: 0;
10+
}
11+
12+
&.backdrop-leave {
13+
opacity: 0;
14+
transition: opacity 0.15s linear;
15+
}
16+
}
17+
18+
.launchpad-container {
19+
position: fixed;
20+
inset: 0;
21+
pointer-events: none;
22+
z-index: variables.$zindex-launchpad;
23+
opacity: 1;
24+
transform: translateY(0);
25+
transition:
26+
opacity 0.5s ease,
27+
transform 0.5s ease;
28+
29+
@starting-style {
30+
opacity: 0;
31+
transform: translateY(-120px);
32+
}
33+
34+
&.expand-leave {
35+
opacity: 0;
36+
transform: translateY(-120px);
37+
transition:
38+
opacity 0.25s ease,
39+
transform 0.25s ease;
40+
}
541
}

projects/element-theme/src/styles/variables/_zindex.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ $zindex-sidepanel-responsive: $zindex-fixed + 1; // above vertical-nav
1616
$zindex-vertical-nav: $zindex-fixed + 1;
1717
$zindex-vertical-nav-collapsed: $zindex-fixed;
1818
$zindex-application-header: $zindex-fixed + 3;
19-
$zindex-launchpad: $zindex-application-header;
19+
$zindex-launchpad: $zindex-application-header - 1;
2020
$zindex-application-header-backdrop: $zindex-launchpad - 1;

0 commit comments

Comments
 (0)