Skip to content

Commit

Permalink
Merge pull request #762 from ErnstBas/733
Browse files Browse the repository at this point in the history
Use CSS instead of JavaScript for responsive embed video iframes
  • Loading branch information
brylie committed Jul 7, 2023
2 parents 48dde86 + 3b9793f commit 7951827
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
7 changes: 7 additions & 0 deletions core/static/css/wf_website.css
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,10 @@ p {
.navbar-dark .navbar-nav .nav-link {
color: #ffe9e5;
}
/* Make sure embedded videos take up full with
while preserving the typical aspect ratio */
iframe {
aspect-ratio: 16 / 9;
width: 100%;
height: 100%;
}
10 changes: 0 additions & 10 deletions library/templates/library/library_item.html
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,3 @@ <h1>
{% endif %}
</dl>
{% endblock %}

{% block extra_js %}
<script src="https://cdn.jsdelivr.net/npm/fitvids@2/dist/fitvids.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
// Ensure embedded videos are responsive
fitvids(".block-embed");
});
</script>
{% endblock extra_js %}

0 comments on commit 7951827

Please sign in to comment.