Skip to content

Commit

Permalink
style: lint demos
Browse files Browse the repository at this point in the history
  • Loading branch information
bennypowers committed Oct 22, 2023
1 parent 7e47f0f commit 7490bee
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions elements/rh-audio-player/demo/customization.html
Original file line number Diff line number Diff line change
Expand Up @@ -469,23 +469,23 @@ <h4 slot="heading">Transcript</h4>
import '@rhds/elements/rh-audio-player/rh-audio-player.js';
const form = document.querySelector('form');
const player = document.querySelector('rh-audio-player');
const opposites = { dark: 'light', light: 'dark' };

/**
* update audio player demo based on form selections
*/
function updateDemo() {
const data = new FormData(form);
const values = Object.fromEntries(data.entries());
const poster = !!values.poster;
const { custom, palette, layout } = values;
const colorClass = custom || '';
const colorPalette = colorClass === 'cyan' ? 'light' : palette;
player.poster = !values.poster || colorClass === 'purple img' ? undefined : "https://www.redhat.com/cms/managed-files/CLH-S7-ep1.png";
player.layout = layout || undefined;
player.colorPalette = colorPalette;
player.className = colorClass;
player.hasAccentColor = palette.match(/^(cyan|purple)/);
player.poster =
!values.poster || colorClass === 'purple img' ? undefined
: 'https://www.redhat.com/cms/managed-files/CLH-S7-ep1.png';
}

form.addEventListener('input', updateDemo);
Expand Down

0 comments on commit 7490bee

Please sign in to comment.