Finished aspect ratio setting

This commit is contained in:
Sam Potts
2017-11-06 20:24:07 +11:00
parent 62c1b368cf
commit 1578525ee3
5 changed files with 6 additions and 6 deletions

View File

@ -19,7 +19,7 @@ const vimeo = {
// Set aspect ratio
const ratio = this.config.ratio.split(':');
const padding = 100 / ratio[0] * ratio[1];
const offset = (100 - padding) / 2;
const offset = (400 - padding) / 8;
this.elements.wrapper.style.paddingBottom = `${padding}%`;
this.media.style.transform = `translateY(-${offset}%)`;