parts
3 years ago
ActionBar.js
2 years ago
Behavior.js
2 years ago
CTA.js
2 years ago
Controls.js
5 years ago
Edit.js
2 years ago
Email.js
2 years ago
Preset.js
4 years ago
Search.js
3 years ago
Style.js
2 years ago
Watermark.js
4 years ago
index.js
4 years ago
Style.js
72 lines
| 1 | /** |
| 2 | * WordPress dependencies |
| 3 | */ |
| 4 | const { __ } = wp.i18n; |
| 5 | const { ToggleControl, BaseControl, RangeControl, SelectControl, ColorPicker } = |
| 6 | wp.components; |
| 7 | import { css, jsx } from "@emotion/core"; |
| 8 | |
| 9 | export default function ({ state, updateState, className }) { |
| 10 | return ( |
| 11 | <div className={className}> |
| 12 | <BaseControl> |
| 13 | <h3>{__("Style", "presto-player")}</h3> |
| 14 | </BaseControl> |
| 15 | <BaseControl> |
| 16 | <ToggleControl |
| 17 | label={__("Hide Logo", "presto-player")} |
| 18 | help={__("Hides the logo on this video.", "presto-player")} |
| 19 | onChange={(hide_logo) => { |
| 20 | updateState({ hide_logo }); |
| 21 | }} |
| 22 | checked={state.hide_logo} |
| 23 | /> |
| 24 | </BaseControl> |
| 25 | <BaseControl> |
| 26 | <RangeControl |
| 27 | label={__("Round Corners", "presto-player")} |
| 28 | help={__("Player border radius size.", "presto-player")} |
| 29 | value={state?.border_radius || 0} |
| 30 | onChange={(border_radius) => updateState({ border_radius })} |
| 31 | min={0} |
| 32 | max={25} |
| 33 | css={css` |
| 34 | padding-left: 4px; |
| 35 | .components-range-control__root { |
| 36 | align-items: flex-start; |
| 37 | } |
| 38 | `} |
| 39 | /> |
| 40 | </BaseControl> |
| 41 | |
| 42 | <BaseControl> |
| 43 | <SelectControl |
| 44 | label={__("Caption Style", "presto-player")} |
| 45 | labelPosition="top" |
| 46 | value={state?.caption_style} |
| 47 | options={[ |
| 48 | { label: __("Default", "presto-player"), value: "default" }, |
| 49 | { label: __("Full", "presto-player"), value: "full" }, |
| 50 | ]} |
| 51 | onChange={(caption_style) => { |
| 52 | updateState({ caption_style }); |
| 53 | }} |
| 54 | /> |
| 55 | </BaseControl> |
| 56 | <BaseControl> |
| 57 | <BaseControl.VisualLabel> |
| 58 | <p>{__("Caption Background", "presto-player")}</p> |
| 59 | </BaseControl.VisualLabel> |
| 60 | |
| 61 | <ColorPicker |
| 62 | color={state?.caption_background || "#000000"} |
| 63 | onChangeComplete={(value) => { |
| 64 | updateState({ caption_background: value.hex }); |
| 65 | }} |
| 66 | disableAlpha |
| 67 | /> |
| 68 | </BaseControl> |
| 69 | </div> |
| 70 | ); |
| 71 | } |
| 72 |