Skip to content

Commit

Permalink
add nudge and basic play/pause
Browse files Browse the repository at this point in the history
  • Loading branch information
samcarton committed Aug 4, 2024
1 parent d460e16 commit 2ae8956
Show file tree
Hide file tree
Showing 6 changed files with 352 additions and 22 deletions.
4 changes: 4 additions & 0 deletions src/components/PauseIcon.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.pause {
color: currentColor;
stroke-width: 2;
}
19 changes: 19 additions & 0 deletions src/components/PauseIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import classes from "./PauseIcon.module.css";

export const PauseIcon = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
className={classes.pause}
>
<rect x="14" y="4" width="4" height="16" rx="1" />
<rect x="6" y="4" width="4" height="16" rx="1" />
</svg>
);
4 changes: 4 additions & 0 deletions src/components/PlayIcon.module.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.play {
color: currentColor;
stroke-width: 2;
}
18 changes: 18 additions & 0 deletions src/components/PlayIcon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import classes from "./PlayIcon.module.css";

export const PlayIcon = () => (
<svg
xmlns="http://www.w3.org/2000/svg"
width="24"
height="24"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
className={classes.play}
>
<polygon points="6 3 20 12 6 21 6 3" />
</svg>
);
146 changes: 135 additions & 11 deletions src/components/VideoPlayer.module.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
:root {
--button-arrow-width: 8px;
}

.container {
display: flex;
flex-direction: column;
Expand Down Expand Up @@ -103,6 +107,28 @@
}

.loopGroup {
display: flex;
flex-direction: row;
justify-content: center;
align-items: baseline;
width: 100%;
gap: 6px;
}

.loopDisplay {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 100%;
gap: 0.5rem;
}

h3 {
margin: 0;
}

.playbackGroup {
display: flex;
flex-direction: row;
justify-content: center;
Expand All @@ -117,8 +143,8 @@
cursor: pointer;
background: rgb(var(--accent-light));
color: #ffffff;
border-radius: 8px;
padding: 12px 12px;
border-radius: 50%;
padding: 12px 13.5px;
font-size: 16px;
font-weight: 700;
line-height: 1;
Expand All @@ -131,15 +157,113 @@
}
}

.loopDisplay {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
width: 100%;
gap: 0.5rem;
.roundedButton {
text-decoration: none;
display: inline-block;
outline: 0;
border: 0;
cursor: pointer;
background: rgb(var(--accent-light));
color: #ffffff;
border-radius: 8px;
padding: 12px 12px;
font-size: 16px;
font-weight: 700;
line-height: 1;
transition:
transform 200ms,
background 200ms;
&:hover {
transform: translateY(-2px);
}
}

h3 {
margin: 0;
.buttonRight {
text-decoration: none;
display: inline-block;
outline: 0;
border: 0;
cursor: pointer;
background: rgb(var(--accent-light));
color: #ffffff;

border-radius: 0;
padding: 12px 12px;
font-size: 16px;
font-weight: 700;
line-height: 1;
transition:
transform 200ms,
background 200ms;
&:hover {
transform: translateY(-2px);
}
clip-path: polygon(
0% 0%,
calc(100% - var(--button-arrow-width)) 0%,
100% 50%,
calc(100% - var(--button-arrow-width)) 100%,
0% 100%,
var(--button-arrow-width) 50%
);
}

.buttonRight {
text-decoration: none;
display: inline-block;
outline: 0;
border: 0;
cursor: pointer;
background: rgb(var(--accent-light));
color: #ffffff;

border-radius: 0;
padding: 12px 12px;
font-size: 16px;
font-weight: 700;
line-height: 1;
transition:
transform 200ms,
background 200ms;
&:hover {
transform: translateY(-2px);
}
clip-path: polygon(
0% 0%,
calc(100% - var(--button-arrow-width)) 0%,
100% 50%,
calc(100% - var(--button-arrow-width)) 100%,
0% 100%,
var(--button-arrow-width) 50%
);
}

.buttonLeft {
text-decoration: none;
display: inline-block;
outline: 0;
border: 0;
cursor: pointer;
background: rgb(var(--accent-light));
color: #ffffff;

border-radius: 0;
padding: 12px 12px;
font-size: 16px;
font-weight: 700;
line-height: 1;
transition:
transform 200ms,
background 200ms;
&:hover {
transform: translateY(-2px);
}
clip-path: polygon(
0% 50%,
var(--button-arrow-width) 0%,
100% 0%,
calc(100% - var(--button-arrow-width)) 50%,
100% 100%,
var(--button-arrow-width) 100%
);
}
Loading

0 comments on commit 2ae8956

Please sign in to comment.