Skip to content

Commit c1c91e0

Browse files
committed
style codeblock
1 parent aea399d commit c1c91e0

File tree

3 files changed

+33
-56
lines changed

3 files changed

+33
-56
lines changed

src/theme/CodeBlock/Container/styles.module.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@
88
--ifm-pre-color: var(--prism-color);
99
overflow-x: scroll;
1010
}
11+

src/theme/CodeBlock/index.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,8 @@ export default function CodeBlockWrapper(props) {
3333

3434
if (!isLoaded) {
3535
return (
36-
<div ref={codeBlockRef}>
37-
<div className={styles.ldsClickHouse}>
38-
<div></div>
39-
<div></div>
40-
<div></div>
41-
<div></div>
42-
<div className={styles.shortBlock}></div>
43-
</div>
36+
<div ref={codeBlockRef} className={styles.wrapper}>
37+
<div className={styles.activity}></div>
4438
</div>
4539
);
4640
}
Lines changed: 30 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,48 @@
1-
2-
.ldsClickHouse,
3-
4-
.ldsClickHouse div {
5-
box-sizing: border-box;
6-
}
7-
8-
.ldsClickHouse {
9-
display: inline-block;
1+
.wrapper {
102
position: relative;
11-
align-self: center;
12-
width: 80px;
13-
height: 80px;
14-
}
15-
16-
.ldsClickHouse div {
17-
color: yellow;
18-
display: inline-block;
19-
position: absolute;
20-
left: 0px;
21-
width: 2px;
22-
background: currentColor;
23-
animation: ldsClickHouse 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite;
3+
height: 100px;
4+
width: 100%;
5+
z-index: 44;
6+
overflow: hidden;
7+
border-radius: 5px;
8+
margin-bottom: 20px;
249
}
2510

26-
.ldsClickHouse div:nth-child(1) {
27-
left: 4px;
28-
animation-delay: -0.40s;
11+
[data-theme='dark'] .wrapper {
12+
background-color: rgb(46,46,41);
2913
}
3014

31-
.ldsClickHouse div:nth-child(2) {
32-
left: 8px;
33-
animation-delay: -0.32s;
15+
[data-theme='light'] .wrapper {
16+
background-color: rgb(245,245,245);
3417
}
3518

36-
.ldsClickHouse div:nth-child(3) {
37-
left: 12px;
38-
animation-delay: -0.24s;
39-
}
40-
41-
.ldsClickHouse div:nth-child(4) {
42-
left: 16px;
43-
animation-delay: -0.12s;
19+
.activity {
20+
position: absolute;
21+
left: -45%;
22+
height: 100%;
23+
width: 45%;
24+
animation: loading 1s infinite;
25+
z-index: 45;
4426
}
4527

46-
.ldsClickHouse div:nth-child(5) {
47-
margin-top: 4px;
48-
left: 20px;
49-
animation-delay: 0s;
28+
[data-theme='dark'] .activity {
29+
background-image: linear-gradient(to left, rgba(31,31,28, .05), rgba(31,31,28, .3), rgba(31,31,28, .6), rgba(31,31,28, .3), rgba(31,31,28, .05));
30+
background-image: -moz-linear-gradient(to left, rgba(31,31,28, .05), rgba(31,31,28, .3), rgba(31,31,28, .6), rgba(31,31,28, .3), rgba(31,31,28, .05));
31+
background-image: -webkit-linear-gradient(to left, rgba(31,31,28, .05), rgba(31,31,28, .3), rgba(31,31,28, .6), rgba(31,31,28, .3), rgba(31,31,28, .05));
5032
}
5133

52-
.shortBlock {
53-
height: 4px !important;
34+
[data-theme='light'] .activity {
35+
background-image: linear-gradient(to left, rgba(227,227,227, .05), rgba(227,227,227, .3), rgba(227,227,227, .6), rgba(227,227,227, .3), rgba(227,227,227, .05));
36+
background-image: -moz-linear-gradient(to left, rgba(227,227,227, .05), rgba(227,227,227, .3), rgba(227,227,227, .6), rgba(227,227,227, .3), rgba(227,227,227, .05));
37+
background-image: -webkit-linear-gradient(to left, rgba(227,227,227, .05), rgba(227,227,227, .3), rgba(227,227,227, .6), rgba(227,227,227, .3), rgba(227,227,227, .05));
5438
}
5539

56-
@keyframes ldsClickHouse {
40+
@keyframes loading {
5741
0% {
58-
top: 4px;
59-
height: 32px;
42+
left: -45%; /* Start off-screen to the left */
6043
}
61-
50%, 100% {
62-
top: 16px;
63-
height: 16px;
44+
100% {
45+
left: calc(100% + 45%); /* Move off-screen to the right */
6446
}
6547
}
6648

0 commit comments

Comments
 (0)