summaryrefslogtreecommitdiff
path: root/src/components/shared/Basic.module.scss
blob: df412e51eab63e97a951056537b6b18ef9a0a370 (plain)
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
@use '~/styles/utils/custom-media' as *;

h2.sectionNameType {
  margin: 0;
  font-size: 1em;
  @media (--breakpoint-not-small) {
    font-size: 1.3em;
  }

  span:nth-child(2) {
    font-size: 12px;
    color: #777;
    font-weight: normal;
    margin: 0 0.3em;
  }
}

@mixin light {
  --loading-dot-1-1: rgba(0, 0, 0, 0.1);
  --loading-dot-1-2: rgba(0, 0, 0, 0.5);
  --loading-dot-1-3: rgba(0, 0, 0, 0.3);
  --loading-dot-2-1: rgba(0, 0, 0, 0.3);
  --loading-dot-2-2: rgba(0, 0, 0, 0.1);
  --loading-dot-2-3: rgba(0, 0, 0, 0.5);
  --loading-dot-3-1: rgba(0, 0, 0, 0.5);
  --loading-dot-3-2: rgba(0, 0, 0, 0.3);
  --loading-dot-3-3: rgba(0, 0, 0, 0.1);
}

@mixin dark {
  --loading-dot-1-1: rgba(255, 255, 255, 0.5);
  --loading-dot-1-2: rgba(255, 255, 255, 0.1);
  --loading-dot-1-3: rgba(255, 255, 255, 0.3);
  --loading-dot-2-1: rgba(255, 255, 255, 0.3);
  --loading-dot-2-2: rgba(255, 255, 255, 0.5);
  --loading-dot-2-3: rgba(255, 255, 255, 0.1);
  --loading-dot-3-1: rgba(255, 255, 255, 0.1);
  --loading-dot-3-2: rgba(255, 255, 255, 0.3);
  --loading-dot-3-3: rgba(255, 255, 255, 0.5);
}

:root[data-theme='auto'] {
  @media (prefers-color-scheme: dark) {
    @include dark;
    color-scheme: dark;
  }
  @media (prefers-color-scheme: light) {
    @include light;
    color-scheme: light;
  }
}

:root[data-theme='dark'] {
  @include dark;
  color-scheme: dark;
}

:root[data-theme='light'] {
  @include light;
  color-scheme: light;
}

.loadingDot,
.loadingDot:before,
.loadingDot:after {
  display: inline-block;
  vertical-align: middle;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  font-size: 0;
}

.loadingDot {
  $d: 1s;

  position: relative;
  background-color: var(--loading-dot-2-1);
  animation: dot2 $d step-start infinite;
  &:before {
    content: '';
    position: absolute;
    left: -12px;
    background-color: var(--loading-dot-1-1);
    animation: dot1 $d step-start infinite;
  }
  &:after {
    content: '';
    position: absolute;
    right: -12px;
    background-color: var(--loading-dot-3-1);
    animation: dot3 $d step-start infinite;
  }
}

@keyframes dot1 {
  0%,
  100% {
    background-color: var(--loading-dot-1-1);
  }
  33% {
    background-color: var(--loading-dot-1-2);
  }
  66% {
    background-color: var(--loading-dot-1-3);
  }
}

@keyframes dot2 {
  0%,
  100% {
    background-color: var(--loading-dot-2-1);
  }
  33% {
    background-color: var(--loading-dot-2-2);
  }
  66% {
    background-color: var(--loading-dot-2-3);
  }
}

@keyframes dot3 {
  0%,
  100% {
    background-color: var(--loading-dot-3-1);
  }
  33% {
    background-color: var(--loading-dot-3-2);
  }
  66% {
    background-color: var(--loading-dot-3-3);
  }
}