Skip to content

Commit

Permalink
Fix play button positioning; Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ValentaTomas committed Jul 28, 2022
1 parent fae18eb commit 0715834
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,10 @@ export default function themeLiveCodeblock(): Plugin {
getThemePath() {
return path.resolve(__dirname, './theme');
},

getTypeScriptThemePath() {
return path.resolve(__dirname, '..', 'src', './theme');
},
};
}

2 changes: 1 addition & 1 deletion src/theme/CodeBlock/VideoPlayer/CloseIconBig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface Props {

function CloseIconBig({ className = '' }: Props) {
return (
<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>
<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>
)
}

Expand Down
24 changes: 18 additions & 6 deletions src/theme/CodeBlock/VideoPlayer/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,37 @@

.video-container {
position: absolute;

display: flex;
padding-top: 5px;
z-index: 1;
right: 0px;
right: -48px;
}

.play-wrapper {
position: relative;
cursor: pointer;

margin: auto;

display: flex;
align-items: center;
justify-content: center;

width: 70px;
height: 70px;
width: 40px;
height: 40px;
overflow: hidden;
border-radius: 50%;
}

.play-wrapper-normal {
color: #0ac069;
border: 1px solid #0ac069;
border: 2px solid #0ac069;
}

.play-wrapper-selected,
.play-wrapper:hover {
border: 1px solid #11df7b;
border: 2px solid #11df7b;
color: #11df7b;
}

Expand All @@ -46,6 +51,13 @@
}

.play {
z-index: 90;
padding-left: 4px;
z-index: 50;
position: absolute;
}

@media (max-width: 996px) {
.video-container {
display: none;
}
}
5 changes: 5 additions & 0 deletions src/vite.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@
background-color: darkslategrey;
color: gainsboro;
padding: 10px;
font-family: monospace;
border-radius: 0.5em;
margin: 10px;
margin-top: 20px;
z-index: 90;
}
2 changes: 1 addition & 1 deletion src/vite.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function MockCodeBlock() {

function App() {
return (
<div style={{ width: '100%', height: '100%' }}>
<div style={{ width: '80%', height: '100%', alignItems: 'center', justifyContent: 'center', fontFamily: 'mono' }}>
<VideoPlayer youtubeID={youtubeID}>
<MockCodeBlock />
</VideoPlayer>
Expand Down

0 comments on commit 0715834

Please sign in to comment.