Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/sessions/contrib/aquarium/browser/media/aquarium.css
13406 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
/* Agents aquarium. All decorative layers use pointer-events:none; mouse
7
* handling is done at the workbench main container level. See aquariumOverlay.ts. */
8
9
/* --- Water --- */
10
11
/* Make the chat bar a positioning context for the water layer (its first
12
* child) and keep its real children above the decorative water — without
13
* explicit z-index, positioned siblings paint after non-positioned ones. */
14
.monaco-workbench .part.chatbar {
15
position: relative;
16
}
17
.monaco-workbench .part.chatbar > .title,
18
.monaco-workbench .part.chatbar > .content {
19
position: relative;
20
z-index: 1;
21
}
22
23
.agents-aquarium-water {
24
position: absolute;
25
inset: 0;
26
pointer-events: none;
27
overflow: hidden;
28
z-index: 0;
29
border-radius: 12px;
30
opacity: 0;
31
transition: opacity 320ms ease-out;
32
/* Linear (not radial) — bands far less than radial alpha gradients. */
33
background: linear-gradient(160deg,
34
rgba(36, 191, 165, 0.06) 0%,
35
rgba(0, 122, 204, 0.05) 55%,
36
rgba(188, 63, 188, 0.05) 100%);
37
}
38
39
.agents-aquarium-water.visible {
40
opacity: 1;
41
}
42
43
/* Two soft drifting accent glows. We use radial-gradient softness inside
44
* each pseudo (not `filter: blur()`) so the parent's `overflow: hidden`
45
* doesn't clip the blur radius and leave a hard edge. Circles are sized
46
* larger than visible so the falloff has somewhere to fade into. */
47
.agents-aquarium-water::before,
48
.agents-aquarium-water::after {
49
content: '';
50
position: absolute;
51
width: 140%;
52
aspect-ratio: 1;
53
border-radius: 50%;
54
pointer-events: none;
55
will-change: transform;
56
}
57
58
.agents-aquarium-water::before {
59
top: -70%;
60
left: -50%;
61
background: radial-gradient(closest-side, rgba(36, 191, 165, 0.10), rgba(36, 191, 165, 0.05) 35%, transparent 75%);
62
animation: agents-aquarium-float-a 18s ease-in-out infinite alternate;
63
}
64
65
.agents-aquarium-water::after {
66
bottom: -70%;
67
right: -50%;
68
background: radial-gradient(closest-side, rgba(0, 122, 204, 0.10), rgba(0, 122, 204, 0.05) 35%, transparent 75%);
69
animation: agents-aquarium-float-b 22s ease-in-out infinite alternate;
70
}
71
72
/* translate3d so the GPU composites instead of re-rasterizing each frame. */
73
@keyframes agents-aquarium-float-a {
74
0% {
75
transform: translate3d(0, 0, 0) scale(1);
76
}
77
50% {
78
transform: translate3d(8%, 6%, 0) scale(1.05);
79
}
80
100% {
81
transform: translate3d(-5%, 10%, 0) scale(0.97);
82
}
83
}
84
85
@keyframes agents-aquarium-float-b {
86
0% {
87
transform: translate3d(0, 0, 0) scale(1);
88
}
89
50% {
90
transform: translate3d(-6%, -8%, 0) scale(1.03);
91
}
92
100% {
93
transform: translate3d(5%, -4%, 0) scale(1.07);
94
}
95
}
96
97
/* --- Fish --- */
98
99
.agents-aquarium-fish-layer,
100
.agents-aquarium-food-layer {
101
position: absolute;
102
inset: 0;
103
pointer-events: none;
104
}
105
106
/* No drop-shadow / blur filter: those force a software rasterization pass
107
* per fish per frame (~10x paint cost at 50 fish). */
108
.agents-aquarium-fish {
109
position: absolute;
110
top: 0;
111
left: 0;
112
will-change: transform, opacity;
113
pointer-events: none;
114
opacity: 0;
115
transition: opacity 360ms ease-out;
116
}
117
118
/* JS sets per-fish transition-delay before adding `.visible` for staggered
119
* entry; the exit handler drives the fade-out via inline styles. */
120
.agents-aquarium-fish.visible {
121
opacity: 1;
122
}
123
124
/* No transition on the inner: facing is eased in JS each frame via
125
* Fish.applyTransform so it stays in sync with the swim direction. */
126
.agents-aquarium-fish-inner {
127
width: 100%;
128
height: 100%;
129
transform-origin: center;
130
}
131
132
.agents-aquarium-fish svg {
133
width: 100%;
134
height: 100%;
135
display: block;
136
overflow: visible;
137
}
138
139
/* Each strip is a clipped vertical slice of the VS Code logo; staggered
140
* translateY produces a sine wave traveling along the body (the swim).
141
* Front strips (--agents-aquarium-strip-index ~ 0) keep the species color;
142
* back strips mix toward white for depth shading. 720ms / 8 strips = 90ms
143
* phase delay; negative delay starts each strip mid-cycle. */
144
.agents-aquarium-fish-strip {
145
color: color-mix(in srgb, currentColor, white calc(var(--agents-aquarium-strip-index, 0) * 4%));
146
animation: agents-aquarium-body-wave 720ms linear infinite;
147
animation-delay: calc(var(--agents-aquarium-strip-index, 0) * -90ms);
148
}
149
150
/* 5-keyframe sine approximation; linear timing lands closer to a true
151
* sinusoid than 2-keyframe ease-in-out (which over-emphasizes extremes). */
152
@keyframes agents-aquarium-body-wave {
153
0% {
154
transform: translateY(0);
155
}
156
25% {
157
transform: translateY(3.5px);
158
}
159
50% {
160
transform: translateY(0);
161
}
162
75% {
163
transform: translateY(-3.5px);
164
}
165
100% {
166
transform: translateY(0);
167
}
168
}
169
170
/* --- Food pellets --- */
171
172
.agents-aquarium-food {
173
position: absolute;
174
top: 0;
175
left: 0;
176
width: 6px;
177
height: 6px;
178
margin: -3px 0 0 -3px;
179
border-radius: 50%;
180
background: radial-gradient(circle at 35% 35%, #ffd56a, #c98a17 80%);
181
box-shadow: 0 0 4px rgba(255, 200, 80, 0.6);
182
pointer-events: none;
183
will-change: transform;
184
}
185
186
/* --- Toggle button (anchored to the chat bar) --- */
187
188
.agents-aquarium-toggle {
189
position: absolute;
190
top: 12px;
191
right: 14px;
192
z-index: 100;
193
width: 24px;
194
height: 24px;
195
border-radius: 50%;
196
border: 1px solid transparent;
197
background: transparent;
198
color: var(--vscode-foreground, #cccccc);
199
display: inline-flex;
200
align-items: center;
201
justify-content: center;
202
padding: 0;
203
cursor: pointer;
204
opacity: 0.5;
205
transition: opacity 160ms ease-out, background-color 160ms ease-out, color 160ms ease-out;
206
}
207
208
.agents-aquarium-toggle:hover {
209
opacity: 1;
210
background: var(--vscode-toolbar-hoverBackground, rgba(255, 255, 255, 0.08));
211
}
212
213
/* `.monaco-workbench` prefix to match the workbench's own `button:focus`
214
* rule so we win the cascade without resorting to !important. */
215
.monaco-workbench button.agents-aquarium-toggle:focus {
216
outline: none;
217
}
218
.monaco-workbench button.agents-aquarium-toggle:focus-visible {
219
opacity: 1;
220
outline: 1px solid var(--vscode-focusBorder);
221
outline-offset: 2px;
222
}
223
224
.agents-aquarium-toggle.active {
225
opacity: 1;
226
color: var(--vscode-icon-foreground, var(--vscode-foreground, #cccccc));
227
}
228
.agents-aquarium-toggle .codicon {
229
font-size: 14px;
230
}
231
232
/* Off-state icon: the agents window logo (same asset as the mobile chat
233
* shell's workspace picker). Theme-swapped under `.vs` / `.hc-light`. */
234
.agents-aquarium-toggle-logo {
235
display: inline-block;
236
width: 14px;
237
height: 14px;
238
background: url('../../../../browser/media/sessions-logo-light.svg') center / contain no-repeat;
239
transform-origin: 50% 50%;
240
/* Brief attention-grabbing wiggle every 12s. Keyframes hold the rest
241
* pose for ~93% of the cycle and only animate during the first ~7%. */
242
animation: agents-aquarium-toggle-wiggle 12s ease-in-out infinite;
243
}
244
245
.vs .agents-aquarium-toggle-logo,
246
.hc-light .agents-aquarium-toggle-logo {
247
background-image: url('../../../../browser/media/sessions-logo-dark.svg');
248
}
249
250
/* No need to nag once the user is engaging with the button. */
251
.agents-aquarium-toggle:hover .agents-aquarium-toggle-logo,
252
.agents-aquarium-toggle:focus-visible .agents-aquarium-toggle-logo {
253
animation: none;
254
}
255
256
@keyframes agents-aquarium-toggle-wiggle {
257
0% {
258
transform: rotate(0deg) scale(1);
259
}
260
1.5% {
261
transform: rotate(-12deg) scale(1.08);
262
}
263
3% {
264
transform: rotate(10deg) scale(1.08);
265
}
266
4.5% {
267
transform: rotate(-8deg) scale(1.05);
268
}
269
6% {
270
transform: rotate(6deg) scale(1.03);
271
}
272
7% {
273
transform: rotate(0deg) scale(1);
274
}
275
100% {
276
transform: rotate(0deg) scale(1);
277
}
278
}
279
280
/* --- Reduced motion --- */
281
282
@media (prefers-reduced-motion: reduce) {
283
.agents-aquarium-fish-strip,
284
.agents-aquarium-water::before,
285
.agents-aquarium-water::after,
286
.agents-aquarium-toggle-logo {
287
animation: none;
288
}
289
290
.agents-aquarium-water,
291
.agents-aquarium-fish {
292
transition: none;
293
}
294
}
295
296