@arraypress/waveform-player 1.13.1 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/waveform-player.cjs +10 -0
- package/dist/waveform-player.cjs.map +2 -2
- package/dist/waveform-player.css +1 -1
- package/dist/waveform-player.esm.js +3 -2
- package/dist/waveform-player.esm.js.map +3 -3
- package/dist/waveform-player.js +10 -0
- package/dist/waveform-player.min.js +3 -2
- package/dist/waveform-player.min.js.map +3 -3
- package/index.d.ts +7 -0
- package/package.json +1 -1
- package/src/css/waveform-player.css +21 -14
- package/src/js/core.js +1 -0
- package/src/js/themes.js +5 -0
- package/src/js/utils.js +6 -0
package/dist/waveform-player.cjs
CHANGED
|
@@ -87,6 +87,10 @@ function parseDataAttributes(element) {
|
|
|
87
87
|
if (element.dataset.buttonAlign) options.buttonAlign = element.dataset.buttonAlign;
|
|
88
88
|
if (element.dataset.layout) options.layout = element.dataset.layout;
|
|
89
89
|
if (element.dataset.buttonStyle) options.buttonStyle = element.dataset.buttonStyle;
|
|
90
|
+
if (element.dataset.buttonSize) {
|
|
91
|
+
const bs = element.dataset.buttonSize;
|
|
92
|
+
options.buttonSize = /^\d+(\.\d+)?$/.test(bs.trim()) ? parseFloat(bs) : bs;
|
|
93
|
+
}
|
|
90
94
|
if (element.dataset.colorPreset) options.colorPreset = element.dataset.colorPreset;
|
|
91
95
|
if (element.dataset.waveformColor) options.waveformColor = parseColorValue(element.dataset.waveformColor);
|
|
92
96
|
if (element.dataset.progressColor) options.progressColor = parseColorValue(element.dataset.progressColor);
|
|
@@ -711,6 +715,11 @@ var DEFAULT_OPTIONS = {
|
|
|
711
715
|
// 'minimal' = a bare play/pause glyph with no circle — the look sample-pack
|
|
712
716
|
// and beat stores use in their preview grids.
|
|
713
717
|
buttonStyle: "circle",
|
|
718
|
+
// Play/pause button size. null = the stylesheet default (36px circle /
|
|
719
|
+
// proportional minimal). A number is treated as px; a string (e.g. '4rem')
|
|
720
|
+
// is used verbatim. Sets the `--wfp-btn-size` CSS var, which scales BOTH
|
|
721
|
+
// styles — box and glyph — proportionally.
|
|
722
|
+
buttonSize: null,
|
|
714
723
|
// Default waveform style
|
|
715
724
|
waveformStyle: "mirror",
|
|
716
725
|
barWidth: 2,
|
|
@@ -944,6 +953,7 @@ var WaveformPlayer = class _WaveformPlayer {
|
|
|
944
953
|
<button class="waveform-btn${this.options.buttonStyle === "minimal" ? " waveform-btn-minimal" : ""}" aria-label="Play/Pause" style="
|
|
945
954
|
border-color: ${this.options.buttonColor};
|
|
946
955
|
color: ${this.options.buttonColor};
|
|
956
|
+
${this.options.buttonSize != null ? `--wfp-btn-size: ${typeof this.options.buttonSize === "number" ? `${this.options.buttonSize}px` : this.options.buttonSize};` : ""}
|
|
947
957
|
">
|
|
948
958
|
<span class="waveform-icon-play">${this.options.playIcon}</span>
|
|
949
959
|
<span class="waveform-icon-pause" style="display:none;">${this.options.pauseIcon}</span>
|