Skip to content

Commit 1b8b338

Browse files
committed
added support for autoplaying videos in posts
1 parent 2681491 commit 1b8b338

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

assets/css/style.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,18 @@ a.post-link:hover {
251251
color: black;
252252
}
253253

254+
video {
255+
max-width: 100%;
256+
}
257+
254258
#title {
255259
font-style: italic;
256260
font-size: 1.6rem;
257261
}
258262

259263
body > .container:first-child {
260264
padding-top: 3rem;
261-
padding-bottom: 12rem;
265+
padding-bottom: 24rem;
262266
}
263267

264268
.content {
@@ -293,6 +297,7 @@ body > .container:first-child {
293297
}
294298

295299
#monero code {
300+
background-color: white;
296301
overflow-wrap: break-word;
297302
white-space: normal;
298303
}

assets/js/script.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ function main() {
77

88
// math
99
renderMathInElement(document.body)
10+
11+
// videos
12+
document.querySelectorAll('video').forEach(v => {
13+
v.addEventListener('pause', () => {
14+
if (v.autoplay) {
15+
v.play()
16+
}
17+
})
18+
})
1019
}
1120

1221
if (document.readyState === "loading") {

0 commit comments

Comments
 (0)