Skip to content

Commit 0715834

Browse files
committed
Fix play button positioning; Cleanup
1 parent fae18eb commit 0715834

File tree

5 files changed

+30
-8
lines changed

5 files changed

+30
-8
lines changed

src/index.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,10 @@ export default function themeLiveCodeblock(): Plugin {
88
getThemePath() {
99
return path.resolve(__dirname, './theme');
1010
},
11+
12+
getTypeScriptThemePath() {
13+
return path.resolve(__dirname, '..', 'src', './theme');
14+
},
1115
};
1216
}
17+

src/theme/CodeBlock/VideoPlayer/CloseIconBig.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export interface Props {
66

77
function CloseIconBig({ className = '' }: Props) {
88
return (
9-
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" className={`feather feather-x ${className}`}><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
9+
<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 26 23" fill="none" stroke="currentColor" strokeWidth="3" strokeLinecap="round" strokeLinejoin="round" className={`feather feather-x ${className}`}><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>
1010
)
1111
}
1212

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

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,37 @@
44

55
.video-container {
66
position: absolute;
7+
8+
display: flex;
9+
padding-top: 5px;
710
z-index: 1;
8-
right: 0px;
11+
right: -48px;
912
}
1013

1114
.play-wrapper {
1215
position: relative;
1316
cursor: pointer;
1417

18+
margin: auto;
19+
1520
display: flex;
1621
align-items: center;
1722
justify-content: center;
1823

19-
width: 70px;
20-
height: 70px;
24+
width: 40px;
25+
height: 40px;
2126
overflow: hidden;
2227
border-radius: 50%;
2328
}
2429

2530
.play-wrapper-normal {
2631
color: #0ac069;
27-
border: 1px solid #0ac069;
32+
border: 2px solid #0ac069;
2833
}
2934

3035
.play-wrapper-selected,
3136
.play-wrapper:hover {
32-
border: 1px solid #11df7b;
37+
border: 2px solid #11df7b;
3338
color: #11df7b;
3439
}
3540

@@ -46,6 +51,13 @@
4651
}
4752

4853
.play {
49-
z-index: 90;
54+
padding-left: 4px;
55+
z-index: 50;
5056
position: absolute;
57+
}
58+
59+
@media (max-width: 996px) {
60+
.video-container {
61+
display: none;
62+
}
5163
}

src/vite.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@
44
background-color: darkslategrey;
55
color: gainsboro;
66
padding: 10px;
7+
font-family: monospace;
8+
border-radius: 0.5em;
9+
margin: 10px;
10+
margin-top: 20px;
11+
z-index: 90;
712
}

src/vite.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function MockCodeBlock() {
2525

2626
function App() {
2727
return (
28-
<div style={{ width: '100%', height: '100%' }}>
28+
<div style={{ width: '80%', height: '100%', alignItems: 'center', justifyContent: 'center', fontFamily: 'mono' }}>
2929
<VideoPlayer youtubeID={youtubeID}>
3030
<MockCodeBlock />
3131
</VideoPlayer>

0 commit comments

Comments
 (0)