-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: custom seeking fast-forward and rewind (#112)
- Loading branch information
Showing
18 changed files
with
567 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
export const createSeekButtons = () => ` | ||
<div style="display:flex;margin-top:12px;justify-content:space-between;height:1.5rem;"> | ||
<button | ||
class="chorus-text-button" | ||
id="chorus-seek-reset-button" | ||
style="padding:0 10px;height:100%;font-size:1rem;" | ||
> | ||
<span>reset</span> | ||
</button> | ||
<button | ||
id="chorus-seek-save-button" | ||
class="chorus-text-button" | ||
style="font-size:1rem;padding:0 10px;height:100%;" | ||
> | ||
<span>save</span> | ||
</button> | ||
</div> | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { createSeekInputs } from './seek-inputs.js' | ||
import { createSeekButtons } from './seek-buttons.js' | ||
import { createSeekToggler } from './seek-toggler.js' | ||
|
||
export const createSeekControls = () => ` | ||
<div id="chorus-seek-controls" style="display: none"> | ||
<div style="margin:.75rem 0"> | ||
${createSeekInputs()} | ||
</div> | ||
<div style="margin-bottom:.75rem"> | ||
${createSeekToggler()} | ||
</div> | ||
${createSeekButtons()} | ||
</div> | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// type: rw | ff; | ||
export const createSeekIcon = type => ` | ||
<button | ||
role="${type}" | ||
class="chorus-hover-white" | ||
id="seek-player-${type}-button" | ||
role="seek-player-${type}-button" | ||
style="display:flex;justify-content:center;align-items:center;position:relative;border:none;background:none;width:2rem;height:2rem;" | ||
> | ||
<span | ||
id="seek-icon-${type}-label" | ||
style="position:absolute;z-index:-10;background:transparent;font-weight:bold;font-size:smaller;top:50%;${type =='ff'? 'left' :'right'}:50%;text-align:center;"> | ||
</span> | ||
<svg | ||
fill="none" | ||
stroke="currentColor" | ||
stroke-width="5" | ||
viewBox="0 0 64 64" | ||
width="1.5rem" | ||
height="1.5rem" | ||
xmlns="http://www.w3.org/2000/svg" | ||
preserveAspectRatio="xMidYMid meet" | ||
style="transform: scaleX(${type == 'ff' ? -1 : 1});z-index:-10" | ||
> | ||
<path d="M34.46,53.91A21.91,21.91,0,1,0,12.55,31.78"></path> | ||
<polyline points="4.65 22.33 12.52 32.62 22.81 24.75"></polyline> | ||
</svg> | ||
</button> | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
export const createSeekInputs = () => ` | ||
<div style="display:flex;justify-content:space-between"> | ||
<div style="display:flex;flex-wrap:wrap;"> | ||
<div class="chorus-common" style="height:unset;width: 100%"> | ||
<button role="rw-down" id="seek-rw-down-button" class="chorus-pill" style="z-index:10;width:2rem;height:2rem;"> | ||
<span class="chorus-text" style="position:relative;z-index:-1;display:inline-block;font-size:x-large;">−</span> | ||
</button> | ||
<div style="position:relative;height:3rem;margin:0 .5rem;"> | ||
<input | ||
min="1" | ||
max="60" | ||
step="1" | ||
type="number" | ||
id="seek-rw-input" | ||
name="chorus-seek-back" | ||
style="position:absolute;width:2rem;background:transparent;font-size:larger;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;" | ||
> | ||
<svg | ||
fill="none" | ||
style="height:100%" | ||
viewBox="0 0 24 24" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<g | ||
stroke="#1ed760" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
stroke-width="1.5" | ||
> | ||
<path d="m14.55 21.67c4.29-1.13 7.45-5.03 7.45-9.67 0-5.52-4.44-10-10-10-6.67 0-10 5.56-10 5.56m0 0v-4.56m0 4.56h2.01 2.43" /> | ||
<path d="m2 12c0 5.52 4.48 10 10 10" opacity=".4" stroke-dasharray="3 3"/> | ||
</g> | ||
</svg> | ||
</div> | ||
<button role="rw-up" id="seek-rw-up-button" class="chorus-pill" style="z-index:10;width:2rem;height:2rem;"> | ||
<span class="chorus-text" style="position:relative;z-index:-1;display:inline-block;font-size:x-large;">+</span> | ||
</button> | ||
</div> | ||
</div> | ||
<div style="display:flex;flex-wrap:wrap;"> | ||
<div class="chorus-common" style="height:unset;width:100%"> | ||
<button role="ff-down" id="seek-ff-down-button" class="chorus-pill" style="z-index:10;width:2rem;height:2rem;"> | ||
<span class="chorus-text" style="position:relative;z-index:-1;display:inline-block;font-size:x-large;">−</span> | ||
</button> | ||
<div style="position:relative;height:3rem;margin:0 .5rem;"> | ||
<input | ||
min="1" | ||
max="60" | ||
step="1" | ||
type="number" | ||
id="seek-ff-input" | ||
name="chorus-seek-forward" | ||
style="z-index:1;position:absolute;width:2rem;background:transparent;font-size:larger;top:50%;left:50%;transform:translate(-50%,-50%);text-align:center;" | ||
> | ||
<svg | ||
fill="none" | ||
viewBox="0 0 24 24" | ||
style="transform: scaleX(-1);height:100%" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<g | ||
stroke="#1ed760" | ||
stroke-linecap="round" | ||
stroke-linejoin="round" | ||
stroke-width="1.5" | ||
> | ||
<path d="m14.55 21.67c4.29-1.13 7.45-5.03 7.45-9.67 0-5.52-4.44-10-10-10-6.67 0-10 5.56-10 5.56m0 0v-4.56m0 4.56h2.01 2.43" /> | ||
<path d="m2 12c0 5.52 4.48 10 10 10" opacity=".4" stroke-dasharray="3 3"/> | ||
</g> | ||
</svg> | ||
</div> | ||
<button role="ff-up" id="seek-ff-up-button" class="chorus-pill" style="z-index:10;width:2rem;height:2rem;"> | ||
<span class="chorus-text" style="position:relative;z-index:-1;display:inline-block;font-size:x-large;">+</span> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { createToggleButton } from '../toggle-button.js' | ||
|
||
export const createSeekToggler = () => ` | ||
<div style="display:flex;justify-content:space-between;align-items:center;width:100%"> | ||
<div style="display:flex;justify-content:space-between;"> | ||
<div style="display:flex;align-items:center;"> | ||
<span id="seek-global-label" class="chorus-text chorus-pill" style="background:green">G</span> | ||
</div> | ||
<div style="display:flex;align-items:center;"> | ||
<span id="seek-shows-label" class="chorus-text chorus-pill">PA</span> | ||
</div> | ||
</div> | ||
<div> | ||
<div style="display:flex;flex-direction:column;justify-content:space-between;align-items:flex-end"> | ||
${ | ||
createToggleButton({ | ||
labelId: 'seek-label', | ||
labelText: 'Global', | ||
onPathId: 'seek-toggle-on', | ||
offPathId: 'seek-toggle-off', | ||
checkboxId: 'seek-checkbox', | ||
buttonId: 'seek-toggle-button', | ||
}) | ||
} | ||
</div> | ||
</div> | ||
</div> | ||
` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.