• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (C) 2018 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//      http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15:root {
16  --record-text-color: #333;
17}
18
19// The whole record page.
20.record-page {
21  position: relative;
22  overflow-y: scroll;
23  background-color: #fefefe;
24  padding: 40px 20px;
25}
26
27// The always-visible centered box that has menu and sections on the right.
28.record-container {
29  position: relative;
30  max-width: 900px;
31  min-height: 500px;
32  margin: auto;
33  border-radius: 5px;
34  box-shadow: 0 1px 2px 0#aaa, 0 1px 3px 1px #eee;
35  background-color: #fff;
36  display: grid;
37  grid-template-columns: 2fr 5fr;
38  grid-template-rows: auto 1fr;
39  grid-template-areas: "header header"
40                       "sidebar section";
41  overflow: hidden;
42  z-index: 6;
43}
44
45.hider {
46  @include transition(0.2s);
47  position: fixed;
48  left: 0;
49  top: 0;
50  bottom: 0;
51  right: 0;
52  background: #000;
53  opacity: 0.2;
54  z-index: 5;
55}
56
57.record-header {
58  grid-area: header;
59  padding: 10px;
60  display: flex;
61  flex-direction: column;
62  border-bottom: 1px solid #eee;
63
64  .top-part {
65    display: flex;
66    justify-content: space-between;
67    align-items: center;
68
69    // Connect/start/stop tracing buttons.
70    .button {
71      display: flex;
72      justify-content: flex-end;
73      align-items: center;
74      width: auto;
75      height: 50px;
76      margin: 0;
77      >* {
78        @include transition(0.2s);
79        cursor: pointer;
80        border-radius: 10px;
81        margin: 10px;
82        text-align: center;
83        background-color: #eee;
84        font-family: 'Raleway', sans-serif;
85        font-size: 17px;
86        @media (max-width: 1280px) {
87          font-size: 1.6vw;
88        }
89        padding: 7px;
90
91        &:hover {
92          background-color: hsl(88, 50%, 84%);
93          box-shadow: 0 0 4px 0px #999;
94        }
95
96        &.selected {
97          background-color: hsl(88, 50%, 67%);
98          box-shadow: 0 0 4px 0px #999;
99        }
100
101        &.disabled {
102          background-color: hsl(0, 0%, 97%);
103        }
104      }
105    }
106
107    .target-and-status {
108      display: flex;
109      flex-direction: column;
110      justify-content: space-evenly;
111
112      .target {
113        display: flex;
114        flex-direction: row;
115        align-items: center;
116      }
117
118      label, select, button {
119        font-weight: 100;
120        margin: 3px;
121        color: #333;
122        font-size: 17px;
123        font-family: 'Roboto', sans-serif;
124        align-items: center;
125
126        &.error-label {
127          max-width: 500px;
128          color: rgb(255, 0, 0);
129          font-size: 15px;
130        }
131      }
132      .chip {
133        @include transition();
134        display: flex;
135        align-items: center;
136        border: 1px solid #eee;
137        outline: none;
138        margin: 4px;
139        border-radius: 20px;
140        padding: 4px;
141        height: 30px;
142        &:hover, &:active {
143          box-shadow: 0 0 4px 0px #ccc;
144          background-color: #fafafa;
145        }
146        i {
147          margin: 3px;
148          align-items: center;
149        }
150      }
151    }
152  }
153
154  .note {
155    border: 1px dashed #ddd;
156    background: #f9eeba;
157    margin: var(--record-section-padding);
158    padding: 10px;
159    font-family: 'Roboto', sans-serif;
160    font-size: 14px;
161    line-height: 20px;
162  }
163
164  select {
165    @include transition();
166    margin-left: 10px;
167    border-radius: 0;
168    border: 1px solid #eee;
169    outline: none;
170    &:hover, &:active {
171      box-shadow: 0 0 6px #ccc;
172    }
173  }
174}
175
176// The left-hand-side menu with 'Cpu', 'Memory' etc.
177.record-menu {
178  grid-area: sidebar;
179  .rec { color: #ee3326; }
180
181  background-color: #fcfcfc;
182  border-right: 1px solid #eee;
183  padding-bottom: 1em;
184
185  header {
186    font-family: 'Roboto', sans-serif;
187    font-size: 14px;
188    font-weight: 700;
189    margin: 1em;
190  }
191
192  ul {
193    list-style-type: none;
194    margin: 0;
195    padding: 0;
196  }
197
198  a, a:link, a:visited {
199    text-decoration: none;
200  }
201
202  li {
203    @include transition();
204    display: block;
205    height: 55px;
206    padding: 0 1em;
207    font-size: 15px;
208    letter-spacing: 0.5px;
209    font-family: 'Raleway', sans-serif;
210    font-weight: 600;
211    color: #666;
212    display: grid;
213    grid-template-columns: 50px 1fr;
214    grid-template-rows: 40px 1fr;
215    grid-template-areas: "icon title" "icon subtext";
216    cursor: pointer;
217    overflow: hidden;
218
219    i {
220      margin: auto;
221      border-radius: 100%;
222      font-size: 32px;
223      width: 38px;
224      height: 38px;
225      padding: 3px;
226      background: #eee;
227      grid-area: icon;
228    }
229
230    .title {
231      transition: line-height .25s ease;
232      grid-area: title;
233      line-height: 55px;
234      display: block;
235    }
236
237    .sub {
238      @include transition(0.5s);
239      grid-area: subtext;
240      font-size: 10px;
241      line-height: 12.5px;
242      margin-top: -5px;
243      opacity: 0;
244    }
245
246    &:hover {
247      background-color: hsl(214, 0%, 90%);
248      .title { line-height: 50px; }
249      .sub {
250        opacity: 1;
251        transition-duration: 0.25s;
252        transition-delay: 0.0s;
253      }
254    }
255
256    &.active {
257      background-color: hsl(214, 80%, 70%);
258      .title, .sub {
259        color: white;
260      }
261    }
262  }  // li
263
264  &.disabled {
265    opacity: 0.50;
266    pointer-events: none;
267  }
268}  // record-menu
269
270
271.record-section {
272  grid-area: section;
273  background: #fff;
274  transition: opacity 0.25s ease;
275  opacity: 0;
276  display: none;
277
278  &:not(.active) {
279    max-height: 0;
280  }
281
282  &.active {
283    display: grid;
284    opacity: 1;
285  }
286
287  // By default space all section elements by the same amount.
288  --record-section-padding: 20px;
289
290  >* {
291    padding-left: var(--record-section-padding);
292    padding-right: var(--record-section-padding);
293    &:first-child { padding-top: 20px; }
294    &:last-child { padding-bottom: 20px; }
295  }
296
297  >header {
298    text-align: center;
299    font-family: 'Raleway', sans-serif;
300    font-size: 20px;
301    padding: 15px 10px;
302    color: #333;
303    letter-spacing: 0.5px;
304  }
305
306  .hide {
307    opacity: 0;
308    visibility: hidden;
309  }
310
311  .probe {
312    display: grid;
313    grid-template-rows: 40px 1fr;
314    grid-template-columns: 220px 1fr;
315    grid-template-areas: "label label" "img descr";
316    transition: color 0.2s ease;
317    padding-top: var(--record-section-padding);
318    padding-bottom: var(--record-section-padding);
319
320    &:nth-of-type(2n) {
321      background-color: #f9f9f9;
322    }
323
324    >img {
325      transition: filter 0.2s ease, opacity 0.2s ease;
326      grid-area: img;
327      width: 210px;
328      box-sizing: content-box;
329      cursor: pointer;
330      opacity: 0.5;
331      filter: saturate(0.15);
332    }
333
334    &:hover {
335      >img { opacity: 1; }
336      >label {
337        color: #333;
338        input[type=checkbox]::after {
339          background: hsl(207, 60%, 60%);
340        }
341      }
342    }  // :hover
343
344    >label {
345      grid-area: label;
346      cursor: pointer;
347      font-family: 'Roboto' , sans-serif;
348      font-size: 20px;
349      font-weight: 400;
350      color: #999;
351
352      // The per-probe on-off switch.
353      input[type=checkbox] {
354        -moz-appearance: none;
355        -webkit-appearance: none;
356        cursor: pointer;
357        margin: 0 10px 0 3px;
358        position: relative;
359        display: inline-block;
360        height: 20px;
361        width: 44px;
362        background: #89898966;
363        border-radius: 100px;
364        transition: all 0.3s ease;
365        overflow: visible;
366        vertical-align: middle;
367
368        &:focus {
369          outline: none;
370        }
371
372        &::after {
373          position: absolute;
374          left: -2px;
375          top: -3px;
376          display: block;
377          width: 26px;
378          height: 26px;
379          border-radius: 100px;
380          background: #f5f5f5;
381          box-shadow: 0px 3px 3px rgba(0,0,0,0.15);
382          content: '';
383          transition: all 0.3s ease;
384        }
385        &:checked {
386          background: #8398b7;
387        }
388        &:focus::after {
389          background: hsl(207, 60%, 60%);
390        }
391        &:checked::after {
392          left: 20px;
393          background: #27303d;
394        }
395      }  // checkbox
396    }  // label
397
398    // The content of the probe section.
399    >div {
400      grid-area: descr;
401      font-size: 14px;
402      font-weight: 200;
403      min-height: 50px;
404      color: var(--record-text-color);
405      line-height: 20px;
406    }
407
408    // .probe-config is showed only when the probe is enabled.
409    .probe-config {
410      @include transition(0.3s);
411      opacity: 0;
412      visibility: hidden;
413      margin: 10px 10px 0 0;
414      max-height: 0;
415    }
416
417    &.enabled {
418      .probe-config {
419        opacity: 1;
420        visibility: visible;
421        max-height: 100vh;
422      }
423      >label span { color: #4e80b7; }
424      >img {
425        filter: saturate(1);
426        opacity: 1;
427      }
428    }
429  }  // probe
430
431  // The three "Stop when full", "Ring buffer", "Long trace" buttons.
432  .record-mode {
433    display: grid;
434    grid-template-columns: 1fr 1fr 1fr;
435    grid-template-areas: ". . .";
436    grid-template-rows: 1fr;
437    padding-top: 0;
438
439    input[type=radio] {
440      appearance: none;
441      -webkit-appearance: none;
442      display: none;
443    }
444
445    >* {
446      @include transition(0.2s);
447      cursor: pointer;
448      border-radius: 15px;
449      margin: 5px;
450      text-align: center;
451      background-color: #eee;
452      font-family: 'Raleway', sans-serif;
453      font-size: 20px;
454      @media (max-width: 1280px) {
455        font-size: 1.6vw;
456      }
457      padding-bottom: 10px;
458
459      &:hover {
460        background-color: hsl(88, 50%, 84%);
461        box-shadow: 0 0 4px 0px #999;
462      }
463
464      &.selected {
465        background-color: hsl(207, 90%, 74%);
466        background-color: hsl(88, 50%, 67%);
467        box-shadow: 0 0 4px 0px #999;
468      }
469
470      img {
471        width: 100%;
472      }
473    }
474  }  // record-mode
475
476  // There are two types of sliders:
477  // 1) The full-width one (default), e.g. the one used in the main recording
478  //    page for the duration of the trace. This one has both an icon and a
479  //    label on the top.
480  // 2) The smaller ones (.thin) used in the probes. This one has no icon.
481  .slider {
482    @include transition(0.3s);
483    display: grid;
484    grid-template-columns: 40px 1fr 130px 0;
485    grid-template-rows: 30px min-content 1fr;
486    grid-template-areas: "hdr hdr hdr hdr" "descr descr descr descr"
487    "icon slider label unit";
488    margin-top: var(--record-section-padding);
489
490    &.thin {
491      grid-template-columns: 1fr 1fr 100px 0;
492      grid-template-areas: "hdr hdr hdr hdr" "descr descr descr descr"
493      "slider slider label unit";
494    }
495
496    &.greyed-out {
497      opacity: 0.5;
498    }
499
500    >* {
501      height: 40px;
502      line-height: 40px;
503    }
504
505    >header {
506      @include transition(0.3s);
507      opacity: 0.6;
508      color: #333;
509      grid-area: hdr;
510    }
511
512    &.thin >header {
513      opacity: 1;
514      color: var(--record-text-color);
515      font-size: 14px;
516    }
517
518    &.thin >header.descr {
519      grid-area: descr;
520      font-size: 12px;
521      color: #666;
522      height: 20px;
523      line-height: 20px;
524    }
525
526    &:hover > header {
527      opacity: 1;
528      transition-duration: 0.15s;
529    }
530
531    >i {
532      grid-area: icon;
533      font-size: 32px;
534      color: #333;
535    }
536
537    input[type=range] {
538      grid-area: slider;
539      width: 100%;
540      appearance: none;
541      -webkit-appearance: none;
542      scroll-snap-type: mandatory;
543      background-color : transparent;
544      outline: none;
545      margin-left: -10px;
546      margin-top: -5px;
547
548      &::-webkit-slider-runnable-track {
549        margin: 10px;
550        border-radius: 1px;
551        width: 100%;
552        height: 10px;
553        background-color : #ddd;
554        border-radius: 4px;
555      }
556
557      &::-webkit-slider-thumb {
558        @include transition();
559        appearance: none;
560        -webkit-appearance: none;
561        border: none;
562        border-radius: 3px;
563        height: 20px;
564        width: 40px;
565        background-color: rgb(33, 150, 243);
566        margin-top: -5px;
567        cursor: pointer;
568        content: "";
569      }
570
571      &:hover::-webkit-slider-thumb,
572      &:focus::-webkit-slider-thumb {
573        box-shadow: 0 0 4px rgb(16, 81, 134);
574        transform: scale(1, 1.1);
575      }
576    }
577
578    &.thin input[type=range]::-webkit-slider-runnable-track {
579      height: 8px;
580    }
581
582    &.thin input[type=range]::-webkit-slider-thumb {
583      width: 20px;
584      border-radius: 100%;
585    }
586
587    .spinner {
588      @include transition();
589      grid-area: label;
590      border: 1px solid #fafafa;
591      border-bottom: 2px solid #ddd;
592      padding: 0 5px;
593      border-radius: 2px;
594      background-color: rgba(255, 255, 255, 60%);
595      font-family: 'Roboto', sans-serif;
596      font-size: 16px;
597      font-weight: 100;
598      height: 35px;
599      outline: none;
600
601      &::-webkit-inner-spin-button,
602      &::-webkit-outer-spin-button,
603      &::-webkit-clear-button {
604        -webkit-appearance: none;
605        margin: 0;
606      }
607
608      &:hover, &:focus {
609        border-bottom-color: hsl(207, 90%, 54%);
610        background-color: hsl(207, 50%, 97%);;
611      }
612
613      &:invalid {
614        border-bottom-color: hsl(9, 90%, 54%);
615        background-color: hsl(9, 50%, 97%);;
616      }
617    }
618
619    &.thin .spinner {
620      font-size: 14px;
621      margin-top: -5px;
622    }
623
624    .unit {
625      grid-area: unit;
626      font-size: 12px;
627      color: var(--record-text-color);
628      position: relative;
629      line-height: 37px;
630      overflow: hidden;
631      width: 35px;
632      left: -45px;
633      text-align: right;
634      margin-top: -5px;
635    }
636  }
637
638  .dropdown {
639    border: 1px solid #eee;
640    outline: none;
641    -webkit-appearance: none;
642
643    &:not(.multicolumn) {
644      overflow: hidden;
645      height: 25px;
646      padding: 0 5px;
647      &:focus, &:hover {
648        height: 30vh;
649        position: absolute;
650        overflow: auto;
651        box-shadow: 0 0 15px 0 #eee;
652      }
653    }
654
655    option, optgroup {
656      @include transition();
657      min-height: 25px;
658      font-size: 12px;
659      color: var(--record-text-color);
660      cursor: pointer;
661      padding: 5px 0;
662    }
663
664    option {
665      padding: 2.5px 5px;
666      border-bottom: 1px solid #eee;
667      &:hover {
668        background-color: hsl(214, 80%, 90%);
669      }
670      &::before {
671        display: none;
672        content: '';
673      }
674    }
675
676    &.multicolumn {
677      padding: 0;
678      max-width: 100%;
679      width: 100%;
680      overflow-y: auto;
681      optgroup {
682        display: grid;
683        padding: 0;
684        grid-template-columns: 1fr 1fr 1fr;
685      }
686      option {
687        &:nth-of-type(3n + 1) {
688          border-left: 1px solid #eee;
689          border-right: 1px solid #eee;
690        }
691        margin: 0;
692      }
693
694      &.two-columns {
695        height: 400px;
696        margin: var(--record-section-padding);
697        optgroup {
698          display: grid;
699          padding: 0;
700          grid-template-columns: 1fr 1fr;
701        }
702        option {
703          &:nth-of-type(2n + 1) {
704            border-left: 1px solid #eee;
705            border-right: 1px solid #eee;
706          }
707          margin: 0;
708        }
709      }
710    }
711  }
712
713  .atrace-categories {
714    height: 227px;
715  }
716
717  .ftrace-events {
718    height: 152px;
719  }
720
721  textarea.extra-input {
722    width: 100%;
723    height: 60px;
724    border: 1px solid #eee;
725    resize: none;
726    outline: none;
727    font-family: var(--monospace-font);
728
729    &::placeholder { color: #aaa; }
730  }
731
732  .code-snippet {
733    display: grid;
734    position: relative;
735    padding: 0;
736    margin: var(--record-section-padding);
737    background-color: #111;
738    border-radius: 4px;
739    user-select: text;
740    box-shadow: 0 0 12px #999;
741
742    @keyframes ripple{
743      0% { transform: scale(1.00); }
744      30% { transform: scale(1.20); }
745      60% { transform: scale(1.00); }
746      80% { transform: scale(1.30); }
747      100% { transform: scale(1.20); }
748    }
749
750    &::before {
751      height: 20px;
752      content: "";
753      display: block;
754      background-color: #598eca;
755    }
756
757    &.no-top-bar {
758      white-space: 'pre';
759      &::before {
760        height: 0;
761      }
762    }
763
764    >code {
765      display: block;
766      margin: 10px 5px 20px 20px;
767      color: #ccc;
768      font-family: var(--monospace-font);
769      font-size: 12px;
770      line-height: 20px;
771      overflow-y: auto;
772      white-space: pre-wrap;
773      word-wrap: break-word;
774
775      // 510px and not 500px, so the overflowing line gets truncated, giving
776      // a clear indication that the code box scrolls.
777      max-height: 510px;
778    }
779
780    >button {
781      @include transition();
782      display: inline-block;
783      position: absolute;
784      top: 30px;
785      right: 20px;
786      color: white;
787      border-radius: 100%;
788      background-color: #333;
789      box-shadow: 0 0 2px rgba(255, 255, 255, 200);
790      padding: 5px;
791      font-size: 16px;
792      line-height: 13px;  // Deliberately smaller to center the icon.
793      user-select: none;
794
795      &:hover {
796        background-color: #444;
797        transform: scale(1.1);
798      }
799    }
800
801    &:active:hover >button:not(:hover) {
802      animation: ripple linear 0.5s;
803      background-color: #701d17;
804      transform: scale(1.1);
805    }
806
807    >button:active:hover {
808      transform: scale(0.9);
809    }
810  }  // code-snippet
811
812  &.instructions {
813    label, select {
814      font-weight: 100;
815      color: #333;
816      font-size: 16px;
817      font-family: 'Roboto', sans-serif;
818    }
819
820    .note {
821      border: 1px dashed #ddd;
822      background: #f9eeba;
823      margin: var(--record-section-padding);
824      padding: 10px;
825      font-family: 'Roboto', sans-serif;
826      font-size: 14px;
827      line-height: 20px;
828    }
829
830    select {
831      @include transition();
832      margin-left: 10px;
833      border-radius: 0;
834      border: 1px solid #eee;
835      outline: none;
836
837      &:hover, &:active {
838        box-shadow: 0 0 6px #ccc;
839      }
840    }
841    // Stop/cancel buttons
842    .buttons {
843      display: flex;
844      justify-content: center;
845      align-items: center;
846      width: auto;
847      height: 70px;
848      >* {
849        @include transition(0.2s);
850        cursor: pointer;
851        border-radius: 10px;
852        text-align: center;
853        margin: 3px;
854        background-color: #eee;
855        font-family: 'Raleway', sans-serif;
856        flex-grow: 1;
857        font-size: 17px;
858        @media (max-width: 1280px) {
859          font-size: 1.6vw;
860        }
861        padding: 7px;
862
863        &:hover {
864          background-color: hsl(88, 50%, 84%);
865          box-shadow: 0 0 4px 0px #999;
866        }
867
868        &.selected {
869          background-color: hsl(88, 50%, 67%);
870          box-shadow: 0 0 4px 0px #999;
871        }
872      }
873    }
874
875    progress {
876      -webkit-appearance: none;
877      appearance: none;
878      width: 600px;
879      height: 30px;
880      margin: var(--record-section-padding);
881      border-radius: 5px;
882    }
883    ::-webkit-progress-value {
884      background-color: hsl(88, 50%, 67%);
885    }
886    ::-webkit-progress-bar {
887      background-color: #eee;
888    }
889  }
890}  // record-section
891