Skip to content

Commit b5ea047

Browse files
committed
add CSS loader to the terminal
1 parent 863efed commit b5ea047

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

docs/src/components/Terminal/index.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,7 @@ export default function Interpreter(): JSX.Element {
163163
return <script key={script} src={script} />
164164
})}
165165
</Head>
166-
<div className={clsx('terminal', styles.marker)} ref={ref}></div>
167-
<div className={styles.term} />
166+
<div className={clsx('terminal', styles.term)} ref={ref}/>
168167
{show_commands && (
169168
<div className={styles.commands}>
170169
<p>Top-level Commands:</p>

docs/src/components/Terminal/styles.module.css

+28-7
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,38 @@
77
text-align: left;
88
resize: vertical;
99
overflow: hidden;
10+
box-shadow: 4px 4px 10px 2px rgba(0, 0, 0, 0.3);
1011
}
1112

12-
.term[class*="terminal"] {
13-
box-shadow: 4px 4px 10px 2px rgba(0, 0, 0, 0.3);
13+
.term:empty::before {
14+
content: '';
15+
display: block;
16+
width: 50px;
17+
padding: 8px;
18+
aspect-ratio: 1;
19+
border-radius: 50%;
20+
position: absolute;
21+
left: 50%;
22+
top: 50%;
23+
transform: translate(-50%, -50%);
24+
background: var(--color);
25+
--_m:
26+
conic-gradient(#0000 10%,#000),
27+
linear-gradient(#000 0 0) content-box;
28+
-webkit-mask: var(--_m);
29+
mask: var(--_m);
30+
-webkit-mask-composite: source-out;
31+
mask-composite: subtract;
32+
animation: spin 1s infinite linear;
33+
}
34+
35+
@keyframes spin {
36+
to {
37+
transform: translate(-50%, -50%) rotate(1turn)
38+
}
1439
}
1540

41+
1642
.commands p {
1743
margin: 0;
1844
}
@@ -26,11 +52,6 @@
2652
gap: 5px;
2753
}
2854

29-
.marker {
30-
position: absolute;
31-
left: -9999999999px;
32-
}
33-
3455
.shake {
3556
animation: shake 0.2s;
3657
}

0 commit comments

Comments
 (0)