File: _loader_line_example.scss

package info (click to toggle)
openstack-dashboard-debian-theme 1.0.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 200 kB
  • sloc: makefile: 3
file content (65 lines) | stat: -rw-r--r-- 1,139 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Adapter with <3 from http://codepen.io/max-scopp/pen/FArlb

// keyframes
@mixin animate-loader($duration) {
  @include animation(material-loader-stretch 2.8s ease $duration infinite)
}

.material-line-loader {
  width: 100%;
  height: 4px;
  position: relative;
  overflow: hidden;

  & > .loader-section {
    position: absolute;
    height: 100%;
    left: 50%;

    &:first-child {
      background: $brand-success;
      @include animate-loader(0s);
    }

    &:nth-child(2) {
      background: $brand-danger;
      @include animate-loader(.4s);
    }

    &:nth-child(3) {
      background: $brand-info;
      @include animate-loader(.8s);
    }

    &:nth-child(4) {
      background: $brand-warning;
      @include animate-loader(1.2s);
    }
  }
}

@include keyframes(material-loader-stretch) {
  0% {
    padding: 0 0 0 0;
    left: 50%;
    z-index: 4;
  }
  25% {
    z-index: 3;
  }
  50% {
    padding: 0 50% 0 50%;
    left: 0;
    z-index: 2;
  }
  100% {
    padding: 0 50% 0 50%;
    left: 0;
    z-index: 1;
  }
}

// Move it up over the tab line, it looks cleaner
.tab-loading .material-line-loader {
  top: -2px;
}