2021-06-15 14:26:38 +02:00
|
|
|
const VideoRatio = function (w) {
|
|
|
|
this.window = w
|
2021-03-29 13:58:05 +02:00
|
|
|
}
|
|
|
|
|
2021-06-15 14:26:38 +02:00
|
|
|
VideoRatio.prototype.init = function () {
|
|
|
|
const videos = this.window.document.querySelectorAll('.video-ratio')
|
2021-03-29 13:58:05 +02:00
|
|
|
|
2021-06-15 14:26:38 +02:00
|
|
|
for (let i = 0, len = videos.length; i < len; i++) {
|
|
|
|
videos[i].style.paddingBottom = videos[i].getAttribute('data-ratio')
|
|
|
|
}
|
2021-03-29 13:58:05 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = VideoRatio
|