UNPKG

2.41 kBSCSSView Raw
1@import 'variables';
2
3@import 'default-theme';
4
5/* Animation Durations */
6$md-progress-circle-duration: 5250ms !default;
7$md-progress-circle-constant-rotate-duration: $md-progress-circle-duration * 0.55 !default;
8$md-progress-circle-sporadic-rotate-duration: $md-progress-circle-duration !default;
9
10/** Component sizing */
11$md-progress-circle-stroke-width: 10px !default;
12// Height and weight of the viewport for md-progress-circle.
13$md-progress-circle-viewport-size: 100px !default;
14
15
16:host {
17 display: block;
18 /** Height and width are provided for md-progress-circle to act as a default.
19 The height and width are expected to be overwritten by application css. */
20 height: $md-progress-circle-viewport-size;
21 width: $md-progress-circle-viewport-size;
22
23 /** SVG's viewBox is defined as 0 0 100 100, this means that all SVG children will placed
24 based on a 100px by 100px box. Additionally all SVG sizes and locations are in reference to
25 this viewBox.
26 */
27 svg {
28 height: 100%;
29 width: 100%;
30 transform-origin: center;
31 }
32
33
34 path {
35 fill: transparent;
36 stroke: md-color($md-primary, 600);
37 /** Stroke width of 10px defines stroke as 10% of the viewBox */
38 stroke-width: $md-progress-circle-stroke-width;
39 }
40
41 &[color='accent'] path {
42 stroke: md-color($md-accent, 600);
43 }
44
45
46 &[color='warn'] path {
47 stroke: md-color($md-warn, 600);
48 }
49
50
51 &[mode='indeterminate'] {
52 animation-duration: $md-progress-circle-sporadic-rotate-duration,
53 $md-progress-circle-constant-rotate-duration;
54 animation-name: md-progress-circle-sporadic-rotate,
55 md-progress-circle-linear-rotate;
56 animation-timing-function: $ease-in-out-curve-function,
57 linear;
58 animation-iteration-count: infinite;
59 transition: none;
60 }
61}
62
63
64/** Animations for indeterminate mode */
65@keyframes md-progress-circle-linear-rotate {
66 0% { transform: rotate(0deg); }
67 100% { transform: rotate(360deg); }
68}
69@keyframes md-progress-circle-sporadic-rotate {
70 12.5% { transform: rotate( 135deg); }
71 25% { transform: rotate( 270deg); }
72 37.5% { transform: rotate( 405deg); }
73 50% { transform: rotate( 540deg); }
74 62.5% { transform: rotate( 675deg); }
75 75% { transform: rotate( 810deg); }
76 87.5% { transform: rotate( 945deg); }
77 100% { transform: rotate(1080deg); }
78}