Skip to content

Commit 9d8e5e3

Browse files
committed
#40 smooth animation of desktop creation added
1 parent 790f671 commit 9d8e5e3

File tree

3 files changed

+184
-51
lines changed

3 files changed

+184
-51
lines changed

src/webOS/coreservices/DesktopAssembler/DesktopAssembler.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function DesktopAssembler({ desktopId = 'default' }) {
1919
const { notify } = useNotification();
2020

2121
useEffect(() => {
22-
notify('Test Notification: App has loaded!', 3000, icon);
22+
//notify('Test Notification: App has loaded!', 3000, icon);
2323
}, [notify]);
2424

2525
const handleOpenApp = (appId) => {

src/webOS/coreservices/MissionControl/components/MissionManager/MissionManager.css

Lines changed: 84 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/* src/components/MissionControl/MissionBar/MissionManager.css */
2-
31
@import "../../../../configs/CSSConfigs/animations.css";
42

53
/* timing vars & defaults */
@@ -12,6 +10,9 @@
1210

1311
/* new var, if you want to reference in CSS */
1412
--delete-slide-duration: 0.3s;
13+
/* fallback values; will be overridden by inline styles */
14+
--desktop-count: 0;
15+
--thumb-width: 0px;
1516
}
1617

1718
/* ---------- Keyframes ---------- */
@@ -33,8 +34,30 @@
3334
to { transform: translate(0, 0); opacity: 1; }
3435
}
3536
@keyframes slideFromRight {
36-
from { transform: translateX(100vw); opacity: 0; }
37-
to { transform: translateX(0); opacity: 1; }
37+
from {
38+
transform: translateX(
39+
calc(
40+
-68px
41+
+ (55vw - ((var(--thumb-width) * var(--desktop-count)) + (30px * var(--desktop-count))) / 2)
42+
)
43+
);
44+
opacity: 1;
45+
}
46+
to { transform: translateX(0); opacity: 1; }
47+
}
48+
/* new: fade then slide in */
49+
@keyframes slideFadeFromRight {
50+
0% {
51+
transform: translateX(
52+
calc(
53+
-68px
54+
+ (55vw - ((var(--thumb-width) * var(--desktop-count)) + (30px * var(--desktop-count))) / 2)
55+
)
56+
);
57+
opacity: 0;
58+
}
59+
10% { opacity: 1; }
60+
100% { transform: translateX(0); opacity: 1; }
3861
}
3962

4063
@keyframes slideWrapperUp {
@@ -80,6 +103,7 @@
80103
display: flex;
81104
justify-content: center;
82105
align-items: center;
106+
z-index: 190;
83107
gap: 43px;
84108
transition:
85109
gap var(--names-slide-duration) var(--easing-flattened),
@@ -126,6 +150,16 @@
126150
cursor: pointer;
127151
opacity: 1; /* now always visible */
128152
z-index: 191;
153+
/* ensure the circle can expand beyond the button bounds */
154+
overflow: visible;
155+
transition: opacity 0.2s;
156+
}
157+
158+
/* disabled state for the + button */
159+
.mc-bar-new.disabled {
160+
cursor: default;
161+
opacity: 0.5;
162+
pointer-events: none;
129163
}
130164

131165
/* Animate the “+” up when the bar expands */
@@ -137,6 +171,27 @@
137171
opacity: 1;
138172
}
139173

174+
/* ---------- Grow circle behind “+” on hover (synced) ---------- */
175+
.mc-bar-new::before {
176+
content: '';
177+
position: absolute;
178+
left: 12px;
179+
top: 27px;
180+
width: 31px;
181+
height: 31px;
182+
border-radius: 50%;
183+
background: rgba(255, 255, 255, 0.7);
184+
backdrop-filter: blur(10px);
185+
transform: translate(-50%, -50%) scale(0);
186+
/* synced to bar-slide-duration and easing */
187+
transition: transform var(--bar-slide-duration) var(--easing-flattened);
188+
z-index: -1;
189+
pointer-events: none;
190+
}
191+
.mc-bar-new:hover::before {
192+
transform: translate(-50%, -50%) scale(1);
193+
}
194+
140195
/* ---------- Exit overlay ---------- */
141196
.mc-exit-overlay {
142197
position: absolute;
@@ -157,11 +212,8 @@
157212
transform var(--desktop-slide-duration) var(--easing-flattened),
158213
opacity var(--desktop-slide-duration) var(--easing-flattened);
159214
}
160-
161215
.mission-control-container.overview-open .desktops-wrapper {
162-
/* still ignore pointer-events here */
163216
pointer-events: none;
164-
165217
position: absolute;
166218
top: 30px; left: 0; right: 0;
167219
display: flex;
@@ -175,7 +227,6 @@
175227
opacity: 0;
176228
transition: none;
177229
}
178-
179230
.mission-control-container.overview-open.bar-expanded .desktops-wrapper {
180231
pointer-events: none;
181232
transform: translateY(5px);
@@ -184,7 +235,6 @@
184235
transform var(--bar-slide-duration) var(--easing-flattened),
185236
opacity var(--bar-slide-duration) var(--easing-flattened);
186237
}
187-
188238
.mission-control-container.overview-open.bar-expanded .desktops-wrapper.closing {
189239
animation: slideWrapperUp var(--bar-slide-duration) var(--easing-flattened) forwards;
190240
}
@@ -200,7 +250,6 @@
200250
position: relative;
201251
margin-left: 0;
202252
}
203-
204253
.mission-control-container.overview-open .desktop-panel {
205254
overflow: hidden;
206255
background: transparent;
@@ -209,7 +258,6 @@
209258
transform: translate(var(--tx), var(--ty));
210259
opacity: 0;
211260
}
212-
213261
.mission-control-container.overview-open.bar-expanded .desktop-panel {
214262
animation:
215263
var(--panel-animation, var(--desktop-panel-animation))
@@ -255,3 +303,28 @@
255303
.delete-icon:hover {
256304
background: rgba(255,255,255,1);
257305
}
306+
307+
/* ---------- Desktop Preview Panel (synced & fading) ---------- */
308+
.preview-panel {
309+
position: absolute;
310+
top: 30px; /* align with desktops-wrapper */
311+
right: calc(0% - var(--thumb-width));
312+
width: var(--thumb-width);
313+
height: var(--thumb-height, 90px);
314+
pointer-events: none;
315+
z-index: 189;
316+
background: rgba(255, 255, 255, 0);
317+
border-radius: 2px;
318+
319+
/* ensure it's hidden by default */
320+
opacity: 0;
321+
322+
/* slide-right still 0.3s, but fade only 0.2s */
323+
transition:
324+
right var(--bar-slide-duration) var(--easing-flattened),
325+
opacity 0.2s ease-in-out;
326+
}
327+
.preview-panel.visible {
328+
right: calc(55px - var(--thumb-width));
329+
opacity: 1;
330+
}

0 commit comments

Comments
 (0)