HTML preprocessors can make writing HTML more powerful or convenient. For instance, Markdown is designed to be easier to write and read for text documents and you could write a loop in Pug.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. So you don't have access to higher-up elements like the <html>
tag. If you want to add classes there that can affect the whole document, this is the place to do it.
In CodePen, whatever you write in the HTML editor is what goes within the <body>
tags in a basic HTML5 template. If you need things in the <head>
of the document, put that code here.
The resource you are linking to is using the 'http' protocol, which may not work when the browser is using https.
CSS preprocessors help make authoring CSS easier. All of them offer things like variables and mixins to provide convenient abstractions.
It's a common practice to apply CSS to a page that styles elements such that they are consistent across all browsers. We offer two of the most popular choices: normalize.css and a reset. Or, choose Neither and nothing will be applied.
To get the best cross-browser support, it is a common practice to apply vendor prefixes to CSS properties and values that require them to work. For instance -webkit-
or -moz-
.
We offer two popular choices: Autoprefixer (which processes your CSS server-side) and -prefix-free (which applies prefixes via a script, client-side).
Any URLs added here will be added as <link>
s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.
You can apply CSS to your Pen from any stylesheet on the web. Just put a URL to it here and we'll apply it, in the order you have them, before the CSS in the Pen itself.
You can also link to another Pen here (use the .css
URL Extension) and we'll pull the CSS from that Pen and include it. If it's using a matching preprocessor, use the appropriate URL Extension and we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
JavaScript preprocessors can help make authoring JavaScript easier and more convenient.
Babel includes JSX processing.
Any URL's added here will be added as <script>
s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.
You can apply a script from anywhere on the web to your Pen. Just put a URL to it here and we'll add it, in the order you have them, before the JavaScript in the Pen itself.
If the script you link to has the file extension of a preprocessor, we'll attempt to process it before applying.
You can also link to another Pen here, and we'll pull the JavaScript from that Pen and include it. If it's using a matching preprocessor, we'll combine the code before preprocessing, so you can use the linked Pen as a true dependency.
Search for and use JavaScript packages from npm here. By selecting a package, an import
statement will be added to the top of the JavaScript editor for this package.
Using packages here is powered by esm.sh, which makes packages from npm not only available on a CDN, but prepares them for native JavaScript ESM usage.
All packages are different, so refer to their docs for how they work.
If you're using React / ReactDOM, make sure to turn on Babel for the JSX processing.
If active, Pens will autosave every 30 seconds after being saved once.
If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.
If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.
Visit your global Editor Settings.
<div id="root"></div>
@font-face {
font-family: "icomoon";
src: url("https://raw.githubusercontent.com/abxlfazl/music-player-widget/main/src/assets/icomoon/fonts/icomoon.eot?u8ckod");
src: url("https://raw.githubusercontent.com/abxlfazl/music-player-widget/main/src/assets/icomoon/fonts/icomoon.eot?u8ckod#iefix")
format("embedded-opentype"),
url("https://raw.githubusercontent.com/abxlfazl/music-player-widget/main/src/assets/icomoon/fonts/icomoon.ttf?u8ckod")
format("truetype"),
url("https://raw.githubusercontent.com/abxlfazl/music-player-widget/main/src/assets/icomoon/fonts/icomoon.woff?u8ckod")
format("woff"),
url("https://raw.githubusercontent.com/abxlfazl/music-player-widget/main/src/assets/icomoon/fonts/icomoon.svg?u8ckod#icomoon")
format("svg");
font-weight: normal;
font-style: normal;
font-display: block;
}
[class^="icon-"],
[class*=" icon-"] {
/* use !important to prevent issues with browser extensions that change fonts */
font-family: "icomoon" !important;
speak: never;
font-style: normal;
font-weight: normal;
font-variant: normal;
text-transform: none;
line-height: 1;
/* Better Font Rendering =========== */
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-back:before {
content: "\e900";
color: #827d7b;
}
.icon-next:before {
content: "\e901";
color: #827d7b;
}
.icon-pause:before {
content: "\e902";
color: #fff;
}
.icon-play:before {
content: "\e903";
color: #fff;
}
.icon-playlist:before {
content: "\e904";
color: #fff;
}
@font-face {
font-family: Avenir;
src: url(https://raw.githubusercontent.com/abxlfazl/music-player-widget/main/src/assets/font/AvenirNextRoundedProMedium.TTF);
}
html {
box-sizing: border-box;
--duration: 1s;
--ease-slider: cubic-bezier(0.4, 0, 0.2, 1);
--ease-timeline: cubic-bezier(0.71, 0.21, 0.3, 0.95);
}
html *,
html *::before,
html *::after {
box-sizing: inherit;
scrollbar-width: none;
}
body {
margin: 0;
display: flex;
align-items: center;
justify-content: center;
height: calc(var(--vH) * 100);
font-family: Avenir, sans-serif;
background-color: var(--body-bg, #fff);
-webkit-tap-highlight-color: transparent;
transition: var(--duration) background-color var(--ease-slider);
}
::-webkit-scrollbar {
width: 0;
height: 0;
}
/* PUBLIC CLASSES */
.img {
width: 100%;
flex-shrink: 0;
display: block;
object-fit: cover;
}
.list {
margin: 0;
padding: 0;
list-style-type: none;
}
.text_trsf-cap {
text-transform: capitalize;
}
.button {
all: unset;
cursor: pointer;
}
.center {
display: flex;
align-items: center;
justify-content: center;
}
.flex-row {
display: flex;
}
.flex-column {
display: flex;
flex-direction: column;
}
._align_center {
align-items: center;
}
._align_start {
align-items: flex-start;
}
._align_end {
align-items: flex-end;
}
._justify_center {
justify-content: center;
}
._justify_start {
justify-content: flex-start;
}
._justify_end {
justify-content: flex-end;
}
._justify_space-btwn {
justify-content: space-between;
}
.text_overflow {
width: 66%;
overflow: hidden;
white-space: nowrap;
display: inline-block;
text-overflow: ellipsis;
}
.loading {
gap: 0 0.5rem;
font-size: 5rem;
font-weight: bold;
}
/* PUBLIC CLASSES */
.music-player {
--color-white: #fff;
--color-gray: #e5e7ea;
--color-blue: #78adfe;
--color-blue-dark: #5781bd;
--box-shadow: 0 2px 6px 1px #0000001f;
--color-text-1: #000;
--color-text-2: #0000006b;
--cover-size: 3.8125em;
--border-radius: 1.625em;
--music-player-height: 24.375em;
--offset-cover: 1.60125em;
width: 20.9375em;
overflow: hidden;
user-select: none;
color: var(--color-text-1);
height: var(--music-player-height);
border-radius: var(--border-radius);
background-color: var(--color-white);
}
.slider {
--shadow-opacity: 1;
z-index: 0;
flex-shrink: 0;
height: 7.125em;
position: relative;
border-radius: inherit;
transition: var(--duration) height var(--ease-timeline);
}
.slider.resize {
--shadow-opacity: 0;
height: var(--music-player-height);
}
.slider::after {
top: 0;
left: 0;
right: 0;
content: "";
width: 100%;
z-index: -1;
height: 100%;
position: absolute;
pointer-events: none;
border-radius: inherit;
box-shadow: var(--box-shadow);
opacity: var(--shadow-opacity);
transition: var(--duration) opacity;
}
.slider__content {
top: 0;
left: 0;
overflow: hidden;
position: absolute;
border-radius: inherit;
width: var(--cover-size);
height: var(--cover-size);
transition: transform, width, height;
transition-duration: var(--duration);
transition-timing-function: var(--ease-timeline);
transform: translate3d(var(--offset-cover), var(--offset-cover), 0);
}
.slider.resize .slider__content {
width: 100%;
height: 17.8125em;
transform: translate3d(0, 0, 0);
}
.slider__content .button {
--size: 3em;
z-index: 1;
position: absolute;
width: var(--size);
height: var(--size);
}
.slider__content i {
position: absolute;
pointer-events: none;
font-size: var(--size);
}
.music-player__playlist-button {
top: 5.5%;
left: 5.5%;
transform: scale(0);
transition: calc(var(--duration) / 2) transform;
}
.slider.resize .music-player__playlist-button {
transform: scale(1);
transition: 0.35s var(--duration) transform cubic-bezier(0, 0.85, 0.11, 1.64);
}
.music-player__broadcast-guarantor .icon-pause,
.music-player__broadcast-guarantor.click .icon-play {
opacity: 0;
}
.music-player__broadcast-guarantor.click .icon-pause {
opacity: 1;
}
.slider__imgs {
width: 100%;
height: 100%;
filter: brightness(75%);
transform: translate3d(calc(var(--index) * 100%), 0, 0);
transition: var(--duration) transform var(--ease-slider);
}
.slider__imgs > img {
pointer-events: none;
}
.slider__controls {
--controls-y: 145%;
--controls-x: 17.3%;
--controls-width: 68.4%;
--controls-resize-width: 88%;
/* Animation performance is better than transition */
gap: 0.375em 0;
flex-wrap: wrap;
position: absolute;
align-items: center;
padding-top: 0.375em;
width: var(--controls-width);
transform: translate3d(var(--controls-x), 0, 0);
animation: var(--controls-animate, "down paused") var(--duration)
var(--ease-timeline) forwards;
}
@keyframes down {
100% {
width: var(--controls-resize-width);
transform: translate3d(0, var(--controls-y), 0);
}
}
@keyframes up {
0% {
width: var(--controls-resize-width);
transform: translate3d(0, var(--controls-y), 0);
}
100% {
width: var(--controls-width);
transform: translate3d(var(--controls-x), 0, 0);
}
}
.slider__switch-button {
font-size: 3em;
height: max-content;
}
.music-player__info {
width: 56.3%;
cursor: pointer;
line-height: 1.8;
overflow: hidden;
font-weight: bold;
padding: 0 0.0625em;
white-space: nowrap;
}
.music-player__info > * {
margin: 0 auto;
pointer-events: none;
}
.music-player__singer-name {
font-size: 1.25em;
width: max-content;
}
.music-player__subtitle {
font-size: 0.85em;
font-weight: bold;
color: var(--color-text-2);
}
.slider__controls .music-player__subtitle {
width: max-content;
}
.music-player__singer-name.animate,
.music-player__subtitle.animate {
--subtitle-gap: 1.5625em;
display: flex;
gap: 0 var(--subtitle-gap);
animation: subtitle 12s 1.2s linear infinite;
}
@keyframes subtitle {
80%,
100% {
transform: translate3d(calc((100% + var(--subtitle-gap)) / -2), 0, 0);
}
}
.progress {
width: 90%;
height: 1.25em;
cursor: pointer;
transition: var(--duration) width var(--ease-timeline);
}
.slider.resize .progress {
width: 100%;
}
.progress__wrapper {
width: 100%;
height: 0.3125em;
position: relative;
border-radius: 1em;
background-color: var(--color-gray);
}
.progress__bar {
top: 0;
left: 0;
bottom: 0;
position: absolute;
width: var(--width);
border-radius: inherit;
background-color: var(--color-blue);
}
.progress__bar::after {
--size: 0.4375em;
left: 98%;
content: "";
position: absolute;
width: var(--size);
height: var(--size);
border-radius: 100%;
background-color: var(--color-blue-dark);
}
.music-player__playlist {
height: 100%;
overflow: hidden auto;
padding: 1.28125em 1.09375em 0 var(--offset-cover);
}
.music-player__song {
--gap: 0.75em;
cursor: pointer;
margin-bottom: var(--gap);
padding-bottom: var(--gap);
border-bottom: 1.938px solid #d8d8d859;
}
.music-player__song audio {
display: none;
}
.music-player__song-img {
width: var(--cover-size);
height: var(--cover-size);
border-radius: var(--border-radius);
}
.music-player__playlist-info {
width: 100%;
overflow: hidden;
line-height: 1.3;
font-size: 1.06875em;
margin-left: 0.7875em;
}
.music-player__song-duration {
font-weight: bold;
font-size: 0.7875em;
color: var(--color-text-2);
}
@media screen and (min-width: 1366px) {
.music-player {
font-size: 1.17132vw;
}
}
@media screen and (max-width: 480px) {
.music-player {
font-size: 0.8rem;
}
}
@media screen and (max-width: 280px) {
.music-player {
font-size: 0.6rem;
}
}
let indexSong = 0;
let isLocked = false;
let songsLength = null;
let selectedSong = null;
let loadingProgress = 0;
let songIsPlayed = false;
let progress_elmnt = null;
let songName_elmnt = null;
let sliderImgs_elmnt = null;
let singerName_elmnt = null;
let progressBar_elmnt = null;
let playlistSongs_elmnt = [];
let loadingProgress_elmnt = null;
let musicPlayerInfo_elmnt = null;
let progressBarIsUpdating = false;
let broadcastGuarantor_elmnt = null;
const root = document.querySelector("#root");
function App({ songs }) {
function handleChangeMusic({ isPrev = false, playListIndex = null }) {
if (isLocked || indexSong === playListIndex) return;
if (playListIndex || playListIndex === 0) {
indexSong = playListIndex;
} else {
indexSong = isPrev ? (indexSong -= 1) : (indexSong += 1);
}
if (indexSong < 0) {
indexSong = 0;
return;
} else if (indexSong > songsLength) {
indexSong = songsLength;
return;
}
selectedSong.pause();
selectedSong.currentTime = 0;
progressBarIsUpdating = false;
selectedSong = playlistSongs_elmnt[indexSong];
selectedSong.paused && songIsPlayed ? selectedSong.play() : selectedSong.pause();
setBodyBg(songs[indexSong].bg);
setProperty(sliderImgs_elmnt, "--index", -indexSong);
updateInfo(singerName_elmnt, songs[indexSong].artist);
updateInfo(songName_elmnt, songs[indexSong].songName);
}
setBodyBg(songs[0].bg);
const appElement = document.createElement('div');
appElement.className = 'music-player flex-column';
appElement.appendChild(Slider({ slides: songs, handleChangeMusic }));
appElement.appendChild(Playlist({ list: songs, handleChangeMusic }));
return appElement;
}
function Slider({ slides, handleChangeMusic }) {
function handleResizeSlider({ target }) {
if (isLocked) {
return;
} else if (target.classList.contains("music-player__info")) {
this.classList.add("resize");
setProperty(this, "--controls-animate", "down running");
return;
} else if (target.classList.contains("music-player__playlist-button")) {
this.classList.remove("resize");
setProperty(this, "--controls-animate", "up running");
return;
}
}
function handlePlayMusic() {
if (selectedSong.currentTime === selectedSong.duration) {
handleChangeMusic({});
}
this.classList.toggle("click");
songIsPlayed = !songIsPlayed;
selectedSong.paused ? selectedSong.play() : selectedSong.pause();
}
const sliderElement = document.createElement('div');
sliderElement.className = 'slider center';
sliderElement.onclick = handleResizeSlider;
const sliderContent = document.createElement('div');
sliderContent.className = 'slider__content center';
const playlistButton = document.createElement('button');
playlistButton.className = 'music-player__playlist-button center button';
const playlistIcon = document.createElement('i');
playlistIcon.className = 'icon-playlist';
playlistButton.appendChild(playlistIcon);
const playButton = document.createElement('button');
playButton.onclick = handlePlayMusic;
playButton.className = 'music-player__broadcast-guarantor center button';
const playIcon = document.createElement('i');
playIcon.className = 'icon-play';
const pauseIcon = document.createElement('i');
pauseIcon.className = 'icon-pause';
playButton.appendChild(playIcon);
playButton.appendChild(pauseIcon);
const sliderImgs = document.createElement('div');
sliderImgs.className = 'slider__imgs flex-row';
slides.forEach(({ songName, files: { cover } }) => {
const img = document.createElement('img');
img.src = cover;
img.className = 'img';
img.alt = songName;
sliderImgs.appendChild(img);
});
sliderContent.appendChild(playlistButton);
sliderContent.appendChild(playButton);
sliderContent.appendChild(sliderImgs);
sliderElement.appendChild(sliderContent);
const sliderControls = document.createElement('div');
sliderControls.className = 'slider__controls center';
const backButton = document.createElement('button');
backButton.className = 'slider__switch-button flex-row button';
backButton.onclick = () => handleChangeMusic({ isPrev: true });
const backIcon = document.createElement('i');
backIcon.className = 'icon-back';
backButton.appendChild(backIcon);
const musicInfo = document.createElement('div');
musicInfo.className = 'music-player__info text_trsf-cap';
const singerName = document.createElement('div');
singerName.className = 'music-player__singer-name';
const singerNameText = document.createElement('div');
singerNameText.textContent = slides[0].artist;
singerName.appendChild(singerNameText);
musicInfo.appendChild(singerName);
const songTitle = document.createElement('div');
songTitle.className = 'music-player__subtitle';
const songTitleText = document.createElement('div');
songTitleText.textContent = slides[0].songName;
songTitle.appendChild(songTitleText);
musicInfo.appendChild(songTitle);
const nextButton = document.createElement('button');
nextButton.className = 'slider__switch-button flex-row button';
nextButton.onclick = () => handleChangeMusic({ isPrev: false });
const nextIcon = document.createElement('i');
nextIcon.className = 'icon-next';
nextButton.appendChild(nextIcon);
const progressContainer = document.createElement('div');
progressContainer.className = 'progress center';
progressContainer.onpointerdown = (e) => {
handleScrub(e);
progressBarIsUpdating = true;
};
const progressWrapper = document.createElement('div');
progressWrapper.className = 'progress__wrapper';
const progressBar = document.createElement('div');
progressBar.className = 'progress__bar center';
progressWrapper.appendChild(progressBar);
progressContainer.appendChild(progressWrapper);
sliderControls.appendChild(backButton);
sliderControls.appendChild(musicInfo);
sliderControls.appendChild(nextButton);
sliderControls.appendChild(progressContainer);
sliderElement.appendChild(sliderControls);
return sliderElement;
}
function Playlist({ list, handleChangeMusic }) {
function loadedAudio() {
const duration = this.duration;
const target = this.parentElement.querySelector(".music-player__song-duration");
let min = parseInt(duration / 60);
if (min < 10) min = "0" + min;
let sec = parseInt(duration % 60);
if (sec < 10) sec = "0" + sec;
target.appendChild(document.createTextNode(`${min}:${sec}`));
}
function updateTheProgressBar() {
const duration = this.duration;
const currentTime = this.currentTime;
const progressBarWidth = (currentTime / duration) * 100;
setProperty(progressBar_elmnt, "--width", `${progressBarWidth}%`);
if (songIsPlayed && currentTime === duration) {
handleChangeMusic({});
}
if (indexSong === songsLength && this === selectedSong && currentTime === duration) {
songIsPlayed = false;
broadcastGuarantor_elmnt.classList.remove("click");
}
}
const playlistElement = document.createElement('ul');
playlistElement.className = 'music-player__playlist list';
list.forEach(({ songName, artist, files: { cover, song } }, index) => {
const li = document.createElement('li');
li.className = 'music-player__song';
li.onclick = () => handleChangeMusic({ isPrev: false, playListIndex: index });
const songInfo = document.createElement('div');
songInfo.className = 'flex-row _align_center';
const img = document.createElement('img');
img.src = cover;
img.className = 'img music-player__song-img';
const playlistInfo = document.createElement('div');
playlistInfo.className = 'music-player__playlist-info text_trsf-cap';
const songNameElement = document.createElement('b');
songNameElement.className = 'text_overflow';
songNameElement.textContent = songName;
playlistInfo.appendChild(songNameElement);
const songDetails = document.createElement('div');
songDetails.className = 'flex-row _justify_space-btwn';
const artistElement = document.createElement('span');
artistElement.className = 'music-player__subtitle';
artistElement.textContent = artist;
const songDuration = document.createElement('span');
songDuration.className = 'music-player__song-duration';
songDetails.appendChild(artistElement);
songDetails.appendChild(songDuration);
playlistInfo.appendChild(songDetails);
songInfo.appendChild(img);
songInfo.appendChild(playlistInfo);
li.appendChild(songInfo);
const audio = document.createElement('audio');
audio.src = song;
audio.onloadeddata = loadedAudio;
audio.ontimeupdate = updateTheProgressBar;
li.appendChild(audio);
playlistElement.appendChild(li);
});
return playlistElement;
}
function Loading() {
const loadingElement = document.createElement('div');
loadingElement.className = 'loading flex-row';
const progressSpan = document.createElement('span');
progressSpan.className = 'loading__progress';
progressSpan.textContent = '0';
loadingElement.appendChild(progressSpan);
loadingElement.appendChild(document.createTextNode('%'));
return loadingElement;
}
fetch("https://gist.githubusercontent.com/abxlfazl/37404417d17230a629683eb3f2f0a88a/raw/366ad64df645e94592847283a306fe2276de458e/music-info.json")
.then((respone) => respone.json())
.then((result) => {
const songs = result.songs;
function downloadTheFiles(media, input) {
return Promise.all(
input.map((song) => {
const promise = new Promise((resolve) => {
const url = song.files[media];
const req = new XMLHttpRequest();
req.open("GET", url, true);
req.responseType = "blob";
req.send();
req.onreadystatechange = () => {
if (req.readyState === 4) {
if (req.status === 200) {
const blob = req.response;
const file = URL.createObjectURL(blob);
song.files[media] = file;
resolve(song);
}
}
};
});
promise.then(() => {
loadingProgress++;
const progress = Math.round(
(loadingProgress / (songs.length * 2)) * 100
);
loadingProgress_elmnt.innerHTML = progress;
});
return promise;
})
);
}
root.appendChild(Loading());
loadingProgress_elmnt = document.querySelector(".loading__progress");
downloadTheFiles("cover", songs).then((respone) => {
downloadTheFiles("song", respone).then((data) => {
root.removeChild(document.querySelector(".loading"));
root.appendChild(App({ songs: data }));
songsLength = data.length - 1;
progress_elmnt = document.querySelector(".progress");
playlistSongs_elmnt = document.querySelectorAll("audio");
sliderImgs_elmnt = document.querySelector(".slider__imgs");
songName_elmnt = document.querySelector(".music-player__subtitle");
musicPlayerInfo_elmnt = document.querySelector(".music-player__info");
singerName_elmnt = document.querySelector(".music-player__singer-name");
selectedSong = playlistSongs_elmnt[indexSong];
progressBar_elmnt = document.querySelector(".progress__bar");
broadcastGuarantor_elmnt = document.querySelector(
".music-player__broadcast-guarantor"
);
controlSubtitleAnimation(musicPlayerInfo_elmnt, songName_elmnt);
controlSubtitleAnimation(musicPlayerInfo_elmnt, singerName_elmnt);
});
});
});
function controlSubtitleAnimation(parent, child) {
if (child.classList.contains("animate")) return;
const element = child.firstChild;
if (child.clientWidth > parent.clientWidth) {
child.appendChild(element.cloneNode(true));
child.classList.add("animate");
}
setProperty(child.parentElement, "width", `${element.clientWidth}px`);
}
function handleResize() {
const vH = window.innerHeight * 0.01;
setProperty(document.documentElement, "--vH", `${vH}px`);
}
function setProperty(target, prop, value = "") {
target.style.setProperty(prop, value);
}
function setBodyBg(color) {
setProperty(document.body, "--body-bg", color);
}
function updateInfo(target, value) {
while (target.firstChild) {
target.removeChild(target.firstChild);
}
const targetChild_elmnt = document.createElement("div");
targetChild_elmnt.appendChild(document.createTextNode(value));
target.appendChild(targetChild_elmnt);
target.classList.remove("animate");
controlSubtitleAnimation(musicPlayerInfo_elmnt, target);
}
function handleScrub(e) {
const progressOffsetLeft = progress_elmnt.getBoundingClientRect().left;
const progressWidth = progress_elmnt.offsetWidth;
const duration = selectedSong.duration;
const currentTime = (e.clientX - progressOffsetLeft) / progressWidth;
selectedSong.currentTime = currentTime * duration;
}
handleResize();
window.addEventListener("resize", handleResize);
window.addEventListener("orientationchange", handleResize);
window.addEventListener("transitionstart", ({ target }) => {
if (target === sliderImgs_elmnt) {
isLocked = true;
setProperty(sliderImgs_elmnt, "will-change", "transform");
}
});
window.addEventListener("transitionend", ({ target, propertyName }) => {
if (target === sliderImgs_elmnt) {
isLocked = false;
setProperty(sliderImgs_elmnt, "will-change", "auto");
}
if (target.classList.contains("slider") && propertyName === "height") {
controlSubtitleAnimation(musicPlayerInfo_elmnt, songName_elmnt);
controlSubtitleAnimation(musicPlayerInfo_elmnt, singerName_elmnt);
}
});
window.addEventListener("pointerup", () => {
if (progressBarIsUpdating) {
selectedSong.muted = false;
progressBarIsUpdating = false;
}
});
window.addEventListener("pointermove", (e) => {
if (progressBarIsUpdating) {
handleScrub(e);
selectedSong.muted = true;
}
});
Also see: Tab Triggers