Skip to content

Commit 4f81aed

Browse files
committed
18.0 RC1: minor fixes
1 parent f6c9a5a commit 4f81aed

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

assets/media/ram10.mp4

-1.33 MB
Binary file not shown.

package.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/static/js/index.js

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
let videos;
2-
let playing = true;
3-
41
fetch('index.data.json').then(response => response.json()).then(data => {
52
let string = randomize(data.marquee);
63
let marquee = document.getElementById('marquee');
@@ -12,8 +9,13 @@ fetch('index.data.json').then(response => response.json()).then(data => {
129
marquee.style.cursor = 'help';
1310
}
1411

15-
videos = data.videos;
16-
injectVideo();
12+
let videoElement = document.getElementById('background');
13+
14+
let source = document.createElement('source');
15+
source.src = `/assets/media/${randomize(data.videos)}`;
16+
source.type = 'video/mp4';
17+
videoElement.appendChild(source);
18+
videoElement.play();
1719
});
1820

1921
const sections = [
@@ -83,17 +85,6 @@ function toggleSection(section) {
8385
}
8486
}
8587

86-
function injectVideo() {
87-
let video = randomize(videos);
88-
let videoElement = document.getElementById('background');
89-
90-
let source = document.createElement('source');
91-
source.src = `/assets/media/${video}`;
92-
source.type = 'video/mp4';
93-
videoElement.appendChild(source);
94-
videoElement.play();
95-
}
96-
9788
function randomize(col) {
9889
return col[Math.floor(Math.random() * col.length)];
9990
}

0 commit comments

Comments
 (0)