feat: add embed video support

This commit is contained in:
Cotes Chung 2022-12-17 03:56:19 +08:00
parent 8de1abda6b
commit ed6dc539ef
No known key found for this signature in database
GPG key ID: 0D9E54843167A808
3 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,4 @@
<iframe class="embed-video twitch lazyload"
src="https://player.twitch.tv/?video={{ include.id }}&parent={{ site.url | split: '://' | last | remove: '/' }}"
frameborder="0" allowfullscreen="true"
scrolling="no"></iframe>

View file

@ -0,0 +1,6 @@
<iframe class="embed-video youtube lazyload"
src="https://www.youtube.com/embed/{{ include.id }}"
title="YouTube video player"
frameborder="0"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>

View file

@ -576,6 +576,21 @@ i { /* fontawesome icons */
} }
} }
.embed-video {
width: 100%;
height: 100%;
border-radius: 4px;
margin-bottom: 1rem;
&.youtube {
aspect-ratio: 16 / 9;
}
&.twitch {
aspect-ratio: 310 / 189;
}
}
/* --- buttons --- */ /* --- buttons --- */
.btn-lang { .btn-lang {
border: 1px solid !important; border: 1px solid !important;