-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Etch-a-sketch theme #454
Open
heff
wants to merge
3
commits into
main
Choose a base branch
from
etch
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Etch-a-sketch theme #454
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta name="viewport" content="width=device-width" /> | ||
<title>Media Chrome Etch-a-Sketch Theme</title> | ||
<script type="module" src="../../dist/index.js"></script> | ||
<script type="module" src="../../src/js/themes/media-theme-etch-a-sketch.js"></script> | ||
</head> | ||
<body> | ||
|
||
<main> | ||
<h1>Media Chrome Etch-a-Sketch Theme</h1> | ||
|
||
<media-theme-etch-a-sketch> | ||
<video | ||
slot="media" | ||
src="https://stream.mux.com/DS00Spx1CV902MCtPj5WknGlR102V5HFkDe/high.mp4" | ||
crossorigin | ||
muted | ||
playsinline | ||
></video> | ||
</media-theme-etch-a-sketch> | ||
|
||
|
||
</main> | ||
</body> | ||
</html> |
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,99 @@ | ||
/* | ||
<media-theme-etch-a-sketch> | ||
<video | ||
slot="media" | ||
src="https://stream.mux.com/DS00Spx1CV902MCtPj5WknGlR102V5HFkDe/high.mp4" | ||
></video> | ||
</media-theme-etch-a-sketch> | ||
*/ | ||
|
||
import { window } from '../utils/server-safe-globals.js'; | ||
import { MediaThemeElement } from '../media-theme-element.js'; | ||
|
||
const template = document.createElement('template'); | ||
template.innerHTML = ` | ||
<style> | ||
* { | ||
box-sizing: border-box; | ||
} | ||
|
||
.examples { | ||
margin-top: 20px; | ||
} | ||
|
||
#playerContainer { | ||
width: 1120px; | ||
padding: 95px 80px 0 80px; | ||
background-color: #FE5F5F; | ||
border-radius: 24px; | ||
box-shadow: 10px 5px 0px #900; | ||
} | ||
|
||
media-controller { | ||
width: 960px; | ||
height: 540px; | ||
margin: 0px auto; | ||
} | ||
|
||
media-control-bar { | ||
height: 35px; | ||
padding: 0; | ||
} | ||
|
||
media-time-range, media-volume-range { | ||
--media-range-padding: 0; | ||
|
||
--media-range-bar-color: #ccc; | ||
--thumb-height: 0; | ||
--thumb-width: 0; | ||
--track-height: 100%; | ||
--track-width: 100%; | ||
} | ||
|
||
#knobs { | ||
display: flex; | ||
justify-content: space-between; | ||
padding: 20px 0; | ||
margin: 0 -50px 0 -50px; | ||
} | ||
|
||
.knob { | ||
background-color: #DED9D9; | ||
height: 95px; | ||
width: 95px; | ||
color: #000; | ||
border-radius: 50px; | ||
--media-icon-color: #000; | ||
--media-button-icon-height: 35px; | ||
box-shadow: 5px 5px 0px rgba(0,0,0,0.25); | ||
} | ||
</style> | ||
|
||
<div id="playerContainer"> | ||
<media-controller id="etchController1"> | ||
<slot name="media" slot="media"></slot> | ||
<media-control-bar> | ||
<media-play-button></media-play-button> | ||
<media-time-range></media-time-range> | ||
<media-mute-button></media-mute-button> | ||
<media-volume-range></media-volume-range> | ||
</media-control-bar> | ||
</media-controller> | ||
|
||
<div id="knobs"> | ||
<media-play-button media-controller="etchController1" id="leftKnob" class="knob"></media-play-button> | ||
<div id="title"></div> | ||
<media-mute-button media-controller="etchController1" id="rightKnob" class="knob"></media-mute-button> | ||
</div> | ||
</div> | ||
`; | ||
|
||
class MediaThemeEtchASketch extends MediaThemeElement { | ||
static template = template; | ||
} | ||
|
||
if (!window.customElements.get('media-theme-etch-a-sketch')) { | ||
window.customElements.define('media-theme-etch-a-sketch', MediaThemeEtchASketch); | ||
} | ||
|
||
export default MediaThemeEtchASketch; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trying to remember if there's any specific downsides to getRootNode. The TS parser at least doesn't like it when trying to use properties on it, so it needs to be ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll need to replace document.getElementById with this.getRootNode().getElementById for themes to work nicely with a decoupled media controller