Commit | Line | Data |
---|---|---|
2e389898 RK |
1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
2 | * License, v. 2.0. If a copy of the MPL was not distributed with this | |
3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
4 | ||
5 | /* Animation-inspector specific theme variables */ | |
6 | ||
7 | .theme-dark, | |
d0a8de80 RK |
8 | .theme-light, |
9 | .theme-firebug { | |
2e389898 | 10 | --even-animation-timeline-background-color: rgba(160,144,144,0.03); |
d0a8de80 RK |
11 | --command-pick-image: url(chrome://devtools/skin/images/command-pick.svg); |
12 | --pause-image: url(chrome://devtools/skin/images/debugger-pause.png); | |
13 | --pause-image-2x: url(chrome://devtools/skin/images/debugger-pause@2x.png); | |
14 | --rewind-image: url(chrome://devtools/skin/images/rewind.png); | |
15 | --rewind-image-2x: url(chrome://devtools/skin/images/rewind@2x.png); | |
16 | --play-image: url(chrome://devtools/skin/images/debugger-play.png); | |
17 | --play-image-2x: url(chrome://devtools/skin/images/debugger-play@2x.png); | |
2e389898 RK |
18 | } |
19 | ||
e9fbfc3a RK |
20 | :root { |
21 | /* How high should toolbars be */ | |
22 | --toolbar-height: 20px; | |
d0a8de80 RK |
23 | /* How wide should the sidebar be (should be wide enough to contain long |
24 | property names like 'border-bottom-right-radius' without ellipsis) */ | |
25 | --timeline-sidebar-width: 200px; | |
e9fbfc3a RK |
26 | /* How high should animations displayed in the timeline be */ |
27 | --timeline-animation-height: 20px; | |
d0a8de80 RK |
28 | /* The size of a keyframe marker in the keyframes diagram */ |
29 | --keyframes-marker-size: 10px; | |
30 | /* The color of the time graduation borders. This should match the the color | |
31 | devtools/client/animationinspector/utils.js */ | |
32 | --time-graduation-border-color: rgba(160, 144, 144, .5); | |
33 | } | |
34 | ||
35 | .animation { | |
36 | --timeline-border-color: var(--theme-body-color); | |
37 | --timeline-background-color: var(--theme-splitter-color); | |
38 | } | |
39 | ||
40 | .animation.cssanimation { | |
41 | --timeline-border-color: var(--theme-highlight-lightorange); | |
42 | --timeline-background-color: var(--theme-contrast-background); | |
43 | } | |
44 | ||
45 | .animation.csstransition { | |
46 | --timeline-border-color: var(--theme-highlight-bluegrey); | |
47 | --timeline-background-color: var(--theme-highlight-blue); | |
48 | } | |
49 | ||
50 | .animation.scriptanimation { | |
51 | --timeline-border-color: var(--theme-highlight-green); | |
52 | --timeline-background-color: var(--theme-graphs-green); | |
e9fbfc3a RK |
53 | } |
54 | ||
20752032 RK |
55 | html { |
56 | height: 100%; | |
57 | } | |
58 | ||
59 | body { | |
60 | margin: 0; | |
61 | padding: 0; | |
62 | display : flex; | |
63 | flex-direction: column; | |
64 | height: 100%; | |
65 | overflow: hidden; | |
66 | color: var(--theme-content-color3); | |
67 | } | |
68 | ||
d7b7f7e1 RK |
69 | /* The top toolbar, containing the toggle-all button. And the timeline toolbar, |
70 | containing playback control buttons, shown only when there are animations | |
71 | displayed in the timeline */ | |
20752032 | 72 | |
d7b7f7e1 RK |
73 | #global-toolbar, |
74 | #timeline-toolbar { | |
20752032 RK |
75 | border-bottom: 1px solid var(--theme-splitter-color); |
76 | display: flex; | |
77 | flex-direction: row; | |
78 | align-items: center; | |
79 | justify-content: flex-end; | |
e9fbfc3a | 80 | height: var(--toolbar-height); |
20752032 RK |
81 | } |
82 | ||
d7b7f7e1 | 83 | #timeline-toolbar { |
d0a8de80 RK |
84 | display: none; |
85 | justify-content: flex-start; | |
20752032 RK |
86 | } |
87 | ||
d7b7f7e1 RK |
88 | [timeline] #global-toolbar { |
89 | display: none; | |
90 | } | |
91 | ||
92 | [timeline] #timeline-toolbar { | |
93 | display: flex; | |
94 | } | |
95 | ||
2e389898 RK |
96 | /* The main animations container */ |
97 | ||
98 | #players { | |
e9fbfc3a | 99 | height: calc(100% - var(--toolbar-height)); |
2e389898 RK |
100 | overflow: auto; |
101 | } | |
102 | ||
d7b7f7e1 RK |
103 | [empty] #players { |
104 | display: none; | |
105 | } | |
106 | ||
20752032 RK |
107 | /* The error message, shown when an invalid/unanimated element is selected */ |
108 | ||
109 | #error-message { | |
110 | padding-top: 10%; | |
111 | text-align: center; | |
112 | flex: 1; | |
113 | overflow: auto; | |
114 | ||
115 | /* The error message is hidden by default */ | |
116 | display: none; | |
117 | } | |
118 | ||
d7b7f7e1 RK |
119 | [empty] #error-message { |
120 | display: block; | |
121 | } | |
122 | ||
123 | /* Element picker, toggle-all buttons, timeline pause button, ... */ | |
20752032 | 124 | |
d0a8de80 RK |
125 | #global-toolbar > *, |
126 | #timeline-toolbar > * { | |
127 | min-height: var(--toolbar-height); | |
128 | border-color: var(--theme-splitter-color); | |
129 | border-width: 0 0 0 1px; | |
130 | display: flex; | |
131 | justify-content: center; | |
132 | align-items: center; | |
133 | } | |
134 | ||
135 | #global-toolbar .label, | |
136 | #timeline-toolbar .label { | |
137 | padding: 0 5px; | |
138 | border-style: solid; | |
139 | } | |
140 | ||
d7b7f7e1 RK |
141 | #global-toolbar .devtools-button, |
142 | #timeline-toolbar .devtools-button { | |
d0a8de80 RK |
143 | margin: 0; |
144 | padding: 0; | |
145 | } | |
146 | ||
147 | #timeline-toolbar .devtools-button, | |
148 | #timeline-toolbar .label { | |
149 | border-width: 0 1px 0 0; | |
d7b7f7e1 RK |
150 | } |
151 | ||
d7b7f7e1 | 152 | #element-picker::before { |
d0a8de80 | 153 | background-image: var(--command-pick-image); |
20752032 RK |
154 | } |
155 | ||
d7b7f7e1 | 156 | .pause-button::before { |
d0a8de80 RK |
157 | background-image: var(--pause-image); |
158 | } | |
159 | ||
160 | #rewind-timeline::before { | |
161 | background-image: var(--rewind-image); | |
20752032 RK |
162 | } |
163 | ||
d7b7f7e1 | 164 | .pause-button.paused::before { |
d0a8de80 | 165 | background-image: var(--play-image); |
20752032 RK |
166 | } |
167 | ||
024a65e9 | 168 | @media (min-resolution: 1.1dppx) { |
d7b7f7e1 | 169 | .pause-button::before { |
d0a8de80 | 170 | background-image: var(--pause-image-2x); |
20752032 RK |
171 | } |
172 | ||
d7b7f7e1 | 173 | .pause-button.paused::before { |
d0a8de80 RK |
174 | background-image: var(--play-image-2x); |
175 | } | |
176 | ||
177 | #rewind-timeline::before { | |
178 | background-image: var(--rewind-image-2x); | |
20752032 RK |
179 | } |
180 | } | |
181 | ||
d0a8de80 | 182 | #timeline-rate select.devtools-button { |
dadba0f2 RK |
183 | -moz-appearance: none; |
184 | text-align: center; | |
dadba0f2 | 185 | font-family: inherit; |
d0a8de80 RK |
186 | color: var(--theme-body-color); |
187 | font-size: 1em; | |
188 | position: absolute; | |
189 | top: 0; | |
190 | left: 0; | |
191 | width: 100%; | |
192 | height: 100%; | |
193 | background-image: url("chrome://devtools/skin/images/dropmarker.svg"); | |
194 | background-repeat: no-repeat; | |
195 | background-position: calc(100% - 4px) center; | |
196 | padding-right: 1em; | |
197 | } | |
198 | ||
199 | #timeline-rate { | |
200 | position: relative; | |
201 | width: 4.5em; | |
dadba0f2 RK |
202 | } |
203 | ||
2e389898 RK |
204 | /* Animation timeline component */ |
205 | ||
206 | .animation-timeline { | |
207 | height: 100%; | |
208 | overflow: hidden; | |
d7b7f7e1 | 209 | position: relative; |
2e389898 | 210 | /* The timeline gets its background-image from a canvas element created in |
d0a8de80 | 211 | /devtools/client/animationinspector/utils.js drawGraphElementBackground |
2e389898 RK |
212 | thanks to document.mozSetImageElement("time-graduations", canvas) |
213 | This is done so that the background can be built dynamically from script */ | |
214 | background-image: -moz-element(#time-graduations); | |
215 | background-repeat: repeat-y; | |
d0a8de80 RK |
216 | /* Make the background be 100% of the timeline area so that it resizes with |
217 | it and subtract the width of the sidebar and the buffer at the right of the | |
218 | timeline */ | |
219 | background-size: calc(100% - var(--timeline-sidebar-width) - var(--keyframes-marker-size)) 100%; | |
e9fbfc3a | 220 | background-position: var(--timeline-sidebar-width) 0; |
2e389898 RK |
221 | display: flex; |
222 | flex-direction: column; | |
223 | } | |
224 | ||
d0a8de80 RK |
225 | /* Useful for positioning animations or keyframes in the timeline */ |
226 | .animation-timeline .track-container { | |
227 | position: absolute; | |
228 | top: 0; | |
229 | left: var(--timeline-sidebar-width); | |
230 | /* Leave the width of a marker right of a track so the 100% markers can be | |
231 | selected easily */ | |
232 | right: var(--keyframes-marker-size); | |
233 | height: var(--timeline-animation-height); | |
234 | } | |
235 | ||
236 | .animation-timeline .scrubber-wrapper { | |
237 | z-index: 2; | |
238 | pointer-events: none; | |
239 | height: 100%; | |
240 | } | |
241 | ||
e9fbfc3a RK |
242 | .animation-timeline .scrubber { |
243 | position: absolute; | |
244 | height: 100%; | |
d0a8de80 | 245 | width: 0; |
e9fbfc3a RK |
246 | border-right: 1px solid #FF0000; |
247 | box-sizing: border-box; | |
e9fbfc3a RK |
248 | } |
249 | ||
250 | .animation-timeline .scrubber::before { | |
251 | content: ""; | |
252 | position: absolute; | |
253 | top: 0; | |
254 | width: 1px; | |
255 | right: -6px; | |
256 | border-top: 5px solid #FF0000; | |
257 | border-left: 5px solid transparent; | |
258 | border-right: 5px solid transparent; | |
259 | } | |
260 | ||
d0a8de80 RK |
261 | /* The scrubber handle is a transparent element displayed on top of the scrubber |
262 | line that allows users to drag it */ | |
263 | .animation-timeline .scrubber .scrubber-handle { | |
264 | position: absolute; | |
265 | height: 100%; | |
266 | top: 0; | |
267 | /* Make it thick enough for easy dragging */ | |
268 | width: 6px; | |
269 | right: -3px; | |
270 | cursor: col-resize; | |
271 | pointer-events: all; | |
272 | } | |
273 | ||
2e389898 | 274 | .animation-timeline .time-header { |
d0a8de80 | 275 | min-height: var(--toolbar-height); |
e9fbfc3a RK |
276 | cursor: col-resize; |
277 | -moz-user-select: none; | |
2e389898 RK |
278 | } |
279 | ||
280 | .animation-timeline .time-header .time-tick { | |
281 | position: absolute; | |
282 | top: 3px; | |
283 | } | |
284 | ||
285 | .animation-timeline .animations { | |
286 | width: 100%; | |
d0a8de80 | 287 | height: 100%; |
2e389898 RK |
288 | overflow-y: auto; |
289 | overflow-x: hidden; | |
d0a8de80 RK |
290 | /* Leave some space for the header */ |
291 | margin-top: var(--timeline-animation-height); | |
2e389898 RK |
292 | padding: 0; |
293 | list-style-type: none; | |
d0a8de80 | 294 | border-top: 1px solid var(--time-graduation-border-color); |
2e389898 RK |
295 | } |
296 | ||
297 | /* Animation block widgets */ | |
298 | ||
299 | .animation-timeline .animation { | |
d0a8de80 | 300 | margin: 2px 0; |
e9fbfc3a | 301 | height: var(--timeline-animation-height); |
2e389898 RK |
302 | position: relative; |
303 | } | |
304 | ||
d0a8de80 RK |
305 | /* We want animations' background colors to alternate, but each animation has |
306 | a sibling (hidden by default) that contains the animated properties and | |
307 | keyframes, so we need to alternate every 4 elements. */ | |
308 | .animation-timeline .animation:nth-child(4n+1) { | |
2e389898 RK |
309 | background-color: var(--even-animation-timeline-background-color); |
310 | } | |
311 | ||
312 | .animation-timeline .animation .target { | |
e9fbfc3a | 313 | width: var(--timeline-sidebar-width); |
2e389898 | 314 | height: 100%; |
d0a8de80 RK |
315 | overflow: hidden; |
316 | display: flex; | |
317 | align-items: center; | |
2e389898 RK |
318 | } |
319 | ||
320 | .animation-timeline .animation-target { | |
321 | background-color: transparent; | |
322 | } | |
323 | ||
324 | .animation-timeline .animation .time-block { | |
d0a8de80 | 325 | cursor: pointer; |
2e389898 RK |
326 | } |
327 | ||
328 | /* Animation iterations */ | |
329 | ||
330 | .animation-timeline .animation .iterations { | |
d0a8de80 | 331 | position: absolute; |
2e389898 | 332 | height: 100%; |
2e389898 | 333 | box-sizing: border-box; |
e9fbfc3a RK |
334 | |
335 | /* Iterations of the animation are displayed with a repeating linear-gradient | |
336 | which size is dynamically changed from JS. The gradient only draws 1px | |
337 | borders between each iteration. These borders must have the same color as | |
338 | the border of this element */ | |
2e389898 | 339 | background-image: |
d0a8de80 RK |
340 | linear-gradient(to left, |
341 | var(--timeline-border-color) 0, | |
342 | var(--timeline-border-color) 1px, | |
2e389898 RK |
343 | transparent 1px, |
344 | transparent 2px); | |
d0a8de80 RK |
345 | border: 1px solid var(--timeline-border-color); |
346 | /* Border-right is already handled by the gradient */ | |
347 | border-width: 1px 0 1px 1px; | |
e9fbfc3a RK |
348 | |
349 | /* The background color is set independently */ | |
350 | background-color: var(--timeline-background-color); | |
351 | } | |
352 | ||
2e389898 RK |
353 | .animation-timeline .animation .iterations.infinite::before, |
354 | .animation-timeline .animation .iterations.infinite::after { | |
355 | content: ""; | |
356 | position: absolute; | |
357 | top: 0; | |
358 | right: 0; | |
359 | width: 0; | |
360 | height: 0; | |
361 | border-right: 4px solid var(--theme-body-background); | |
362 | border-top: 4px solid transparent; | |
363 | border-bottom: 4px solid transparent; | |
364 | } | |
365 | ||
366 | .animation-timeline .animation .iterations.infinite::after { | |
367 | bottom: 0; | |
368 | top: unset; | |
369 | } | |
370 | ||
e9fbfc3a | 371 | .animation-timeline .animation .name { |
d0a8de80 | 372 | position: absolute; |
e9fbfc3a RK |
373 | color: var(--theme-selection-color); |
374 | height: 100%; | |
d0a8de80 RK |
375 | display: flex; |
376 | align-items: center; | |
377 | padding: 0 2px; | |
378 | box-sizing: border-box; | |
379 | --fast-track-icon-width: 12px; | |
380 | z-index: 1; | |
381 | } | |
382 | ||
383 | .animation-timeline .animation .name div { | |
384 | /* Flex items don't support text-overflow, so a child div is used */ | |
385 | white-space: nowrap; | |
2e389898 | 386 | overflow: hidden; |
e9fbfc3a | 387 | text-overflow: ellipsis; |
2e389898 RK |
388 | } |
389 | ||
d0a8de80 RK |
390 | .animation-timeline .fast-track .name div { |
391 | width: calc(100% - var(--fast-track-icon-width)); | |
392 | } | |
393 | ||
394 | .animation-timeline .fast-track .name::after { | |
dadba0f2 | 395 | /* Animations running on the compositor have the fast-track background image*/ |
d0a8de80 RK |
396 | content: ""; |
397 | display: block; | |
398 | position: absolute; | |
399 | top: 0; | |
400 | right: 0; | |
401 | height: 100%; | |
402 | width: var(--fast-track-icon-width); | |
403 | z-index: 1; | |
404 | ||
dadba0f2 RK |
405 | background-image: url("images/animation-fast-track.svg"); |
406 | background-repeat: no-repeat; | |
d0a8de80 | 407 | background-position: center; |
dadba0f2 RK |
408 | } |
409 | ||
d0a8de80 RK |
410 | .animation-timeline .animation .delay, |
411 | .animation-timeline .animation .end-delay { | |
2e389898 | 412 | position: absolute; |
d0a8de80 RK |
413 | height: 100%; |
414 | border: 1px solid var(--timeline-border-color); | |
e9fbfc3a | 415 | box-sizing: border-box; |
d0a8de80 | 416 | } |
e9fbfc3a | 417 | |
d0a8de80 | 418 | .animation-timeline .animation .delay { |
e9fbfc3a RK |
419 | border-width: 1px 0 1px 1px; |
420 | background-image: repeating-linear-gradient(45deg, | |
421 | transparent, | |
422 | transparent 1px, | |
423 | var(--theme-selection-color) 1px, | |
424 | var(--theme-selection-color) 4px); | |
d0a8de80 | 425 | background-color: var(--timeline-border-color); |
e9fbfc3a RK |
426 | } |
427 | ||
d0a8de80 RK |
428 | .animation-timeline .animation .end-delay { |
429 | border-width: 1px 1px 1px 0; | |
430 | background-image: repeating-linear-gradient( | |
431 | -45deg, | |
432 | transparent, | |
433 | transparent 3px, | |
434 | var(--timeline-border-color) 3px, | |
435 | var(--timeline-border-color) 4px); | |
436 | } | |
437 | ||
438 | .animation-timeline .animation .delay.negative, | |
439 | .animation-timeline .animation .end-delay.negative { | |
e9fbfc3a RK |
440 | /* Negative delays are displayed on top of the animation, so they need a |
441 | right border. Whereas normal delays are displayed just before the | |
442 | animation, so there's already the animation's left border that serves as | |
443 | a separation. */ | |
444 | border-width: 1px; | |
2e389898 RK |
445 | } |
446 | ||
d74db938 RK |
447 | /* Animation target node gutter, contains a preview of the dom node */ |
448 | ||
449 | .animation-target { | |
450 | background-color: var(--theme-toolbar-background); | |
d0a8de80 | 451 | padding: 0 4px; |
d74db938 RK |
452 | box-sizing: border-box; |
453 | overflow: hidden; | |
454 | text-overflow: ellipsis; | |
455 | white-space: nowrap; | |
d0a8de80 | 456 | cursor: pointer; |
d74db938 RK |
457 | } |
458 | ||
459 | .animation-target .attribute-name { | |
460 | padding-left: 4px; | |
461 | } | |
462 | ||
dadba0f2 | 463 | .animation-target .node-highlighter { |
dc9d5d64 | 464 | background: url("chrome://devtools/skin/images/vview-open-inspector.png") no-repeat 0 0; |
d74db938 RK |
465 | padding-left: 16px; |
466 | margin-right: 5px; | |
467 | cursor: pointer; | |
468 | } | |
469 | ||
dadba0f2 RK |
470 | .animation-target .node-highlighter:hover { |
471 | filter: url(images/filters.svg#checked-icon-state); | |
d74db938 RK |
472 | } |
473 | ||
dadba0f2 RK |
474 | .animation-target .node-highlighter:active, |
475 | .animation-target .node-highlighter.selected { | |
476 | filter: url(images/filters.svg#checked-icon-state); | |
d74db938 RK |
477 | } |
478 | ||
d0a8de80 | 479 | /* Inline keyframes info in the timeline */ |
20752032 | 480 | |
d0a8de80 RK |
481 | .animation-timeline .animated-properties:not(.selected) { |
482 | display: none; | |
20752032 RK |
483 | } |
484 | ||
d0a8de80 RK |
485 | .animation-timeline .animated-properties { |
486 | background-color: var(--theme-selection-background-semitransparent); | |
20752032 RK |
487 | } |
488 | ||
d0a8de80 RK |
489 | .animation-timeline .animated-properties ul { |
490 | margin: 0; | |
491 | padding: 0; | |
492 | list-style-type: none; | |
b336389b RK |
493 | } |
494 | ||
d0a8de80 | 495 | .animation-timeline .animated-properties .property { |
e9fbfc3a | 496 | height: var(--timeline-animation-height); |
d0a8de80 | 497 | position: relative; |
20752032 RK |
498 | } |
499 | ||
d0a8de80 RK |
500 | .animation-timeline .animated-properties .property:nth-child(2n) { |
501 | background-color: var(--even-animation-timeline-background-color); | |
20752032 RK |
502 | } |
503 | ||
d0a8de80 RK |
504 | .animation-timeline .animated-properties .name { |
505 | width: var(--timeline-sidebar-width); | |
506 | padding-right: var(--keyframes-marker-size); | |
507 | box-sizing: border-box; | |
508 | height: 100%; | |
509 | color: var(--theme-body-color-alt); | |
510 | white-space: nowrap; | |
511 | display: flex; | |
512 | justify-content: flex-end; | |
513 | align-items: center; | |
20752032 RK |
514 | } |
515 | ||
d0a8de80 RK |
516 | .animation-timeline .animated-properties .name div { |
517 | overflow: hidden; | |
518 | text-overflow: ellipsis; | |
20752032 RK |
519 | } |
520 | ||
d0a8de80 RK |
521 | .animation-timeline .animated-properties .frames { |
522 | /* The frames list is absolutely positioned and the left and width properties | |
523 | are dynamically set from javascript to match the animation's startTime and | |
524 | duration */ | |
525 | position: absolute; | |
526 | top: 0; | |
527 | height: 100%; | |
528 | /* Using flexbox to vertically center the frames */ | |
529 | display: flex; | |
530 | align-items: center; | |
20752032 RK |
531 | } |
532 | ||
d0a8de80 RK |
533 | /* Keyframes diagram, displayed below the timeline, inside the animation-details |
534 | element. */ | |
20752032 | 535 | |
d0a8de80 RK |
536 | .keyframes { |
537 | /* Actual keyframe markers are positioned absolutely within this container and | |
538 | their position is relative to its size (we know the offset of each frame | |
539 | in percentage) */ | |
540 | position: relative; | |
541 | width: 100%; | |
542 | height: 0; | |
20752032 RK |
543 | } |
544 | ||
d0a8de80 RK |
545 | .keyframes.cssanimation { |
546 | background-color: var(--theme-contrast-background); | |
20752032 RK |
547 | } |
548 | ||
d0a8de80 RK |
549 | .keyframes.csstransition { |
550 | background-color: var(--theme-highlight-blue); | |
20752032 RK |
551 | } |
552 | ||
d0a8de80 RK |
553 | .keyframes.scriptanimation { |
554 | background-color: var(--theme-graphs-green); | |
20752032 RK |
555 | } |
556 | ||
d0a8de80 | 557 | .keyframes .frame { |
20752032 | 558 | position: absolute; |
d0a8de80 RK |
559 | top: 0; |
560 | width: 0; | |
561 | height: 0; | |
562 | background-color: inherit; | |
563 | cursor: pointer; | |
20752032 RK |
564 | } |
565 | ||
d0a8de80 RK |
566 | .keyframes .frame::before { |
567 | content: ""; | |
568 | display: block; | |
569 | transform: | |
570 | translateX(calc(var(--keyframes-marker-size) * -.5)) | |
571 | /* The extra pixel on the Y axis is so that markers are centered on the | |
572 | horizontal line in the keyframes diagram. */ | |
573 | translateY(calc(var(--keyframes-marker-size) * -.5 + 1px)); | |
574 | width: var(--keyframes-marker-size); | |
575 | height: var(--keyframes-marker-size); | |
576 | border-radius: 100%; | |
577 | background-color: inherit; | |
20752032 | 578 | } |