bune.city/assets/js/post.js

14 lines
551 B
JavaScript
Raw Normal View History

2020-04-09 15:56:02 +00:00
let players = {}
document.addEventListener('DOMContentLoaded', (event) => {
let headers = dgtn(`h2`);
Object.values(headers).forEach((header) => {
header.innerHTML += `<a class='post-nav-link' aria-hidden='true' href='#${header.id}'>#</a>`;
});
players = Array.from(dgcn('plyr')).map(p => new Plyr(p, {
iconUrl: '/assets/plyr/plyr.svg',
controls: ['play-large', 'play', 'current-time', 'progress', 'download', 'mute', 'volume', 'captions', 'settings', 'pip', 'airplay', 'fullscreen'],
quality: {
default: p.dataset.default
}
}));
});