parts
6 days ago
ActionBar.js
6 days ago
ActionBar.scss
6 days ago
Behavior.js
2 years ago
CTA.js
6 days ago
CTA.scss
6 days ago
Controls.js
5 years ago
Edit.js
6 days ago
Edit.scss
6 days ago
Email.js
6 days ago
Email.scss
6 days ago
Preset.js
4 years ago
Search.js
3 years ago
Style.js
6 days ago
Style.scss
6 days ago
Watermark.js
4 years ago
index.js
6 days ago
index.scss
6 days ago
Style.js
67 lines
| 1 | /** |
| 2 | * WordPress dependencies |
| 3 | */ |
| 4 | const { __ } = wp.i18n; |
| 5 | const { ToggleControl, BaseControl, RangeControl, SelectControl, ColorPicker } = |
| 6 | wp.components; |
| 7 | import "./Style.scss"; |
| 8 | |
| 9 | export default function Style({ 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 | className="presto-preset-style__range" |
| 34 | /> |
| 35 | </BaseControl> |
| 36 | |
| 37 | <BaseControl> |
| 38 | <SelectControl |
| 39 | label={__("Caption Style", "presto-player")} |
| 40 | labelPosition="top" |
| 41 | value={state?.caption_style} |
| 42 | options={[ |
| 43 | { label: __("Default", "presto-player"), value: "default" }, |
| 44 | { label: __("Full", "presto-player"), value: "full" }, |
| 45 | ]} |
| 46 | onChange={(caption_style) => { |
| 47 | updateState({ caption_style }); |
| 48 | }} |
| 49 | /> |
| 50 | </BaseControl> |
| 51 | <BaseControl> |
| 52 | <BaseControl.VisualLabel> |
| 53 | <p>{__("Caption Background", "presto-player")}</p> |
| 54 | </BaseControl.VisualLabel> |
| 55 | |
| 56 | <ColorPicker |
| 57 | color={state?.caption_background || "#000000"} |
| 58 | onChangeComplete={(value) => { |
| 59 | updateState({ caption_background: value.hex }); |
| 60 | }} |
| 61 | disableAlpha |
| 62 | /> |
| 63 | </BaseControl> |
| 64 | </div> |
| 65 | ); |
| 66 | } |
| 67 |